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

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

?? dhcprelay.c

?? VxWorks下DHCP的源代碼!
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* dhcpRelay.c - DHCP server and relay agent shared code library *//* Copyright 1984 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01e,07may02,wap  Put debug messages under DHCPR_DEBUG (SPR #76495)01d,27mar02,wap  call ip_mloopback() rather than calling looutput() directly                 (SPR #72246)01c,22mar02,wap  avoid division by zero in dhcpServerRelay() (SPR #74456)01b,06dec01,wap  Add NPT support01a,12oct01,rae  merge from truestack ver 01n, base 01f (SPR #69547)01i,17nov00,spm  added support for BSD Ethernet devices01h,24oct00,spm  fixed merge from tor3_x branch and updated mod history01g,23oct00,niq  merged from version 01h of tor3_x branch (base version 01f)01f,04dec97,spm  added code review modifications01e,06oct97,spm  split interface name into device name and unit number; fixed                 errors in debugging output01d,02jun97,spm  changed DHCP option tags to prevent name conflicts (SPR #8667)                 and updated man pages01c,28apr97,spm  limited maximum number of hops to 16 for RFC compliance01b,18apr97,spm  added conditional include DHCPR_DEBUG for displayed output01a,07apr97,spm  created by modifying WIDE project DHCP implementation*//*DESCRIPTIONThis library contains the code used by the DHCP relay agent to transfer packets between DHCP or BOOTP clients and DHCP servers. The DHCP serverwill also use this code if configured to act as a relay agent. Thelibrary also includes the shared transmit routine which sends unicastpackets to a DHCP client without performing address resolution, sincethe destination IP address is not yet resolvable.INCLUDE_FILES: dhcprLib.h*//* * WIDE Project DHCP Implementation * Copyright (c) 1995 Akihiro Tominaga * Copyright (c) 1995 WIDE Project * All rights reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided only with the following * conditions are satisfied: * * 1. Both the copyright notice and this permission notice appear in *    all copies of the software, derivative works or modified versions, *    and any portions thereof, and that both notices appear in *    supporting documentation. * 2. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *      This product includes software developed by WIDE Project and *      its contributors. * 3. Neither the name of WIDE Project nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND WIDE * PROJECT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. ALSO, THERE * IS NO WARRANTY IMPLIED OR OTHERWISE, NOR IS SUPPORT PROVIDED. * * Feedback of the results generated from any improvements or * extensions made to this software would be much appreciated. * Any such feedback should be sent to: *  *  Akihiro Tominaga *  WIDE Project *  Keio University, Endo 5322, Kanagawa, Japan *  (E-mail: dhcp-dist@wide.ad.jp) * * WIDE project has the rights to redistribute these changes. *//* includes */#include "vxWorks.h"#include "vxLib.h"              /* checksum() declaration. */#include <stdio.h>#include <stdlib.h>#include <sys/ioctl.h>#include <netinet/in.h>#include <arpa/inet.h>#include "logLib.h"#include "sockLib.h"#include "ioLib.h"#include "ipProto.h"            /* IP_DRV_CTRL definition. */#include "muxLib.h"#include "tickLib.h"            /* tickGet() declaration. */#ifdef DHCPR_DEBUG#include "inetLib.h"#endif#include "dhcprLib.h"#include "dhcp/dhcp.h"#include "dhcp/common.h"#include "dhcp/common_subr.h"/* globals */#ifndef VIRTUAL_STACKDHCP_TARGET_DESC *pDhcpRelayTargetTbl;struct server *pDhcpTargetList = NULL;int dhcpNumTargets = 0;struct msg dhcpMsgIn;struct msg dhcprMsgOut;u_short dhcps_port;u_short dhcpc_port;#else#include "netinet/vsLib.h"#include "netinet/vsDhcps.h"#endif /* VIRTUAL_STACK *//* forward declarations */IMPORT void ip_mloopback (struct ifnet *, struct mbuf *, struct sockaddr_in *, struct rtentry *rt);void dhcpServerRelay (struct if_info *);void dhcpClientRelay (struct if_info *, int, char *);LOCAL STATUS forwarding ();/********************************************************************************* dhcpsSend - 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, but uses the available* hardware address of the original sender as the destination link-level* address instead of performing address resolution.** Bypassing the normal address resolution process is required since the* destination IP address has not yet been assigned so (for instance)* ARP requests would fail, preventing delivery of the reply.** RETURNS: OK, or ERROR if send fails.** ERRNO: N/A** NOMANUAL*/STATUS dhcpsSend (struct ifnet *pIf,    /* interface for sending message */                  char *pHwAddr,    /* destination link-level address */                  int hlen,     /* size of link-level address, in bytes */                  struct sockaddr_in *pDest,    /* destination IP address for message */                  char *pData,  /* IP packet containing DHCP message */                  int size,     /* amount of data to send */                  BOOL broadcastFlag    /* broadcast packet? */    ){    IP_DRV_CTRL *pDrvCtrl;      /* Protocol-specific information. */    void *pIpCookie;            /* Result of muxBind() routine for device */    struct mbuf *pMbuf;    u_short etype;    int s;    if ((pIf->if_flags & (IFF_UP | IFF_RUNNING)) != (IFF_UP | IFF_RUNNING))        return (ERROR);         /* ENETDOWN */    pDrvCtrl = (IP_DRV_CTRL *) pIf->pCookie;    if (pDrvCtrl == NULL)       /* Undefined error in original transmit code. */        return (ERROR);    pIpCookie = pDrvCtrl->pIpCookie;    if (pIpCookie == NULL)        return (ERROR);         /* EINVAL */    pMbuf = bcopy_to_mbufs (pData, size, 0, pIf, NONE);    if (pMbuf == NULL)        return (ERROR);         /* ENOBUFS */    s = splnet ();    pIf->if_lastchange = tickGet ();    /* Setup existing mBlk structures and build link-level header. */    etype = htons (ETHERTYPE_IP);    pDrvCtrl->pSrc->m_data = (char *) &((struct arpcom *) pIf)->ac_enaddr;    bcopy (pHwAddr, (char *) pDrvCtrl->pDstAddr, hlen);    pDrvCtrl->pDst->mBlkHdr.reserved = etype;    pDrvCtrl->pSrc->mBlkHdr.reserved = etype;    if (broadcastFlag) {        /*         * Use the registered resolve routine to get the link-level broadcast.         */        pMbuf->mBlkHdr.mFlags |= M_BCAST;        /* Loopback a copy of the data if using a simplex interface. */        if (pIf->if_flags & IFF_SIMPLEX) {            ip_mloopback (pIf, pMbuf, (struct sockaddr_in *) pDest, NULL);        }    }    if (pDrvCtrl->nptFlag) {        if (pIf->if_addrlen) {            M_PREPEND (pMbuf, pIf->if_addrlen, M_DONTWAIT);            if (pMbuf == NULL) {                netMblkClChainFree (pMbuf);                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 {        pMbuf = muxLinkHeaderCreate (pDrvCtrl->pIpCookie, pMbuf,                                     pDrvCtrl->pSrc, pDrvCtrl->pDst, broadcastFlag);        if (pMbuf == NULL) {            netMblkClChainFree (pMbuf);            return (ERROR);     /* ENOBUFS */        }    }    /*     * 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);         /* ENOBUFS */    }    IF_ENQUEUE (&pIf->if_snd, pMbuf);    pIf->if_start (pIf);    pIf->if_obytes += pMbuf->mBlkHdr.mLen;    if (pMbuf->m_flags & M_MCAST || pMbuf->m_flags & M_BCAST)        pIf->if_omcasts++;    splx (s);    return (OK);}/********************************************************************************* dhcpServerRelay - send incoming DHCP/BOOTP message to client port** This routine relays a DHCP or BOOTP message to the client port of * every DHCP server or relay agent whose IP address is contained in the * circular linked list of targets. That list is constructed during startup of * the relay agent (or server, if configured to relay messages). The routine* accesses global pointers already set to indicate the outgoing message. * All messages are discarded after the hops field exceeds 16 to comply with* the relay agent behavior specified in RFC 1542. The relay agent normally* discards such messages before this routine is called. They will only* be received by this routine if the user ignores the instructions in the* manual and sets the value of DHCP_MAX_HOPS higher than 16.** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/void dhcpServerRelay (struct if_info *ifp){    unsigned int hash;    int i;    struct server *srvp;    dhcpMsgIn.dhcp->hops++;    if (dhcpMsgIn.dhcp->hops >= 17) /* RFC limits to 16 hops - ignore. */        return;    /*     * If the target table is empty, bail, otherwise     * trying to do the hash computation below will yield a     * division by zero.     */    if (dhcpNumTargets == 0)        return;    if (dhcpMsgIn.dhcp->giaddr.s_addr == 0)        dhcpMsgIn.dhcp->giaddr.s_addr = ifp->ipaddr.s_addr;    /* Quick and dirty load balancing - pick starting point in circular list. */    hash = (unsigned) checksum ((u_short *) dhcpMsgIn.dhcp->chaddr, (MAX_HLEN / 2));    hash %= dhcpNumTargets;    srvp = pDhcpTargetList;    for (i = 0; i < hash; i++)        srvp = srvp->next;    forwarding (srvp);    return;}/********************************************************************************* forwarding - send DHCP/BOOTP message to target address

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费的成人av| 亚洲综合色自拍一区| 色婷婷综合久久久| 免费视频一区二区| 国产精品国产三级国产三级人妇| 91精品国产一区二区人妖| 成人午夜精品在线| 美女视频一区二区| 亚洲成人精品影院| 国产精品麻豆一区二区| 欧美大片在线观看一区| 欧美日韩视频专区在线播放| 成人午夜伦理影院| 国内精品嫩模私拍在线| 视频一区二区三区入口| 亚洲精品国产一区二区精华液| 久久久精品免费网站| 337p亚洲精品色噜噜狠狠| av电影在线观看一区| 国产精品99久久久| 精东粉嫩av免费一区二区三区| 香蕉影视欧美成人| 《视频一区视频二区| 亚洲国产精品99久久久久久久久 | 亚洲女同一区二区| 国产三级一区二区| 久久久久久**毛片大全| 精品999在线播放| 欧美成人精品1314www| 91精品啪在线观看国产60岁| 欧美三级日韩三级| 亚洲午夜一二三区视频| 亚洲黄色尤物视频| 亚洲精品视频在线看| 亚洲精品久久久蜜桃| 亚洲欧美日韩国产成人精品影院| 中文字幕制服丝袜成人av| 国产午夜一区二区三区| 欧美国产精品一区| 中文字幕不卡在线播放| 国产精品久久久久四虎| 国产精品久久久久影院| 亚洲欧洲三级电影| 国产精品久久精品日日| 亚洲日本中文字幕区| 一区二区三区四区不卡在线| 一区二区三区久久久| 一区二区在线观看不卡| 亚洲精品乱码久久久久久黑人| 亚洲三级免费电影| 亚洲成人www| 奇米综合一区二区三区精品视频| 日韩高清在线一区| 国产综合色视频| 国产成人精品影院| 91网站在线播放| 欧洲日韩一区二区三区| 欧美丰满高潮xxxx喷水动漫| 日韩一区二区高清| 久久一夜天堂av一区二区三区| 国产三级一区二区三区| 综合av第一页| 午夜精品免费在线观看| 久久精品久久精品| 成人免费视频国产在线观看| 一本一道久久a久久精品 | 毛片一区二区三区| 国产尤物一区二区在线| fc2成人免费人成在线观看播放| 色综合视频在线观看| 欧美精品 国产精品| 国产午夜精品久久久久久久| 亚洲免费观看高清完整版在线| 午夜不卡av在线| 国产剧情一区在线| 91极品美女在线| 日韩欧美国产综合一区| 国产精品福利电影一区二区三区四区| 亚洲精品久久久蜜桃| 激情深爱一区二区| 91视频国产观看| 精品乱码亚洲一区二区不卡| 亚洲色图一区二区三区| 老司机精品视频一区二区三区| 9i在线看片成人免费| 国产精品一级片在线观看| 91国偷自产一区二区使用方法| 欧美成人激情免费网| 亚洲乱码国产乱码精品精的特点 | 国产精品久久久久久久久免费相片| 一区二区三区欧美久久| 国产精品自拍一区| 欧美欧美欧美欧美首页| 国产精品国产三级国产有无不卡 | 中文字幕一区不卡| 美女任你摸久久 | 91官网在线观看| 久久久久9999亚洲精品| 亚洲bt欧美bt精品| 99精品视频在线免费观看| 日韩精品影音先锋| 亚洲午夜视频在线观看| www.亚洲色图.com| 欧美精品一区二区在线播放| 亚洲丶国产丶欧美一区二区三区| 国产成人精品亚洲午夜麻豆| 日韩一区二区三区观看| 亚洲一区二区美女| 94-欧美-setu| 中文字幕av一区二区三区免费看 | 亚洲精品免费看| 岛国av在线一区| 久久这里只有精品6| 蜜臀久久99精品久久久久久9| 欧美亚洲综合网| 日韩毛片精品高清免费| 国产东北露脸精品视频| 精品奇米国产一区二区三区| 五月婷婷久久综合| 欧美在线free| 樱桃国产成人精品视频| 色悠悠久久综合| 国产精品久久久爽爽爽麻豆色哟哟 | www.成人在线| 国产欧美精品区一区二区三区 | 亚洲精品日产精品乱码不卡| 国产成人啪免费观看软件| 久久综合久久99| 国内国产精品久久| 久久毛片高清国产| 黄页网站大全一区二区| 精品国产99国产精品| 美女视频一区二区| 精品国产91亚洲一区二区三区婷婷| 亚洲r级在线视频| 在线播放日韩导航| 青青草成人在线观看| 欧美一二三在线| 久久99精品国产麻豆婷婷| 精品久久国产字幕高潮| 麻豆91在线播放免费| 日韩精品综合一本久道在线视频| 男人的天堂久久精品| 精品卡一卡二卡三卡四在线| 国产剧情av麻豆香蕉精品| 日本一区二区三级电影在线观看| 丁香激情综合五月| 亚洲欧洲精品一区二区精品久久久| 91在线视频免费观看| 亚洲影院理伦片| 欧美精品久久天天躁| 精品在线播放午夜| 国产欧美一区二区三区在线看蜜臀 | 免费成人av在线| 久久久久久久久久美女| 不卡av在线网| 亚洲在线一区二区三区| 欧美一区二区精品在线| 国产精品综合av一区二区国产馆| 中文一区二区在线观看| 一本色道a无线码一区v| 日韩国产精品91| 国产欧美一二三区| 91国内精品野花午夜精品| 日韩国产一二三区| 久久精品视频一区| 在线日韩国产精品| 精品一区二区三区免费播放| 国产精品女主播av| 欧美久久久久中文字幕| 狠狠狠色丁香婷婷综合久久五月| 自拍av一区二区三区| 91精品国产91久久久久久最新毛片 | 欧美成人一区二区三区片免费| 久久丁香综合五月国产三级网站| 国产精品久线观看视频| 欧美日韩aaa| 高清国产一区二区| 亚洲影院久久精品| 久久久久99精品一区| 欧美色图片你懂的| 国产大陆a不卡| 亚洲.国产.中文慕字在线| 久久免费午夜影院| 欧美色老头old∨ideo| 国产经典欧美精品| 亚洲成人一区在线| 国产精品人人做人人爽人人添| 欧美麻豆精品久久久久久| 国产91丝袜在线播放| 视频在线在亚洲| 国产精品嫩草99a| 日韩欧美高清一区| 欧洲国内综合视频| 成人国产一区二区三区精品| 日韩高清一级片| 有码一区二区三区| 国产精品视频你懂的| 日韩精品一区二区三区视频在线观看 | 欧美挠脚心视频网站|