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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
26uuu亚洲综合色欧美 | 亚洲国产精品精华液ab| 在线免费观看日本一区| 91网站视频在线观看| 成人激情免费网站| 97久久精品人人做人人爽50路| 国产精品一区二区你懂的| 国产一区二区伦理| 国产精品1区二区.| 成人免费视频免费观看| 99久久99久久精品免费看蜜桃| 99久久精品国产一区| 色成年激情久久综合| 欧美军同video69gay| 欧美一区二区美女| 久久亚洲私人国产精品va媚药| 国产日韩欧美一区二区三区综合| 国产女人18毛片水真多成人如厕 | 国产精品网曝门| 亚洲欧洲另类国产综合| 亚洲一区二区中文在线| 亚洲不卡一区二区三区| 国内成人自拍视频| fc2成人免费人成在线观看播放| 色婷婷精品久久二区二区蜜臀av | 欧美一区二区视频免费观看| 精品少妇一区二区三区免费观看| 国产欧美日韩中文久久| 亚洲国产视频a| 国产在线播放一区二区三区| 91丝袜美女网| 欧美一区二区三区视频在线| 久久久久久久综合日本| 亚洲制服丝袜一区| 国产美女精品在线| 亚洲欧美另类久久久精品| 日韩电影在线看| 91农村精品一区二区在线| 欧美日韩免费高清一区色橹橹 | 国产精品日产欧美久久久久| 亚洲综合久久久| 成人深夜在线观看| 日韩精品在线看片z| 欧美一区二区在线播放| 亚洲女人的天堂| 国产精品一二三四五| 欧美日本一区二区三区四区| 国产片一区二区| 久久99久久精品| 4438成人网| 一区二区三区美女| 成人美女视频在线观看18| 日韩一级片在线观看| 亚洲国产另类精品专区| 成人精品gif动图一区| 日韩一级欧美一级| 亚洲妇熟xx妇色黄| 99国产精品久久久久久久久久| 欧美精品一区二区三区久久久| 五月婷婷久久丁香| 欧美日韩视频专区在线播放| 中文字幕不卡在线| 国产一区美女在线| 精品理论电影在线观看| 六月丁香婷婷久久| 日韩欧美激情四射| 强制捆绑调教一区二区| 91精品国产91久久久久久一区二区| 一区二区三区四区五区视频在线观看 | 91视频在线看| 国产精品电影一区二区三区| 国产成人av福利| 日本一区二区三区高清不卡| 激情偷乱视频一区二区三区| 精品噜噜噜噜久久久久久久久试看 | 日韩av不卡一区二区| 欧美日韩国产成人在线免费| 夜夜嗨av一区二区三区中文字幕 | 欧美一区二区黄色| 免费日韩伦理电影| 欧美精品一区二区三区一线天视频| 蜜桃91丨九色丨蝌蚪91桃色| 日韩欧美的一区| 国产成人在线视频播放| 国产精品乱子久久久久| 日本道精品一区二区三区| 一区二区三区四区在线免费观看 | 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 亚洲欧美视频在线观看| 欧美怡红院视频| 青青草国产成人av片免费| 日韩欧美国产一区二区在线播放| 麻豆国产一区二区| 国产欧美精品一区aⅴ影院 | 日韩美女主播在线视频一区二区三区| 美女尤物国产一区| 国产精品久久久久影院| 色天使色偷偷av一区二区| 亚洲va韩国va欧美va精品| 日韩精品一区二区三区蜜臀| 国产成人综合在线| 亚洲午夜在线电影| 2023国产一二三区日本精品2022| 成人激情电影免费在线观看| 午夜影院久久久| 日本一区二区成人| 欧美日韩精品欧美日韩精品一综合| 国产综合一区二区| 一区二区成人在线观看| 91久久人澡人人添人人爽欧美| 日韩在线一区二区三区| 久久九九影视网| 欧美日韩三级在线| 99国内精品久久| 极品美女销魂一区二区三区| 亚洲激情成人在线| 国产亚洲美州欧州综合国| 欧美影院精品一区| 成人成人成人在线视频| 另类中文字幕网| 一级中文字幕一区二区| 欧美高清在线精品一区| 91精品国产综合久久福利| 国产成人精品亚洲日本在线桃色| 亚洲国产激情av| 精品国产一二三区| 欧美精品九九99久久| 色婷婷精品大视频在线蜜桃视频 | 综合久久国产九一剧情麻豆| 欧美xxxx老人做受| 欧美日韩视频在线观看一区二区三区| 北条麻妃一区二区三区| 国内精品不卡在线| 久久精品国产久精国产| 天天爽夜夜爽夜夜爽精品视频| 国产精品美女一区二区三区| 久久无码av三级| 欧美电视剧免费全集观看| 欧美精品丝袜久久久中文字幕| 99久久婷婷国产综合精品电影| 亚洲线精品一区二区三区八戒| 国产欧美视频在线观看| 久久精品一区蜜桃臀影院| 精品免费视频.| 日韩丝袜情趣美女图片| 91精品国产综合久久精品| 欧美亚洲尤物久久| 欧美日韩另类一区| 欧美日韩大陆一区二区| 一本色道久久综合亚洲精品按摩| 国产成人精品免费在线| 日本欧美大码aⅴ在线播放| 亚洲男人电影天堂| 亚洲福利一区二区三区| 天天色综合天天| 午夜久久久久久| 日韩国产欧美在线观看| 亚洲视频中文字幕| 国产精品成人一区二区三区夜夜夜| 国产亚洲欧美一区在线观看| 国产精品天天摸av网| 亚洲色图一区二区三区| 一区二区三区在线播放| 日本在线观看不卡视频| 九一九一国产精品| 成人午夜精品一区二区三区| 国产伦精一区二区三区| a亚洲天堂av| 欧美三级资源在线| 日韩午夜激情免费电影| 国产精品―色哟哟| 亚洲一区二区三区自拍| 免费观看在线综合| 成人一二三区视频| 欧美视频一区二区| 2019国产精品| 亚洲久草在线视频| 卡一卡二国产精品| 99久久精品国产毛片| 日韩一级大片在线| 国产精品国产三级国产aⅴ入口| 一区二区三区四区乱视频| 日本不卡视频在线| 波多野结衣精品在线| 欧美伦理视频网站| 中文字幕国产一区| 亚洲va欧美va人人爽午夜| 国产成人亚洲精品青草天美| 在线观看不卡一区| 精品久久久久久无| 一区二区三区不卡视频在线观看| 免费日韩伦理电影| 91网上在线视频| 国产性色一区二区| 图片区日韩欧美亚洲| 成人做爰69片免费看网站| 欧美伦理影视网| 亚洲日本在线看| 国产乱子伦一区二区三区国色天香| 99久久99久久精品国产片果冻|