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

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

?? database.c

?? vxworks的完整的源代碼
?? 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*/void dump_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);        }    *idtype = (u_char) j;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品久久99久久久久| 日本欧美大码aⅴ在线播放| 丁香另类激情小说| 中文字幕第一区综合| a级精品国产片在线观看| 亚洲男人的天堂av| 337p亚洲精品色噜噜噜| 久久99久久99小草精品免视看| 精品捆绑美女sm三区| 国产福利精品导航| 亚洲精品网站在线观看| 在线不卡一区二区| 国内精品免费**视频| 亚洲国产精品激情在线观看| 色婷婷一区二区三区四区| 婷婷久久综合九色国产成人 | av色综合久久天堂av综合| 亚洲欧美国产毛片在线| 91精品国产综合久久精品| 国产精品一区二区x88av| 最新日韩av在线| 欧美美女一区二区三区| 激情六月婷婷综合| 亚洲卡通动漫在线| 欧美一区二区在线免费观看| 粉嫩绯色av一区二区在线观看| 夜夜爽夜夜爽精品视频| 精品国产乱码久久久久久夜甘婷婷| 成人免费视频视频| 午夜视频一区二区| 国产精品美女久久久久久| 欧美高清视频一二三区| 成人久久久精品乱码一区二区三区| 亚洲一卡二卡三卡四卡| 欧美国产视频在线| 91精品国产麻豆国产自产在线 | 成人av资源下载| 日本sm残虐另类| 中文字幕一区二区三区色视频| 欧美日韩精品福利| 成人免费毛片高清视频| 麻豆精品久久久| 亚洲男人天堂av网| 久久精品一区蜜桃臀影院| 欧美精品1区2区| 97精品超碰一区二区三区| 韩日欧美一区二区三区| 三级亚洲高清视频| 亚洲视频一区二区在线| 久久久久久久久久久99999| 欧美日韩大陆在线| 色婷婷久久综合| 成人激情黄色小说| 久草这里只有精品视频| 亚洲国产精品人人做人人爽| 国产精品久久久久婷婷二区次| 制服丝袜日韩国产| 欧美性色aⅴ视频一区日韩精品| 福利电影一区二区| 激情成人午夜视频| 99久久伊人久久99| 国产美女视频91| 玖玖九九国产精品| 免费观看日韩av| 亚洲观看高清完整版在线观看| 亚洲欧美日韩在线| 亚洲国产精品ⅴa在线观看| 2023国产精品视频| 精品理论电影在线| 日韩欧美一级在线播放| 91精品国产福利| 91精品国产黑色紧身裤美女| 欧美日韩亚洲另类| 欧美日韩中字一区| 精品视频一区二区不卡| 欧美色欧美亚洲另类二区| 一本久道久久综合中文字幕| 一本大道久久a久久综合| 色av一区二区| 欧美影院一区二区三区| 欧美三级视频在线| 欧美精品丝袜久久久中文字幕| 欧美精品久久一区二区三区| 欧美一区二区三区在线看| 日韩一区二区免费电影| 欧美xxxx在线观看| 久久久久久久综合日本| 国产欧美日本一区二区三区| 一区视频在线播放| 亚洲人成7777| 亚洲电影一区二区三区| 免费人成黄页网站在线一区二区| 久久国产欧美日韩精品| 国产综合成人久久大片91| 国产不卡在线视频| 日本精品视频一区二区| 91福利在线导航| 欧美一区2区视频在线观看| 日韩欧美亚洲国产另类| 久久精品日韩一区二区三区| 国产精品久久久久影视| 亚洲第一成年网| 狠狠v欧美v日韩v亚洲ⅴ| 成人免费看片app下载| 色偷偷久久人人79超碰人人澡| 欧美日韩国产一级片| 精品国产百合女同互慰| 欧美国产禁国产网站cc| 亚洲制服欧美中文字幕中文字幕| 日本欧美久久久久免费播放网| 国产成人免费9x9x人网站视频| 一本久道中文字幕精品亚洲嫩| 欧美一级片免费看| 国产精品久久久久久福利一牛影视| 一区二区三区四区不卡视频 | 九色porny丨国产精品| 国产成人精品三级麻豆| 欧美性videosxxxxx| 久久久精品国产免大香伊| 亚洲黄色录像片| 国产一区二区三区美女| 欧美亚州韩日在线看免费版国语版| 日韩午夜激情av| 亚洲精品你懂的| 韩国视频一区二区| 欧美日韩国产高清一区二区三区| 国产亲近乱来精品视频| 日韩av高清在线观看| 99热精品一区二区| 欧美mv和日韩mv国产网站| 亚洲精品乱码久久久久久黑人| 卡一卡二国产精品| 欧美日韩国产a| 亚洲欧美另类久久久精品| 黑人精品欧美一区二区蜜桃| 欧美三级午夜理伦三级中视频| 国产精品久久毛片av大全日韩| 免费成人性网站| 欧美日韩精品三区| 一区二区三区在线视频免费| 成人一区在线观看| 久久综合色天天久久综合图片| 香蕉影视欧美成人| 91视频国产资源| 国产精品免费aⅴ片在线观看| 久久精品国产亚洲a| 欧美美女bb生活片| 一级精品视频在线观看宜春院 | 亚洲一区二区三区国产| 成人av在线一区二区| 久久久精品黄色| 精品亚洲成av人在线观看| 91精品国产综合久久精品app| 亚洲精品第1页| 91免费版pro下载短视频| 国产精品伦理在线| 福利一区二区在线观看| 久久久国产精华| 国产精品一区二区三区四区| 亚洲精品一区二区三区99| 国产真实乱子伦精品视频| 精品国产不卡一区二区三区| 久久99国产精品麻豆| 欧美xingq一区二区| 久久99久久99| www激情久久| 国产成人在线视频网站| 国产精品视频第一区| 国产91精品久久久久久久网曝门| 久久老女人爱爱| 国产精品一级片| 国产婷婷色一区二区三区四区| 国产麻豆成人精品| 国产人久久人人人人爽| av中文一区二区三区| 亚洲色图都市小说| 欧洲av在线精品| 婷婷久久综合九色综合绿巨人| 欧美一级一区二区| 国产一区二区久久| 中文一区二区完整视频在线观看| 成人h动漫精品一区二区| 中文字幕色av一区二区三区| 一本色道久久综合亚洲aⅴ蜜桃 | 92精品国产成人观看免费| 国产精品久久久久桃色tv| 91丨九色丨蝌蚪富婆spa| 亚洲欧美日韩国产中文在线| 欧洲一区在线观看| 亚洲一区二区成人在线观看| 91精品国产综合久久久蜜臀图片| 国产一区视频网站| 亚洲欧美日韩系列| 欧美三级电影在线看| 日本va欧美va精品| 国产精品污www在线观看| 在线精品视频免费观看| 免费黄网站欧美| 中文字幕在线一区二区三区| 在线观看不卡一区|