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

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

?? database.c

?? VxWorks下DHCP的源代碼!
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* database.c - DHCP server data retrieval code *//* Copyright 1984 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01o,07may02,wap  Put debug messages under DHCPS_DEBUG (SPR #76495)01n,29oct01,wap  Fix use of get_integer() with htons()/htonl() (SPR #34808)01m,12oct01,rae  merge from truestack ver 01n, base 01j                 SPRs 69547, 65163, 3357601l,24oct00,spm  fixed modification history after tor3_x merge01k,23oct00,niq  merged from version 01l of tor3_x branch (base version 01j)01j,17dec97,spm  fixed byte order of address-based loop boundaries (SPR #20056)01i,04dec97,spm  added code review modifications01h,06oct97,spm  added newlines and component labels to default output01g,26aug97,spm  modified comments for all routines01f,02jun97,spm  added test for optional storage routine and updated man pages01e,08may97,spm  corrected use of storage routines, removed memory leak, and                 documented shutdown of server 01d,30apr97,spm  added missing START call to DHCPS_LEASE_HOOK storage routine01c,18apr97,spm  added conditional include DHCPS_DEBUG for displayed output01b,08apr97,spm  corrected byte ordering when adding MTU plateau table option01a,07apr97,spm  created by modifying WIDE project DHCP implementation*//*DESCRIPTIONThis library contains the code used by the DHCP server to access permanentstorage through two optional function hooks provided by the user. The function specified by dhcpsAddressHookAdd() is used to store and retrieve address pool entries which are added by the user with dhcpsLeaseEntryAdd(). This capability allows the user to bypass the static table definition andadd entries without recompiling the runtime image. If the storage hook isnot provided, only the address pool entries contained in the static tableswill be retained across server reboots. As a result, any client using otheraddress pool entries will be unable to renew its lease.The second storage hook, specified by dhcpsLeaseHookAdd(), is much more critical. It is used to store and retrieve the subset of address pool entries which have been offered to a client, or are currently in use. If this storage hook is not provided, the server might issue network addresses which are already in use, causing unpredictable results.INCLUDE_FILES: dhcpsLib.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 <stdio.h>#include <unistd.h>#include <stdlib.h>#include <ctype.h>#include <string.h>#include <time.h>#include <sys/types.h>#include <netinet/in.h>#include <arpa/inet.h>#include <inetLib.h>#include <logLib.h>#include "dhcp/dhcp.h"#include "dhcp/common.h"#include "dhcpsLib.h"#include "dhcp/hash.h"#include "dhcp/database.h"/* global variables for both virtual stack and regular stack */IMPORT long dhcps_dflt_lease;   /* Default for default lease length. */IMPORT long dhcps_max_lease;    /* Default for maximum lease length. */IMPORT DHCPS_LEASE_DESC *pDhcpsLeasePool;#ifndef VIRTUAL_STACK/* globals */struct hash_tbl cidhashtable;struct hash_tbl iphashtable;struct hash_tbl nmhashtable;struct hash_tbl relayhashtable;struct hash_tbl paramhashtable;struct hash_member *bindlist;struct hash_member *reslist;#else#include "netinet/vsLib.h"#include "netinet/vsDhcps.h"#endif /* VIRTUAL_STACK */IMPORT void dhcpsFreeResource (struct dhcp_resource *);/********************************************************************************* dump_bind_db - write all active bindings to permanent storage** This routine takes a snapshot of the linked list which contains the* descriptors for each active or pending lease. It calls a hook routine, * supplied by the user, to record these entries in permanent storage. This * storage is required to maintain the consistency of the server data * structures and is the key to the integrity of the entire DHCP protocol. ** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/voiddump_bind_db (void){    struct hash_member *bindptr = NULL;    STATUS result;    if (dhcpsLeaseHookRtn == NULL)        return;    result = (*dhcpsLeaseHookRtn) (DHCPS_STORAGE_STOP, NULL, 0);    if (result != OK) {        logMsg ("Warning: cannot close the binding database.\n", 0, 0, 0, 0, 0, 0);        return;    }    /* Remove old values. */    result = (*dhcpsLeaseHookRtn) (DHCPS_STORAGE_CLEAR, NULL, 0);    if (result != OK) {        logMsg ("Warning: cannot clear the binding database.\n", 0, 0, 0, 0, 0, 0);        return;    }    result = (*dhcpsLeaseHookRtn) (DHCPS_STORAGE_START, NULL, 0);    if (result != OK) {        logMsg ("Warning: cannot open the binding database.\n", 0, 0, 0, 0, 0, 0);        return;    }    bindptr = bindlist;    while (bindptr != NULL) {        dump_bind_entry (bindptr->data);        bindptr = bindptr->next;    }    return;}/********************************************************************************* dump_bind_entry - write a binding record to permanent storage** This routine calls a hook routine, supplied by the user, to store the entry * for an active lease. The stored entry takes the following form:**    <client ID>:<subnet number>:<H/W address>:<expiration time>:<entry name>** where the entry name identifies the corresponding entry in the address pool.** RETURNS: N/A** ERRNO: N/A** NOMANUAL*/void dump_bind_entry (struct dhcp_binding *bp   /* binding record to add to storage */    ){    char tmp[30];               /* Maximum length of quoted date string. */    char new_entry[100];        /*                                  * Maximum length of entry -                                 * type/ID, subnet, hardware address,                                 * expiration time, and entry name.                                  */    /*      * Do not store incomplete or static entries. Incomplete entries result     * when the corresponding address fails an ICMP check, indicating     * it is in use by an unknown client. A static binding entry is     * created for each manual lease in the address pool. Since they     * implicitly provide an infinite lease to a specific client, storage      * of their current state is meaningless.      */    if ((bp->flag & COMPLETE_ENTRY) == 0 || (bp->flag & STATIC_ENTRY) != 0)        return;    /* Convert the data structure into a formatted string. */    sprintf (new_entry, "%s:", cidtos (&bp->cid, 1));    sprintf (tmp, "%s:", haddrtos (&bp->haddr));    strcat (new_entry, tmp);    if (bp->expire_epoch == 0xffffffff) {        if (bp->flag & BOOTP_ENTRY)            sprintf (tmp, "\"bootp\":");        else            sprintf (tmp, "\"infinity\":");    } else if (bp->expire_epoch == 0)        sprintf (tmp, "\"\":");    else {        sprintf (tmp, "\"%s", (char *) ctime (&bp->expire_epoch));        /* Replace '\n' added by ctime() with the closing quote. */        tmp[strlen (tmp) - 1] = '"';        strcat (tmp, ":");      /* Append field delimiter. */    }    strcat (new_entry, tmp);    sprintf (tmp, "%s\n", bp->res_name);    strcat (new_entry, tmp);    /* Call the user-supplied storage hook to save the entry. */    (*dhcpsLeaseHookRtn) (DHCPS_STORAGE_WRITE, new_entry, strlen (new_entry));    return;}/********************************************************************************* finish - cleanup and remove data structures before exiting** This "routine" contains the functions needed for an orderly shutdown of * the server task. The dump_bind_db() routine stores a snapshot of all active* leases and dhcpsCleanup() removes the installed packet filter device and all* dynamically allocated memory. In the original code, this routine was * triggered by SIGTERM or SIGINT. This is not a working example, since* the server task created at system startup is not removed. The code is not* included in the DHCP release.** RETURNS: N/A** ERRNO: N/A** NOMANUAL*//* void finish (void)    {    dump_bind_db ();    dhcpsCleanup (6);    /@ Instead of exit(), the entry point of the server task should return. @/    exit (0);     }  *//********************************************************************************* add_bind - record lease offers and active leases** This routine stores the pending offers and active leases in the internal* linked list. The contents of the list are periodically written to permanent* storage by the dump_bind_db() routine defined above.** RETURNS: 0 if successful, or -1 on memory allocation error.** ERRNO: N/A** NOMANUAL*/int add_bind (struct dhcp_binding *bind /* binding record to store in memory */    ){    struct hash_member *bindptr;#ifndef VIRTUAL_STACK    extern struct hash_member *bindlist;#endif    bindptr = (struct hash_member *) calloc (1, sizeof (struct hash_member));    if (bindptr == NULL) {#ifdef DHCPS_DEBUG        logMsg ("Warning: memory allocation error adding binding.\n", 0, 0, 0, 0, 0, 0);#endif        return (-1);    }    bindptr->next = bindlist;    bindptr->data = (hash_datum *) bind;    bindlist = bindptr;    nbind++;    return (0);}/********************************************************************************* read_idtype - extract identifier type from input string** This routine extracts the single byte which contains the numeric type from * a numeric pair of the form <type>:<value>. It is used when parsing entries * from the client identifier field of the address pool and binding databases, * and for reading from the hardware address field contained in the binding * database. Valid values for the ID type are listed in the "Assigned Numbers" * RFC under the ARP section. RFC 1700 defined the following types:**	 Number Hardware Type (hrd)                 * 	------ -----------------------------------*	      1 Ethernet (10Mb)*	      2 Experimental Ethernet (3Mb)*	      3 Amateur Radio AX.25*	      4 Proteon ProNET Token Ring*	      5 Chaos*	      6 IEEE 802 Networks*	      7 ARCNET*	      8 Hyperchannel*	      9 Lanstar*	     10 Autonet Short Address*	     11 LocalTalk*	     12 LocalNet (IBM PCNet or SYTEK LocalNET)*	     13 Ultra link*	     14 SMDS*	     15 Frame Relay*	     16 Asynchronous Transmission Mode (ATM)*	     17 HDLC*	     18 Fibre Channel*	     19 Asynchronous Transmission Mode (ATM)*	     20 Serial Line*	     21 Asynchronous Transmission Mode (ATM)** RETURNS: 0 if successful, or -1 on parse error.** ERRNO: N/A** NOMANUAL*/static int read_idtype (char **cp,  /* current location in input string */                        u_char * idtype /* pointer to storage for extracted value */    ){    char tmpstr[MAXSTRINGLEN];    int j;    get_string (cp, tmpstr);    if (sscanf (tmpstr, "%d", &j) != 1)    {#ifdef DHCPS_DEBUG        logMsg ("Warning: Can't extract type value.\n", 0, 0, 0, 0, 0, 0);#endif        return (-1);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色婷婷av一区二区三区大白胸| 国产真实精品久久二三区| 久久久久九九视频| 精品奇米国产一区二区三区| 91精品婷婷国产综合久久| 51精品秘密在线观看| 欧美熟乱第一页| 99国产一区二区三精品乱码| 色综合久久久久久久久| 欧美亚洲一区二区三区四区| 欧美浪妇xxxx高跟鞋交| 日韩三级中文字幕| 久久亚洲一区二区三区四区| 亚洲国产精华液网站w| 亚洲欧美一区二区不卡| 亚洲高清在线视频| 精品一区二区三区在线观看国产| 精品亚洲porn| 99久久精品国产一区| 欧美色图免费看| 日韩久久久久久| 国产精品国产三级国产普通话三级 | 精品视频一区二区不卡| 日韩欧美国产成人一区二区| 国产欧美日韩精品在线| 亚洲国产综合在线| 国内精品久久久久影院一蜜桃| 成熟亚洲日本毛茸茸凸凹| 欧美性三三影院| 久久精品视频在线免费观看 | 欧美日韩综合一区| 欧美成人精品3d动漫h| 自拍av一区二区三区| 免费观看在线综合| 91久久精品一区二区| 欧美r级在线观看| 一区二区三区产品免费精品久久75| 视频一区免费在线观看| 成人黄色av网站在线| 欧美一区二区三区在线看| 一区免费观看视频| 狠狠狠色丁香婷婷综合久久五月| 91麻豆精品秘密| 久久夜色精品一区| 青青草国产精品97视觉盛宴| 一本久道中文字幕精品亚洲嫩| 久久综合999| 视频精品一区二区| 91久久精品一区二区三区| 国产免费久久精品| 久久超碰97中文字幕| 欧美日韩在线三级| 亚洲卡通欧美制服中文| 粉嫩一区二区三区在线看| 日韩欧美一区二区免费| 亚洲影视资源网| www.久久精品| 国产精品久久久久久久久搜平片| 久久国产麻豆精品| 555www色欧美视频| 亚洲国产一区二区三区| 91视频精品在这里| 国产三级欧美三级日产三级99| 蜜桃av噜噜一区| 欧美日韩亚洲高清一区二区| 亚洲另类在线一区| 欧洲一区二区av| 一区二区三区精品| 欧美日韩一二区| 亚洲线精品一区二区三区八戒| 91视频精品在这里| 亚洲最色的网站| 国产精品1024| 亚洲日本青草视频在线怡红院 | 精品国精品国产| 久久精品国产精品亚洲红杏| 欧美一级二级三级乱码| 日韩av不卡一区二区| 日韩视频在线观看一区二区| 久久精品久久综合| 久久综合久久综合久久| 国产麻豆精品theporn| 久久精品亚洲精品国产欧美kt∨| 国产一区二区剧情av在线| 久久精品日产第一区二区三区高清版 | 香蕉久久一区二区不卡无毒影院| 91久久国产综合久久| 午夜激情综合网| 日韩精品中文字幕一区二区三区 | 在线成人高清不卡| 日本欧美一区二区| 久久久国产精品麻豆| 99精品视频在线免费观看| 一区二区高清在线| 日韩精品一区二区三区视频在线观看| 捆绑变态av一区二区三区| 国产清纯美女被跳蛋高潮一区二区久久w | 日韩一区二区三区视频| 国内精品国产成人国产三级粉色| 国产精品网曝门| 欧美日韩一区中文字幕| 国产一区激情在线| 亚洲精品一二三| 精品成人私密视频| 91在线观看成人| 日本免费在线视频不卡一不卡二| 久久久久久电影| 在线观看不卡视频| 国产黄人亚洲片| 亚洲国产精品久久不卡毛片| 久久人人97超碰com| 色婷婷av一区| 国产成人自拍网| 日本伊人精品一区二区三区观看方式| 国产午夜精品福利| 91麻豆精品国产无毒不卡在线观看| 国产成人精品aa毛片| 午夜精品久久久久影视| 中文字幕在线不卡国产视频| 欧美一区二区成人| 99热99精品| 国产剧情一区二区| 免费久久99精品国产| 亚洲一区二区三区不卡国产欧美| 国产肉丝袜一区二区| 精品日本一线二线三线不卡| 欧美日韩一区中文字幕| 99久久国产综合色|国产精品| 精品午夜一区二区三区在线观看| 亚洲电影在线免费观看| 国产精品福利一区二区三区| 久久五月婷婷丁香社区| 91精品国产欧美一区二区成人 | 91精品国产手机| 欧美日韩午夜影院| 欧美综合一区二区| 91丨porny丨国产入口| 成人午夜视频网站| 国产精一区二区三区| 国内外精品视频| 久久99在线观看| 欧美bbbbb| 美女视频一区二区三区| 日本va欧美va精品发布| 亚洲欧美aⅴ...| 亚洲女子a中天字幕| 亚洲女与黑人做爰| 亚洲最大的成人av| 亚洲一区二区av电影| 亚洲一区免费在线观看| 一区二区三区.www| 亚洲最新视频在线播放| 亚洲一区二区高清| 日本网站在线观看一区二区三区| 日韩二区三区四区| 精彩视频一区二区三区| 韩国精品主播一区二区在线观看| 激情久久五月天| 成人综合在线网站| 97久久超碰国产精品电影| 色视频成人在线观看免| 欧美三电影在线| 91精品国产高清一区二区三区| 538在线一区二区精品国产| 精品久久久久香蕉网| 国产日产亚洲精品系列| 亚洲人吸女人奶水| 亚洲一区二区三区自拍| 蜜桃av一区二区在线观看| 国产一区欧美二区| 色综合久久久久网| 日韩免费看的电影| 中文字幕不卡三区| 亚洲大型综合色站| 国产一区欧美一区| 一本大道综合伊人精品热热| 欧美一级久久久久久久大片| 久久久久久日产精品| 亚洲另类在线视频| 精品一区二区三区欧美| 色乱码一区二区三区88 | 狠狠色综合日日| 91视频精品在这里| 日韩免费电影一区| 亚洲美腿欧美偷拍| 久久精品国产成人一区二区三区| 成人高清视频在线观看| 欧美丰满嫩嫩电影| 国产精品福利一区二区三区| 欧美aaaaaa午夜精品| av亚洲精华国产精华精| 欧美一区二区三区视频在线观看 | 日本电影欧美片| 久久这里都是精品| 亚洲自拍与偷拍| 成人开心网精品视频| 欧美videossexotv100| 亚洲国产另类精品专区| 成人不卡免费av| 2020日本不卡一区二区视频|