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

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

?? ip_vs_conn.c

?? 優龍2410linux2.6.8內核源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * IPVS         An implementation of the IP virtual server support for the *              LINUX operating system.  IPVS is now implemented as a module *              over the Netfilter framework. IPVS can be used to build a *              high-performance and highly available server based on a *              cluster of servers. * * Version:     $Id: ip_vs_conn.c,v 1.31 2003/04/18 09:03:16 wensong Exp $ * * Authors:     Wensong Zhang <wensong@linuxvirtualserver.org> *              Peter Kese <peter.kese@ijs.si> *              Julian Anastasov <ja@ssi.bg> * *              This program is free software; you can redistribute it and/or *              modify it under the terms of the GNU General Public License *              as published by the Free Software Foundation; either version *              2 of the License, or (at your option) any later version. * * The IPVS code for kernel 2.2 was done by Wensong Zhang and Peter Kese, * with changes/fixes from Julian Anastasov, Lars Marowsky-Bree, Horms * and others. Many code here is taken from IP MASQ code of kernel 2.2. * * Changes: * */#include <linux/kernel.h>#include <linux/vmalloc.h>#include <linux/proc_fs.h>		/* for proc_net_* */#include <linux/seq_file.h>#include <linux/jhash.h>#include <linux/random.h>#include <net/ip_vs.h>/* *  Connection hash table: for input and output packets lookups of IPVS */static struct list_head *ip_vs_conn_tab;/*  SLAB cache for IPVS connections */static kmem_cache_t *ip_vs_conn_cachep;/*  counter for current IPVS connections */static atomic_t ip_vs_conn_count = ATOMIC_INIT(0);/*  counter for no client port connections */static atomic_t ip_vs_conn_no_cport_cnt = ATOMIC_INIT(0);/* random value for IPVS connection hash */static unsigned int ip_vs_conn_rnd;/* *  Fine locking granularity for big connection hash table */#define CT_LOCKARRAY_BITS  4#define CT_LOCKARRAY_SIZE  (1<<CT_LOCKARRAY_BITS)#define CT_LOCKARRAY_MASK  (CT_LOCKARRAY_SIZE-1)struct ip_vs_aligned_lock{	rwlock_t	l;} __attribute__((__aligned__(SMP_CACHE_BYTES)));/* lock array for conn table */struct ip_vs_aligned_lock__ip_vs_conntbl_lock_array[CT_LOCKARRAY_SIZE] __cacheline_aligned;static inline void ct_read_lock(unsigned key){	read_lock(&__ip_vs_conntbl_lock_array[key&CT_LOCKARRAY_MASK].l);}static inline void ct_read_unlock(unsigned key){	read_unlock(&__ip_vs_conntbl_lock_array[key&CT_LOCKARRAY_MASK].l);}static inline void ct_write_lock(unsigned key){	write_lock(&__ip_vs_conntbl_lock_array[key&CT_LOCKARRAY_MASK].l);}static inline void ct_write_unlock(unsigned key){	write_unlock(&__ip_vs_conntbl_lock_array[key&CT_LOCKARRAY_MASK].l);}static inline void ct_read_lock_bh(unsigned key){	read_lock_bh(&__ip_vs_conntbl_lock_array[key&CT_LOCKARRAY_MASK].l);}static inline void ct_read_unlock_bh(unsigned key){	read_unlock_bh(&__ip_vs_conntbl_lock_array[key&CT_LOCKARRAY_MASK].l);}static inline void ct_write_lock_bh(unsigned key){	write_lock_bh(&__ip_vs_conntbl_lock_array[key&CT_LOCKARRAY_MASK].l);}static inline void ct_write_unlock_bh(unsigned key){	write_unlock_bh(&__ip_vs_conntbl_lock_array[key&CT_LOCKARRAY_MASK].l);}/* *	Returns hash value for IPVS connection entry */static unsigned int ip_vs_conn_hashkey(unsigned proto, __u32 addr, __u16 port){	return jhash_3words(addr, port, proto, ip_vs_conn_rnd)		& IP_VS_CONN_TAB_MASK;}/* *	Hashes ip_vs_conn in ip_vs_conn_tab by proto,addr,port. *	returns bool success. */static inline int ip_vs_conn_hash(struct ip_vs_conn *cp){	unsigned hash;	int ret;	/* Hash by protocol, client address and port */	hash = ip_vs_conn_hashkey(cp->protocol, cp->caddr, cp->cport);	ct_write_lock(hash);	if (!(cp->flags & IP_VS_CONN_F_HASHED)) {		list_add(&cp->c_list, &ip_vs_conn_tab[hash]);		cp->flags |= IP_VS_CONN_F_HASHED;		atomic_inc(&cp->refcnt);		ret = 1;	} else {		IP_VS_ERR("ip_vs_conn_hash(): request for already hashed, "			  "called from %p\n", __builtin_return_address(0));		ret = 0;	}	ct_write_unlock(hash);	return ret;}/* *	UNhashes ip_vs_conn from ip_vs_conn_tab. *	returns bool success. */static inline int ip_vs_conn_unhash(struct ip_vs_conn *cp){	unsigned hash;	int ret;	/* unhash it and decrease its reference counter */	hash = ip_vs_conn_hashkey(cp->protocol, cp->caddr, cp->cport);	ct_write_lock(hash);	if (cp->flags & IP_VS_CONN_F_HASHED) {		list_del(&cp->c_list);		cp->flags &= ~IP_VS_CONN_F_HASHED;		atomic_dec(&cp->refcnt);		ret = 1;	} else		ret = 0;	ct_write_unlock(hash);	return ret;}/* *  Gets ip_vs_conn associated with supplied parameters in the ip_vs_conn_tab. *  Called for pkts coming from OUTside-to-INside. *	s_addr, s_port: pkt source address (foreign host) *	d_addr, d_port: pkt dest address (load balancer) */static inline struct ip_vs_conn *__ip_vs_conn_in_get(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port){	unsigned hash;	struct ip_vs_conn *cp;	hash = ip_vs_conn_hashkey(protocol, s_addr, s_port);	ct_read_lock(hash);	list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {		if (s_addr==cp->caddr && s_port==cp->cport &&		    d_port==cp->vport && d_addr==cp->vaddr &&		    protocol==cp->protocol) {			/* HIT */			atomic_inc(&cp->refcnt);			ct_read_unlock(hash);			return cp;		}	}	ct_read_unlock(hash);	return NULL;}struct ip_vs_conn *ip_vs_conn_in_get(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port){	struct ip_vs_conn *cp;	cp = __ip_vs_conn_in_get(protocol, s_addr, s_port, d_addr, d_port);	if (!cp && atomic_read(&ip_vs_conn_no_cport_cnt))		cp = __ip_vs_conn_in_get(protocol, s_addr, 0, d_addr, d_port);	IP_VS_DBG(7, "lookup/in %s %u.%u.%u.%u:%d->%u.%u.%u.%u:%d %s\n",		  ip_vs_proto_name(protocol),		  NIPQUAD(s_addr), ntohs(s_port),		  NIPQUAD(d_addr), ntohs(d_port),		  cp?"hit":"not hit");	return cp;}/* *  Gets ip_vs_conn associated with supplied parameters in the ip_vs_conn_tab. *  Called for pkts coming from inside-to-OUTside. *	s_addr, s_port: pkt source address (inside host) *	d_addr, d_port: pkt dest address (foreign host) */struct ip_vs_conn *ip_vs_conn_out_get(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port){	unsigned hash;	struct ip_vs_conn *cp, *ret=NULL;	/*	 *	Check for "full" addressed entries	 */	hash = ip_vs_conn_hashkey(protocol, d_addr, d_port);	ct_read_lock(hash);	list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {		if (d_addr == cp->caddr && d_port == cp->cport &&		    s_port == cp->dport && s_addr == cp->daddr &&		    protocol == cp->protocol) {			/* HIT */			atomic_inc(&cp->refcnt);			ret = cp;			break;		}	}	ct_read_unlock(hash);	IP_VS_DBG(7, "lookup/out %s %u.%u.%u.%u:%d->%u.%u.%u.%u:%d %s\n",		  ip_vs_proto_name(protocol),		  NIPQUAD(s_addr), ntohs(s_port),		  NIPQUAD(d_addr), ntohs(d_port),		  ret?"hit":"not hit");	return ret;}/* *      Put back the conn and restart its timer with its timeout */void ip_vs_conn_put(struct ip_vs_conn *cp){	/* reset it expire in its timeout */	mod_timer(&cp->timer, jiffies+cp->timeout);	__ip_vs_conn_put(cp);}/* *	Fill a no_client_port connection with a client port number */void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __u16 cport){	if (ip_vs_conn_unhash(cp)) {		spin_lock(&cp->lock);		if (cp->flags & IP_VS_CONN_F_NO_CPORT) {			atomic_dec(&ip_vs_conn_no_cport_cnt);			cp->flags &= ~IP_VS_CONN_F_NO_CPORT;			cp->cport = cport;		}		spin_unlock(&cp->lock);		/* hash on new dport */		ip_vs_conn_hash(cp);	}}/* *	Bind a connection entry with the corresponding packet_xmit. *	Called by ip_vs_conn_new. */static inline void ip_vs_bind_xmit(struct ip_vs_conn *cp){	switch (IP_VS_FWD_METHOD(cp)) {	case IP_VS_CONN_F_MASQ:		cp->packet_xmit = ip_vs_nat_xmit;		break;	case IP_VS_CONN_F_TUNNEL:		cp->packet_xmit = ip_vs_tunnel_xmit;		break;	case IP_VS_CONN_F_DROUTE:		cp->packet_xmit = ip_vs_dr_xmit;		break;	case IP_VS_CONN_F_LOCALNODE:		cp->packet_xmit = ip_vs_null_xmit;		break;	case IP_VS_CONN_F_BYPASS:		cp->packet_xmit = ip_vs_bypass_xmit;		break;	}}static inline int ip_vs_dest_totalconns(struct ip_vs_dest *dest){	return atomic_read(&dest->activeconns)		+ atomic_read(&dest->inactconns);}/* *	Bind a connection entry with a virtual service destination *	Called just after a new connection entry is created. */static inline voidip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest){	/* if dest is NULL, then return directly */	if (!dest)		return;	/* Increase the refcnt counter of the dest */	atomic_inc(&dest->refcnt);	/* Bind with the destination and its corresponding transmitter */	cp->flags |= atomic_read(&dest->conn_flags);	cp->dest = dest;	IP_VS_DBG(9, "Bind-dest %s c:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d "		  "d:%u.%u.%u.%u:%d fwd:%c s:%u flg:%X cnt:%d destcnt:%d\n",		  ip_vs_proto_name(cp->protocol),		  NIPQUAD(cp->caddr), ntohs(cp->cport),		  NIPQUAD(cp->vaddr), ntohs(cp->vport),		  NIPQUAD(cp->daddr), ntohs(cp->dport),		  ip_vs_fwd_tag(cp), cp->state,		  cp->flags, atomic_read(&cp->refcnt),		  atomic_read(&dest->refcnt));	/* Update the connection counters */	if (cp->cport || (cp->flags & IP_VS_CONN_F_NO_CPORT)) {		/* It is a normal connection, so increase the inactive		   connection counter because it is in TCP SYNRECV		   state (inactive) or other protocol inacive state */		atomic_inc(&dest->inactconns);	} else {		/* It is a persistent connection/template, so increase		   the peristent connection counter */		atomic_inc(&dest->persistconns);	}	if (dest->u_threshold != 0 &&	    ip_vs_dest_totalconns(dest) >= dest->u_threshold)		dest->flags |= IP_VS_DEST_F_OVERLOAD;}/* *	Unbind a connection entry with its VS destination *	Called by the ip_vs_conn_expire function. */static inline void ip_vs_unbind_dest(struct ip_vs_conn *cp){	struct ip_vs_dest *dest = cp->dest;	if (!dest)		return;	IP_VS_DBG(9, "Unbind-dest %s c:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d "		  "d:%u.%u.%u.%u:%d fwd:%c s:%u flg:%X cnt:%d destcnt:%d\n",		  ip_vs_proto_name(cp->protocol),		  NIPQUAD(cp->caddr), ntohs(cp->cport),		  NIPQUAD(cp->vaddr), ntohs(cp->vport),		  NIPQUAD(cp->daddr), ntohs(cp->dport),		  ip_vs_fwd_tag(cp), cp->state,		  cp->flags, atomic_read(&cp->refcnt),		  atomic_read(&dest->refcnt));	/* Update the connection counters */	if (cp->cport || (cp->flags & IP_VS_CONN_F_NO_CPORT)) {		/* It is a normal connection, so decrease the inactconns		   or activeconns counter */		if (cp->flags & IP_VS_CONN_F_INACTIVE) {			atomic_dec(&dest->inactconns);		} else {			atomic_dec(&dest->activeconns);		}	} else {		/* It is a persistent connection/template, so decrease		   the peristent connection counter */		atomic_dec(&dest->persistconns);	}	if (dest->l_threshold != 0) {		if (ip_vs_dest_totalconns(dest) < dest->l_threshold)			dest->flags &= ~IP_VS_DEST_F_OVERLOAD;	} else if (dest->u_threshold != 0) {		if (ip_vs_dest_totalconns(dest) * 4 < dest->u_threshold * 3)			dest->flags &= ~IP_VS_DEST_F_OVERLOAD;	} else {		if (dest->flags & IP_VS_DEST_F_OVERLOAD)			dest->flags &= ~IP_VS_DEST_F_OVERLOAD;	}	/*	 * Simply decrease the refcnt of the dest, because the	 * dest will be either in service's destination list	 * or in the trash.	 */	atomic_dec(&dest->refcnt);}/* *	Checking if the destination of a connection template is available. *	If available, return 1, otherwise invalidate this connection *	template and return 0. */int ip_vs_check_template(struct ip_vs_conn *ct){	struct ip_vs_dest *dest = ct->dest;	/*	 * Checking the dest server status.	 */	if ((dest == NULL) ||	    !(dest->flags & IP_VS_DEST_F_AVAILABLE)) {		IP_VS_DBG(9, "check_template: dest not available for "			  "protocol %s s:%u.%u.%u.%u:%d v:%u.%u.%u.%u:%d "			  "-> d:%u.%u.%u.%u:%d\n",			  ip_vs_proto_name(ct->protocol),

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区在线视频| 国产成人在线影院 | aaa欧美大片| 蜜臀av一区二区| 日韩av一区二| 五月综合激情网| 午夜精品久久久久久久久久久 | 欧洲另类一二三四区| av成人老司机| 久久亚洲综合色一区二区三区| 欧美大片在线观看一区| 精品国精品国产| 国产色产综合色产在线视频| 久久奇米777| 亚洲色图视频免费播放| 樱花草国产18久久久久| 亚洲成人一二三| 久久精品国产精品青草| 国产99久久久国产精品潘金网站| 国产a精品视频| 精品国产免费一区二区三区四区 | 国产91清纯白嫩初高中在线观看| 91精选在线观看| 精品对白一区国产伦| 午夜精品免费在线观看| 欧美日韩中文字幕一区二区| 欧美大白屁股肥臀xxxxxx| 精品国产乱码久久久久久闺蜜 | 国产一区二区精品久久| 国产成人精品亚洲777人妖| 日韩欧美高清一区| 免费在线观看视频一区| eeuss国产一区二区三区| 国产精品网曝门| 精品少妇一区二区三区在线播放| 欧美日韩1区2区| 午夜视黄欧洲亚洲| 国产成人免费视| 国产亚洲精品aa| av在线播放成人| 亚洲黄一区二区三区| 欧洲一区在线观看| 日韩**一区毛片| 精品福利二区三区| 懂色av一区二区三区蜜臀| 国产欧美视频一区二区| 午夜激情综合网| 日韩一级视频免费观看在线| 亚洲欧美国产三级| 国产激情一区二区三区桃花岛亚洲| 2023国产精品自拍| 成人激情动漫在线观看| 欧美大片国产精品| 成人aa视频在线观看| 一区二区三区高清不卡| 国产69精品久久久久777| 欧美激情中文不卡| 国产在线精品不卡| 亚洲视频一区二区在线| 91精品免费观看| 国产高清成人在线| 夜夜夜精品看看| 久久久九九九九| 91国偷自产一区二区三区成为亚洲经典 | 91丨porny丨在线| 久久久国产一区二区三区四区小说 | 综合久久久久久| 欧美日韩免费视频| 国产呦萝稀缺另类资源| 亚洲精品乱码久久久久久久久 | 综合网在线视频| 日韩视频免费观看高清完整版| 成人av中文字幕| 日韩av中文在线观看| 亚洲丝袜另类动漫二区| 日韩美女在线视频| 色乱码一区二区三区88| 国产大陆亚洲精品国产| 天天综合日日夜夜精品| 国产精品久久久久9999吃药| 波多野结衣的一区二区三区| 午夜精品免费在线观看| 《视频一区视频二区| 99精品欧美一区二区蜜桃免费| 国产精品欧美久久久久无广告 | 精久久久久久久久久久| 精品99一区二区三区| 色94色欧美sute亚洲线路一ni| 国产在线视频精品一区| 国产日韩高清在线| 日韩小视频在线观看专区| 色婷婷综合久久久| 日本亚洲欧美天堂免费| 亚洲男人天堂av| 国产精品色眯眯| 欧美极品另类videosde| 精品国产一区二区三区久久久蜜月| 欧美日韩激情一区| 色哦色哦哦色天天综合| 97精品国产97久久久久久久久久久久 | 国产成人精品影院| 国产综合一区二区| 久久99国产精品尤物| 男男视频亚洲欧美| 免费欧美高清视频| 麻豆精品视频在线观看视频| 日韩av中文在线观看| 偷拍日韩校园综合在线| 亚洲成va人在线观看| 亚洲一区二区三区视频在线| 日韩精品一区二区三区中文精品 | 天堂蜜桃91精品| 国产欧美日韩精品一区| 久久久欧美精品sm网站| 欧美mv和日韩mv国产网站| 欧美大肚乱孕交hd孕妇| 精品国产乱码久久久久久1区2区 | 精品久久久久久久久久久院品网 | 91麻豆精品一区二区三区| 成人avav影音| 91国产视频在线观看| 欧美三级电影在线看| 777久久久精品| 日韩美女一区二区三区四区| 久久久久久久av麻豆果冻| 国产欧美精品区一区二区三区| 亚洲国产成人午夜在线一区| 综合久久给合久久狠狠狠97色| 亚洲男人天堂av网| 丝袜诱惑亚洲看片| 国产麻豆精品在线观看| 成人综合婷婷国产精品久久免费| 同产精品九九九| 玖玖九九国产精品| 成人免费看的视频| 欧美日韩综合一区| 欧美videossexotv100| 国产人久久人人人人爽| 亚洲最色的网站| 久久精品99国产精品日本| 成人动漫中文字幕| 欧美日韩精品电影| 国产午夜精品久久久久久久| 亚洲乱码国产乱码精品精可以看| 亚洲国产aⅴ成人精品无吗| 中文字幕一区二区三区蜜月| 亚洲高清不卡在线| 国产乱子轮精品视频| 日韩精品一二区| 国产成人精品免费网站| 色屁屁一区二区| 久久蜜臀中文字幕| 一卡二卡欧美日韩| 国产精品一区一区三区| 欧美三级电影网| 中文字幕精品一区二区三区精品| 亚洲国产欧美在线人成| 精品一区二区三区在线观看国产 | 丁香婷婷综合网| 制服丝袜一区二区三区| 国产精品剧情在线亚洲| 日本视频一区二区| 色综合一个色综合亚洲| kk眼镜猥琐国模调教系列一区二区| 欧美丰满嫩嫩电影| 欧美日韩国产精品成人| 国产偷国产偷精品高清尤物| 日本成人中文字幕在线视频| 99久久精品免费观看| 精品99一区二区| 日本不卡免费在线视频| 91浏览器在线视频| 久久一区二区三区四区| 婷婷成人综合网| 欧美在线视频日韩| 国产精品美女一区二区| 韩国三级电影一区二区| 91精品国产福利| 亚洲一区二区视频在线观看| 成人av网站在线观看免费| 久久众筹精品私拍模特| 蜜臀久久久久久久| 91麻豆精品国产| 同产精品九九九| 欧美日本一区二区三区| 一区二区三国产精华液| 99久久免费精品| 中文字幕永久在线不卡| 国产精品18久久久久久久网站| 日韩欧美一区在线观看| 日本不卡中文字幕| 7777精品伊人久久久大香线蕉超级流畅 | 亚洲欧美欧美一区二区三区| 高清av一区二区| 国产精品亲子伦对白| 成人性视频免费网站| 国产精品不卡一区| eeuss鲁一区二区三区| 国产精品久久久久久久久免费丝袜| 国产不卡在线播放|