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

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

?? mdb.c

?? open source dhcp server client etc...
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* mdb.c   Server-specific in-memory database support. *//* * Copyright (c) 1996-2001 Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. Neither the name of The Internet Software Consortium 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 INTERNET SOFTWARE CONSORTIUM AND * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED.  IN NO EVENT SHALL THE INTERNET SOFTWARE CONSORTIUM OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * This software has been written for the Internet Software Consortium * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc. * To learn more about the Internet Software Consortium, see * ``http://www.isc.org/''.  To learn more about Vixie Enterprises, * see ``http://www.vix.com''.   To learn more about Nominum, Inc., see * ``http://www.nominum.com''. */#ifndef lintstatic char copyright[] ="$Id: mdb.c,v 1.67.2.9 2001/08/23 16:30:58 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium.  All rights reserved.\n";#endif /* not lint */#include "dhcpd.h"struct subnet *subnets;struct shared_network *shared_networks;struct hash_table *host_hw_addr_hash;struct hash_table *host_uid_hash;struct hash_table *lease_uid_hash;struct hash_table *lease_ip_addr_hash;struct hash_table *lease_hw_addr_hash;struct hash_table *host_name_hash;omapi_object_type_t *dhcp_type_host;static int find_uid_statement (struct executable_statement *esp,			       void *vp, int condp){	struct executable_statement **evp = vp;	if (esp -> op == supersede_option_statement &&	    esp -> data.option &&	    (esp -> data.option -> option -> universe ==	     &dhcp_universe) &&	    (esp -> data.option -> option -> code ==	     DHO_DHCP_CLIENT_IDENTIFIER)) {		if (condp) {			log_error ("dhcp client identifier may not be %s",				   "specified conditionally.");		} else if (!(*evp)) {			executable_statement_reference (evp, esp, MDL);			return 1;		} else {			log_error ("only one dhcp client identifier may be %s",				   "specified");		}	}	return 0;}isc_result_t enter_host (hd, dynamicp, commit)	struct host_decl *hd;	int dynamicp;	int commit;{	struct host_decl *hp = (struct host_decl *)0;	struct host_decl *np = (struct host_decl *)0;	struct executable_statement *esp;	if (!host_name_hash) {		host_name_hash =			new_hash ((hash_reference)host_reference,				  (hash_dereference)host_dereference, 0, MDL);		if (!host_name_hash)			log_fatal ("Can't allocate host name hash");		host_hash_add (host_name_hash,			       (unsigned char *)hd -> name,			       strlen (hd -> name), hd, MDL);	} else {		host_hash_lookup (&hp, host_name_hash,				  (unsigned char *)hd -> name,				  strlen (hd -> name), MDL);		/* If it's deleted, we can supersede it. */		if (hp && (hp -> flags & HOST_DECL_DELETED)) {			host_hash_delete (host_name_hash,					  (unsigned char *)hd -> name,					  strlen (hd -> name), MDL);			/* If the old entry wasn't dynamic, then we			   always have to keep the deletion. */			if (!hp -> flags & HOST_DECL_DYNAMIC)				hd -> flags |= HOST_DECL_STATIC;		}		/* If we are updating an existing host declaration, we		   can just delete it and add it again. */		if (hp && hp == hd) {			host_dereference (&hp, MDL);			delete_host (hd, 0);			if (!write_host (hd))				return ISC_R_IOERROR;			hd -> flags &= ~HOST_DECL_DELETED;		}		/* If there isn't already a host decl matching this		   address, add it to the hash table. */		if (!hp) {			host_hash_add (host_name_hash,				       (unsigned char *)hd -> name,				       strlen (hd -> name), hd, MDL);		} else {			/* XXX actually, we have to delete the old one			   XXX carefully and replace it.   Not done yet. */			host_dereference (&hp, MDL);			return ISC_R_EXISTS;		}	}	if (hd -> n_ipaddr)		host_dereference (&hd -> n_ipaddr, MDL);	if (!hd -> type)		hd -> type = dhcp_type_host;	if (hd -> interface.hlen) {		if (!host_hw_addr_hash) {			host_hw_addr_hash =				new_hash ((hash_reference)host_reference,					  (hash_dereference)host_dereference,					  0, MDL);			if (!host_hw_addr_hash)				log_fatal ("Can't allocate host/hw hash");		} else {			/* If there isn't already a host decl matching this			   address, add it to the hash table. */			host_hash_lookup (&hp, host_hw_addr_hash,					  hd -> interface.hbuf,					  hd -> interface.hlen, MDL);		}		if (!hp)			host_hash_add (host_hw_addr_hash, hd -> interface.hbuf,				       hd -> interface.hlen, hd, MDL);		else {			/* If there was already a host declaration for			   this hardware address, add this one to the			   end of the list. */			for (np = hp; np -> n_ipaddr; np = np -> n_ipaddr)				;			host_reference (&np -> n_ipaddr, hd, MDL);			host_dereference (&hp, MDL);		}	}	/* See if there's a statement that sets the client identifier.	   This is a kludge - the client identifier really shouldn't be	   set with an executable statement. */	esp = (struct executable_statement *)0;	if (executable_statement_foreach (hd -> group -> statements,					  find_uid_statement, &esp, 0)) {		evaluate_option_cache (&hd -> client_identifier,				       (struct packet *)0,				       (struct lease *)0,				       (struct client_state *)0,				       (struct option_state *)0,				       (struct option_state *)0, &global_scope,				       esp -> data.option, MDL);	}	/* If we got a client identifier, hash this entry by	   client identifier. */	if (hd -> client_identifier.len) {		/* If there's no uid hash, make one; otherwise, see if		   there's already an entry in the hash for this host. */		if (!host_uid_hash) {			host_uid_hash =				new_hash ((hash_reference)host_reference,					  (hash_dereference)host_dereference,					  0, MDL);			if (!host_uid_hash)				log_fatal ("Can't allocate host/uid hash");			host_hash_add (host_uid_hash,				       hd -> client_identifier.data,				       hd -> client_identifier.len,				       hd, MDL);		} else {			/* If there's already a host declaration for this			   client identifier, add this one to the end of the			   list.  Otherwise, add it to the hash table. */			if (host_hash_lookup (&hp, host_uid_hash,					      hd -> client_identifier.data,					      hd -> client_identifier.len,					      MDL)) {				/* Don't link it in twice... */				if (!np) {					for (np = hp; np -> n_ipaddr;					     np = np -> n_ipaddr) {						if (hd == np)						    break;					}					if (hd != np)					    host_reference (&np -> n_ipaddr,							    hd, MDL);				}				host_dereference (&hp, MDL);			} else {				host_hash_add (host_uid_hash,					       hd -> client_identifier.data,					       hd -> client_identifier.len,					       hd, MDL);			}		}	}	if (dynamicp && commit) {		if (!write_host (hd))			return ISC_R_IOERROR;		if (!commit_leases ())			return ISC_R_IOERROR;	}	return ISC_R_SUCCESS;}isc_result_t delete_host (hd, commit)	struct host_decl *hd;	int commit;{	struct host_decl *hp = (struct host_decl *)0;	struct host_decl *np = (struct host_decl *)0;	struct host_decl *foo;	struct executable_statement *esp;	int hw_head = 0, uid_head = 1;	/* Don't need to do it twice. */	if (hd -> flags & HOST_DECL_DELETED)		return ISC_R_SUCCESS;	/* But we do need to do it once!   :') */	hd -> flags |= HOST_DECL_DELETED;	if (hd -> interface.hlen) {	    if (host_hw_addr_hash) {		if (host_hash_lookup (&hp, host_hw_addr_hash,				      hd -> interface.hbuf,				      hd -> interface.hlen, MDL)) {		    if (hp == hd) {			host_hash_delete (host_hw_addr_hash,					  hd -> interface.hbuf,					  hd -> interface.hlen, MDL);			hw_head = 1;		    } else {			np = (struct host_decl *)0;			foo = (struct host_decl *)0;			host_reference (&foo, hp, MDL);			while (foo) {			    if (foo == hd)				    break;			    host_reference (&np, foo, MDL);			    host_dereference (&foo, MDL);			    if (np -> n_ipaddr)				    host_reference (&foo, np -> n_ipaddr, MDL);			}			if (foo) {			    host_dereference (&np -> n_ipaddr, MDL);			    if (hd -> n_ipaddr)				host_reference (&np -> n_ipaddr,						hd -> n_ipaddr, MDL);			    host_dereference (&foo, MDL);			}			if (np)				host_dereference (&np, MDL);		    }		    host_dereference (&hp, MDL);		}	    }	}	/* If we got a client identifier, hash this entry by	   client identifier. */	if (hd -> client_identifier.len) {	    if (host_uid_hash) {		if (host_hash_lookup (&hp, host_uid_hash,				      hd -> client_identifier.data,				      hd -> client_identifier.len, MDL)) {		    if (hp == hd) {			host_hash_delete (host_uid_hash,					  hd -> client_identifier.data,					  hd -> client_identifier.len, MDL);			uid_head = 1;		    } else {			np = (struct host_decl *)0;			foo = (struct host_decl *)0;			host_reference (&foo, hp, MDL);			while (foo) {			    if (foo == hd)				    break;			    host_reference (&np, foo, MDL);			    host_dereference (&foo, MDL);			    if (np -> n_ipaddr)				    host_reference (&foo, np -> n_ipaddr, MDL);			}			if (foo) {			    host_dereference (&np -> n_ipaddr, MDL);			    if (hd -> n_ipaddr)				host_reference (&np -> n_ipaddr,						hd -> n_ipaddr, MDL);			    host_dereference (&foo, MDL);			}			if (np)				host_dereference (&np, MDL);		    }		    host_dereference (&hp, MDL);		}	    }	}	if (hd -> n_ipaddr) {		if (uid_head && hd -> n_ipaddr -> client_identifier.len) {			host_hash_add				(host_uid_hash,				 hd -> n_ipaddr -> client_identifier.data,				 hd -> n_ipaddr -> client_identifier.len,				 hd -> n_ipaddr, MDL);		}		if (hw_head && hd -> n_ipaddr -> interface.hlen) {			host_hash_add (host_hw_addr_hash,				       hd -> n_ipaddr -> interface.hbuf,				       hd -> n_ipaddr -> interface.hlen,				       hd -> n_ipaddr, MDL);		}		host_dereference (&hd -> n_ipaddr, MDL);	}	if (host_name_hash) {		if (host_hash_lookup (&hp, host_name_hash,				      (unsigned char *)hd -> name,				      strlen (hd -> name), MDL)) {			if (hp == hd && !(hp -> flags & HOST_DECL_STATIC)) {				host_hash_delete (host_name_hash,						  (unsigned char *)hd -> name,						  strlen (hd -> name), MDL);			}			host_dereference (&hp, MDL);		}	}	if (commit) {		if (!write_host (hd))			return ISC_R_IOERROR;		if (!commit_leases ())			return ISC_R_IOERROR;	}	return ISC_R_SUCCESS;}int find_hosts_by_haddr (struct host_decl **hp, int htype,			 const unsigned char *haddr, unsigned hlen,			 const char *file, int line){	struct host_decl *foo;	struct hardware h;	h.hlen = hlen + 1;	h.hbuf [0] = htype;	memcpy (&h.hbuf [1], haddr, hlen);	return host_hash_lookup (hp, host_hw_addr_hash,				 h.hbuf, h.hlen, file, line);}int find_hosts_by_uid (struct host_decl **hp,		       const unsigned char *data, unsigned len,		       const char *file, int line){	return host_hash_lookup (hp, host_uid_hash, data, len, file, line);}/* More than one host_decl can be returned by find_hosts_by_haddr or   find_hosts_by_uid, and each host_decl can have multiple addresses.   Loop through the list of hosts, and then for each host, through the   list of addresses, looking for an address that's in the same shared   network as the one specified.    Store the matching address through   the addr pointer, update the host pointer to point at the host_decl   that matched, and return the subnet that matched. */int find_host_for_network (struct subnet **sp, struct host_decl **host,			   struct iaddr *addr, struct shared_network *share){	int i;	struct subnet *subnet;	struct iaddr ip_address;	struct host_decl *hp;	struct data_string fixed_addr;	memset (&fixed_addr, 0, sizeof fixed_addr);	for (hp = *host; hp; hp = hp -> n_ipaddr) {		if (!hp -> fixed_addr)			continue;		if (!evaluate_option_cache (&fixed_addr, (struct packet *)0,					    (struct lease *)0,					    (struct client_state *)0,					    (struct option_state *)0,					    (struct option_state *)0,					    &global_scope,					    hp -> fixed_addr, MDL))			continue;		for (i = 0; i < fixed_addr.len; i += 4) {			ip_address.len = 4;			memcpy (ip_address.iabuf,				fixed_addr.data + i, 4);			if (find_grouped_subnet (sp, share, ip_address, MDL)) {				struct host_decl *tmp = (struct host_decl *)0;				*addr = ip_address;				/* This is probably not necessary, but				   just in case *host is the only reference				   to that host declaration, make a temporary				   reference so that dereferencing it doesn't				   dereference hp out from under us. */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人免费视频网站| 国产精品一区2区| 久久综合精品国产一区二区三区| 成人国产电影网| 青青青爽久久午夜综合久久午夜| 国产色产综合产在线视频| 欧美性大战久久久久久久| 国产91高潮流白浆在线麻豆| 婷婷久久综合九色综合绿巨人| 久久精品亚洲麻豆av一区二区 | 国产精品色一区二区三区| 欧美精品在线视频| 色综合久久中文字幕| 国产91在线|亚洲| 不卡一区在线观看| 麻豆精品蜜桃视频网站| 亚洲一本大道在线| 中文字幕亚洲在| 久久噜噜亚洲综合| 欧美v亚洲v综合ⅴ国产v| 欧美日韩你懂的| 色成人在线视频| 色噜噜狠狠成人网p站| 成人美女视频在线看| 精品在线一区二区三区| 美女一区二区在线观看| 亚洲1区2区3区视频| 亚洲自拍偷拍麻豆| 亚洲人成精品久久久久| 中文字幕一区二区三| 日本一区二区视频在线观看| 久久蜜桃一区二区| 国产欧美日韩麻豆91| 久久久久国产精品麻豆ai换脸| 亚洲精品一区二区三区在线观看| 91麻豆精品国产91| 日韩午夜在线播放| 日韩一区二区视频在线观看| 日韩一区二区三区三四区视频在线观看 | 久久久久久久精| 26uuu亚洲综合色| 久久久国产精华| 亚洲国产精品成人综合| 国产精品成人免费精品自在线观看| 中文字幕久久午夜不卡| 中文字幕不卡的av| 亚洲色图在线播放| 一区二区久久久久久| 亚洲日本va午夜在线电影| 有码一区二区三区| 日精品一区二区三区| 日本不卡高清视频| 国内成人自拍视频| 成人综合在线观看| 一本色道**综合亚洲精品蜜桃冫| 色哟哟一区二区| 欧美一区二区三区在线视频| 日韩一二三四区| 久久久综合网站| 国产精品日日摸夜夜摸av| 亚洲人成网站在线| 婷婷开心激情综合| 国产一区二区精品久久| a4yy欧美一区二区三区| 色婷婷综合在线| 欧美一区二区免费视频| 久久久天堂av| 亚洲欧美成人一区二区三区| 五月天中文字幕一区二区| 九九国产精品视频| www.亚洲色图| 欧美精品一二三四| 国产午夜亚洲精品理论片色戒| 亚洲狠狠丁香婷婷综合久久久| 日韩影院精彩在线| 成人免费av在线| 欧美日韩国产一区二区三区地区| 精品理论电影在线观看 | 欧美激情在线免费观看| 一区二区三区免费网站| 美国欧美日韩国产在线播放| 成人h版在线观看| 欧美一级欧美一级在线播放| 国产精品污网站| 丝袜亚洲另类欧美综合| 成人免费的视频| 制服丝袜日韩国产| 专区另类欧美日韩| 美女国产一区二区| 色丁香久综合在线久综合在线观看| 欧美一区二区三区白人| 亚洲私人黄色宅男| 韩国v欧美v亚洲v日本v| 欧美性大战xxxxx久久久| 国产欧美一区二区精品久导航| 亚洲成av人片在www色猫咪| 大胆亚洲人体视频| 日韩三级视频中文字幕| 一区二区三区在线观看国产| 国产精品1024| 日韩视频一区二区在线观看| 亚洲精品自拍动漫在线| 国产老肥熟一区二区三区| 欧美日本乱大交xxxxx| 中文字幕亚洲视频| 国产福利一区在线| 日韩欧美国产小视频| 亚洲国产一区二区三区| 国产成a人无v码亚洲福利| 精品久久国产老人久久综合| 亚洲妇熟xx妇色黄| 99精品视频一区| 中文字幕乱码一区二区免费| 久久精品久久精品| 日韩一区二区三区免费看| 一区二区三区丝袜| 91香蕉视频在线| 国产精品成人网| a亚洲天堂av| 中文字幕制服丝袜一区二区三区| 国产精品一区二区在线看| 日韩欧美激情在线| 久久激情综合网| 日韩美女一区二区三区四区| 日韩1区2区日韩1区2区| 欧美日韩亚洲另类| 一区二区三区美女视频| 在线中文字幕一区二区| 尤物视频一区二区| 欧洲一区二区三区在线| 亚洲精品成a人| 色屁屁一区二区| 一级特黄大欧美久久久| 欧美图区在线视频| 丝袜诱惑制服诱惑色一区在线观看| 欧美三级在线视频| 日韩电影免费在线看| 日韩午夜激情电影| 久久99精品一区二区三区 | 日韩欧美你懂的| 久久99久久久久久久久久久| 日韩免费观看高清完整版在线观看| 免费成人在线视频观看| 精品国内二区三区| 国产成人免费在线| 中文字幕一区二区在线观看 | 欧美日韩国产一级二级| 婷婷六月综合亚洲| 欧美va亚洲va国产综合| 国产在线精品免费| 亚洲欧洲一区二区三区| 91成人免费网站| 日本成人超碰在线观看| 精品成人a区在线观看| 国产精品伊人色| 亚洲男人天堂av| 欧美一区二区播放| 国产精品69毛片高清亚洲| 综合久久综合久久| 欧美日韩亚洲不卡| 久久99精品国产.久久久久久| 欧美国产成人在线| 欧美丝袜丝交足nylons图片| 日韩精品一级中文字幕精品视频免费观看 | 亚洲一区中文日韩| 91精品国产欧美一区二区| 国产一本一道久久香蕉| 国产精品系列在线| 欧美日韩在线三级| 韩国成人在线视频| 日韩一区欧美小说| 6080日韩午夜伦伦午夜伦| 国产精品一二三区| 一区二区三区毛片| 久久综合99re88久久爱| av成人老司机| 奇米色一区二区| 国产精品美女www爽爽爽| 欧美精品久久久久久久多人混战| 国产在线视频一区二区| 亚洲最大色网站| 久久新电视剧免费观看| 91极品美女在线| 国产精品综合av一区二区国产馆| 亚洲综合激情另类小说区| 精品日本一线二线三线不卡| 91碰在线视频| 国产综合久久久久影院| 一区二区三区 在线观看视频| 26uuu久久综合| 欧美日韩一区二区三区视频| 国产精品白丝jk黑袜喷水| 爽好久久久欧美精品| 国产精品久久久久久久久久久免费看| 91精品国产高清一区二区三区蜜臀 | 欧美伦理影视网| 成人av资源站| 久草热8精品视频在线观看| 亚洲欧洲制服丝袜| 国产精品三级在线观看|