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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dhcprelay.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* 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** This routine relays a DHCP or BOOTP message to the specified target address.** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/static STATUS forwarding    (

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级三级三级| 99在线精品一区二区三区| 国产欧美视频一区二区三区| 91蜜桃婷婷狠狠久久综合9色| 日韩av一级电影| 国产精品久久久久精k8| 91精品国产高清一区二区三区蜜臀 | 欧美裸体bbwbbwbbw| 成人综合在线视频| 美腿丝袜亚洲一区| 亚洲一区二区成人在线观看| 国产校园另类小说区| 777欧美精品| 色吊一区二区三区| 99精品偷自拍| 成人精品一区二区三区四区| 美女视频一区二区三区| 婷婷丁香久久五月婷婷| 亚洲欧洲性图库| 欧美激情一区二区在线| 精品不卡在线视频| 日韩欧美激情四射| 3d动漫精品啪啪1区2区免费| 在线视频欧美精品| 91在线精品秘密一区二区| 国产福利精品导航| 国内精品免费**视频| 老色鬼精品视频在线观看播放| 亚洲网友自拍偷拍| 亚洲电影中文字幕在线观看| 亚洲乱码国产乱码精品精可以看| 国产精品剧情在线亚洲| 国产亚洲短视频| 久久久国产精品午夜一区ai换脸| 日韩欧美色综合网站| 欧美一区二区三区影视| 91精品国产综合久久久久久久久久 | 欧美性一区二区| 91麻豆蜜桃一区二区三区| 成人av资源网站| 成人激情综合网站| 本田岬高潮一区二区三区| a美女胸又www黄视频久久| 成人深夜在线观看| 91小视频在线免费看| 91麻豆蜜桃一区二区三区| 在线中文字幕不卡| 欧美日韩免费一区二区三区视频| 欧美日韩高清在线播放| 67194成人在线观看| 日韩一区二区三区视频| 欧美大白屁股肥臀xxxxxx| 欧美成人乱码一区二区三区| 久久精品一区四区| 国产精品久久久久精k8| 一区二区三区日韩欧美精品| 亚洲午夜精品网| 男人的天堂久久精品| 国产一区二区三区四区在线观看| 国产乱人伦偷精品视频免下载 | 91在线国产福利| 91黄视频在线观看| 欧美日韩国产色站一区二区三区| 69精品人人人人| 久久这里只精品最新地址| 国产精品亲子伦对白| 亚洲人xxxx| 天天色图综合网| 激情五月播播久久久精品| 成人网页在线观看| 欧洲av一区二区嗯嗯嗯啊| 91精品国产福利| 国产日产亚洲精品系列| 一区二区三区欧美日| 麻豆中文一区二区| 99久久精品免费看| 欧美老女人在线| 久久精品视频在线看| 一区二区三区四区视频精品免费| 九九视频精品免费| 91麻豆自制传媒国产之光| 日韩午夜电影在线观看| 中文字幕亚洲在| 免费av网站大全久久| 99久久99久久久精品齐齐| 91麻豆精品91久久久久同性| 欧美国产激情一区二区三区蜜月| 亚洲综合清纯丝袜自拍| 国产一区二区三区最好精华液| 一道本成人在线| 久久午夜羞羞影院免费观看| 亚洲免费在线看| 精品一区二区三区日韩| 欧美日韩一区二区三区不卡| 国产亚洲精品免费| 日韩激情中文字幕| 99国产精品久| 久久综合999| 五月婷婷激情综合| 91丝袜高跟美女视频| 精品久久久久久久久久久久久久久| 依依成人综合视频| 高清不卡一区二区在线| 欧美大黄免费观看| 亚洲国产精品一区二区www| 风间由美性色一区二区三区| 欧美一级免费观看| 亚洲欧洲在线观看av| 欧美精品丝袜中出| 欧美一二区视频| 亚洲黄色小说网站| 丁香婷婷综合五月| 欧美成人a视频| 午夜精品久久久久影视| 91在线高清观看| 中文字幕免费在线观看视频一区| 日本中文字幕一区| 久久久久久99久久久精品网站| 艳妇臀荡乳欲伦亚洲一区| 成人免费视频视频在线观看免费| 精品美女一区二区| 青娱乐精品视频在线| 欧美电影一区二区三区| 亚洲一区二区三区四区在线免费观看 | 精品奇米国产一区二区三区| 亚洲第四色夜色| 91久久久免费一区二区| 伊人一区二区三区| 99久久综合精品| 国产精品久久久久9999吃药| 国产成人亚洲精品狼色在线| 久久婷婷一区二区三区| 精品中文字幕一区二区小辣椒| 在线播放国产精品二区一二区四区| 亚洲最新视频在线观看| 在线观看日韩毛片| 亚洲综合小说图片| 欧美日韩综合在线免费观看| 亚洲成国产人片在线观看| 欧美日韩一区视频| 日日夜夜免费精品| 欧美一级精品在线| 国产综合色在线视频区| 久久久久高清精品| 波多野结衣精品在线| 日韩一区在线免费观看| 色久优优欧美色久优优| 一区二区免费在线播放| 欧美日韩国产在线观看| 日本色综合中文字幕| 2024国产精品| 丁香五精品蜜臀久久久久99网站| 中文字幕制服丝袜成人av| 色综合天天综合在线视频| 亚洲一区av在线| 88在线观看91蜜桃国自产| 久久电影网电视剧免费观看| 久久亚洲私人国产精品va媚药| 粉嫩嫩av羞羞动漫久久久| 日韩理论电影院| 欧美日韩免费一区二区三区 | 日本一区二区三区dvd视频在线| 成人午夜短视频| 亚洲一级电影视频| 日韩一区二区电影网| 狠狠网亚洲精品| 亚洲人成人一区二区在线观看| 欧美日韩国产一区| 国产精品一二二区| 亚洲精品国产无天堂网2021| 欧美久久婷婷综合色| 国产毛片精品国产一区二区三区| 国产精品初高中害羞小美女文| 欧美在线免费播放| 激情文学综合丁香| 亚洲六月丁香色婷婷综合久久 | 亚洲福利视频一区二区| 日韩欧美精品在线视频| av电影在线观看一区| 日欧美一区二区| 国产无遮挡一区二区三区毛片日本| 一本到一区二区三区| 国内久久婷婷综合| 亚洲一二三区不卡| 久久精品视频免费| 制服丝袜亚洲播放| 成人18视频日本| 毛片一区二区三区| 一区二区三区在线视频免费观看| 精品入口麻豆88视频| 91久久精品午夜一区二区| 精品一区二区成人精品| 亚洲一区二区三区小说| 中文字幕欧美三区| 欧美电影在线免费观看| 99re66热这里只有精品3直播 | 99视频有精品| 美女视频黄频大全不卡视频在线播放| 国产精品久久久久久久蜜臀| 日韩欧美区一区二|