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

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

?? dhcps.c

?? VxWorks下DHCP的源代碼!
?? C
?? 第 1 頁 / 共 5 頁
字號:
* get_cid - Retrieve client identifier** This routine extracts the client identifier from the options field of the* DHCP client request and stores the <type>:<value> pair in the given * structure. If no explicit client ID is given, the routine uses the hardware* address, as specified by RFC 1541.** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/static void get_cid (struct dhcp *msg,  /* pointer to incoming message */                     int length,    /* length of incoming message */                     struct client_id *cid  /* pointer to storage for parsed data */    ){    char *option = NULL;    option = pickup_opt (msg, length, _DHCP_CLIENT_ID_TAG);    if (option != NULL) {        cid->idlen = ((int) DHCPOPTLEN (option)) - 1;   /* -1 for ID type */        bcopy (OPTBODY (option) + 1, cid->id, cid->idlen);        cid->idtype = *OPTBODY (option);    } else {        /* haddr is used to substitute for client identifier */        cid->idlen = msg->hlen;        cid->idtype = msg->htype;        bcopy (msg->chaddr, cid->id, msg->hlen);    }    return;}/********************************************************************************* get_maxoptlen - Calculate size of options field** This routine determines the number of bytes available for DHCP options* without overloading. For standard length messages of 548 bytes, it returns * the default length of 312 bytes. For longer messages, it returns 312 bytes * plus the excess bytes (beyond 548), unless the DHCP message length exceeds* the MTU size. In that case, it returns the number of bytes in the MTU not* needed for the IP header, UDP header, and the fixed-length portion of the* DHCP messages, which require 264 bytes total.** RETURNS: Size of variable-length options field** ERRNO: N/A** NOMANUAL*/static int get_maxoptlen (struct dhcp *msg, /* pointer to incoming message */                          int length    /* length of incoming message */    ){    char *option = NULL;    int retval = DFLTOPTLEN;    /* Calculate length of options field from maximum message size. */    if ((option = pickup_opt (msg, length, _DHCP_MAXMSGSIZE_TAG)) != NULL)        retval = GETHS (OPTBODY (option)) - IPHL - UDPHL - DFLTDHCPLEN + DFLTOPTLEN;    /*      * If requested maximum size exceeds largest supported value, return     * value equal to portion of buffer not required for message headers     * or fixed-size portion of DHCP message.      */    if (retval - DFLTOPTLEN + DFLTDHCPLEN + UDPHL + IPHL > dhcpsMaxSize)        retval = dhcpsMaxSize - IPHL - UDPHL - DFLTDHCPLEN + DFLTOPTLEN;    return (retval);}/********************************************************************************* get_subnet - Retrieve subnet number** This routine determines the subnet number of the requesting client and* stores it in the given structure. This value is determined using the* subnet mask specified by the client, if present. Otherwise, it is formed* from the last known subnet mask, if available, or the subnet mask of the* receiving interface. The server will only issue leases for IP addresses * with the same subnet number as the requesting client.** RETURNS: 0 if subnet number determined, or -1 otherwise.** ERRNO: N/A** NOMANUAL*/static int get_subnet (struct dhcp *msg,    /* pointer to incoming message */                       int length,  /* length of incoming message */                       struct in_addr *subn,    /* pointer to storage for parsed data */                       struct if_info *ifp  /* pointer to receiving interface descriptor */    ){    char *option = NULL;    struct relay_acl *acl = NULL;    struct dhcp_resource *res = NULL;#ifdef DHCPS_DEBUG    char output[INET_ADDR_LEN];#endif    if (msg->ciaddr.s_addr != 0) {        if ((option = pickup_opt (msg, length, _DHCP_SUBNET_MASK_TAG))            != NULL) {            subn->s_addr = msg->ciaddr.s_addr & htonl (GETHL (OPTBODY (option)));            return (0);        } else {            res = (struct dhcp_resource *)                hash_find (&iphashtable, (char *) &msg->ciaddr.s_addr,                           sizeof (u_long), resipcmp, &msg->ciaddr);#ifdef DHCPS_DEBUG            if (res == NULL)                logMsg ("get_subnet can't find IP address in hash table.\n", 0, 0, 0, 0, 0, 0);#endif            if (res != NULL) {                subn->s_addr = msg->ciaddr.s_addr & res->subnet_mask.s_addr;                return (0);            }        }    }    if (msg->giaddr.s_addr != 0) {        if ((option = pickup_opt (msg, length, _DHCP_SUBNET_MASK_TAG))            != NULL) {            subn->s_addr = msg->giaddr.s_addr & htonl (GETHL (OPTBODY (option)));            return (0);        } else if ((acl = (struct relay_acl *)                    hash_find (&relayhashtable, (char *) &msg->giaddr,                               sizeof (struct in_addr), relayipcmp, &msg->giaddr)) == NULL) {#ifdef DHCPS_DEBUG            inet_ntoa_b (msg->giaddr, output);            logMsg ("DHCP message sent from invalid relay agent(%s).\n", output, 0, 0, 0, 0, 0);#endif            return (-1);        } else {            subn->s_addr = (acl->relay.s_addr & acl->subnet_mask.s_addr);            return (0);        }    }    /* Client doesn't have IP address - form from received interface. */    subn->s_addr = ifp->ipaddr.s_addr & ifp->subnetmask.s_addr;    return (0);}/********************************************************************************* get_snmk - Retrieve subnet mask** This routine determines the subnet mask for the requesting client and* stores it in the given structure. This value is determined from the * value specified for the relay agent, if the message was forwarded, or* the subnet mask of the receiving interface. ** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/static int get_snmk (struct dhcp *msg,  /* pointer to incoming message */                     int length,    /* length of incoming message */                     struct in_addr *subn,  /* pointer to storage for parsed data */                     struct if_info *ifp    /* pointer to interface descriptor */    ){    struct relay_acl *acl = NULL;#ifdef DHCPS_DEBUG    char output[INET_ADDR_LEN];#endif    if (msg->giaddr.s_addr != 0) {        acl = (struct relay_acl *) hash_find (&relayhashtable,                                              (char *) &msg->giaddr,                                              sizeof (struct in_addr), relayipcmp, &msg->giaddr);        if (acl == NULL) {#ifdef DHCPS_DEBUG            inet_ntoa_b (msg->giaddr, output);            logMsg ("packet received from invalid relay agent(%s).\n", output, 0, 0, 0, 0, 0);#endif            return (-1);        } else {            subn->s_addr = acl->subnet_mask.s_addr;            return (0);        }    }    subn->s_addr = ifp->subnetmask.s_addr;    return (0);}/********************************************************************************* available_res - Check resource availability** This routine determines if the resource selected by the server may* be offered to the client. The resource is available if it has not been* assigned or offered to any client (res->binding == NULL), or the lease has * expired (expire_epoch < curr_epoch), or an outstanding offer was not * acknowledged within the time allotted (temp_epoch < curr_epoch). The* resource is also available if it was  manually assigned to the given * client (binding->cid matches given client ID).** RETURNS: TRUE if resource available, or FALSE otherwise. ** ERRNO: N/A** NOMANUAL*/static int available_res (struct dhcp_resource *res,    /* pointer to lease descriptor */                          struct client_id *cid,    /* pointer to client ID */                          time_t curr_epoch /* current time, in seconds */    ){    return (res->binding == NULL ||            (res->binding->expire_epoch != 0xffffffff &&             res->binding->expire_epoch < curr_epoch &&             res->binding->temp_epoch < curr_epoch) || cidcmp (&res->binding->cid, cid));}/********************************************************************************* cidcopy - copy client identifier** This routine copies the <type>:<value> client identifier pair from the* source structure to the destination.** RETURNS: 0, always.** ERRNO: N/A** NOMANUAL*/static int cidcopy (struct client_id *src,  /* source client identifier */                    struct client_id *dst   /* destiniation client identifier */    ){    dst->subnet.s_addr = src->subnet.s_addr;    dst->idtype = src->idtype;    dst->idlen = src->idlen;    bzero (dst->id, src->idlen);    bcopy (src->id, dst->id, src->idlen);    return (0);}/********************************************************************************* choose_lease - determine lease duration** This routine selects the lease duration for the offer to the client. If* the resource is client-specific, the lease duration is infinite. Otherwise,* the server provides the duration requested by the client, if available, or * the maximum available lease, whichever is less. If the client does not * request a lease duration, and has no active lease, the default lease value * is returned. For lease renewals or rebinding attempts, or if the lease* has expired, the default lease value is also returned.** RETURNS: Selected lease duration.** ERRNO: N/A** NOMANUAL*/static int choose_lease (int reqlease,  /* requested lease duration (sec) */                         time_t curr_epoch, /* current time, in seconds */                         struct dhcp_resource *offer_res    /* pointer to lease descriptor */    ){    u_long offer_lease = 0;    /* Manual allocation - give an infinite lease to client. */    if (ISSET (offer_res->valid, S_CLIENT_ID))        offer_lease = 0xffffffff;    /* Give requested lease, or maximum lease if request exceeds that value. */    else if (reqlease != 0) {        if (reqlease <= offer_res->max_lease)            offer_lease = reqlease;        else            offer_lease = offer_res->max_lease;    }    /* Initial request - give default lease. */    else if (offer_res->binding == NULL)        offer_lease = offer_res->default_lease;    /* Lease renewal or rebinding. */    else {        /* "Renew" infinite lease. */        if (offer_res->binding->expire_epoch == 0xffffffff)            offer_lease = 0xffffffff;        /*         * Lease expired (or being renewed) - give new lease         * of default duration.         */        else            offer_lease = offer_res->default_lease;    }    return (offer_lease);}/********************************************************************************* select_wcid - retrieve manually allocated leases** This routine retrieves the dhcp_resource structure which holds the parameters* from the address pool database specifically allocated to the client with* the given client identifier, if any. These lease types have the highest* priority when the server is selecting a lease for a client in response to* a DHCP discover message.** RETURNS: Manually allocated resource, or NULL if none or not available.** ERRNO: N/A** NOMANUAL*/static struct dhcp_resource *select_wcid (int msgtype,  /* DHCP message type */                                          struct client_id *cid,    /* pointer to client ID */                                          time_t curr_epoch /* current time, in seconds */    ){    struct dhcp_binding *binding = NULL;    binding = (struct dhcp_binding *) hash_find (&cidhashtable, cid->id,                                                 cid->idlen, bindcidcmp, cid);    if (binding != NULL) {        /*         * Is the resource used ?         */        if (available_res (binding->res, cid, curr_epoch)) {            if (icmp_check (msgtype, &binding->res->ip_addr) == GOOD) {                return (binding->res);            } else {                turnoff_bind (binding);                return (NULL);            }        }    }    return (NULL);}/********************************************************************************* select_wreqip - retrieve resource matching IP address** This routine retrieves the dhcp_resource structure which provides the IP

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色婷婷综合久久久久中文 | 蜜桃视频在线观看一区二区| 欧美性生活久久| 亚洲国产精品尤物yw在线观看| 欧美视频自拍偷拍| 麻豆精品视频在线观看免费| 26uuu久久天堂性欧美| 成人做爰69片免费看网站| 欧美国产成人精品| 色噜噜狠狠成人中文综合| 亚洲最新视频在线播放| 欧美日韩精品一区二区| 青青草国产成人99久久| 国产欧美日韩一区二区三区在线观看| 国产69精品久久久久毛片| 中文字幕在线不卡一区二区三区| 在线观看免费亚洲| 久久国产精品99久久人人澡| 国产亚洲欧美色| 色一情一伦一子一伦一区| 丝袜美腿亚洲综合| 久久久久久久久久久久久久久99 | 日本精品免费观看高清观看| 日韩高清一区在线| 久久午夜羞羞影院免费观看| 91麻豆免费观看| 美女一区二区久久| 国产精品免费丝袜| 欧美性欧美巨大黑白大战| 国产一二三精品| 亚洲午夜一二三区视频| 亚洲精品在线免费观看视频| 色吧成人激情小说| 国产中文字幕一区| 亚洲一二三区在线观看| 国产女人aaa级久久久级| 欧美男人的天堂一二区| 岛国精品在线观看| 奇米精品一区二区三区在线观看| 亚洲欧洲日韩综合一区二区| 91精品国产综合久久久蜜臀粉嫩| 成av人片一区二区| 精品亚洲aⅴ乱码一区二区三区| 亚洲天堂久久久久久久| 精品久久久久久久久久久久包黑料 | 91精品国产综合久久精品 | 91在线精品一区二区三区| 美女在线视频一区| 亚洲mv在线观看| 国产精品嫩草99a| 久久久久久黄色| 欧美一区二区在线看| 色综合久久99| 成人理论电影网| 国内精品久久久久影院一蜜桃| 亚洲午夜一二三区视频| 亚洲视频图片小说| 中文字幕电影一区| 久久综合久久综合久久| 欧美精品vⅰdeose4hd| 色综合婷婷久久| av在线播放成人| 国产suv精品一区二区三区| 日本中文字幕一区| 午夜视频在线观看一区| 亚洲最大的成人av| 亚洲欧美日韩人成在线播放| 国产精品久久一卡二卡| 久久精品一区八戒影视| 欧美mv日韩mv国产网站app| 91精品国产免费| 欧美电影影音先锋| 欧美日韩一区二区在线视频| 在线看国产日韩| 91麻豆福利精品推荐| 色综合天天综合| 91小宝寻花一区二区三区| 97se亚洲国产综合自在线 | 国产一区二区三区在线看麻豆| 日本大胆欧美人术艺术动态| 亚洲成人tv网| 日韩高清在线一区| 免费一级欧美片在线观看| 秋霞成人午夜伦在线观看| 日韩福利视频导航| 蜜桃久久av一区| 国产毛片精品国产一区二区三区| 国产一区二区精品在线观看| 国产乱码精品一区二区三| 国产精品白丝jk白祙喷水网站| 国产一区二区精品久久91| 国产sm精品调教视频网站| 91亚洲精品久久久蜜桃| 在线日韩一区二区| 欧美精品自拍偷拍动漫精品| 日韩一卡二卡三卡| 久久久久久免费毛片精品| 欧美国产精品中文字幕| 亚洲精品国产成人久久av盗摄| 亚洲精品福利视频网站| 午夜亚洲福利老司机| 捆绑紧缚一区二区三区视频| 国产激情偷乱视频一区二区三区| 成人h动漫精品| 欧美午夜一区二区三区| 欧美一级在线观看| 国产三区在线成人av| 一区二区三区日韩在线观看| 日本美女视频一区二区| 国产成人亚洲综合a∨婷婷图片| 91天堂素人约啪| 欧美一区二区三区在线观看视频| 国产婷婷色一区二区三区四区| 中文字幕亚洲一区二区va在线| 亚洲mv在线观看| 国产成a人无v码亚洲福利| 欧美三级在线视频| www国产成人| 亚洲国产成人av网| 国产一区二区主播在线| 91捆绑美女网站| 精品精品国产高清a毛片牛牛| 国产精品久久久久久久久晋中| 性做久久久久久免费观看| 久久精品国产99国产精品| 91在线观看视频| 精品国产精品网麻豆系列 | 亚洲一区二区三区爽爽爽爽爽| 激情都市一区二区| 欧洲在线/亚洲| 日本一区二区三区在线观看| 亚洲成人av福利| 白白色 亚洲乱淫| 欧美一区二区不卡视频| 一区二区三区视频在线观看| 国产精品1区二区.| 在线播放91灌醉迷j高跟美女 | 美女一区二区久久| 在线观看视频欧美| 欧美国产日本视频| 加勒比av一区二区| 欧美美女喷水视频| 怡红院av一区二区三区| 国产精品99久久久久久久女警 | 国产精品久久久久影院| 麻豆精品在线看| 欧美色综合影院| 成人免费在线观看入口| 国内成人精品2018免费看| 3751色影院一区二区三区| 亚洲青青青在线视频| 成人精品国产免费网站| 欧美精品一区二区三区久久久| 日韩电影在线免费观看| 色欧美乱欧美15图片| 国产精品视频第一区| 国产美女在线观看一区| 欧美xxxxx裸体时装秀| 日韩黄色免费电影| 欧美日韩成人在线一区| 亚洲gay无套男同| 色欧美片视频在线观看| 国产精品国产成人国产三级 | 国产视频视频一区| 国产一区91精品张津瑜| 久久综合五月天婷婷伊人| 麻豆精品蜜桃视频网站| 日韩欧美aaaaaa| 理论电影国产精品| 日韩一区二区在线观看视频| 日本视频一区二区三区| 欧美一级精品在线| 另类人妖一区二区av| 久久免费电影网| 成熟亚洲日本毛茸茸凸凹| 中文字幕中文字幕一区二区| 成人aa视频在线观看| 亚洲日本va午夜在线电影| 色综合久久六月婷婷中文字幕| 亚洲精选免费视频| 欧美色综合网站| 视频一区二区三区在线| 日韩欧美一级二级三级| 国产乱码精品一区二区三| 国产精品久久久久一区| 色就色 综合激情| 午夜视频久久久久久| 欧美一区二区免费| 国产一区二区在线看| 国产精品电影一区二区三区| 色婷婷国产精品综合在线观看| 亚洲超丰满肉感bbw| 日韩视频在线永久播放| 国产成人啪免费观看软件| 亚洲欧美激情视频在线观看一区二区三区| 日本高清不卡aⅴ免费网站| 同产精品九九九| 久久久久国产免费免费| 色婷婷av一区| 韩国毛片一区二区三区|