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

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

?? ip_vs_ftp.c

?? 優龍2410linux2.6.8內核源代碼
?? C
字號:
/* * ip_vs_ftp.c: IPVS ftp application module * * Version:	$Id: ip_vs_ftp.c,v 1.13 2002/09/15 08:14:08 wensong Exp $ * * Authors:	Wensong Zhang <wensong@linuxvirtualserver.org> * * Changes: * * *	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. * * Most code here is taken from ip_masq_ftp.c in kernel 2.2. The difference * is that ip_vs_ftp module handles the reverse direction to ip_masq_ftp. * *		IP_MASQ_FTP ftp masquerading module * * Version:	@(#)ip_masq_ftp.c 0.04   02/05/96 * * Author:	Wouter Gadeyne * */#include <linux/module.h>#include <linux/moduleparam.h>#include <linux/kernel.h>#include <linux/skbuff.h>#include <linux/in.h>#include <linux/ip.h>#include <net/protocol.h>#include <net/tcp.h>#include <net/ip_vs.h>#define SERVER_STRING "227 Entering Passive Mode ("#define CLIENT_STRING "PORT "/* * List of ports (up to IP_VS_APP_MAX_PORTS) to be handled by helper * First port is set to the default port. */static int ports[IP_VS_APP_MAX_PORTS] = {21, 0};static int ports_c;module_param_array(ports, int, ports_c, 0);/* *	Debug level */#ifdef CONFIG_IP_VS_DEBUGstatic int debug=0;module_param(debug, int, 0);#endif/*	Dummy variable */static int ip_vs_ftp_pasv;static intip_vs_ftp_init_conn(struct ip_vs_app *app, struct ip_vs_conn *cp){	return 0;}static intip_vs_ftp_done_conn(struct ip_vs_app *app, struct ip_vs_conn *cp){	return 0;}/* * Get <addr,port> from the string "xxx.xxx.xxx.xxx,ppp,ppp", started * with the "pattern" and terminated with the "term" character. * <addr,port> is in network order. */static int ip_vs_ftp_get_addrport(char *data, char *data_limit,				  const char *pattern, size_t plen, char term,				  __u32 *addr, __u16 *port,				  char **start, char **end){	unsigned char p[6];	int i = 0;	if (data_limit - data < plen) {		/* check if there is partial match */		if (strnicmp(data, pattern, data_limit - data) == 0)			return -1;		else			return 0;	}	if (strnicmp(data, pattern, plen) != 0) {		return 0;	}	*start = data + plen;	for (data = *start; *data != term; data++) {		if (data == data_limit)			return -1;	}	*end = data;	memset(p, 0, sizeof(p));	for (data = *start; data != *end; data++) {		if (*data >= '0' && *data <= '9') {			p[i] = p[i]*10 + *data - '0';		} else if (*data == ',' && i < 5) {			i++;		} else {			/* unexpected character */			return -1;		}	}	if (i != 5)		return -1;	*addr = (p[3]<<24) | (p[2]<<16) | (p[1]<<8) | p[0];	*port = (p[5]<<8) | p[4];	return 1;}/* * Look at outgoing ftp packets to catch the response to a PASV command * from the server (inside-to-outside). * When we see one, we build a connection entry with the client address, * client port 0 (unknown at the moment), the server address and the * server port.  Mark the current connection entry as a control channel * of the new entry. All this work is just to make the data connection * can be scheduled to the right server later. * * The outgoing packet should be something like *   "227 Entering Passive Mode (xxx,xxx,xxx,xxx,ppp,ppp)". * xxx,xxx,xxx,xxx is the server address, ppp,ppp is the server port number. */static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,			 struct sk_buff **pskb, int *diff){	struct iphdr *iph;	struct tcphdr *th;	char *data, *data_limit;	char *start, *end;	__u32 from;	__u16 port;	struct ip_vs_conn *n_cp;	char buf[24];		/* xxx.xxx.xxx.xxx,ppp,ppp\000 */	unsigned buf_len;	int ret;	*diff = 0;	/* Only useful for established sessions */	if (cp->state != IP_VS_TCP_S_ESTABLISHED)		return 1;	/* Linear packets are much easier to deal with. */	if (!ip_vs_make_skb_writable(pskb, (*pskb)->len))		return 0;	if (cp->app_data == &ip_vs_ftp_pasv) {		iph = (*pskb)->nh.iph;		th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]);		data = (char *)th + (th->doff << 2);		data_limit = (*pskb)->tail;		if (ip_vs_ftp_get_addrport(data, data_limit,					   SERVER_STRING,					   sizeof(SERVER_STRING)-1, ')',					   &from, &port,					   &start, &end) != 1)			return 1;		IP_VS_DBG(1-debug, "PASV response (%u.%u.%u.%u:%d) -> "			  "%u.%u.%u.%u:%d detected\n",			  NIPQUAD(from), ntohs(port), NIPQUAD(cp->caddr), 0);		/*		 * Now update or create an connection entry for it		 */		n_cp = ip_vs_conn_out_get(iph->protocol, from, port,					  cp->caddr, 0);		if (!n_cp) {			n_cp = ip_vs_conn_new(IPPROTO_TCP,					      cp->caddr, 0,					      cp->vaddr, port,					      from, port,					      IP_VS_CONN_F_NO_CPORT,					      cp->dest);			if (!n_cp)				return 0;			/* add its controller */			ip_vs_control_add(n_cp, cp);		}		/*		 * Replace the old passive address with the new one		 */		from = n_cp->vaddr;		port = n_cp->vport;		sprintf(buf,"%d,%d,%d,%d,%d,%d", NIPQUAD(from),			port&255, (port>>8)&255);		buf_len = strlen(buf);		/*		 * Calculate required delta-offset to keep TCP happy		 */		*diff = buf_len - (end-start);		if (*diff == 0) {			/* simply replace it with new passive address */			memcpy(start, buf, buf_len);			ret = 1;		} else {			ret = !ip_vs_skb_replace(*pskb, GFP_ATOMIC, start,					  end-start, buf, buf_len);		}		cp->app_data = NULL;		ip_vs_tcp_conn_listen(n_cp);		ip_vs_conn_put(n_cp);		return ret;	}	return 1;}/* * Look at incoming ftp packets to catch the PASV/PORT command * (outside-to-inside). * * The incoming packet having the PORT command should be something like *      "PORT xxx,xxx,xxx,xxx,ppp,ppp\n". * xxx,xxx,xxx,xxx is the client address, ppp,ppp is the client port number. * In this case, we create a connection entry using the client address and * port, so that the active ftp data connection from the server can reach * the client. */static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp,			struct sk_buff **pskb, int *diff){	struct iphdr *iph;	struct tcphdr *th;	char *data, *data_start, *data_limit;	char *start, *end;	__u32 to;	__u16 port;	struct ip_vs_conn *n_cp;	/* no diff required for incoming packets */	*diff = 0;	/* Only useful for established sessions */	if (cp->state != IP_VS_TCP_S_ESTABLISHED)		return 1;	/* Linear packets are much easier to deal with. */	if (!ip_vs_make_skb_writable(pskb, (*pskb)->len))		return 0;	/*	 * Detecting whether it is passive	 */	iph = (*pskb)->nh.iph;	th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]);	/* Since there may be OPTIONS in the TCP packet and the HLEN is	   the length of the header in 32-bit multiples, it is accurate	   to calculate data address by th+HLEN*4 */	data = data_start = (char *)th + (th->doff << 2);	data_limit = (*pskb)->tail;	while (data <= data_limit - 6) {		if (strnicmp(data, "PASV\r\n", 6) == 0) {			/* Passive mode on */			IP_VS_DBG(1-debug, "got PASV at %zd of %zd\n",				  data - data_start,				  data_limit - data_start);			cp->app_data = &ip_vs_ftp_pasv;			return 1;		}		data++;	}	/*	 * To support virtual FTP server, the scenerio is as follows:	 *       FTP client ----> Load Balancer ----> FTP server	 * First detect the port number in the application data,	 * then create a new connection entry for the coming data	 * connection.	 */	if (ip_vs_ftp_get_addrport(data_start, data_limit,				   CLIENT_STRING, sizeof(CLIENT_STRING)-1,				   '\r', &to, &port,				   &start, &end) != 1)		return 1;	IP_VS_DBG(1-debug, "PORT %u.%u.%u.%u:%d detected\n",		  NIPQUAD(to), ntohs(port));	/* Passive mode off */	cp->app_data = NULL;	/*	 * Now update or create a connection entry for it	 */	IP_VS_DBG(1-debug, "protocol %s %u.%u.%u.%u:%d %u.%u.%u.%u:%d\n",		  ip_vs_proto_name(iph->protocol),		  NIPQUAD(to), ntohs(port), NIPQUAD(cp->vaddr), 0);	n_cp = ip_vs_conn_in_get(iph->protocol,				 to, port,				 cp->vaddr, htons(ntohs(cp->vport)-1));	if (!n_cp) {		n_cp = ip_vs_conn_new(IPPROTO_TCP,				      to, port,				      cp->vaddr, htons(ntohs(cp->vport)-1),				      cp->daddr, htons(ntohs(cp->dport)-1),				      0,				      cp->dest);		if (!n_cp)			return 0;		/* add its controller */		ip_vs_control_add(n_cp, cp);	}	/*	 *	Move tunnel to listen state	 */	ip_vs_tcp_conn_listen(n_cp);	ip_vs_conn_put(n_cp);	return 1;}static struct ip_vs_app ip_vs_ftp = {	.name =		"ftp",	.type =		IP_VS_APP_TYPE_FTP,	.protocol =	IPPROTO_TCP,	.module =	THIS_MODULE,	.incs_list =	LIST_HEAD_INIT(ip_vs_ftp.incs_list),	.init_conn =	ip_vs_ftp_init_conn,	.done_conn =	ip_vs_ftp_done_conn,	.bind_conn =	NULL,	.unbind_conn =	NULL,	.pkt_out =	ip_vs_ftp_out,	.pkt_in =	ip_vs_ftp_in,};/* *	ip_vs_ftp initialization */static int __init ip_vs_ftp_init(void){	int i, ret;	struct ip_vs_app *app = &ip_vs_ftp;	ret = register_ip_vs_app(app);	if (ret)		return ret;	for (i=0; i<IP_VS_APP_MAX_PORTS; i++) {		if (!ports[i])			continue;		ret = register_ip_vs_app_inc(app, app->protocol, ports[i]);		if (ret)			break;		IP_VS_DBG(1-debug, "%s: loaded support on port[%d] = %d\n",			  app->name, i, ports[i]);	}	if (ret)		unregister_ip_vs_app(app);	return ret;}/* *	ip_vs_ftp finish. */static void __exit ip_vs_ftp_exit(void){	unregister_ip_vs_app(&ip_vs_ftp);}module_init(ip_vs_ftp_init);module_exit(ip_vs_ftp_exit);MODULE_LICENSE("GPL");

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区欧美视频| 久久久一区二区三区| 色综合天天做天天爱| 99久久99久久精品免费观看| 成人中文字幕在线| 成人美女视频在线看| 9久草视频在线视频精品| 99精品在线免费| 欧美日韩三级在线| 日韩一本二本av| 久久亚洲精品小早川怜子| 国产精品丝袜久久久久久app| 亚洲欧美在线aaa| 洋洋成人永久网站入口| 首页国产丝袜综合| 国模套图日韩精品一区二区| 国产传媒日韩欧美成人| 国产69精品久久99不卡| 日本大香伊一区二区三区| 91.com在线观看| 欧美精品一区二区久久久| 国产精品久久看| 日韩av网站在线观看| 国产高清久久久| 在线日韩av片| 久久精品视频一区二区三区| 自拍视频在线观看一区二区| 日韩电影在线一区二区三区| 国产精品亚洲一区二区三区妖精| 99久久国产综合精品女不卡| 欧美在线免费视屏| 久久久久久电影| 亚洲韩国精品一区| 国产精品中文字幕日韩精品| 色婷婷久久一区二区三区麻豆| 日韩亚洲欧美中文三级| 国产精品国产三级国产| 欧美aⅴ一区二区三区视频| 国产成人av电影在线| 欧美一级二级在线观看| 亚洲欧美日韩电影| 国产一区二区美女| 欧美久久久久久久久中文字幕| 久久精品欧美日韩| 日韩激情视频网站| 欧美色图片你懂的| 中文欧美字幕免费| 国产一区二区主播在线| 欧美午夜精品一区| 国产精品大尺度| 国产麻豆午夜三级精品| 欧美精品在线观看播放| 亚洲欧美电影院| www.欧美日韩国产在线| 国产亚洲成aⅴ人片在线观看| 婷婷久久综合九色综合绿巨人| 丁香网亚洲国际| 国产精品一区二区男女羞羞无遮挡 | 亚洲黄色小说网站| 免费在线观看成人| 欧美日韩国产三级| 亚洲三级免费观看| 成人黄色在线视频| 国产欧美日韩综合精品一区二区| 日韩电影一区二区三区四区| 欧美探花视频资源| 亚洲香肠在线观看| 色吧成人激情小说| 亚洲一区在线观看免费观看电影高清 | 成人精品免费视频| 国产无一区二区| 亚洲综合偷拍欧美一区色| 国产高清一区日本| 韩国成人福利片在线播放| 99精品久久免费看蜜臀剧情介绍| www国产成人免费观看视频 深夜成人网| 国产成a人亚洲| 国内精品伊人久久久久av影院| 欧美一区二区三区免费观看视频 | 97精品国产97久久久久久久久久久久 | 丝袜诱惑制服诱惑色一区在线观看 | 一区二区三区成人| 欧美系列一区二区| 国产日韩欧美精品综合| 中文字幕中文字幕在线一区 | 久久精品视频在线看| 国产精品小仙女| 久久久蜜桃精品| 成人黄页毛片网站| 亚洲在线观看免费视频| 欧美精品日韩一本| 精品无人区卡一卡二卡三乱码免费卡 | 99精品国产91久久久久久| 亚洲私人黄色宅男| 欧美日韩大陆在线| 精品影院一区二区久久久| 国产欧美日韩三级| 91麻豆6部合集magnet| 首页亚洲欧美制服丝腿| 久久精品一二三| 色婷婷精品大视频在线蜜桃视频| 亚洲gay无套男同| 久久久久88色偷偷免费| 在线观看一区二区精品视频| 久久国产欧美日韩精品| 国产精品家庭影院| 日韩免费观看高清完整版| av一二三不卡影片| 日本aⅴ免费视频一区二区三区| 久久久精品黄色| 欧美二区在线观看| 国产999精品久久久久久绿帽| 亚洲一区二区三区四区在线观看 | 91久色porny | 国产精品成人网| 在线电影欧美成精品| 成人爽a毛片一区二区免费| 视频一区二区国产| 亚洲色图都市小说| 欧美精品一区二区三区蜜臀| 欧美色欧美亚洲另类二区| 国产99久久久国产精品免费看| 石原莉奈在线亚洲二区| 最新久久zyz资源站| 精品精品国产高清a毛片牛牛| 一本久久a久久免费精品不卡| 国产伦精一区二区三区| 天天av天天翘天天综合网色鬼国产| 欧美激情一区二区三区不卡 | 国产日本一区二区| 日韩欧美在线一区二区三区| 91在线免费看| 成人一区在线看| 国产在线看一区| 久久99精品国产| 免费观看久久久4p| 日本不卡一二三| 日本不卡中文字幕| 亚洲一区日韩精品中文字幕| 国产精品视频你懂的| 国产日本欧洲亚洲| 国产日韩视频一区二区三区| 精品1区2区在线观看| 精品国产乱码久久久久久免费 | 亚洲国产成人自拍| 日本一区二区免费在线| 国产午夜精品久久久久久久| 久久久91精品国产一区二区精品| 日韩欧美123| 欧美电视剧在线观看完整版| 日韩一区二区三| 精品黑人一区二区三区久久| 337p粉嫩大胆噜噜噜噜噜91av| 日韩精品中文字幕一区| 日韩视频在线观看一区二区| 日韩美女一区二区三区| www激情久久| 国产精品美女久久久久久久久| 中文字幕在线一区免费| 亚洲欧美激情视频在线观看一区二区三区| 中文天堂在线一区| 一区二区三区在线视频免费| 亚洲一区二区四区蜜桃| 午夜电影久久久| 黑人巨大精品欧美黑白配亚洲| 国产99一区视频免费| 97超碰欧美中文字幕| 欧美在线高清视频| 日韩免费成人网| 久久久蜜臀国产一区二区| 日韩一区在线播放| 午夜电影网一区| 国产成人在线免费| 色噜噜偷拍精品综合在线| 欧美日韩一区 二区 三区 久久精品| 欧美在线啊v一区| 欧美sm极限捆绑bd| 国产精品不卡在线| 日韩高清在线观看| 国产福利91精品一区二区三区| 96av麻豆蜜桃一区二区| 色久优优欧美色久优优| 日韩女优电影在线观看| 国产精品福利av | 久久久久久久av麻豆果冻| 亚洲日本中文字幕区| 蜜桃视频在线观看一区| 成人免费av在线| 欧美一区二区三区思思人| 国产午夜精品美女毛片视频| 国产一区二区主播在线| 色综合欧美在线视频区| 精品欧美一区二区三区精品久久| 国产精品情趣视频| 日韩激情一二三区| 91香蕉视频在线| 欧美精品一区二区三区一线天视频| 亚洲欧美日韩国产另类专区 | 色94色欧美sute亚洲线路二| 亚洲精品一区二区三区99|