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

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

?? common_subr.c

?? vxworks的完整的源代碼
?? C
字號:
/* common_subr.c - DHCP library common code *//* Copyright 1984 - 2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01l,22may02,wap  use tickGet() instead of vxTicks in dhcpTime()01k,23apr02,wap  Implement dhcpTime() routine to use instead of time() (SPR                 #68900)01j,12oct01,rae  merge from truestack ver o1k, base o1f (VIRTUAL_STACK)01i,04nov00,niq  Changing the MIB2 type names to conform to the RFC2233 names01h,24oct00,spm  fixed modification history after tor3_x merge01g,23oct00,niq  merged from version 01h of tor3_x branch (base version 01f)01f,26aug97,spm  moved routines not shared by client and server01e,10jun97,spm  isolated incoming messages in state machine from input hooks01d,02jun97,spm  changed DHCP option tags to prevent name conflicts (SPR #8667)                 and updated man pages01c,07apr97,spm  added INCLUDE_FILES to module heading01b,29jan97,spm  brought into compliance with Wind River coding standards01a,03oct96,spm  created by modifying WIDE Project DHCP Implementation*//*DESCRIPTIONThis library contains the code common to the WIDE Project implementationsof the DHCP client (runtime and boot-time versions) and the DHCP server,modified for VxWorks compatibility, as well as some internal WRS code whichis also shared by those components.INCLUDE_FILES: None*//* * 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 "m2Lib.h"#include "sysLib.h"#include "tickLib.h"#include "private/timerLibP.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <sys/socket.h>#include <net/if.h>#include <netinet/in_systm.h>#include <netinet/in.h>#include <netinet/ip.h>#include <netinet/udp.h>#include <netinet/if_ether.h>#include "dhcp/dhcp.h"#ifdef VIRTUAL_STACK#include "netinet/vsLib.h"#endif /* VIRTUAL_STACK *//* forward declarations */u_short get_ipsum (struct ip *);u_short get_udpsum (struct ip *, struct udphdr *);u_short udp_cksum (struct ps_udph *, char *, int);/********************************************************************************* dhcpConvert - convert the hardware type from the MUX** This routine converts the hardware type value which the MUX interface* provides into the encoding that DHCP uses. The MUX interface uses the* RFC 1213 MIB values while DHCP uses the interface encodings from the ARP* section of the assigned numbers RFC (RFC 1700).** NOMANUAL** RETURNS: RFC 1700 encoding of type value, or ERROR if none.**/int dhcpConvert    (    int muxType         /* RFC 1213 interface type value */    )    {    int dhcpType = 0;    switch (muxType)        {        default:            return (ERROR);            break;        case M2_ifType_ethernet_csmacd:            dhcpType = ETHER;            break;        case M2_ifType_ethernet3Mbit:            dhcpType = EXPETHER;            break;        case M2_ifType_proteon10Mbit:     /* fall-through */        case M2_ifType_proteon80Mbit:            dhcpType = PRONET;            break;        case M2_ifType_iso88023_csmacd:    /* fall-through */        case M2_ifType_iso88024_tokenBus:  /* fall-through */        case M2_ifType_iso88025_tokenRing: /* fall-through */        case M2_ifType_iso88026_man:            dhcpType = IEEE802;            break;        case M2_ifType_hyperchannel:            dhcpType = HYPERCH;            break;        case M2_ifType_starLan:            dhcpType = LANSTAR;            break;        case M2_ifType_ultra:            dhcpType = ULTRALINK;            break;        case M2_ifType_frameRelay:            dhcpType = FRAMERELAY;            break;        case M2_ifType_propPointToPointSerial:    /* fall-through */        case M2_ifType_ppp:                       /* fall-through */        case M2_ifType_slip:            dhcpType = SERIAL;            break;        }    return (dhcpType);    }/********************************************************************************* pickup_opt - extract an option from a DHCP message** This routine searches the fields in a DHCP message for the option specified* by the <tag> parameter. If the file and sname message fields are overloaded * with options, they are searched as well. The search order is:**    options field -> 'file' field -> 'sname' field** RETURNS: Pointer to first occurrence of option, or NULL if not found.** ERRNO:   N/A** SEE ALSO: RFC 1533** NOMANUAL*/char *	pickup_opt    (    struct dhcp *	msg,      /* Incoming message copied to structure */    int			msglen,   /* Length of message */    char		tag       /* RFC 1533 tag for desired option */    )    {    BOOL 	sname_is_opt = FALSE;    BOOL 	file_is_opt = FALSE;    int 	i = 0;    char *	opt = NULL;    char *	found = NULL;    /*  search option field. */    opt = &msg->options[MAGIC_LEN];    for (i = 0; i < msglen - DFLTDHCPLEN + DFLTOPTLEN - MAGIC_LEN; i++)         {        if (*(opt + i) == tag)             {            found = (opt + i);            break;            }        else if (*(opt + i) == _DHCP_END_TAG)             break;        else if (*(opt + i) == _DHCP_OPT_OVERLOAD_TAG)             {            i += 2 ;            if (*(opt + i) == 1)                file_is_opt = TRUE;            else if (*(opt + i) == 2)                sname_is_opt = TRUE;            else if (*(opt + i) == 3)                file_is_opt = sname_is_opt = TRUE;            continue;            }        else if (*(opt + i) == _DHCP_PAD_TAG)             continue;        else             i += *(u_char *)(opt + i + 1) + 1;        }    if (found != NULL)        return (found);    /* If necessary, search file field. */    if (file_is_opt)        {        opt = msg->file;        for (i = 0; i < sizeof (msg->file); i++)              {             if (*(opt + i) == _DHCP_PAD_TAG)                  continue;             else if (*(opt + i) == _DHCP_END_TAG)                  break;             else if (*(opt + i) == tag)                  {                 found = (opt + i);                 break;                 }             else                  i += *(u_char *)(opt + i + 1) + 1;             }        if (found != NULL)            return (found);        }    /* If necessary, search sname field. */    if (sname_is_opt)         {        opt = msg->sname;        for (i = 0; i < sizeof (msg->sname); i++)             {            if (*(opt + i) == _DHCP_PAD_TAG)                 continue;            else if (*(opt + i) == _DHCP_END_TAG)                 break;            else if (*(opt + i) == tag)                 {                found = (opt + i);                break;                }            else                i += *(u_char *)(opt + i + 1) + 1;            }        if (found != NULL)            return(found);        }    return(NULL);    }/********************************************************************************* udp_cksum - calculate the UDP header checksum** This routine calculates the checksum for the given UDP pseudo-header and * additional bytes of data contained in the provided buffer, interpreted* as unsigned shorts in network byte order.** RETURNS: Value of calculated checksum, or 0xffff instead of 0.** ERRNO:   N/A** NOMANUAL*/u_short udp_cksum    (    struct ps_udph *pUdpPh,	/* UDP pseudo-header */    char *buf,                  /* Additional data (received UDP header) */    int n                       /* Length of provided buffer */    )    {    u_long 		sum = 0;    u_short *		tmp = NULL;    u_short		result;    FAST int 		i = 0;    unsigned char 	pad[2];    tmp = (u_short *) pUdpPh;    for (i = 0; i < 6; i++)         {        sum += *tmp++;        }          tmp = (u_short *)buf;    while (n > 1)         {        sum += *tmp++;        n -= sizeof (u_short);        }    if (n == 1)		/* n % 2 == 1, so padding is needed */        {        pad [0] = *(u_char *)tmp;        pad [1] = 0;        tmp = (u_short *)pad;        sum += *tmp;        }    sum = (sum >> 16) + (sum & 0xffff);    sum += (sum >> 16);    result = (u_short) ~sum;    if (result == 0)        result = 0xffff;    return (result);    }/********************************************************************************* dhcpTime - return system uptime** This routine is similar to the POSIX time() routine, except it returns* the time in terms of the number of seconds that the system has been* running and is immune to changes in the system clock made by* clock_settime(). Note however that it is _not_ immune to someone* calling tickSet(). This is not the same thing as changing the* calendar time though and should happen less frequently.** RETURNS: Number of seconds since the system was booted.** ERRNO:   N/A** NOMANUAL*/time_t dhcpTime    (    time_t *timer    )    {    ULONG      sysTicks;     sysTicks = tickGet()/sysClkRateGet();    if (timer != NULL)        *timer = (time_t) sysTicks;    return (time_t) (sysTicks);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久99久久| 亚洲欧美日本韩国| 日韩三级电影网址| 欧美色手机在线观看| 欧美成人性战久久| 91免费国产在线| 波多野结衣精品在线| 99精品视频一区| 高清国产一区二区| 成人av在线资源| 久久久亚洲精品石原莉奈| 日韩女同互慰一区二区| 精品国产制服丝袜高跟| 国产亚洲自拍一区| 国产精品久久久久影院老司| 国产精品人成在线观看免费| 一区视频在线播放| 亚洲精品菠萝久久久久久久| 一区二区在线观看免费视频播放| 一区二区三区鲁丝不卡| 午夜成人免费视频| 精品在线视频一区| 国产乱淫av一区二区三区| 成人av一区二区三区| 色综合天天综合网国产成人综合天| 色婷婷综合久久久中文一区二区| 欧美亚洲动漫另类| 91精品国产全国免费观看| 精品国产欧美一区二区| 91精品福利在线一区二区三区| 亚洲精品一区二区三区福利| 国产欧美日韩精品在线| 亚洲色图欧美激情| 秋霞午夜鲁丝一区二区老狼| 极品销魂美女一区二区三区| 成人免费不卡视频| 在线视频一区二区三区| 91精品国产入口| 国产农村妇女毛片精品久久麻豆 | 日韩视频一区二区在线观看| 欧美精品一区二区三区四区| 国产精品视频一二三区| 亚洲欧美日韩中文字幕一区二区三区 | 欧美猛男男办公室激情| 日韩精品自拍偷拍| 久久久久久亚洲综合影院红桃| 日韩一区中文字幕| 日韩精品一级中文字幕精品视频免费观看 | 精品国产亚洲一区二区三区在线观看| 国产日韩精品一区| 亚洲欧洲国产专区| 天堂一区二区在线| 美脚の诱脚舐め脚责91| 成人av网址在线| 99久久久久久99| 欧美丰满一区二区免费视频| 国产欧美一区二区在线观看| 午夜激情一区二区| 国产成人在线视频网址| 欧美日韩一级黄| 日本一区二区免费在线观看视频| 艳妇臀荡乳欲伦亚洲一区| 国产精品综合一区二区三区| 欧美日韩亚洲国产综合| 国产精品三级视频| 玖玖九九国产精品| 欧美性受极品xxxx喷水| 国产色产综合色产在线视频| 日韩中文字幕区一区有砖一区| heyzo一本久久综合| 欧美另类z0zxhd电影| 国产精品美女视频| 蓝色福利精品导航| 欧美三级中文字| 国产精品电影一区二区三区| 日产国产高清一区二区三区| 色吊一区二区三区| 国产精品久久久一区麻豆最新章节| 久久福利资源站| 欧美久久一二区| 亚洲欧美成人一区二区三区| 从欧美一区二区三区| 精品国产乱码久久久久久牛牛| 亚洲午夜久久久久久久久久久| 国产99精品国产| 久久综合久久综合九色| 美女一区二区久久| 在线综合+亚洲+欧美中文字幕| 亚洲欧美精品午睡沙发| 99亚偷拍自图区亚洲| 久久久国产精品麻豆| 久久99最新地址| 3d动漫精品啪啪1区2区免费| 亚洲一区二区三区四区在线观看 | 欧美色电影在线| 亚洲一区二区高清| 91论坛在线播放| 中文字幕色av一区二区三区| 粉嫩aⅴ一区二区三区四区| 久久久久高清精品| 国产高清在线精品| 欧美精品一区二区三区高清aⅴ | 中文字幕在线观看一区| 成人黄动漫网站免费app| 国产香蕉久久精品综合网| 久久99久久99小草精品免视看| 91精品国产综合久久久久| 三级久久三级久久| 欧美精品视频www在线观看| 亚洲成av人**亚洲成av**| 欧美午夜影院一区| 午夜精品一区二区三区三上悠亚| 欧美三级电影一区| 午夜伦欧美伦电影理论片| 9191精品国产综合久久久久久| 亚洲v日本v欧美v久久精品| 欧美人xxxx| 久久精品国产一区二区| 亚洲精品在线免费播放| 国产激情一区二区三区四区| 国产精品三级电影| 日本乱人伦一区| 亚洲欧美福利一区二区| av亚洲精华国产精华| 亚洲啪啪综合av一区二区三区| 欧美中文字幕一区二区三区| 亚洲不卡一区二区三区| 色激情天天射综合网| 亚洲资源中文字幕| 欧美一区二区三区男人的天堂 | 欧美日韩国产大片| 日产欧产美韩系列久久99| 精品免费视频一区二区| 国产在线国偷精品免费看| 久久精品网站免费观看| 色综合久久综合网97色综合| 午夜伦欧美伦电影理论片| 精品国产欧美一区二区| 成人av小说网| 日韩精品亚洲专区| 国产偷v国产偷v亚洲高清| 在线观看亚洲精品| 美女视频黄a大片欧美| 欧美国产日韩一二三区| 欧美唯美清纯偷拍| 国产精品一区三区| 亚洲综合久久久久| 久久影院视频免费| 色综合久久天天综合网| 麻豆精品在线看| 一区二区三区在线不卡| 精品国产一区二区三区四区四| 97国产一区二区| 久久99国产精品尤物| 自拍偷拍亚洲欧美日韩| 日韩女优av电影| 91激情在线视频| 国产精品综合一区二区| 一区二区三区四区不卡在线 | 久久色中文字幕| 在线看国产一区二区| 国产精品一区二区在线观看不卡 | 日韩国产欧美三级| 国产精品久久久久毛片软件| 91精品国产黑色紧身裤美女| 成年人国产精品| 久久er精品视频| 亚洲一区二区三区不卡国产欧美| 久久久亚洲精品石原莉奈 | 亚洲精品免费在线| 欧美xxx久久| 欧美人与z0zoxxxx视频| 色综合久久综合网欧美综合网| 国产在线一区二区综合免费视频| 亚洲一区二区精品久久av| 国产精品传媒入口麻豆| 欧美精品一区二区不卡| 欧美日韩一二区| 色综合天天做天天爱| 成人开心网精品视频| 卡一卡二国产精品 | 91精品国产手机| 欧美色视频在线| 91久久香蕉国产日韩欧美9色| 国产伦精一区二区三区| 蜜乳av一区二区| 日韩专区中文字幕一区二区| 亚洲成人一区在线| 亚洲黄色性网站| 中文字幕一区二区三区在线不卡 | 亚洲aⅴ怡春院| 一区二区三区欧美亚洲| 亚洲天堂av一区| 国产精品成人一区二区艾草 | 蜜桃传媒麻豆第一区在线观看| 亚洲成va人在线观看| 亚洲sss视频在线视频| 一级女性全黄久久生活片免费| 亚洲品质自拍视频| 亚洲欧美日韩人成在线播放|