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

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

?? mdb.c

?? DHCP服務器源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* mdb.c   Server-specific in-memory database support. *//* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1996-2003 by Internet Software Consortium * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * *   Internet Systems Consortium, Inc. *   950 Charter Street *   Redwood City, CA 94063 *   <info@isc.org> *   http://www.isc.org/ * * This software has been written for Internet Systems Consortium * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc. * To learn more about Internet Systems 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.19 2004/06/10 17:59:56 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium.  All rights reserved.\n";#endif /* not lint */#include "dhcpd.h"#include "omapip/hash.h"struct subnet *subnets;struct shared_network *shared_networks;host_hash_t *host_hw_addr_hash;host_hash_t *host_uid_hash;host_hash_t *host_name_hash;lease_hash_t *lease_uid_hash;lease_hash_t *lease_ip_addr_hash;lease_hash_t *lease_hw_addr_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) {		if (!host_new_hash (&host_name_hash, 0, MDL))			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_STATIC) {				hd -> flags |= HOST_DECL_STATIC;			}			host_dereference (&hp, MDL);		}		/* 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) {			if (!host_new_hash (&host_hw_addr_hash, 0, MDL))				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) {			if (!host_new_hash (&host_uid_hash, 0, MDL))				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;			    if (np)				    host_dereference (&np, MDL);			    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;			    if (np)				host_dereference (&np, MDL);			    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. */				host_reference (&tmp, *host, MDL);				host_dereference (host, MDL);				host_reference (host, hp, MDL);				host_dereference (&tmp, MDL);				data_string_forget (&fixed_addr, MDL);				return 1;			}		}		data_string_forget (&fixed_addr, MDL);	}	return 0;}void new_address_range (cfile, low, high, subnet, pool, lpchain)	struct parse *cfile;	struct iaddr low, high;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产91高潮流白浆在线麻豆| 亚洲精品乱码久久久久久黑人 | 成人丝袜高跟foot| 久久美女艺术照精彩视频福利播放 | 日韩中文字幕亚洲一区二区va在线| 欧美在线影院一区二区| 亚洲一区国产视频| 7777精品伊人久久久大香线蕉最新版| 日韩精品高清不卡| 26uuu久久天堂性欧美| 风间由美一区二区三区在线观看 | 奇米影视在线99精品| 欧美电影免费提供在线观看| 国产精品一区免费在线观看| 国产精品久久影院| 欧美亚洲动漫精品| 久久99久国产精品黄毛片色诱| 国产欧美日韩综合精品一区二区| 成年人国产精品| 亚洲成人先锋电影| 久久女同互慰一区二区三区| 97se亚洲国产综合自在线不卡 | 久久在线免费观看| av在线不卡免费看| 视频在线在亚洲| 久久亚洲春色中文字幕久久久| 成人精品小蝌蚪| 亚洲成在线观看| 久久精品夜色噜噜亚洲aⅴ| 一本色道亚洲精品aⅴ| 麻豆成人综合网| 亚洲免费资源在线播放| 日韩视频永久免费| 91在线小视频| 久久99精品一区二区三区三区| 成人免费一区二区三区视频| 欧美一区二区三区视频在线| 成人高清伦理免费影院在线观看| 亚洲福利国产精品| 中文字幕精品在线不卡| 欧美一级欧美三级在线观看| 色综合天天综合在线视频| 久久99精品久久久久久国产越南| 亚洲免费在线观看| 久久久国产精华| 欧美一区日本一区韩国一区| 99re热这里只有精品免费视频 | 亚洲女人的天堂| 国产亚洲制服色| 91麻豆精品国产无毒不卡在线观看| 成人v精品蜜桃久久一区| 久久国内精品自在自线400部| 亚洲欧美激情插| 国产视频一区二区在线| 欧美一区二区黄色| 欧美三级电影一区| 色综合一个色综合| www.成人在线| 国产成人无遮挡在线视频| 日本欧美加勒比视频| 一区二区三区不卡在线观看| 最新热久久免费视频| 国产日产精品1区| 久久这里只精品最新地址| 日韩欧美美女一区二区三区| 777色狠狠一区二区三区| 欧美日韩日本视频| 欧美日韩一区三区| 欧美在线制服丝袜| 欧美午夜精品电影| 欧美三级日韩在线| 欧美日韩国产一级| 欧美人牲a欧美精品| 在线观看av一区| 欧美日韩一级大片网址| 欧美三级韩国三级日本三斤| 欧美在线你懂的| 欧美日本精品一区二区三区| 91麻豆精品国产91久久久更新时间 | 日本高清不卡aⅴ免费网站| 99免费精品视频| 色先锋aa成人| 欧美在线一二三| 欧美精选一区二区| 日韩欧美123| 欧美sm美女调教| 久久蜜桃香蕉精品一区二区三区| 国产亚洲一区二区三区四区 | 亚洲激情图片小说视频| 亚洲综合久久久| 婷婷综合另类小说色区| 日韩av一区二| 国产做a爰片久久毛片| 国产91富婆露脸刺激对白| 99久久久免费精品国产一区二区| 91免费看片在线观看| 欧美揉bbbbb揉bbbbb| 欧美男男青年gay1069videost | 欧美激情综合在线| 亚洲色图清纯唯美| 视频一区二区三区在线| 久久国产精品色婷婷| 成人午夜免费视频| 欧洲视频一区二区| 日韩欧美电影在线| 中文字幕成人在线观看| 亚洲成人第一页| 狠狠色狠狠色综合系列| 91视频免费看| 日韩一区二区在线看片| 国产女主播一区| 亚洲一二三四在线观看| 久久国产成人午夜av影院| 国产91精品在线观看| 欧美性色欧美a在线播放| 日韩精品一区二区三区在线播放| 国产精品美女久久久久久2018| 伊人一区二区三区| 韩国成人福利片在线播放| 91麻豆.com| 亚洲精品一区二区三区影院 | 国产精品每日更新在线播放网址| 亚洲成人第一页| 国产·精品毛片| 欧美日韩国产电影| 国产精品久久毛片| 久久国产生活片100| 色狠狠一区二区| 久久久综合网站| 肉丝袜脚交视频一区二区| av不卡免费电影| 欧美精品一区二区三区在线| 洋洋成人永久网站入口| 国产成人在线视频免费播放| 欧美日韩成人在线| 亚洲欧洲av色图| 国产福利一区在线观看| 日韩欧美一二三四区| 午夜日韩在线观看| 日本韩国一区二区三区视频| 国产午夜亚洲精品不卡| 美女免费视频一区二区| 欧美精选在线播放| 亚洲一卡二卡三卡四卡五卡| 91美女片黄在线| 中文字幕一区二区三区在线播放| 婷婷中文字幕一区三区| 欧美色图天堂网| 亚洲女厕所小便bbb| 99vv1com这只有精品| 国产精品天美传媒| 国产**成人网毛片九色| 欧美xxx久久| 久久精品国产澳门| 日韩欧美一二三| 久久成人免费网站| 日韩欧美中文一区二区| 午夜伊人狠狠久久| 欧美日韩精品一区二区三区| 中文字幕日韩一区二区| 国产真实乱子伦精品视频| 欧美一级欧美三级在线观看| 亚洲v中文字幕| 欧美最新大片在线看| 亚洲天堂a在线| 蜜臀av性久久久久蜜臀aⅴ | 婷婷一区二区三区| 欧洲精品一区二区| 日韩一区在线播放| 成人动漫中文字幕| 最新国产の精品合集bt伙计| 国产电影一区在线| 久久久久久一级片| 日本欧美一区二区在线观看| 日韩欧美国产午夜精品| 蜜芽一区二区三区| 7777女厕盗摄久久久| 美女网站一区二区| 欧美日韩国产区一| 丝袜美腿成人在线| 91麻豆福利精品推荐| 亚洲国产欧美在线人成| 色婷婷激情久久| 一区二区三区久久久| 欧美日韩国产一级片| 日韩精品福利网| 欧美成人a视频| 蜜臀久久久99精品久久久久久| 久久久美女艺术照精彩视频福利播放| 麻豆国产91在线播放| 久久久久国色av免费看影院| thepron国产精品| 亚洲三级在线观看| 欧美午夜精品久久久久久孕妇| 亚洲日本韩国一区| 欧美精品一二三| 日本不卡的三区四区五区| 日韩欧美国产小视频| 972aa.com艺术欧美| 尤物视频一区二区|