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

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

?? ip_conntrack_core.c

?? 優龍2410linux2.6.8內核源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* Connection state tracking for netfilter.  This is separated from,   but required by, the NAT layer; it can also be used by an iptables   extension. *//* (C) 1999-2001 Paul `Rusty' Russell   * (C) 2002-2004 Netfilter Core Team <coreteam@netfilter.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * 23 Apr 2001: Harald Welte <laforge@gnumonks.org> * 	- new API and handling of conntrack/nat helpers * 	- now capable of multiple expectations for one master * 16 Jul 2002: Harald Welte <laforge@gnumonks.org> * 	- add usage/reference counts to ip_conntrack_expect *	- export ip_conntrack[_expect]_{find_get,put} functions * */#include <linux/config.h>#include <linux/types.h>#include <linux/icmp.h>#include <linux/ip.h>#include <linux/netfilter.h>#include <linux/netfilter_ipv4.h>#include <linux/module.h>#include <linux/skbuff.h>#include <linux/proc_fs.h>#include <linux/vmalloc.h>#include <net/checksum.h>#include <net/ip.h>#include <linux/stddef.h>#include <linux/sysctl.h>#include <linux/slab.h>#include <linux/random.h>#include <linux/jhash.h>/* For ERR_PTR().  Yeah, I know... --RR */#include <linux/fs.h>/* This rwlock protects the main hash table, protocol/helper/expected   registrations, conntrack timers*/#define ASSERT_READ_LOCK(x) MUST_BE_READ_LOCKED(&ip_conntrack_lock)#define ASSERT_WRITE_LOCK(x) MUST_BE_WRITE_LOCKED(&ip_conntrack_lock)#include <linux/netfilter_ipv4/ip_conntrack.h>#include <linux/netfilter_ipv4/ip_conntrack_protocol.h>#include <linux/netfilter_ipv4/ip_conntrack_helper.h>#include <linux/netfilter_ipv4/ip_conntrack_core.h>#include <linux/netfilter_ipv4/listhelp.h>#define IP_CONNTRACK_VERSION	"2.1"#if 0#define DEBUGP printk#else#define DEBUGP(format, args...)#endifDECLARE_RWLOCK(ip_conntrack_lock);DECLARE_RWLOCK(ip_conntrack_expect_tuple_lock);void (*ip_conntrack_destroyed)(struct ip_conntrack *conntrack) = NULL;LIST_HEAD(ip_conntrack_expect_list);LIST_HEAD(protocol_list);static LIST_HEAD(helpers);unsigned int ip_conntrack_htable_size = 0;int ip_conntrack_max;static atomic_t ip_conntrack_count = ATOMIC_INIT(0);struct list_head *ip_conntrack_hash;static kmem_cache_t *ip_conntrack_cachep;struct ip_conntrack ip_conntrack_untracked;extern struct ip_conntrack_protocol ip_conntrack_generic_protocol;static inline int proto_cmpfn(const struct ip_conntrack_protocol *curr,			      u_int8_t protocol){	return protocol == curr->proto;}struct ip_conntrack_protocol *__ip_ct_find_proto(u_int8_t protocol){	struct ip_conntrack_protocol *p;	MUST_BE_READ_LOCKED(&ip_conntrack_lock);	p = LIST_FIND(&protocol_list, proto_cmpfn,		      struct ip_conntrack_protocol *, protocol);	if (!p)		p = &ip_conntrack_generic_protocol;	return p;}struct ip_conntrack_protocol *ip_ct_find_proto(u_int8_t protocol){	struct ip_conntrack_protocol *p;	READ_LOCK(&ip_conntrack_lock);	p = __ip_ct_find_proto(protocol);	READ_UNLOCK(&ip_conntrack_lock);	return p;}inline void ip_conntrack_put(struct ip_conntrack *ct){	IP_NF_ASSERT(ct);	IP_NF_ASSERT(ct->infos[0].master);	/* nf_conntrack_put wants to go via an info struct, so feed it           one at random. */	nf_conntrack_put(&ct->infos[0]);}static int ip_conntrack_hash_rnd_initted;static unsigned int ip_conntrack_hash_rnd;static u_int32_thash_conntrack(const struct ip_conntrack_tuple *tuple){#if 0	dump_tuple(tuple);#endif	return (jhash_3words(tuple->src.ip,	                     (tuple->dst.ip ^ tuple->dst.protonum),	                     (tuple->src.u.all | (tuple->dst.u.all << 16)),	                     ip_conntrack_hash_rnd) % ip_conntrack_htable_size);}intget_tuple(const struct iphdr *iph,	  const struct sk_buff *skb,	  unsigned int dataoff,	  struct ip_conntrack_tuple *tuple,	  const struct ip_conntrack_protocol *protocol){	/* Never happen */	if (iph->frag_off & htons(IP_OFFSET)) {		printk("ip_conntrack_core: Frag of proto %u.\n",		       iph->protocol);		return 0;	}	tuple->src.ip = iph->saddr;	tuple->dst.ip = iph->daddr;	tuple->dst.protonum = iph->protocol;	return protocol->pkt_to_tuple(skb, dataoff, tuple);}static intinvert_tuple(struct ip_conntrack_tuple *inverse,	     const struct ip_conntrack_tuple *orig,	     const struct ip_conntrack_protocol *protocol){	inverse->src.ip = orig->dst.ip;	inverse->dst.ip = orig->src.ip;	inverse->dst.protonum = orig->dst.protonum;	return protocol->invert_tuple(inverse, orig);}/* ip_conntrack_expect helper functions *//* Compare tuple parts depending on mask. */static inline int expect_cmp(const struct ip_conntrack_expect *i,			     const struct ip_conntrack_tuple *tuple){	MUST_BE_READ_LOCKED(&ip_conntrack_expect_tuple_lock);	return ip_ct_tuple_mask_cmp(tuple, &i->tuple, &i->mask);}static voiddestroy_expect(struct ip_conntrack_expect *exp){	DEBUGP("destroy_expect(%p) use=%d\n", exp, atomic_read(&exp->use));	IP_NF_ASSERT(atomic_read(&exp->use) == 0);	IP_NF_ASSERT(!timer_pending(&exp->timeout));	kfree(exp);}inline void ip_conntrack_expect_put(struct ip_conntrack_expect *exp){	IP_NF_ASSERT(exp);	if (atomic_dec_and_test(&exp->use)) {		/* usage count dropped to zero */		destroy_expect(exp);	}}static inline struct ip_conntrack_expect *__ip_ct_expect_find(const struct ip_conntrack_tuple *tuple){	MUST_BE_READ_LOCKED(&ip_conntrack_lock);	MUST_BE_READ_LOCKED(&ip_conntrack_expect_tuple_lock);	return LIST_FIND(&ip_conntrack_expect_list, expect_cmp, 			 struct ip_conntrack_expect *, tuple);}/* Find a expectation corresponding to a tuple. */struct ip_conntrack_expect *ip_conntrack_expect_find_get(const struct ip_conntrack_tuple *tuple){	struct ip_conntrack_expect *exp;	READ_LOCK(&ip_conntrack_lock);	READ_LOCK(&ip_conntrack_expect_tuple_lock);	exp = __ip_ct_expect_find(tuple);	if (exp)		atomic_inc(&exp->use);	READ_UNLOCK(&ip_conntrack_expect_tuple_lock);	READ_UNLOCK(&ip_conntrack_lock);	return exp;}/* remove one specific expectation from all lists and drop refcount, * does _NOT_ delete the timer. */static void __unexpect_related(struct ip_conntrack_expect *expect){	DEBUGP("unexpect_related(%p)\n", expect);	MUST_BE_WRITE_LOCKED(&ip_conntrack_lock);	/* we're not allowed to unexpect a confirmed expectation! */	IP_NF_ASSERT(!expect->sibling);	/* delete from global and local lists */	list_del(&expect->list);	list_del(&expect->expected_list);	/* decrement expect-count of master conntrack */	if (expect->expectant)		expect->expectant->expecting--;	ip_conntrack_expect_put(expect);}/* remove one specific expecatation from all lists, drop refcount * and expire timer.  * This function can _NOT_ be called for confirmed expects! */static void unexpect_related(struct ip_conntrack_expect *expect){	IP_NF_ASSERT(expect->expectant);	IP_NF_ASSERT(expect->expectant->helper);	/* if we are supposed to have a timer, but we can't delete	 * it: race condition.  __unexpect_related will	 * be calledd by timeout function */	if (expect->expectant->helper->timeout	    && !del_timer(&expect->timeout))		return;	__unexpect_related(expect);}/* delete all unconfirmed expectations for this conntrack */static void remove_expectations(struct ip_conntrack *ct, int drop_refcount){	struct list_head *exp_entry, *next;	struct ip_conntrack_expect *exp;	DEBUGP("remove_expectations(%p)\n", ct);	list_for_each_safe(exp_entry, next, &ct->sibling_list) {		exp = list_entry(exp_entry, struct ip_conntrack_expect,				 expected_list);		/* we skip established expectations, as we want to delete		 * the un-established ones only */		if (exp->sibling) {			DEBUGP("remove_expectations: skipping established %p of %p\n", exp->sibling, ct);			if (drop_refcount) {				/* Indicate that this expectations parent is dead */				ip_conntrack_put(exp->expectant);				exp->expectant = NULL;			}			continue;		}		IP_NF_ASSERT(list_inlist(&ip_conntrack_expect_list, exp));		IP_NF_ASSERT(exp->expectant == ct);		/* delete expectation from global and private lists */		unexpect_related(exp);	}}static voidclean_from_lists(struct ip_conntrack *ct){	unsigned int ho, hr;		DEBUGP("clean_from_lists(%p)\n", ct);	MUST_BE_WRITE_LOCKED(&ip_conntrack_lock);	ho = hash_conntrack(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);	hr = hash_conntrack(&ct->tuplehash[IP_CT_DIR_REPLY].tuple);	LIST_DELETE(&ip_conntrack_hash[ho], &ct->tuplehash[IP_CT_DIR_ORIGINAL]);	LIST_DELETE(&ip_conntrack_hash[hr], &ct->tuplehash[IP_CT_DIR_REPLY]);	/* Destroy all un-established, pending expectations */	remove_expectations(ct, 1);}static voiddestroy_conntrack(struct nf_conntrack *nfct){	struct ip_conntrack *ct = (struct ip_conntrack *)nfct, *master = NULL;	struct ip_conntrack_protocol *proto;	DEBUGP("destroy_conntrack(%p)\n", ct);	IP_NF_ASSERT(atomic_read(&nfct->use) == 0);	IP_NF_ASSERT(!timer_pending(&ct->timeout));	/* To make sure we don't get any weird locking issues here:	 * destroy_conntrack() MUST NOT be called with a write lock	 * to ip_conntrack_lock!!! -HW */	proto = ip_ct_find_proto(ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.protonum);	if (proto && proto->destroy)		proto->destroy(ct);	if (ip_conntrack_destroyed)		ip_conntrack_destroyed(ct);	WRITE_LOCK(&ip_conntrack_lock);	/* Make sure don't leave any orphaned expectations lying around */	if (ct->expecting)		remove_expectations(ct, 1);	/* Delete our master expectation */	if (ct->master) {		if (ct->master->expectant) {			/* can't call __unexpect_related here,			 * since it would screw up expect_list */			list_del(&ct->master->expected_list);			master = ct->master->expectant;		}		kfree(ct->master);	}	WRITE_UNLOCK(&ip_conntrack_lock);	if (master)		ip_conntrack_put(master);	DEBUGP("destroy_conntrack: returning ct=%p to slab\n", ct);	kmem_cache_free(ip_conntrack_cachep, ct);	atomic_dec(&ip_conntrack_count);}static void death_by_timeout(unsigned long ul_conntrack){	struct ip_conntrack *ct = (void *)ul_conntrack;	WRITE_LOCK(&ip_conntrack_lock);	clean_from_lists(ct);	WRITE_UNLOCK(&ip_conntrack_lock);	ip_conntrack_put(ct);}static inline intconntrack_tuple_cmp(const struct ip_conntrack_tuple_hash *i,		    const struct ip_conntrack_tuple *tuple,		    const struct ip_conntrack *ignored_conntrack){	MUST_BE_READ_LOCKED(&ip_conntrack_lock);	return i->ctrack != ignored_conntrack		&& ip_ct_tuple_equal(tuple, &i->tuple);}static struct ip_conntrack_tuple_hash *__ip_conntrack_find(const struct ip_conntrack_tuple *tuple,		    const struct ip_conntrack *ignored_conntrack){	struct ip_conntrack_tuple_hash *h;	unsigned int hash = hash_conntrack(tuple);	MUST_BE_READ_LOCKED(&ip_conntrack_lock);	h = LIST_FIND(&ip_conntrack_hash[hash],		      conntrack_tuple_cmp,		      struct ip_conntrack_tuple_hash *,		      tuple, ignored_conntrack);	return h;}/* Find a connection corresponding to a tuple. */struct ip_conntrack_tuple_hash *ip_conntrack_find_get(const struct ip_conntrack_tuple *tuple,		      const struct ip_conntrack *ignored_conntrack){	struct ip_conntrack_tuple_hash *h;	READ_LOCK(&ip_conntrack_lock);	h = __ip_conntrack_find(tuple, ignored_conntrack);	if (h)		atomic_inc(&h->ctrack->ct_general.use);	READ_UNLOCK(&ip_conntrack_lock);	return h;}static inline struct ip_conntrack *__ip_conntrack_get(struct nf_ct_info *nfct, enum ip_conntrack_info *ctinfo){	struct ip_conntrack *ct		= (struct ip_conntrack *)nfct->master;	/* ctinfo is the index of the nfct inside the conntrack */	*ctinfo = nfct - ct->infos;	IP_NF_ASSERT(*ctinfo >= 0 && *ctinfo < IP_CT_NUMBER);	return ct;}/* Return conntrack and conntrack_info given skb->nfct->master */struct ip_conntrack *ip_conntrack_get(struct sk_buff *skb, enum ip_conntrack_info *ctinfo){	if (skb->nfct) 		return __ip_conntrack_get(skb->nfct, ctinfo);	return NULL;}/* Confirm a connection given skb->nfct; places it in hash table */int__ip_conntrack_confirm(struct nf_ct_info *nfct){	unsigned int hash, repl_hash;	struct ip_conntrack *ct;	enum ip_conntrack_info ctinfo;	ct = __ip_conntrack_get(nfct, &ctinfo);	/* ipt_REJECT uses ip_conntrack_attach to attach related	   ICMP/TCP RST packets in other direction.  Actual packet	   which created connection will be IP_CT_NEW or for an	   expected connection, IP_CT_RELATED. */	if (CTINFO2DIR(ctinfo) != IP_CT_DIR_ORIGINAL)		return NF_ACCEPT;	hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);	repl_hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_REPLY].tuple);	/* We're not in hash table, and we refuse to set up related	   connections for unconfirmed conns.  But packet copies and	   REJECT will give spurious warnings here. */	/* IP_NF_ASSERT(atomic_read(&ct->ct_general.use) == 1); */	/* No external references means noone else could have           confirmed us. */	IP_NF_ASSERT(!is_confirmed(ct));	DEBUGP("Confirming conntrack %p\n", ct);	WRITE_LOCK(&ip_conntrack_lock);	/* See if there's one in the list already, including reverse:           NAT could have grabbed it without realizing, since we're           not in the hash.  If there is, we lost race. */	if (!LIST_FIND(&ip_conntrack_hash[hash],		       conntrack_tuple_cmp,		       struct ip_conntrack_tuple_hash *,		       &ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple, NULL)	    && !LIST_FIND(&ip_conntrack_hash[repl_hash],			  conntrack_tuple_cmp,			  struct ip_conntrack_tuple_hash *,			  &ct->tuplehash[IP_CT_DIR_REPLY].tuple, NULL)) {		list_prepend(&ip_conntrack_hash[hash],			     &ct->tuplehash[IP_CT_DIR_ORIGINAL]);		list_prepend(&ip_conntrack_hash[repl_hash],			     &ct->tuplehash[IP_CT_DIR_REPLY]);		/* Timer relative to confirmation time, not original		   setting time, otherwise we'd get timer wrap in		   weird delay cases. */		ct->timeout.expires += jiffies;		add_timer(&ct->timeout);		atomic_inc(&ct->ct_general.use);		set_bit(IPS_CONFIRMED_BIT, &ct->status);		WRITE_UNLOCK(&ip_conntrack_lock);		return NF_ACCEPT;	}	WRITE_UNLOCK(&ip_conntrack_lock);	return NF_DROP;}/* Returns true if a connection correspondings to the tuple (required   for NAT). */int

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91麻豆精品国产综合久久久久久| 亚洲一区二区三区在线看| 精品久久久网站| 国产精品久久久久精k8 | 26uuu国产日韩综合| 国产欧美日韩三级| 舔着乳尖日韩一区| 成人性生交大片免费| 欧美三级欧美一级| 久久久99久久精品欧美| 亚洲欧美日韩综合aⅴ视频| 日本不卡一区二区三区| 久久精品国产亚洲a| 91美女在线看| 久久久影视传媒| eeuss鲁一区二区三区| 欧美精品一区二区三区蜜桃 | 国产精品久久午夜夜伦鲁鲁| heyzo一本久久综合| 午夜亚洲福利老司机| 精品日韩欧美一区二区| 91视视频在线观看入口直接观看www| 亚洲精品免费在线观看| 成人a级免费电影| 欧美成人性战久久| 成人久久18免费网站麻豆| 亚洲一区二区三区免费视频| 欧美va亚洲va香蕉在线| 成人动漫中文字幕| 日韩中文字幕一区二区三区| 欧美色综合天天久久综合精品| 国产精品免费久久久久| 成人免费福利片| 五月天亚洲婷婷| 国产精品污www在线观看| 欧美剧情电影在线观看完整版免费励志电影 | 中文字幕中文在线不卡住| 欧美日韩精品欧美日韩精品| 亚洲成人综合视频| 欧美视频三区在线播放| 国产精品99久久不卡二区| www久久精品| 欧美吞精做爰啪啪高潮| 成人av网站免费| 麻豆91免费看| 欧美国产精品中文字幕| 成人精品电影在线观看| 免费观看一级特黄欧美大片| 亚洲精品伦理在线| 中文一区二区在线观看| 亚洲精品在线观| 欧美一区二区三区成人| 久久精工是国产品牌吗| av在线播放不卡| 久久精品久久精品| 午夜视黄欧洲亚洲| 91精品国产综合久久香蕉的特点| 国产一区二区精品在线观看| 亚洲精品一区二区三区四区高清 | 欧美精品乱码久久久久久| 国产高清精品网站| 亚洲一级二级三级| 日本在线不卡视频一二三区| 久久99热狠狠色一区二区| 国产福利精品一区二区| 色8久久人人97超碰香蕉987| 九九视频精品免费| 午夜国产精品一区| 久久91精品久久久久久秒播| 国产精品1区二区.| 欧日韩精品视频| 色噜噜狠狠色综合欧洲selulu| 91成人在线观看喷潮| 欧美一二三区在线观看| 欧美精品少妇一区二区三区| 欧美大肚乱孕交hd孕妇| 欧美一卡在线观看| 国产精品网站在线观看| 亚洲v中文字幕| 国产精品77777| 欧美日韩一级二级| 国产亚洲成aⅴ人片在线观看| 亚洲女人****多毛耸耸8| 日韩av一区二区三区四区| 成人免费黄色大片| 欧美一区二视频| 国产精品国产a| 人人精品人人爱| 一本色道久久综合狠狠躁的推荐| av一区二区久久| 欧美一区二区三区成人| 亚洲人午夜精品天堂一二香蕉| 日韩国产高清在线| 一本在线高清不卡dvd| 精品国产精品一区二区夜夜嗨| 亚洲色图欧美激情| 亚洲国产一区二区三区青草影视| 亚洲国产裸拍裸体视频在线观看乱了| 黑人精品欧美一区二区蜜桃| 国产一区欧美日韩| 欧美日韩二区三区| 亚洲人成影院在线观看| 麻豆国产精品视频| 欧美色图片你懂的| 国产精品久久国产精麻豆99网站| 日韩电影在线一区二区| 色999日韩国产欧美一区二区| 国产视频一区二区在线| 蜜臀av性久久久久蜜臀aⅴ四虎| 日本福利一区二区| 欧美精彩视频一区二区三区| 紧缚捆绑精品一区二区| 欧美日韩黄色一区二区| 一个色综合av| 蜜桃视频一区二区三区| 欧美日韩精品三区| 一区二区三区**美女毛片| 99精品欧美一区二区三区综合在线| 在线视频国内自拍亚洲视频| 国产精品国产三级国产有无不卡 | 91黄色免费网站| 国产精品久久久久久久久免费丝袜| 久久国产精品一区二区| 日韩视频中午一区| 天堂一区二区在线免费观看| 色综合久久综合| 亚洲黄色av一区| 91蜜桃在线免费视频| 国产精品久久久久久福利一牛影视| 国产成人午夜精品影院观看视频| 日韩精品综合一本久道在线视频| 日韩国产精品久久久久久亚洲| 欧美日本一区二区在线观看| 亚洲最大色网站| 欧美撒尿777hd撒尿| 亚洲午夜久久久久| 欧美性感一区二区三区| 午夜精品久久久久久久99樱桃| 日本久久电影网| 亚洲永久免费视频| 欧美色爱综合网| 人人精品人人爱| 亚洲精品一区在线观看| 国产成人综合在线观看| 国产精品理论片| 91看片淫黄大片一级| 亚洲综合成人在线| 91精品综合久久久久久| 久久精品国产亚洲高清剧情介绍| 精品国产污网站| www.日韩精品| 伊人一区二区三区| 欧美美女喷水视频| 老司机一区二区| 国产日韩欧美不卡在线| 99久久精品一区| 亚洲午夜日本在线观看| 91精品国产综合久久精品图片| 麻豆精品国产传媒mv男同 | 亚洲丝袜制服诱惑| 精品视频999| 精品一区精品二区高清| 中文字幕精品三区| 欧美在线三级电影| 精品在线免费视频| 国产精品久久久久天堂| 欧美午夜片在线观看| 国产一区在线视频| 亚洲欧美另类久久久精品2019 | 国产精品美女久久久久aⅴ国产馆| 成人激情免费电影网址| 亚洲精品成人少妇| 日韩欧美成人一区| aaa亚洲精品一二三区| 亚洲va欧美va人人爽| 国产亚洲综合在线| 欧美在线观看一区| 国产精品一区二区在线观看网站| 中文字幕一区不卡| 一本久久精品一区二区| 青青草97国产精品免费观看无弹窗版| 久久久午夜精品理论片中文字幕| 在线观看视频一区二区| 激情欧美日韩一区二区| 亚洲激情在线播放| 欧美精品一区二区在线观看| 一本大道综合伊人精品热热| 国内外精品视频| 午夜国产不卡在线观看视频| 国产精品女主播在线观看| 91精品国产高清一区二区三区| 大胆欧美人体老妇| 看电视剧不卡顿的网站| 一区二区三区中文在线观看| 国产婷婷色一区二区三区四区| 欧美男人的天堂一二区| 色综合久久综合网97色综合| 国产精品一区二区在线观看不卡 | 欧美久久久久免费| 成人动漫一区二区在线|