亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? dhcpccommonlib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/* dhcpcCommonLib.c - DHCP client interface shared code library *//* Copyright 1984 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02a,26apr02,wap  Update documentation for dhcpcOptionAdd() routine (SPR                 #73769)01z,23apr02,wap  Use BPF_WORDALIGN() when retreiving multiple messages from a                 BPF buffer (SPR #74215)01y,06dec01,wap  Add NPT support01x,16nov01,spm  added mod history fix from main branch, ver 01w, base 01v01w,15oct01,rae  merge from truestack ver 01z, base 01q (SPR #65264)01v,24may01,mil  Bump up dhcp read task stack size to 5000.01u,17nov00,spm  added support for BSD Ethernet devices01t,16nov00,spm  added required mutual exclusion when sending message01s,24oct00,spm  fixed merge from tor3_x branch and updated mod history01r,23oct00,niq  merged from version 01w of tor3_x branch (base version 01q);                 upgrade to BPF replaces tagged frames support01q,16mar99,spm  recovered orphaned code from tor1_0_1.sens1_1 (SPR #25770)01p,06oct98,spm  fixed copying of parameters with IP address pairs (SPR #22416)01o,04dec97,spm  added code review modifications01n,06oct97,spm  removed reference to deleted endDriver global; replaced with                 support for dynamic driver type detection01m,30sep97,kbw  fixed minor spelling error in library man page01l,02sep97,spm  modified handling of fatal errors - corrected conditions for                  disabling network interface and added event hook execution01k,26aug97,spm  major overhaul: reorganized code and changed user interface                 to support multiple leases at runtime01j,06aug97,spm  removed parameters linked list to reduce memory required;                 renamed class field of dhcp_reqspec structure to prevent C++                 compilation errors (SPR #9079); corrected minor errors in                 man pages introduced by 01i revision01i,30jul97,kbw  fixed man page problems found in beta review01h,15jul97,spm  cleaned up man pages01g,10jun97,spm  moved length test to prevent buffer overflow and isolated                  incoming messages in state machine from input hooks01f,02jun97,spm  changed DHCP option tags to prevent name conflicts (SPR #8667)                 and updated man pages01e,06may97,spm  changed memory access to align IP header on four byte boundary01d,15apr97,kbw  fixing man page format and wording01c,07apr97,spm  added code to use Host Requirements defaults and cleanup                  memory on exit, fixed bugs caused by Ethernet trailers,                  eliminated potential buffer overruns, rewrote documentation01b,29jan97,spm  added END driver support and modified to fit coding standards01a,14nov96,spm  created from shared functions of dhcpcLib.c and dhcpcBootLib.c*//*DESCRIPTIONThis library contains the shared functions used by the both the run-timeand boot-time portions of the DHCP client.INCLUDE FILES: dhcpcLib.hSEE ALSO: dhcpcLib*//* includes */#include "dhcp/copyright_dhcp.h"#include "vxWorks.h"#include "wdLib.h"#include "semLib.h"#include "intLib.h"#include "vxLib.h" 	/* checksum() declaration */#include "tickLib.h" 	/* tickGet() declaration */#include "muxLib.h"#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <errno.h>#include <signal.h>#include <fcntl.h>#include <sys/types.h>#include <sys/socket.h>#include <sys/ioctl.h>#include <net/if.h>#include <netinet/in.h>#include <netinet/in_systm.h>#include <netinet/if_ether.h>#include <netinet/ip.h>#include <netinet/udp.h>#include <arpa/inet.h> #include "dhcp/dhcpcCommonLib.h"#include "dhcp/dhcpcStateLib.h"#include "dhcp/dhcpc.h"#include "net/bpf.h"#include "ipProto.h"/* defines */#define _BYTESPERWORD 	4 	/* Conversion factor for IP header */     /* Host requirements documents default values. */#define _HRD_MAX_DGRAM  576     /* Default maximum datagram size. */#define _HRD_IP_TTL     64      /* Default IP time-to-live (seconds) */#define _HRD_MTU        576     /* Default interface MTU */#define _HRD_ROUTER     0xffffffff /* Default router solication */                                   /* address - 255.255.255.255 */#define _HRD_ARP_TIME   60      /* Default ARP cache timeout (seconds) */#define _HRD_TCP_TTL    64      /* Default TCP time-to-live (seconds) */#define _HRD_TCP_TIME   7200    /* Default TCP keepalive interval (seconds) *//* globals */int dhcpcDataSock; 		/* Accesses runtime DHCP messages */BOOL _dhcpcBootFlag = FALSE; 	/* Data socket available? (only at runtime) */int dhcpcReadTaskId;                    /* DHCP message retrieval task */LEASE_DATA **   dhcpcLeaseList;         /* List of available cookies. */MESSAGE_DATA *  dhcpcMessageList;       /* Available DHCP messages. */int dhcpcBufSize; 			/* Maximum supported message size */int dhcpcMaxLeases; 		/*                                 * Set externally when building runtime image                                 * or to 1 when running boot image.                                 */int dhcpcMinLease; 		/* Set externally when building image. */int _dhcpcReadTaskPriority  = 56;      /* Priority level of data retriever */int _dhcpcReadTaskOptions   = 0;       /* Option settings of data retriever */int _dhcpcReadTaskStackSize = 5000;    /* Stack size of data retriever */    /* Berkeley Packet Filter instructions for catching DHCP messages. */struct bpf_insn dhcpfilter[] = {  BPF_STMT(BPF_LD+BPF_TYPE,0),                /* Save lltype in accumulator */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ETHERTYPE_IP, 0, 22),  /* IP packet? */  /*   * The remaining statements use the (new) BPF_HLEN alias to avoid any   * link-layer dependencies. The expected destination port and transaction   * ID values are altered when necessary by the DHCP routines to match the   * actual settings.   */  BPF_STMT(BPF_LD+BPF_H+BPF_ABS+BPF_HLEN, 6),    /* A <- IP FRAGMENT field */  BPF_JUMP(BPF_JMP+BPF_JSET+BPF_K, 0x1fff, 20, 0),         /* OFFSET == 0 ? */  BPF_STMT(BPF_LDX+BPF_HLEN, 0),          /* X <- frame data offset */  BPF_STMT(BPF_LD+BPF_B+BPF_IND, 9),      /* A <- IP_PROTO field */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, IPPROTO_UDP, 0, 17),     /* UDP ? */  BPF_STMT(BPF_LD+BPF_HLEN, 0),           /* A <- frame data offset */  BPF_STMT(BPF_LDX+BPF_B+BPF_MSH+BPF_HLEN, 0), /* X <- IPHDR LEN field */  BPF_STMT(BPF_ALU+BPF_ADD+BPF_X, 0),     /* A <- start of UDP datagram */  BPF_STMT(BPF_MISC+BPF_TAX, 0),          /* X <- start of UDP datagram */  BPF_STMT(BPF_LD+BPF_H+BPF_IND, 2),      /* A <- UDP DSTPORT */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 68, 0, 11), /* check DSTPORT */  BPF_STMT(BPF_LD+BPF_H+BPF_ABS+BPF_HLEN, 2),  /* A <- IP LEN field */  BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 0, 0, 9),    /* Correct IP length? */  BPF_STMT(BPF_LD+BPF_H+BPF_IND, 4),      /* A <- UDP LEN field */  BPF_JUMP(BPF_JMP+BPF_JGE+BPF_K, 0, 0, 7),    /* Correct UDP length? */  BPF_STMT(BPF_LD+BPF_B+BPF_IND, 8),      /* A <- DHCP op field */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, BOOTREPLY, 0, 5),  BPF_STMT(BPF_LD+BPF_W+BPF_IND, 12),      /* A <- DHCP xid field */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, -1, 0, 3),   /* -1 replaced with real xid */  BPF_STMT(BPF_LD+BPF_W+BPF_IND, 244),    /* A <- DHCP options */  BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, 0x63825363, 0, 1),                                                 /* Matches magic cookie? */  BPF_STMT(BPF_RET+BPF_K+BPF_HLEN, DFLTDHCPLEN + UDPHL + IPHL),                                           /*                                            * ignore data beyond expected                                            * size (some drivers add padding).                                            */  BPF_STMT(BPF_RET+BPF_K, 0)          /* unrecognized message: ignore frame */  };struct bpf_program dhcpread = {    sizeof (dhcpfilter) / sizeof (struct bpf_insn),    dhcpfilter    };RING_ID		dhcpcEventRing; 	/* Ring buffer of DHCP events */SEM_ID		dhcpcEventSem; 		/* DHCP event notification *//* forward declarations */UCHAR * dhcpcOptionMerge (UCHAR, UCHAR *, UCHAR *, int);UCHAR * dhcpcOptCreate (UCHAR, UCHAR *, UCHAR *, int);void dhcpcRead (void);                   /* Retrieve incoming DHCP messages *//********************************************************************************* dhcpcArpSend - transmit an outgoing ARP message** This routine uses the MUX or netif interface to send a frame containing an* ARP packet independently of the link level type. ** RETURNS: OK, or ERROR if send fails.** ERRNO: N/A** NOMANUAL** INTERNAL* Ideally, the dhcpSend() routine would handle any link-level frame* using the registered output routine (ipOutput in the ipProto.c module).* However, constructing frames with the link-level broadcast address* requires significant changes to the MUX/END interface and the ipOutput* routine which are not backward compatible. This routine extracts* relevant portions of the ipOutput routine so that only the driver* layer interface is affected.*/STATUS dhcpcArpSend    (    struct ifnet *      pIf,    /* interface for sending message */    char *              pData,  /* frame containing ARP packet */    int                 size 	/* length of frame, in bytes */    )    {    u_short etype;    int s;    struct mbuf * pMbuf;    IP_DRV_CTRL* pDrvCtrl;    struct arpcom *ac = (struct arpcom *)pIf;    struct ether_header *eh;    BOOL bsdFlag = FALSE;    /* BSD or END network device? */    pDrvCtrl = (IP_DRV_CTRL *)pIf->pCookie;    if (pDrvCtrl == NULL)        bsdFlag = TRUE;             else if (pDrvCtrl->pIpCookie == NULL)        return (ERROR);    if ((pIf->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))        return (ERROR);    pMbuf = bcopy_to_mbufs (pData, size, 0, pIf, NONE);    if (pMbuf == NULL)        return (ERROR);    pIf->if_lastchange = tickGet();    etype = htons (ETHERTYPE_ARP);    if (bsdFlag)        {        /* Build an Ethernet header to the broadcast address. */        M_PREPEND (pMbuf, sizeof (struct ether_header), M_DONTWAIT);        if (pMbuf == 0)            return (ERROR);        eh = mtod (pMbuf, struct ether_header *);        pMbuf->mBlkHdr.mFlags |= M_BCAST; /* Always broadcast ARP messages. */        bcopy((caddr_t)&etype,(caddr_t)&eh->ether_type,                sizeof(eh->ether_type));        bcopy((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,              sizeof (etherbroadcastaddr));        bcopy((caddr_t)ac->ac_enaddr, (caddr_t)eh->ether_shost,            sizeof(eh->ether_shost));        }     else        {        /*         * Use the MUX interface to build a frame header. We         * need to handle both END and NPT devices here.         */        if (pDrvCtrl->nptFlag)            {            if (pIf->if_addrlen)                {                M_PREPEND(pMbuf, pIf->if_addrlen, M_DONTWAIT);                if (pMbuf == NULL)                    return(ERROR);                ((M_BLK_ID)pMbuf)->mBlkPktHdr.rcvif = 0;                /* Store the destination address. */                bcopy (pDrvCtrl->pDstAddr, pMbuf->m_data, pIf->if_addrlen);                }            /* Save the network protocol type. */            ((M_BLK_ID)pMbuf)->mBlkHdr.reserved = etype;            }        else            {            pDrvCtrl->pSrc->m_data = (char *)&ac->ac_enaddr;            pDrvCtrl->pDst->mBlkHdr.reserved = etype;            pDrvCtrl->pSrc->mBlkHdr.reserved = etype;            pMbuf->mBlkHdr.mFlags |= M_BCAST; /* Always broadcast ARP messages. */            if ((pMbuf = muxLinkHeaderCreate (pDrvCtrl->pIpCookie, pMbuf,                                              pDrvCtrl->pSrc,                                              pDrvCtrl->pDst, TRUE)) == NULL)                return (ERROR);            }        }    s = splimp();    /*     * Queue message on interface, and start output if interface     * not yet active.     */    if (IF_QFULL(&pIf->if_snd))        {        IF_DROP(&pIf->if_snd);        splx(s);        netMblkClChainFree (pMbuf);        return (ERROR);        }    IF_ENQUEUE(&pIf->if_snd, pMbuf);    if ((pIf->if_flags & IFF_OACTIVE) == 0)        (*pIf->if_start)(pIf);    splx(s);    pIf->if_obytes += pMbuf->mBlkHdr.mLen;    if (pMbuf->m_flags & M_MCAST || pMbuf->m_flags & M_BCAST)        pIf->if_omcasts++;    return (OK);    }/********************************************************************************* dhcpSend - transmit an outgoing DHCP message** This routine uses the MUX interface to send an IP packet containing a* DHCP message independently of the link level type. It is derived from* the ipOutput() routine in the ipProto.c module. It also transmits messages* for a BSD Ethernet interface.** RETURNS: OK, or ERROR if send fails.** ERRNO: N/A** INTERNAL* Since the underlying processing performs address resolution, this transmit* routine is only valid when sending messages to a DHCP participant (such* as a server or relay agent) with a known IP address. It cannot send* replies to clients since the hosts will not respond to resolution requests* for the target IP address if it is not yet assigned.** NOMANUAL*/STATUS dhcpSend    (    struct ifnet * 		pIf,    /* interface for sending message */    struct sockaddr_in * 	pDest,  /* destination IP address of message */    char * 			pData,  /* IP packet containing DHCP message */    int 			size,   /* amount of data to send */    BOOL 			broadcastFlag   /* broadcast packet? */    )    {    struct mbuf * pMbuf;    int result;    int level;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
盗摄精品av一区二区三区| 麻豆精品国产传媒mv男同| 亚洲综合清纯丝袜自拍| 亚洲第一综合色| 精品一区二区三区在线观看| 韩国av一区二区| 日本久久精品电影| 欧美一区二区网站| 亚洲欧美偷拍卡通变态| 热久久久久久久| 99国产精品99久久久久久| 欧美日韩国产另类一区| 国产精品情趣视频| 男人的j进女人的j一区| 在线日韩av片| 国产亚洲精品bt天堂精选| 亚洲午夜三级在线| 高清国产一区二区三区| 欧美va天堂va视频va在线| 亚洲三级在线播放| 成人性生交大片免费看视频在线| 91精品久久久久久久91蜜桃| 中文字幕亚洲在| 国产精品亚洲视频| 久久这里都是精品| 偷拍一区二区三区| 欧美精品成人一区二区三区四区| 中文av一区二区| 国产白丝精品91爽爽久久| 久久九九国产精品| 国产盗摄精品一区二区三区在线| 日韩欧美一区中文| 久久精品国产免费看久久精品| 日韩一二在线观看| 精品一区二区三区视频 | 亚洲一区二区三区四区的| 99在线精品视频| 亚洲国产aⅴ天堂久久| 日韩一区二区三区高清免费看看| 日韩中文字幕一区二区三区| 精品视频色一区| 老司机精品视频在线| 久久这里只精品最新地址| youjizz国产精品| 亚洲成人7777| 精品国产一二三区| 99久久精品国产麻豆演员表| 亚洲精品乱码久久久久| 欧美顶级少妇做爰| 成人在线视频首页| 婷婷综合五月天| 亚洲婷婷国产精品电影人久久| 欧美猛男男办公室激情| 精品一区二区三区av| 亚洲色图清纯唯美| 国产亚洲欧美色| 欧美日韩国产高清一区二区三区 | 欧美视频一区二区三区| 国产精品77777| 亚洲超碰97人人做人人爱| 久久精品人人做人人综合| 欧美美女bb生活片| 色综合久久综合网97色综合| 九色|91porny| 老司机精品视频导航| 亚洲国产精品一区二区久久| 伊人性伊人情综合网| 国产女主播一区| 中文av一区二区| 久久久精品2019中文字幕之3| 欧美日韩国产首页| 欧美日韩免费不卡视频一区二区三区| 国产成人免费在线| 国产凹凸在线观看一区二区| 国产精品自拍一区| 亚洲精品美腿丝袜| 亚洲一区二区三区三| 一色屋精品亚洲香蕉网站| 亚洲国产激情av| 日韩美女视频一区二区| 中文字幕亚洲一区二区va在线| 欧美精品一区二区三区高清aⅴ| 91麻豆精品国产91久久久久久 | 亚洲精品免费在线播放| 亚洲综合自拍偷拍| 琪琪一区二区三区| 国产成人精品亚洲777人妖| 国产91在线看| 色婷婷久久久久swag精品| 欧美日韩精品综合在线| 日韩视频一区二区三区| 中文字幕av一区二区三区| 亚洲欧美在线观看| 美女在线一区二区| 99精品欧美一区二区三区综合在线| 91免费在线播放| 91精品国产欧美一区二区18| 久久久久综合网| 一级日本不卡的影视| 99久久精品国产一区二区三区| 欧美妇女性影城| 亚洲欧洲av在线| 捆绑调教一区二区三区| 日本伦理一区二区| 久久久五月婷婷| 日韩av一区二区三区四区| 91免费在线视频观看| 久久先锋资源网| 另类中文字幕网| 欧美在线一二三| 亚洲狼人国产精品| 成人国产一区二区三区精品| 欧美大胆一级视频| 日韩和欧美一区二区三区| 欧美日本在线看| 中文在线免费一区三区高中清不卡| 五月天视频一区| 日本二三区不卡| 亚洲桃色在线一区| 成人黄色免费短视频| 欧美激情综合五月色丁香 | 这里只有精品免费| 日韩av一区二区在线影视| 3atv在线一区二区三区| 日韩影院精彩在线| 欧美一区二区三区公司| 日韩高清欧美激情| 日韩欧美的一区二区| 极品少妇一区二区三区精品视频| 欧美va亚洲va国产综合| 看国产成人h片视频| 久久美女艺术照精彩视频福利播放| 蓝色福利精品导航| 国产日韩综合av| 成人av网站在线观看| 亚洲色图20p| 欧美v亚洲v综合ⅴ国产v| 大尺度一区二区| 亚洲综合成人在线视频| 91精品国产一区二区三区| 国产一区中文字幕| 一区二区三区在线免费播放| 欧美一级淫片007| 91在线播放网址| 国产精一区二区三区| 亚洲精品一卡二卡| 久久女同性恋中文字幕| 欧美偷拍一区二区| 丁香天五香天堂综合| 亚洲成人精品一区| 中文字幕一区二区5566日韩| 欧美一二三区精品| 欧美亚洲愉拍一区二区| 成人午夜视频福利| 国内外精品视频| 日韩av一二三| 奇米影视在线99精品| 五月天久久比比资源色| 视频一区二区三区入口| 中文子幕无线码一区tr| 日韩免费性生活视频播放| 欧美精品粉嫩高潮一区二区| 91蜜桃在线观看| 成人毛片视频在线观看| 国产经典欧美精品| 成人性生交大片免费看视频在线 | 日韩精品一区二区三区视频 | 一区二区成人在线| 夜夜操天天操亚洲| 亚洲一级不卡视频| 亚洲第一福利一区| 国产91在线看| 美女网站视频久久| 捆绑变态av一区二区三区| 捆绑紧缚一区二区三区视频| 美女国产一区二区| 国产精品主播直播| 成人综合在线网站| 91蜜桃在线观看| 欧美日本一区二区| 精品99久久久久久| 国产精品欧美久久久久一区二区| 亚洲欧洲av一区二区三区久久| 亚洲精品国产a| 免费不卡在线观看| 92国产精品观看| 欧美乱妇23p| 国产精品美女久久久久aⅴ| 亚洲蜜桃精久久久久久久| 午夜电影网一区| 成人性视频免费网站| 717成人午夜免费福利电影| 精品88久久久久88久久久| 国产精品久久久爽爽爽麻豆色哟哟| 亚洲欧美日韩在线播放| 国内精品国产成人国产三级粉色 | 精品99999| 日韩不卡一区二区| 欧洲一区在线观看| 亚洲欧美综合在线精品|