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

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

?? radix.c

?? vxwork源代碼
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/* radix.c - common routines for routing engine *//* Copyright 1990 - 2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/* * Copyright (c) 1988, 1989, 1993 *	The Regents of the University of California.  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. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *	This product includes software developed by the University of *	California, Berkeley and its contributors. * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. * *	@(#)radix.c	8.5 (Berkeley) 5/19/95 *//*modification history--------------------01d,05nov01,vvv  fixed compilation warning01c,12oct01,rae  merge from truestack ver 01f, base 01b01b,02jul97,vin  fixed warnings.01a,03mar96,vin  created from BSD4.4lite2.*//* * Routines to build and maintain radix trees for routing lookups. */#include "vxWorks.h"#include "stdlib.h"#include "logLib.h"#include "string.h"#include "net/domain.h"#include "net/systm.h"#include "net/radix.h"#ifdef WV_INSTRUMENTATION#ifdef INCLUDE_WVNET#include "wvNetLib.h"#endif#endif#ifdef VIRTUAL_STACK#include "netinet/vsLib.h"#elseint	max_keylen;struct radix_mask *rn_mkfreelist;struct radix_node_head *mask_rnhead;static char *addmask_key;static char *rn_zeros, *rn_ones;#endif#ifdef WV_INSTRUMENTATION#ifdef INCLUDE_WVNET    /* Set common fields of event identifiers for this module. */LOCAL UCHAR wvNetModuleId = WV_NET_RADIX_MODULE;   /* Value for radix.c */LOCAL UCHAR wvNetLocalFilter = WV_NET_NONE;     /* Available event filter */LOCAL ULONG wvNetEventId;       /* Event identifier: see wvNetLib.h */#endif    /* INCLUDE_WVNET */#endifstatic char normal_chars[] = {0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, -1};#define rn_masktop (mask_rnhead->rnh_treetop)#undef Bcmp#define Bcmp(a, b, l) (l == 0 ? 0 : bcmp((caddr_t)(a), (caddr_t)(b), (u_long)l))/* * The data structure for the keys is a radix tree with one way * branching removed.  The index rn_b at an internal node n represents a bit * position to be tested.  The tree is arranged so that all descendants * of a node n have keys whose bits all agree up to position rn_b - 1. * (We say the index of n is rn_b.) * * There is at least one descendant which has a one bit at position rn_b, * and at least one with a zero there. * * A route is determined by a pair of key and mask.  We require that the * bit-wise logical and of the key and mask to be the key. * We define the index of a route to associated with the mask to be * the first bit number in the mask where 0 occurs (with bit number 0 * representing the highest order bit). *  * We say a mask is normal if every bit is 0, past the index of the mask. * If a node n has a descendant (k, m) with index(m) == index(n) == rn_b, * and m is a normal mask, then the route applies to every descendant of n. * If the index(m) < rn_b, this implies the trailing last few bits of k * before bit b are all 0, (and hence consequently true of every descendant * of n), so the route applies to all descendants of the node as well. *  * Similar logic shows that a non-normal mask m such that * index(m) <= index(n) could potentially apply to many children of n. * Thus, for each non-host route, we attach its mask to a list at an internal * node as high in the tree as we can go.  * * The present version of the code makes use of normal routes in short- * circuiting an explict mask and compare operation when testing whether * a key satisfies a normal route, and also in remembering the unique leaf * that governs a subtree. */struct radix_node *rn_search(v_arg, head)	void *v_arg;	struct radix_node *head;{	register struct radix_node *x;	register caddr_t v;	for (x = head, v = v_arg; x->rn_b >= 0;) {		if (x->rn_bmask & v[x->rn_off])			x = x->rn_r;		else			x = x->rn_l;	}	return (x);}struct radix_node *rn_search_m(v_arg, head, m_arg)	struct radix_node *head;	void *v_arg, *m_arg;{	register struct radix_node *x;	register caddr_t v = v_arg, m = m_arg;	for (x = head; x->rn_b >= 0;) {		if ((x->rn_bmask & m[x->rn_off]) &&		    (x->rn_bmask & v[x->rn_off]))			x = x->rn_r;		else			x = x->rn_l;	}	return x;}intrn_refines(m_arg, n_arg)	void *m_arg, *n_arg;{	register caddr_t m = m_arg, n = n_arg;	register caddr_t lim, lim2 = lim = n + *(u_char *)n;	int longer = (*(u_char *)n++) - (int)(*(u_char *)m++);	int masks_are_equal = 1;	if (longer > 0)		lim -= longer;	while (n < lim) {		if (*n & ~(*m))			return 0;		if (*n++ != *m++)			masks_are_equal = 0;	}	while (n < lim2)		if (*n++)			return 0;	if (masks_are_equal && (longer < 0))		for (lim2 = m - longer; m < lim2; )			if (*m++)				return 1;	return (!masks_are_equal);}struct radix_node *rn_lookup(v_arg, m_arg, head)	void *v_arg, *m_arg;	struct radix_node_head *head;{	register struct radix_node *x;	caddr_t netmask = 0;	if (m_arg) {		if ((x = rn_addmask(m_arg, 1, head->rnh_treetop->rn_off)) == 0)			return (0);		netmask = x->rn_key;	}	x = rn_match(v_arg, head);	if (x && netmask) {		while (x && x->rn_mask != netmask)			x = x->rn_dupedkey;	}	return x;}static intrn_satsifies_leaf(trial, leaf, skip)	char *trial;	register struct radix_node *leaf;	int skip;{	register char *cp = trial, *cp2 = leaf->rn_key, *cp3 = leaf->rn_mask;	char *cplim;	int length = min(*(u_char *)cp, *(u_char *)cp2);	if (cp3 == 0)		cp3 = rn_ones;	else		length = min(length, *(u_char *)cp3);	cplim = cp + length; cp3 += skip; cp2 += skip;	for (cp += skip; cp < cplim; cp++, cp2++, cp3++)		if ((*cp ^ *cp2) & *cp3)			return 0;	return 1;}struct radix_node *rn_match(v_arg, head)	void *v_arg;	struct radix_node_head *head;{	caddr_t v = v_arg;	register struct radix_node *t = head->rnh_treetop, *x;	register caddr_t cp = v, cp2;	caddr_t cplim;	struct radix_node *saved_t, *top = t;	int off = t->rn_off, vlen = *(u_char *)cp, matched_off;	register int test, b, rn_b;	/*	 * Open code rn_search(v, top) to avoid overhead of extra	 * subroutine call.	 */	for (; t->rn_b >= 0; ) {		if (t->rn_bmask & cp[t->rn_off])			t = t->rn_r;		else			t = t->rn_l;	}	/*	 * See if we match exactly as a host destination	 * or at least learn how many bits match, for normal mask finesse.	 *	 * It doesn't hurt us to limit how many bytes to check	 * to the length of the mask, since if it matches we had a genuine	 * match and the leaf we have is the most specific one anyway;	 * if it didn't match with a shorter length it would fail	 * with a long one.  This wins big for class B&C netmasks which	 * are probably the most common case...	 */	if (t->rn_mask)		vlen = *(u_char *)t->rn_mask;	cp += off; cp2 = t->rn_key + off; cplim = v + vlen;	for (; cp < cplim; cp++, cp2++)		if (*cp != *cp2)			goto on1;	/*	 * This extra grot is in case we are explicitly asked	 * to look up the default.  Ugh!	 */	if ((t->rn_flags & RNF_ROOT) && t->rn_dupedkey)		t = t->rn_dupedkey;	return t;on1:	test = (*cp ^ *cp2) & 0xff; /* find first bit that differs */	for (b = 7; (test >>= 1) > 0;)		b--;	matched_off = cp - v;	b += matched_off << 3;	rn_b = -1 - b;	/*	 * If there is a host route in a duped-key chain, it will be first.	 */	if ((saved_t = t)->rn_mask == 0)		t = t->rn_dupedkey;	for (; t; t = t->rn_dupedkey)		/*		 * Even if we don't match exactly as a host,		 * we may match if the leaf we wound up at is		 * a route to a net.		 */		if (t->rn_flags & RNF_NORMAL) {			if (rn_b <= t->rn_b)				return t;		} else if (rn_satsifies_leaf(v, t, matched_off))				return t;	t = saved_t;	/* start searching up the tree */	do {		register struct radix_mask *m;		t = t->rn_p;		m = t->rn_mklist;		if (m) {			/*			 * If non-contiguous masks ever become important			 * we can restore the masking and open coding of			 * the search and satisfaction test and put the			 * calculation of "off" back before the "do".			 */			do {				if (m->rm_flags & RNF_NORMAL) {					if (rn_b <= m->rm_b)						return (m->rm_leaf);				} else {					off = min(t->rn_off, matched_off);					x = rn_search_m(v, t, m->rm_mask);					while (x && x->rn_mask != m->rm_mask)						x = x->rn_dupedkey;					if (x && rn_satsifies_leaf(v, x, off))						    return x;				}			m = m->rm_mklist;			} while (m);		}	} while (t != top);	return 0;}		#ifdef RN_DEBUGint	rn_nodenum;struct	radix_node *rn_clist;int	rn_saveinfo;int	rn_debug =  1;#endifstruct radix_node *rn_newpair(v, b, nodes)	void *v;	int b;	struct radix_node nodes[2];{	register struct radix_node *tt = nodes, *t = tt + 1;	t->rn_b = b; t->rn_bmask = 0x80 >> (b & 7);	t->rn_l = tt; t->rn_off = b >> 3;	tt->rn_b = -1; tt->rn_key = (caddr_t)v; tt->rn_p = t;	tt->rn_flags = t->rn_flags = RNF_ACTIVE;#ifdef RN_DEBUG	tt->rn_info = rn_nodenum++; t->rn_info = rn_nodenum++;	tt->rn_twin = t; tt->rn_ybro = rn_clist; rn_clist = tt;#endif	return t;}struct radix_node *rn_insert(v_arg, head, dupentry, nodes)	void *v_arg;	struct radix_node_head *head;	int *dupentry;	struct radix_node nodes[2];{	caddr_t v = v_arg;	struct radix_node *top = head->rnh_treetop;	int head_off = top->rn_off, vlen = (int)*((u_char *)v);	register struct radix_node *t = rn_search(v_arg, top);	register caddr_t cp = v + head_off;	register int b;	struct radix_node *tt;    	/*	 * Find first bit at which v and t->rn_key differ	 */    {	register caddr_t cp2 = t->rn_key + head_off;	register int cmp_res;	caddr_t cplim = v + vlen;	while (cp < cplim)		if (*cp2++ != *cp++)			goto on1;	*dupentry = 1;	return t;on1:	*dupentry = 0;	cmp_res = (cp[-1] ^ cp2[-1]) & 0xff;	for (b = (cp - v) << 3; cmp_res; b--)		cmp_res >>= 1;    }    {

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区免费播放 | 亚洲一区免费在线观看| 大白屁股一区二区视频| 久久亚洲精精品中文字幕早川悠里| 日本不卡一区二区三区高清视频| 欧美日韩一区二区三区四区| 亚洲va欧美va人人爽午夜| 91精品免费观看| 男女男精品视频网| 日韩欧美国产麻豆| 国产真实精品久久二三区| 久久精品一区二区三区不卡| 风间由美中文字幕在线看视频国产欧美| 欧美成人a在线| 成人一区二区视频| 亚洲激情校园春色| 精品少妇一区二区| 国产成人免费视频网站高清观看视频| 国产亚洲精品7777| 欧美视频在线观看一区二区| 免费日韩伦理电影| 中文字幕中文字幕一区二区| 欧美日韩aaaaaa| 成人永久aaa| 免费看日韩a级影片| 亚洲精品久久久蜜桃| 亚洲精品在线电影| 欧美性受xxxx黑人xyx性爽| 精品一区二区三区久久久| 亚洲欧美综合另类在线卡通| 欧美日韩国产欧美日美国产精品| 国产盗摄一区二区三区| 亚洲成人精品影院| 亚洲图片另类小说| 国产精品理论在线观看| 久久伊人中文字幕| 日韩一级黄色片| 欧美色欧美亚洲另类二区| 99久久久精品| 成人午夜精品在线| 国产成人在线色| 国产剧情一区二区三区| 国内精品视频666| 捆绑调教美女网站视频一区| 亚洲激情av在线| 亚洲自拍另类综合| 亚洲成人自拍偷拍| 午夜av一区二区| 日本欧美一区二区| 日韩精品电影一区亚洲| 午夜精品福利在线| 亚洲高清视频的网址| 亚洲成av人片一区二区三区| 亚洲超丰满肉感bbw| 日本va欧美va瓶| 国产一区二区在线观看视频| 国产一区二区看久久| 国产乱国产乱300精品| 成人动漫av在线| 色婷婷综合五月| 欧美精品一二三| 久久午夜老司机| 亚洲美女视频在线| 婷婷开心激情综合| 国产宾馆实践打屁股91| 99免费精品在线| 欧美一级片在线观看| 国产精品免费看片| 亚洲成人激情综合网| 国产乱码精品一品二品| 色综合天天做天天爱| 欧美一区二区精美| 亚洲素人一区二区| 久久激情五月激情| 91官网在线免费观看| 欧美va亚洲va在线观看蝴蝶网| 中文字幕成人网| 久久疯狂做爰流白浆xx| 91视频观看视频| 亚洲精品一区二区三区香蕉 | 色老综合老女人久久久| www国产亚洲精品久久麻豆| 艳妇臀荡乳欲伦亚洲一区| 久久精品国产亚洲aⅴ| 在线观看日韩电影| 亚洲国产激情av| 国产呦萝稀缺另类资源| 欧美日韩高清一区| 亚洲综合激情小说| 91色porny在线视频| 中文字幕巨乱亚洲| 国产高清在线精品| 久久久五月婷婷| 国产一区二区福利视频| 精品理论电影在线观看 | 午夜影院久久久| 在线视频综合导航| 亚洲少妇最新在线视频| 在线精品视频一区二区三四| 亚洲视频免费在线观看| 色偷偷久久人人79超碰人人澡| 国产精品全国免费观看高清| 色狠狠av一区二区三区| 最新中文字幕一区二区三区| 99热这里都是精品| 亚洲综合在线观看视频| 欧美色爱综合网| 另类欧美日韩国产在线| 26uuu精品一区二区在线观看| 国产成人免费视频| 亚洲日本丝袜连裤袜办公室| 制服丝袜亚洲网站| 国产专区综合网| 亚洲丰满少妇videoshd| 精品盗摄一区二区三区| 91视频观看视频| 国产美女娇喘av呻吟久久| 久久99久久精品欧美| 亚洲日本在线视频观看| 日韩欧美的一区二区| www.99精品| 精品在线你懂的| 一区二区三区在线免费| 国产三区在线成人av| 欧美精品少妇一区二区三区| 国产精品996| 亚洲 欧美综合在线网络| 国产欧美日韩精品一区| 日韩一级二级三级| 欧美日本不卡视频| 韩国精品主播一区二区在线观看 | 欧美在线播放高清精品| 亚洲午夜影视影院在线观看| 一区二区久久久| 三级影片在线观看欧美日韩一区二区| 亚洲成人av福利| 天天av天天翘天天综合网| 中文字幕亚洲综合久久菠萝蜜| 欧美激情一区在线观看| 久久久久久免费| 久久免费美女视频| 久久久国产一区二区三区四区小说 | 婷婷国产v国产偷v亚洲高清| 中文字幕视频一区二区三区久| 久久精品人人做人人综合| 精品国产一区二区亚洲人成毛片| 91精品中文字幕一区二区三区| 在线成人小视频| 久久综合久久综合久久综合| 国产精品午夜在线| 性欧美疯狂xxxxbbbb| 国内精品在线播放| 99精品国产视频| 欧美精品高清视频| 中文字幕欧美日本乱码一线二线| 国产精品美女久久久久久久网站| 日韩一区在线看| 日本va欧美va欧美va精品| 成人福利视频在线看| 欧美日韩大陆一区二区| 国产亚洲美州欧州综合国| 亚洲欧美国产三级| 国产在线精品不卡| 在线免费观看不卡av| 久久中文娱乐网| 日韩欧美黄色影院| 国产亚洲欧美在线| 狠狠色丁香婷综合久久| 日韩欧美中文字幕精品| 麻豆精品在线视频| 精品国产一区二区在线观看| 日韩精品一二三四| 欧美日韩亚洲综合一区二区三区 | 欧美久久一二区| 五月婷婷综合在线| 91精品91久久久中77777| 国产日韩亚洲欧美综合| 国产在线看一区| 日韩一区二区高清| 婷婷六月综合亚洲| 欧美精品粉嫩高潮一区二区| 亚洲女同ⅹxx女同tv| 一本色道久久加勒比精品| 综合色天天鬼久久鬼色| 一本一道综合狠狠老| 亚洲成a人v欧美综合天堂下载| 91 com成人网| 韩日av一区二区| 日本一区二区不卡视频| 99久久国产综合精品女不卡| 亚洲综合精品久久| 日韩一区二区三区电影在线观看 | 亚洲国产综合色| 日本道色综合久久| 亚洲图片欧美色图| 日韩一区二区免费在线电影| 国内久久婷婷综合| 中文字幕av一区 二区| 91麻豆国产香蕉久久精品| 亚洲成a人片在线观看中文|