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

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

?? sch_atm.c

?? ARM 嵌入式 系統 設計與實例開發 實驗教材 二源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* net/sched/sch_atm.c - ATM VC selection "queueing discipline" *//* Written 1998-2000 by Werner Almesberger, EPFL ICA */#include <linux/config.h>#include <linux/module.h>#include <linux/string.h>#include <linux/errno.h>#include <linux/skbuff.h>#include <linux/interrupt.h>#include <linux/atmdev.h>#include <linux/atmclip.h>#include <linux/netdevice.h>#include <linux/rtnetlink.h>#include <linux/file.h> /* for fput */#include <net/pkt_sched.h>#include <net/sock.h>extern struct socket *sockfd_lookup(int fd, int *err); /* @@@ fix this */#define sockfd_put(sock) fput((sock)->file)	/* @@@ copied because it's						   __inline__ in socket.c */#if 0 /* control */#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)#else#define DPRINTK(format,args...)#endif#if 0 /* data */#define D2PRINTK(format,args...) printk(KERN_DEBUG format,##args)#else#define D2PRINTK(format,args...)#endif/* * The ATM queuing discipline provides a framework for invoking classifiers * (aka "filters"), which in turn select classes of this queuing discipline. * Each class maps the flow(s) it is handling to a given VC. Multiple classes * may share the same VC. * * When creating a class, VCs are specified by passing the number of the open * socket descriptor by which the calling process references the VC. The kernel * keeps the VC open at least until all classes using it are removed. * * In this file, most functions are named atm_tc_* to avoid confusion with all * the atm_* in net/atm. This naming convention differs from what's used in the * rest of net/sched. * * Known bugs: *  - sometimes messes up the IP stack *  - any manipulations besides the few operations described in the README, are *    untested and likely to crash the system *  - should lock the flow while there is data in the queue (?) */#define PRIV(sch) ((struct atm_qdisc_data *) (sch)->data)#define VCC2FLOW(vcc) ((struct atm_flow_data *) ((vcc)->user_back))struct atm_flow_data {	struct Qdisc		*q;		/* FIFO, TBF, etc. */	struct tcf_proto	*filter_list;	struct atm_vcc		*vcc;		/* VCC; NULL if VCC is closed */	void (*old_pop)(struct atm_vcc *vcc,struct sk_buff *skb); /* chaining */	struct atm_qdisc_data	*parent;	/* parent qdisc */	struct socket		*sock;		/* for closing */	u32			classid;	/* x:y type ID */	int			ref;		/* reference count */	struct tc_stats		stats;	struct atm_flow_data	*next;	struct atm_flow_data	*excess;	/* flow for excess traffic;						   NULL to set CLP instead */	int			hdr_len;	unsigned char		hdr[0];		/* header data; MUST BE LAST */};struct atm_qdisc_data {	struct atm_flow_data	link;		/* unclassified skbs go here */	struct atm_flow_data	*flows;		/* NB: "link" is also on this						   list */	struct tasklet_struct	task;		/* requeue tasklet */};/* ------------------------- Class/flow operations ------------------------- */static int find_flow(struct atm_qdisc_data *qdisc,struct atm_flow_data *flow){	struct atm_flow_data *walk;	DPRINTK("find_flow(qdisc %p,flow %p)\n",qdisc,flow);	for (walk = qdisc->flows; walk; walk = walk->next)		if (walk == flow) return 1;	DPRINTK("find_flow: not found\n");	return 0;}static __inline__ struct atm_flow_data *lookup_flow(struct Qdisc *sch,    u32 classid){	struct atm_flow_data *flow;        for (flow = PRIV(sch)->flows; flow; flow = flow->next)		if (flow->classid == classid) break;	return flow;}static int atm_tc_graft(struct Qdisc *sch,unsigned long arg,    struct Qdisc *new,struct Qdisc **old){	struct atm_qdisc_data *p = PRIV(sch);	struct atm_flow_data *flow = (struct atm_flow_data *) arg;	DPRINTK("atm_tc_graft(sch %p,[qdisc %p],flow %p,new %p,old %p)\n",sch,	    p,flow,new,old);	if (!find_flow(p,flow)) return -EINVAL;	if (!new) new = &noop_qdisc;	*old = xchg(&flow->q,new);	if (*old) qdisc_reset(*old);        return 0;}static struct Qdisc *atm_tc_leaf(struct Qdisc *sch,unsigned long cl){	struct atm_flow_data *flow = (struct atm_flow_data *) cl;	DPRINTK("atm_tc_leaf(sch %p,flow %p)\n",sch,flow);	return flow ? flow->q : NULL;}static unsigned long atm_tc_get(struct Qdisc *sch,u32 classid){	struct atm_qdisc_data *p __attribute__((unused)) = PRIV(sch);	struct atm_flow_data *flow;	DPRINTK("atm_tc_get(sch %p,[qdisc %p],classid %x)\n",sch,p,classid);	flow = lookup_flow(sch,classid);        if (flow) flow->ref++;	DPRINTK("atm_tc_get: flow %p\n",flow);	return (unsigned long) flow;}static unsigned long atm_tc_bind_filter(struct Qdisc *sch,    unsigned long parent, u32 classid){	return atm_tc_get(sch,classid);}static void destroy_filters(struct atm_flow_data *flow){	struct tcf_proto *filter;	while ((filter = flow->filter_list)) {		DPRINTK("destroy_filters: destroying filter %p\n",filter);		flow->filter_list = filter->next;		filter->ops->destroy(filter);	}}/* * atm_tc_put handles all destructions, including the ones that are explicitly * requested (atm_tc_destroy, etc.). The assumption here is that we never drop * anything that still seems to be in use. */static void atm_tc_put(struct Qdisc *sch, unsigned long cl){	struct atm_qdisc_data *p = PRIV(sch);	struct atm_flow_data *flow = (struct atm_flow_data *) cl;	struct atm_flow_data **prev;	DPRINTK("atm_tc_put(sch %p,[qdisc %p],flow %p)\n",sch,p,flow);	if (--flow->ref) return;	DPRINTK("atm_tc_put: destroying\n");	for (prev = &p->flows; *prev; prev = &(*prev)->next)		if (*prev == flow) break;	if (!*prev) {		printk(KERN_CRIT "atm_tc_put: class %p not found\n",flow);		return;	}	*prev = flow->next;	DPRINTK("atm_tc_put: qdisc %p\n",flow->q);	qdisc_destroy(flow->q);	destroy_filters(flow);	if (flow->sock) {		DPRINTK("atm_tc_put: f_count %d\n",		    file_count(flow->sock->file));		flow->vcc->pop = flow->old_pop;		sockfd_put(flow->sock);	}	if (flow->excess) atm_tc_put(sch,(unsigned long) flow->excess);	if (flow != &p->link) kfree(flow);	/*	 * If flow == &p->link, the qdisc no longer works at this point and	 * needs to be removed. (By the caller of atm_tc_put.)	 */}static void sch_atm_pop(struct atm_vcc *vcc,struct sk_buff *skb){	struct atm_qdisc_data *p = VCC2FLOW(vcc)->parent;	D2PRINTK("sch_atm_pop(vcc %p,skb %p,[qdisc %p])\n",vcc,skb,p);	VCC2FLOW(vcc)->old_pop(vcc,skb);	tasklet_schedule(&p->task);}static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent,    struct rtattr **tca, unsigned long *arg){	struct atm_qdisc_data *p = PRIV(sch);	struct atm_flow_data *flow = (struct atm_flow_data *) *arg;	struct atm_flow_data *excess = NULL;	struct rtattr *opt = tca[TCA_OPTIONS-1];	struct rtattr *tb[TCA_ATM_MAX];	struct socket *sock;	int fd,error,hdr_len;	void *hdr;	DPRINTK("atm_tc_change(sch %p,[qdisc %p],classid %x,parent %x,"	    "flow %p,opt %p)\n",sch,p,classid,parent,flow,opt);	/*	 * The concept of parents doesn't apply for this qdisc.	 */	if (parent && parent != TC_H_ROOT && parent != sch->handle)		return -EINVAL;	/*	 * ATM classes cannot be changed. In order to change properties of the	 * ATM connection, that socket needs to be modified directly (via the	 * native ATM API. In order to send a flow to a different VC, the old	 * class needs to be removed and a new one added. (This may be changed	 * later.)	 */	if (flow) return -EBUSY;	if (opt == NULL || rtattr_parse(tb,TCA_ATM_MAX,RTA_DATA(opt),	    RTA_PAYLOAD(opt))) return -EINVAL;	if (!tb[TCA_ATM_FD-1] || RTA_PAYLOAD(tb[TCA_ATM_FD-1]) < sizeof(fd))		return -EINVAL;	fd = *(int *) RTA_DATA(tb[TCA_ATM_FD-1]);	DPRINTK("atm_tc_change: fd %d\n",fd);	if (tb[TCA_ATM_HDR-1]) {		hdr_len = RTA_PAYLOAD(tb[TCA_ATM_HDR-1]);		hdr = RTA_DATA(tb[TCA_ATM_HDR-1]);	}	else {		hdr_len = RFC1483LLC_LEN;		hdr = NULL; /* default LLC/SNAP for IP */	}	if (!tb[TCA_ATM_EXCESS-1]) excess = NULL;	else {		if (RTA_PAYLOAD(tb[TCA_ATM_EXCESS-1]) != sizeof(u32))			return -EINVAL;		excess = (struct atm_flow_data *) atm_tc_get(sch,		    *(u32 *) RTA_DATA(tb[TCA_ATM_EXCESS-1]));		if (!excess) return -ENOENT;	}	DPRINTK("atm_tc_change: type %d, payload %d, hdr_len %d\n",	    opt->rta_type,RTA_PAYLOAD(opt),hdr_len);	if (!(sock = sockfd_lookup(fd,&error))) return error; /* f_count++ */	DPRINTK("atm_tc_change: f_count %d\n",file_count(sock->file));        if (sock->ops->family != PF_ATMSVC && sock->ops->family != PF_ATMPVC) {		error = -EPROTOTYPE;                goto err_out;	}	/* @@@ should check if the socket is really operational or we'll crash	   on vcc->send */	if (classid) {		if (TC_H_MAJ(classid ^ sch->handle)) {			DPRINTK("atm_tc_change: classid mismatch\n");			error = -EINVAL;			goto err_out;		}		if (find_flow(p,flow)) {			error = -EEXIST;			goto err_out;		}	}	else {		int i;		unsigned long cl;		for (i = 1; i < 0x8000; i++) {			classid = TC_H_MAKE(sch->handle,0x8000 | i);			if (!(cl = atm_tc_get(sch,classid))) break;			atm_tc_put(sch,cl);		}	}	DPRINTK("atm_tc_change: new id %x\n",classid);	flow = kmalloc(sizeof(struct atm_flow_data)+hdr_len,GFP_KERNEL);	DPRINTK("atm_tc_change: flow %p\n",flow);	if (!flow) {		error = -ENOBUFS;		goto err_out;	}	memset(flow,0,sizeof(*flow));	flow->filter_list = NULL;	if (!(flow->q = qdisc_create_dflt(sch->dev,&pfifo_qdisc_ops)))		flow->q = &noop_qdisc;	DPRINTK("atm_tc_change: qdisc %p\n",flow->q);	flow->sock = sock;        flow->vcc = ATM_SD(sock); /* speedup */	flow->vcc->user_back = flow;        DPRINTK("atm_tc_change: vcc %p\n",flow->vcc);	flow->old_pop = flow->vcc->pop;	flow->parent = p;	flow->vcc->pop = sch_atm_pop;	flow->classid = classid;	flow->ref = 1;	flow->excess = excess;	flow->next = p->link.next;	p->link.next = flow;	flow->hdr_len = hdr_len;	if (hdr) memcpy(flow->hdr,hdr,hdr_len);	else {		memcpy(flow->hdr,llc_oui,sizeof(llc_oui));		((u16 *) flow->hdr)[3] = htons(ETH_P_IP);	}	*arg = (unsigned long) flow;	return 0;err_out:	if (excess) atm_tc_put(sch,(unsigned long) excess);	sockfd_put(sock);	return error;}static int atm_tc_delete(struct Qdisc *sch,unsigned long arg){	struct atm_qdisc_data *p = PRIV(sch);	struct atm_flow_data *flow = (struct atm_flow_data *) arg;	DPRINTK("atm_tc_delete(sch %p,[qdisc %p],flow %p)\n",sch,p,flow);	if (!find_flow(PRIV(sch),flow)) return -EINVAL;	if (flow->filter_list || flow == &p->link) return -EBUSY;	/*	 * Reference count must be 2: one for "keepalive" (set at class	 * creation), and one for the reference held when calling delete.	 */	if (flow->ref < 2) {		printk(KERN_ERR "atm_tc_delete: flow->ref == %d\n",flow->ref);		return -EINVAL;	}	if (flow->ref > 2) return -EBUSY; /* catch references via excess, etc.*/	atm_tc_put(sch,arg);	return 0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美日本韩国| 国产午夜亚洲精品羞羞网站| 一区二区三区在线高清| 91国在线观看| 亚洲福利视频导航| 9191成人精品久久| 精品在线免费观看| 国产午夜精品一区二区三区嫩草 | 91精品欧美一区二区三区综合在| 亚洲国产精品久久久久秋霞影院| 欧美区在线观看| 国产在线观看一区二区| 欧美激情综合五月色丁香| 91亚洲午夜精品久久久久久| 亚州成人在线电影| 欧美大尺度电影在线| 国产不卡免费视频| 亚洲美女视频在线观看| 欧美巨大另类极品videosbest| 精品制服美女丁香| 国产精品成人午夜| 欧美一级日韩免费不卡| 不卡的电影网站| 日本亚洲最大的色成网站www| 欧美精品一区二区三区蜜桃| 99久久99久久精品免费观看| 日韩中文字幕一区二区三区| 久久精品欧美日韩精品 | 99精品国产99久久久久久白柏| 国产三级欧美三级| 亚洲永久免费av| 欧美不卡一区二区三区四区| 91福利小视频| 黑人巨大精品欧美黑白配亚洲| 亚洲精品亚洲人成人网| 久久噜噜亚洲综合| 欧美精品1区2区| 99精品欧美一区二区蜜桃免费| 免费看精品久久片| 亚洲综合色在线| 欧美激情一区二区三区四区| 日韩午夜中文字幕| 色综合久久66| 成人av电影在线| 激情图片小说一区| 亚洲综合成人网| 国产精品美女久久久久av爽李琼| 欧美变态凌虐bdsm| 777午夜精品视频在线播放| av成人动漫在线观看| 久久成人久久爱| 婷婷久久综合九色综合绿巨人 | av电影天堂一区二区在线观看| 蜜桃视频在线观看一区| 亚洲一区二区高清| 亚洲人午夜精品天堂一二香蕉| 久久这里只有精品首页| 日韩一级在线观看| 欧美日韩高清一区| 一本久久综合亚洲鲁鲁五月天| 成人毛片老司机大片| 国产精品中文有码| 裸体歌舞表演一区二区| 日本欧美久久久久免费播放网| 亚洲一区二区三区小说| 亚洲美女少妇撒尿| 一区在线播放视频| 亚洲欧美在线观看| ...中文天堂在线一区| 中文字幕精品一区| 国产目拍亚洲精品99久久精品| 久久欧美一区二区| 欧美精品一区二区在线播放| 欧美精品一区在线观看| 精品剧情v国产在线观看在线| 欧美一区二区在线免费播放| 欧美精品一二三| 欧美一级日韩免费不卡| 精品国产1区二区| 2020国产精品自拍| 国产欧美日本一区视频| 国产拍揄自揄精品视频麻豆| 国产精品青草综合久久久久99| 国产女主播视频一区二区| 国产精品视频在线看| 中文字幕五月欧美| 亚洲综合免费观看高清完整版| 一级日本不卡的影视| 午夜精品一区二区三区三上悠亚| 亚洲福中文字幕伊人影院| 日韩电影在线看| 精品在线观看视频| 国产成人综合在线观看| 99久久夜色精品国产网站| 91福利视频网站| 欧美日韩高清一区| 久久亚洲免费视频| 国产精品人妖ts系列视频| 成人avav在线| 成人午夜视频网站| 国模一区二区三区白浆| 日韩中文字幕区一区有砖一区| 在线精品视频免费播放| 亚洲午夜精品网| 精品一区二区三区在线观看| 色婷婷久久一区二区三区麻豆| 青娱乐精品视频| 在线播放欧美女士性生活| 亚洲一区二区精品3399| 91啪亚洲精品| 国产精品一二三| 99国产精品国产精品毛片| 亚洲第一综合色| 亚洲影视资源网| aaa亚洲精品| 国产一区二区毛片| 蜜臀a∨国产成人精品| 欧美一级xxx| 樱花影视一区二区| 最新欧美精品一区二区三区| 日韩一级二级三级精品视频| 欧美精品三级日韩久久| 欧美成人a∨高清免费观看| 亚洲另类春色国产| 在线看不卡av| 中文字幕中文字幕在线一区| 日本一区二区三区四区在线视频 | 国产偷v国产偷v亚洲高清| 亚洲婷婷综合久久一本伊一区| 中文成人av在线| 美女在线视频一区| 亚洲一区二区欧美| 色88888久久久久久影院野外| av中文字幕不卡| 精品亚洲国产成人av制服丝袜| 亚洲卡通欧美制服中文| 免费看黄色91| 国产精品一区二区在线看| 不卡的看片网站| 欧美精品一区二区三区四区| 亚洲aaa精品| 91蜜桃在线免费视频| 久久久99精品免费观看不卡| 日韩成人精品视频| 欧美日韩另类一区| 一区二区欧美在线观看| 9色porny自拍视频一区二区| 久久先锋影音av鲁色资源网| 日韩精彩视频在线观看| 91精品福利在线| 日韩美女视频一区二区| 成人高清视频在线| 中文字幕av一区 二区| 国产精品一区2区| 亚洲精品在线观| 韩国中文字幕2020精品| 日韩精品一区二区三区老鸭窝 | 视频一区视频二区中文字幕| 91蝌蚪porny九色| 亚洲欧洲成人自拍| 成人91在线观看| 国产精品九色蝌蚪自拍| av高清久久久| 亚洲色图制服诱惑| 色欧美乱欧美15图片| 亚洲精品视频自拍| 91福利国产精品| 性久久久久久久久| 欧美久久久久中文字幕| 日本网站在线观看一区二区三区 | 国产色婷婷亚洲99精品小说| 国产高清精品在线| 成人免费在线视频| 91丨九色丨蝌蚪丨老版| 亚洲精品欧美在线| 欧美偷拍一区二区| 日韩精品久久久久久| 欧美一区日韩一区| 激情文学综合丁香| 中文字幕中文在线不卡住| 99这里只有久久精品视频| 亚洲精品日韩一| 欧美一区二区三区日韩视频| 麻豆久久久久久久| 中文字幕欧美日韩一区| 色综合久久99| 婷婷久久综合九色国产成人| 欧美大片一区二区三区| 国产99久久久久| 亚洲欧美国产毛片在线| 欧美剧情电影在线观看完整版免费励志电影| 日日噜噜夜夜狠狠视频欧美人 | 亚洲一区在线观看网站| 91精品国产麻豆国产自产在线| 国产中文字幕精品| 亚洲日本一区二区三区| 欧美一区二区视频在线观看2022| 国产精品一区二区免费不卡 | 亚洲天堂av一区| 欧美一级夜夜爽|