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

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

?? handle.c

?? DHCP服務器源碼
?? C
字號:
/* handle.c   Functions for maintaining handles on objects. *//* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1999-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''. */#include <omapip/omapip_p.h>/* The handle table is a hierarchical tree designed for quick mapping   of handle identifiers to objects.  Objects contain their own handle   identifiers if they have them, so the reverse mapping is also   quick.  The hierarchy is made up of table objects, each of which   has 120 entries, a flag indicating whether the table is a leaf   table or an indirect table, the handle of the first object covered   by the table and the first object after that that's *not* covered   by the table, a count of how many objects of either type are   currently stored in the table, and an array of 120 entries pointing   either to objects or tables.   When we go to add an object to the table, we look to see if the   next object handle to be assigned is covered by the outermost   table.  If it is, we find the place within that table where the   next handle should go, and if necessary create additional nodes in   the tree to contain the new handle.  The pointer to the object is   then stored in the correct position.      Theoretically, we could have some code here to free up handle   tables as they go out of use, but by and large handle tables won't   go out of use, so this is being skipped for now.  It shouldn't be   too hard to implement in the future if there's a different   application. */omapi_handle_table_t *omapi_handle_table;omapi_handle_t omapi_next_handle = 1;	/* Next handle to be assigned. */static isc_result_t omapi_handle_lookup_in (omapi_object_t **,					    omapi_handle_t,					    omapi_handle_table_t *);static isc_result_t omapi_object_handle_in_table (omapi_handle_t,						  omapi_handle_table_t *,						  omapi_object_t *);static isc_result_t omapi_handle_table_enclose (omapi_handle_table_t **);isc_result_t omapi_object_handle (omapi_handle_t *h, omapi_object_t *o){	int tabix;	isc_result_t status;	if (o -> handle) {		*h = o -> handle;		return ISC_R_SUCCESS;	}		if (!omapi_handle_table) {		omapi_handle_table = dmalloc (sizeof *omapi_handle_table, MDL);		if (!omapi_handle_table)			return ISC_R_NOMEMORY;		memset (omapi_handle_table, 0, sizeof *omapi_handle_table);		omapi_handle_table -> first = 0;		omapi_handle_table -> limit = OMAPI_HANDLE_TABLE_SIZE;		omapi_handle_table -> leafp = 1;	}	/* If this handle doesn't fit in the outer table, we need to	   make a new outer table.  This is a while loop in case for	   some reason we decide to do disjoint handle allocation,	   where the next level of indirection still isn't big enough	   to enclose the next handle ID. */	while (omapi_next_handle >= omapi_handle_table -> limit) {		omapi_handle_table_t *new;				new = dmalloc (sizeof *new, MDL);		if (!new)			return ISC_R_NOMEMORY;		memset (new, 0, sizeof *new);		new -> first = 0;		new -> limit = (omapi_handle_table -> limit *					       OMAPI_HANDLE_TABLE_SIZE);		new -> leafp = 0;		new -> children [0].table = omapi_handle_table;		omapi_handle_table = new;	}	/* Try to cram this handle into the existing table. */	status = omapi_object_handle_in_table (omapi_next_handle,					       omapi_handle_table, o);	/* If it worked, return the next handle and increment it. */	if (status == ISC_R_SUCCESS) {		*h = omapi_next_handle;		omapi_next_handle++;		return ISC_R_SUCCESS;	}	if (status != ISC_R_NOSPACE)		return status;	status = omapi_handle_table_enclose (&omapi_handle_table);	if (status != ISC_R_SUCCESS)		return status;	status = omapi_object_handle_in_table (omapi_next_handle,					       omapi_handle_table, o);	if (status != ISC_R_SUCCESS)		return status;	*h = omapi_next_handle;	omapi_next_handle++;	return ISC_R_SUCCESS;}static isc_result_t omapi_object_handle_in_table (omapi_handle_t h,						  omapi_handle_table_t *table,						  omapi_object_t *o){	omapi_handle_table_t *inner;	omapi_handle_t scale, index;	isc_result_t status;	if (table -> first > h || table -> limit <= h)		return ISC_R_NOSPACE;		/* If this is a leaf table, just stash the object in the	   appropriate place. */	if (table -> leafp) {		status = (omapi_object_reference			  (&table -> children [h - table -> first].object,			   o, MDL));		if (status != ISC_R_SUCCESS)			return status;		o -> handle = h;		return ISC_R_SUCCESS;	}	/* Scale is the number of handles represented by each child of this	   table.   For a leaf table, scale would be 1.   For a first level	   of indirection, 120.   For a second, 120 * 120.   Et cetera. */	scale = (table -> limit - table -> first) / OMAPI_HANDLE_TABLE_SIZE;	/* So the next most direct table from this one that contains the	   handle must be the subtable of this table whose index into this	   table's array of children is the handle divided by the scale. */	index = (h - table -> first) / scale;	inner = table -> children [index].table;	/* If there is no more direct table than this one in the slot	   we came up with, make one. */	if (!inner) {		inner = dmalloc (sizeof *inner, MDL);		if (!inner)			return ISC_R_NOMEMORY;		memset (inner, 0, sizeof *inner);		inner -> first = index * scale + table -> first;		inner -> limit = inner -> first + scale;		if (scale == OMAPI_HANDLE_TABLE_SIZE)			inner -> leafp = 1;		table -> children [index].table = inner;	}	status = omapi_object_handle_in_table (h, inner, o);	if (status == ISC_R_NOSPACE) {		status = (omapi_handle_table_enclose			  (&table -> children [index].table));		if (status != ISC_R_SUCCESS)			return status;		return omapi_object_handle_in_table			(h, table -> children [index].table, o);	}	return status;}static isc_result_t omapi_handle_table_enclose (omapi_handle_table_t **table){	omapi_handle_table_t *inner = *table;	omapi_handle_table_t *new;	int index, base, scale;	/* The scale of the table we're enclosing is going to be the	   difference between its "first" and "limit" members.  So the	   scale of the table enclosing it is going to be that multiplied	   by the table size. */	scale = (inner -> first - inner -> limit) * OMAPI_HANDLE_TABLE_SIZE;	/* The range that the enclosing table covers is going to be	   the result of subtracting the remainder of dividing the	   enclosed table's first entry number by the enclosing	   table's scale.  If handle IDs are being allocated	   sequentially, the enclosing table's "first" value will be	   the same as the enclosed table's "first" value. */	base = inner -> first - inner -> first % scale;	/* The index into the enclosing table at which the enclosed table	   will be stored is going to be the difference between the "first"	   value of the enclosing table and the enclosed table - zero, if	   we are allocating sequentially. */	index = (base - inner -> first) / OMAPI_HANDLE_TABLE_SIZE;	new = dmalloc (sizeof *new, MDL);	if (!new)		return ISC_R_NOMEMORY;	memset (new, 0, sizeof *new);	new -> first = base;	new -> limit = base + scale;	if (scale == OMAPI_HANDLE_TABLE_SIZE)		new -> leafp = 0;	new -> children [index].table = inner;	*table = new;	return ISC_R_SUCCESS;}isc_result_t omapi_handle_lookup (omapi_object_t **o, omapi_handle_t h){	return omapi_handle_lookup_in (o, h, omapi_handle_table);}static isc_result_t omapi_handle_lookup_in (omapi_object_t **o,					    omapi_handle_t h,					    omapi_handle_table_t *table){	omapi_handle_table_t *inner;	omapi_handle_t scale, index;	if (!table || table -> first > h || table -> limit <= h)		return ISC_R_NOTFOUND;		/* If this is a leaf table, just grab the object. */	if (table -> leafp) {		/* Not there? */		if (!table -> children [h - table -> first].object)			return ISC_R_NOTFOUND;		return omapi_object_reference			(o, table -> children [h - table -> first].object,			 MDL);	}	/* Scale is the number of handles represented by each child of this	   table.   For a leaf table, scale would be 1.   For a first level	   of indirection, 120.   For a second, 120 * 120.   Et cetera. */	scale = (table -> limit - table -> first) / OMAPI_HANDLE_TABLE_SIZE;	/* So the next most direct table from this one that contains the	   handle must be the subtable of this table whose index into this	   table's array of children is the handle divided by the scale. */	index = (h - table -> first) / scale;	inner = table -> children [index].table;	return omapi_handle_lookup_in (o, h, table -> children [index].table);}/* For looking up objects based on handles that have been sent on the wire. */isc_result_t omapi_handle_td_lookup (omapi_object_t **obj,				     omapi_typed_data_t *handle){	isc_result_t status;	omapi_handle_t h;	if (handle -> type == omapi_datatype_int)		h = handle -> u.integer;	else if (handle -> type == omapi_datatype_data &&		 handle -> u.buffer.len == sizeof h) {		memcpy (&h, handle -> u.buffer.value, sizeof h);		h = ntohl (h);	} else		return ISC_R_INVALIDARG;	return omapi_handle_lookup (obj, h);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人精品电影在线观看| 人妖欧美一区二区| www.亚洲人| 国产精品久久久久久久久免费丝袜| 国产精品1区二区.| 国产精品美女久久久久久久久| 成人综合日日夜夜| 亚洲免费电影在线| 欧美日韩日本视频| 精品一区二区精品| 日本一区二区三区在线不卡| 成人av免费在线观看| 亚洲精品视频一区| 欧美一区二区成人6969| 国产毛片精品一区| 亚洲人成网站影音先锋播放| 欧美亚洲一区二区在线观看| 日韩精品每日更新| 久久精品亚洲精品国产欧美kt∨ | 国产日韩v精品一区二区| 国产精品自在欧美一区| 中文字幕一区二区三| 欧美日韩夫妻久久| 韩国一区二区三区| 亚洲永久免费视频| 久久精品免视看| 91国产精品成人| 极品瑜伽女神91| 亚洲精品国产高清久久伦理二区 | 精品福利视频一区二区三区| 岛国一区二区在线观看| 午夜在线成人av| 国产色产综合色产在线视频| 欧美视频日韩视频| 懂色av中文字幕一区二区三区 | 99re在线精品| 久久99国产精品久久99果冻传媒| 自拍偷在线精品自拍偷无码专区 | 国产91精品久久久久久久网曝门| 亚洲伦在线观看| 国产丝袜美腿一区二区三区| 欧美视频你懂的| 97精品久久久久中文字幕| 蜜臀av国产精品久久久久| 一区二区三区在线视频观看58| 欧美videos中文字幕| 欧美在线视频不卡| 成人激情黄色小说| 国产裸体歌舞团一区二区| 亚洲成人先锋电影| 亚洲精品免费在线| 欧美国产日本韩| 久久伊人蜜桃av一区二区| 欧美一区二区视频在线观看| 91久久精品国产91性色tv| 国产一区二区三区免费观看| 亚洲国产一区二区视频| 综合欧美一区二区三区| 亚洲国产成人私人影院tom| 日韩欧美在线1卡| 欧美精品在线一区二区三区| 色综合天天综合| 99久久免费精品高清特色大片| 国内成人自拍视频| 久久电影网站中文字幕| 免费在线观看视频一区| 久久精品国产精品亚洲综合| 亚洲九九爱视频| 亚洲免费观看在线视频| 1区2区3区欧美| 亚洲欧美国产高清| 亚洲伦在线观看| 亚洲精品国产品国语在线app| 亚洲图片激情小说| 亚洲色图欧美偷拍| 国产精品护士白丝一区av| 国产精品色眯眯| 国产精品色噜噜| 日韩毛片高清在线播放| 亚洲精品五月天| 亚洲国产精品久久不卡毛片| 亚洲成人手机在线| 丝袜美腿亚洲综合| 另类小说视频一区二区| 免费观看久久久4p| 国产一区二区网址| 国产99久久久久| 99久久婷婷国产综合精品| 在线观看一区二区精品视频| 欧美午夜在线观看| 日韩午夜av电影| 欧美精品一区二区三区很污很色的| 精品国产露脸精彩对白| 国产婷婷一区二区| ...av二区三区久久精品| 亚洲免费观看高清完整版在线观看| 亚洲综合无码一区二区| 免费在线看成人av| 懂色av一区二区三区免费看| 一本色道久久加勒比精品| 欧美日韩一区二区三区免费看| 这里是久久伊人| 国产三级精品在线| 一区二区激情小说| 久久精品二区亚洲w码| 成人中文字幕电影| 欧美亚洲综合色| 亚洲精品一区二区三区在线观看| 国产日韩成人精品| 亚洲一区二区偷拍精品| 国产一区二区三区久久悠悠色av| 97se亚洲国产综合在线| 欧美一卡二卡在线观看| 国产精品久久久久久久浪潮网站| 亚洲成人福利片| 国产成人在线看| 欧美日韩国产一区二区三区地区| 久久久蜜桃精品| 午夜精品久久久久久久99水蜜桃 | 精品久久一区二区| 亚洲人成人一区二区在线观看| 免费成人在线影院| 91丝袜美女网| 精品国精品国产| 一区二区三区在线观看视频| 久久不见久久见中文字幕免费| 91在线视频18| 久久综合久久99| 舔着乳尖日韩一区| 91免费视频观看| 久久久九九九九| 美女在线视频一区| 欧美在线免费视屏| 国产精品素人视频| 久久99久久久久| 精品视频999| ...中文天堂在线一区| 国产综合色在线| 欧美肥妇free| 亚洲综合色噜噜狠狠| 99视频超级精品| 国产日本亚洲高清| 国内精品视频一区二区三区八戒| 精品国产一二三| 日本视频免费一区| 欧美亚洲综合在线| 亚洲欧美乱综合| 成人一区二区三区视频| 精品国产亚洲在线| 日本一不卡视频| 欧美日本韩国一区二区三区视频| 亚洲精品成人精品456| 波多野结衣精品在线| 国产调教视频一区| 国产精品一区三区| ww亚洲ww在线观看国产| 免费在线观看一区二区三区| 91.com视频| 日日夜夜免费精品| 正在播放亚洲一区| 天天综合日日夜夜精品| 欧美亚洲国产一区二区三区va| 亚洲视频网在线直播| 97精品久久久午夜一区二区三区 | 精品久久久久久无| 蜜芽一区二区三区| 日韩欧美亚洲国产另类| 日本不卡一区二区| 精品国产凹凸成av人网站| 蜜臀av一区二区| 欧美r级在线观看| 国产一区二区三区在线观看精品| 久久香蕉国产线看观看99| 国内精品久久久久影院一蜜桃| 日韩欧美国产wwwww| 奇米影视一区二区三区| 精品蜜桃在线看| 国产精品1区二区.| 亚洲天堂网中文字| 在线一区二区视频| 日本女人一区二区三区| 欧美成人免费网站| 成人免费高清视频在线观看| 中文字幕中文字幕中文字幕亚洲无线| 99re这里都是精品| 午夜影院久久久| 久久综合色婷婷| 成人精品免费视频| 亚洲综合激情另类小说区| 欧美肥胖老妇做爰| 国产麻豆精品95视频| 亚洲欧洲综合另类| 777色狠狠一区二区三区| 激情国产一区二区| 亚洲欧美日韩国产中文在线| 欧美日韩国产片| 国产精品中文字幕日韩精品| 亚洲视频电影在线| 欧美成人一区二区三区在线观看| 国产白丝网站精品污在线入口|