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

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

?? ip_strm_mod.c

?? 7號信令功能代碼,為開源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*************************************************************************									**                   Gcom DLPI <-> Linux SKBUF Driver		        **									***************************************************************************									**                  Copyright (C) 1995,1996,1997 Gcom, Inc		**									**									**	Author: Among others Mikel L. Matthews Gcom, Inc.		**									** Copyright (C) 1997-1999  Mikel Matthews, Gcom, Inc <mikel@gcom.com>	**                          Dave Grothe, Gcom, Inc <dave@gcom.com>	**									*************************************************************************//* * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. *  * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Library General Public License for more details. *  * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Cambridge, * MA 02139, USA. *  * This is a pushable streams module that bridges a DLPI stream to * an IP masquerading as a network driver. * * The way you use it is as follows: * * Open your DLPI stream file. * * Push this module. * * Do DLPI attach and bind. * * Send SIOCSIFNAME ioctl with the desired interface name. * * The ioctl causes the module to register itself with IP as a network * interface driver. * * Do the appropriate ifconfig and route commands. * * You can tear down the IP side by doing ifconfig <name> off.  You can * tear down the whole thing by closing the streams file. *//*************************************************************************                              SCCS ID                                  ***************************************************************************									** The following strings identify this module as to version info.	**									*************************************************************************/#ident "@(#) LiS ip_strm_mod.c 2.21 10/09/02 22:08:57 "#include <linux/config.h>#include <linux/version.h>#ifdef CONFIG_MODVERSIONS#include <linux/modversions.h>#endif#include <linux/module.h>#include <linux/kernel.h>#include <linux/string.h>#include <linux/errno.h>#include <linux/ioport.h>#include <linux/slab.h>#include <linux/interrupt.h>#include <linux/timer.h>#include <linux/pci.h>#include <linux/spinlock.h>#include <linux/init.h>#include <linux/delay.h>#include <linux/ioctl.h>#include <asm/bitops.h>#include <asm/io.h>#include <asm/uaccess.h>#include <linux/net.h>#include <linux/in.h>#include <linux/netdevice.h>#include <linux/etherdevice.h>#include <linux/skbuff.h>#include <linux/ethtool.h>#include <linux/delay.h>#include <linux/types.h>#include <linux/if_arp.h>/* * UNIX includes */#include <sys/stream.h>#include <sys/cmn_err.h>#include <sys/dlpi.h>#include <sys/mkdev.h>#include <sys/ddi.h>#include <sys/cred.h>#include <sys/LiS/mod.h>#include "ip_strm_mod.h"#include <sys/osif.h>/*************************************************************************                        Function Prototypes                            *************************************************************************//* * Functions in this file */extern int	ip_strm_init(struct ism_dev *dev) ;/*************************************************************************                    Streams Entry Point Routines                       ***************************************************************************									** The following section of code contains the entry point routines for	** the streams driver.  These are the open, close, put and service	** routines pointed to by the qinit structures above.			**									*************************************************************************/extern  int		ip_to_streams_open(queue_t *,dev_t *,int ,int, cred_t *);extern  int		ip_to_streams_close(queue_t *, int, cred_t *);extern  int		ip_to_streams_wput(queue_t *,mblk_t *);extern  int		ip_to_streams_wsrv(queue_t *);extern  int		ip_to_streams_rput(queue_t *,mblk_t *);extern  int	        ip_to_streams_rsrv(queue_t *);extern  int		ip_to_streams_conn_req(ip_to_streams_minor_t *minor_ptr,				      mblk_t *mp, int retry) ;extern int		ip_to_streams_proto(ip_to_streams_minor_t *, mblk_t *,					int );#ifdef GCOMextern  void		netman_hex_mp (mblk_t *, char *);extern  void    	Rsys_print_traced_token (char *bufp) ;extern	void		Rsys_hex_print(char *, unsigned char *, int);#endif/*************************************************************************                    Linkage to Streams System                          *************************************************************************/struct module_info ip_to_streams_minfo =	{ 0		/* mi_idnum  */	, "ip_to_streams"	/* mi_idname */	, 0		/* mi_minpsz */	, INFPSZ	/* mi_maxpsz */	, 20000		/* mi_hiwat  */	, 2000		/* mi_lowat  */	};struct qinit ip_to_streams_rinit =	{ ip_to_streams_rput	, ip_to_streams_rsrv	/* qi_srvp  */	, ip_to_streams_open	/* qi_open  */	, ip_to_streams_close	/* qi_close */	, NULL			/* qi_admin */	, &ip_to_streams_minfo	/* qi_minfo */	, NULL		/* qi_mstat */	};struct qinit ip_to_streams_winit =	{ ip_to_streams_wput	/* qi_putp  */	, ip_to_streams_wsrv	/* qi_srvp  */	, NULL		/* qi_open  */	, NULL		/* qi_close */	, NULL		/* qi_admin */	, &ip_to_streams_minfo	/* qi_minfo */	, NULL		/* qi_mstat */	};struct streamtab ip_to_streams_info =	{ &ip_to_streams_rinit	   /* read queue definition */	, &ip_to_streams_winit	   /* write queue definition */	, NULL			   /* mux read queue  */	, NULL			   /* mux write queue */	};int	ip_to_streamsdevflag = 0;/*************************************************************************                       Storage Declarations                            *************************************************************************/unsigned long		 ip_to_streams_debug_mask = 0;#define IP_STRM_MTU (1500)/*************************************************************************                           ip_to_streams_open                          ***************************************************************************									** The streams open routine. Called when this is pushed on to the stack	**									*************************************************************************/intip_to_streams_open( queue_t *rdq,	   dev_t   *devp,	   int      flag,	   int      sflag,	   cred_t  *credp){    ip_to_streams_minor_t	*minor_ptr ;    if ( ip_to_streams_debug_mask & (DBG_OPEN) )	cmn_err(CE_CONT, "\nip_to_streams_open: q=%x sflag=%d", sflag) ;    minor_ptr = (ip_to_streams_minor_p) ALLOC(sizeof(ip_to_streams_minor_t)) ;    if (minor_ptr == NULL)	return(-ENOMEM) ;    memset(minor_ptr, 0, sizeof(*minor_ptr)) ;	/* clear to zero */    minor_ptr->dl_magic = DL_MAGIC ;    rdq->q_ptr = (caddr_t) minor_ptr ;    WR(rdq)->q_ptr = (caddr_t) minor_ptr ;    minor_ptr->dl_rdq = rdq ;    minor_ptr->dl_wrq = WR(rdq) ;    minor_ptr->dl_q   = rdq;    minor_ptr->dl_err_prim = -1 ;		/* ensure no retry */    strcpy(minor_ptr->myname, "is") ;		/* initial name Ip/Streams */#if defined(KERNEL_2_3)    strcpy(minor_ptr->mydev.name, "is") ;	/* initial name Ip/Streams */#else    minor_ptr->mydev.name = minor_ptr->myname ;#endif    minor_ptr->mydev.init = ip_strm_init ;    minor_ptr->mydev.priv = minor_ptr ;    if ( ip_to_streams_debug_mask & (DBG_OPEN) )	cmn_err(CE_CONT, "\nip_to_streams_open succeeded") ;    return (0);			/* success */} /* ip_to_streams_open *//*************************************************************************                          ip_to_streams_close                          ***************************************************************************									** Called when closing the stream					**									*************************************************************************/int ip_to_streams_close(queue_t *q, int dummy, cred_t *credp){    ip_to_streams_minor_t	*minor_ptr ;    if ( ip_to_streams_debug_mask & (DBG_OPEN) )	cmn_err(CE_CONT, "\nip_to_streams_close: q=%x ", q) ;    minor_ptr = (ip_to_streams_minor_t *) q->q_ptr ;    if (   minor_ptr != (ip_to_streams_minor_t *) NULL	&& minor_ptr->dl_magic == DL_MAGIC       )    {	if ( ip_to_streams_debug_mask & (DBG_OPEN) )	    cmn_err(CE_CONT, "ip_to_streams_close: %s\n", minor_ptr->myname) ;	if (minor_ptr->dev_registered != 0)	/* still open to IP */	    unregister_netdev(&minor_ptr->mydev) ;	minor_ptr->dl_magic = ~DL_MAGIC ;	FREE(minor_ptr) ;    }    else    if ( ip_to_streams_debug_mask & (DBG_OPEN) )	cmn_err(CE_CONT, "ip_to_streams_close: invalid minor ptr q_ptr=%x\n",			q->q_ptr) ;    q->q_ptr = NULL ;				/* zot the q ptrs */    WR(q)->q_ptr = NULL ;			/* zot the q ptrs */    return(0) ;} /* ip_to_streams_close *//*************************************************************************                          ip_to_streams_ioctl                          ***************************************************************************									** Have a look at an ioctl received from the user.  Return 1 if the	** ioctl is to be forwarded downstream.  Return 0 if we handled it here.	**									*************************************************************************/int ip_to_streams_ioctl(queue_t *q, mblk_t  *mp){    struct iocblk		*iocp;    ip_to_streams_minor_t	*minor_ptr ;    mblk_t			*xmp = mp->b_cont ;    int				 result = 0 ;    iocp = (struct iocblk *) mp -> b_rptr;      /* the request header */    if ((mp -> b_wptr - mp -> b_rptr) < sizeof (struct iocblk *))   /* small */	return(1) ;			/* let driver deal with it */    minor_ptr = (ip_to_streams_minor_t *) q->q_ptr ;    switch (iocp -> ioc_cmd)    {    case SIOCSIFNAME:		/* set interface name */        /*         * This ioctl is sent by the streams user.  It is the last step         * in making this stream available to IP.  Once we know the         * name we register the device with IP as an interface.         *         * As an added feature, the streams user can set the name         * to the empty string and we will unregister from IP.  When         * we unregister we leave the streams side alone so that a         * simple "set if-name" ioctl will make the interface appear         * under IP again.         */	if (xmp != NULL && *xmp->b_rptr != 0)		/* name specified */	{	    strncpy(minor_ptr->myname, xmp->b_rptr, sizeof(minor_ptr->myname)) ;#if defined(KERNEL_2_3)	    strcpy(minor_ptr->mydev.name, minor_ptr->myname) ;#else	    minor_ptr->mydev.name = minor_ptr->myname ;#endif	    if ((result = register_netdev(&minor_ptr->mydev)) != 0)		printk("ip_to_streams_ioctl: "		       "register_netdev(%s) failed: %d\n",		       minor_ptr->myname, result);	    else		printk("ip_to_streams_ioctl: SIOCSIFNAME: %s\n",			minor_ptr->myname) ;	    minor_ptr->dev_registered = result == 0 ;	}	else				/* nullify name, unregister */	{	    unregister_netdev(&minor_ptr->mydev) ;	    strcpy(minor_ptr->myname, "is") ;	    minor_ptr->contype = 0;	/* not connected */	    minor_ptr->ip_open = 0 ;	/* not open to IP now */	}	if (xmp != NULL)	{	    freemsg(xmp) ;		/* don't return any data */	    mp->b_cont = NULL ;	}	break ;    default:	printk("ip_to_streams_ioctl: undefined ioctl: 0x%x\n", iocp->ioc_cmd) ;	result = -EINVAL ;	break ;    }    /*     * If you exit the switch then we are going to reply to the     * ioctl and not forward it downstream.     */    if (result)						/* error */    {	mp -> b_datap -> db_type = M_IOCNAK;	iocp -> ioc_count = 0;                          /* no data */    }    else                                                /* success */    {	mp -> b_datap -> db_type = M_IOCACK;	if ((xmp = mp -> b_cont) == NULL)               /* no chained buf */	    iocp -> ioc_count = 0;                      /* no data */	else                                            /* a response */	    iocp -> ioc_count = xmp -> b_wptr - xmp -> b_rptr;    }    iocp -> ioc_error = result;    qreply(q, mp);    return(0) ;				/* do not forward */} /* ip_to_streams_ioctl *//*************************************************************************                           ip_to_streams_wput                          ***************************************************************************									** Write side put routine						**									*************************************************************************/int ip_to_streams_wput(queue_t *q, mblk_t  *mp){    ip_to_streams_minor_t	*minor_ptr ;    if ( ip_to_streams_debug_mask & DBG_PUT )	cmn_err(CE_CONT, "\nip_to_streams_wput: q=%x mp=%x\n", q, mp) ;    minor_ptr = (ip_to_streams_minor_t *) q->q_ptr ;    /* make sure the data structure is valid */    if (   minor_ptr == (ip_to_streams_minor_t *) NULL	|| minor_ptr->dl_magic != DL_MAGIC       )    {	if (ip_to_streams_debug_mask & DBG_SQUAWK)	    cmn_err(CE_NOTE, "ip_to_streams_wput: bad minor") ;	freemsg(mp) ;	return(0) ;    }    switch(mp->b_datap->db_type)    {    case M_DATA:	if ( canputnext(q) )		/* data uses flow control */	    putnext(q, mp);	else	    putq(q, mp);	break;    case M_PROTO:    case M_PCPROTO:    {	int err;	union DL_primitives *dlp;	err = 0;	dlp = (union DL_primitives *)mp->b_rptr;	switch(dlp->dl_primitive)	{	    case DL_UNITDATA_REQ:	    {		if ( ip_to_streams_debug_mask & DBG_WPUT)		    printk("ip_to_streams_wput: DL_UNITDATA_REQ:\n");		if ( canputnext(q) )		/* data uses flow control */		    putnext(q, mp);		else		    putq(q, mp);		return(0) ;	    }	    case DL_INFO_REQ:	    {		if ( ip_to_streams_debug_mask & DBG_WPUT)		    printk("ip_to_streams_wput: DL_INFO_REQ:\n");		putnext(q, mp);		break;	    }	    case DL_BIND_REQ:	    {		dl_bind_req_t	     *dlp;		if ( ip_to_streams_debug_mask & DBG_WPUT)		    printk("ip_to_streams_wput:DL_BIND_REQ:\n");		minor_ptr->dlstate = DL_BIND_PENDING;		dlp = (dl_bind_req_t *) mp->b_rptr ;		minor_ptr->dl_sap = dlp->dl_sap ;	/* save SAP */		putnext(q, mp);		break;	    }	    case DL_UNBIND_REQ:	    {		if ( ip_to_streams_debug_mask & DBG_WPUT)		    printk("DL_UNBIND_REQ:\n");		minor_ptr->dlstate = DL_UNBIND_PENDING;		minor_ptr->dl_sap = 0 ;		putnext(q, mp);		break;	    }	    case DL_ATTACH_REQ:	    {		if ( ip_to_streams_debug_mask & DBG_WPUT)		    printk("DL_ATTACH_REQ:\n");		minor_ptr->dlstate = DL_ATTACH_PENDING;		putnext(q, mp);		break;	    }	    case DL_DETACH_REQ:	    {		if ( ip_to_streams_debug_mask & DBG_WPUT)		    printk("DL_DETACH_REQ:\n");		minor_ptr->dlstate = DL_DETACH_PENDING ;		putnext(q, mp);		break;	    }	    break;	}	break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产乱码久久| 91麻豆福利精品推荐| 亚洲乱码国产乱码精品精98午夜| 久久人人爽人人爽| 日韩女优av电影| 亚洲精品一区二区三区蜜桃下载| 欧美一区二区三区四区高清| 欧美日韩成人在线一区| 欧美日韩中文字幕精品| 欧美日韩国产精品自在自线| 欧美日韩国产在线观看| 欧美肥妇bbw| 欧美成人video| 久久久99久久精品欧美| 欧美国产精品专区| 国产精品欧美精品| 国产精品初高中害羞小美女文| 亚洲欧洲一区二区在线播放| 亚洲人妖av一区二区| 亚洲精品国产成人久久av盗摄 | 秋霞影院一区二区| 日韩精品一级中文字幕精品视频免费观看| 一区二区三区高清在线| 午夜电影久久久| 美国毛片一区二区三区| 国产一区欧美一区| 91在线视频网址| 欧美日韩小视频| 久久久蜜桃精品| 亚洲免费高清视频在线| 日韩国产欧美一区二区三区| 久久99精品一区二区三区| 国产91精品在线观看| 欧美亚洲一区二区三区四区| 精品剧情v国产在线观看在线| 中文一区在线播放| 午夜精品免费在线观看| 国产成人h网站| 欧美日韩国产色站一区二区三区| 久久一区二区视频| 亚洲中国最大av网站| 狠狠久久亚洲欧美| 91久久国产综合久久| 日韩精品一区在线| 亚洲日本va午夜在线影院| 久久成人久久爱| 欧美亚州韩日在线看免费版国语版 | 日本不卡视频一二三区| 成人精品亚洲人成在线| 91精品国产91热久久久做人人| 国产日韩欧美综合在线| 日韩不卡一区二区| 91麻豆自制传媒国产之光| 久久婷婷综合激情| 天天综合色天天综合| 91丨porny丨最新| 国产日韩三级在线| 九九九久久久精品| 欧美精品国产精品| 亚洲成人av一区二区三区| 成人精品视频一区二区三区| 精品va天堂亚洲国产| 国产乱码精品一区二区三| 欧美自拍偷拍午夜视频| 国产精品美女久久久久aⅴ| 精品无码三级在线观看视频| 欧美巨大另类极品videosbest| 亚洲女同女同女同女同女同69| 国产九色精品成人porny| 日韩三级视频在线观看| 性欧美大战久久久久久久久| 色视频欧美一区二区三区| 国产精品嫩草久久久久| 国产不卡在线视频| 日本一区二区三级电影在线观看 | 粉嫩绯色av一区二区在线观看| 日韩欧美一级精品久久| 日韩在线一区二区三区| 欧美精品久久天天躁| 午夜激情一区二区三区| 欧美精品粉嫩高潮一区二区| 日产国产欧美视频一区精品| 9191久久久久久久久久久| 天天影视色香欲综合网老头| 91精品国产色综合久久不卡蜜臀| 天天射综合影视| 欧美一个色资源| 激情综合网激情| 国产精品视频一二三区| 99久久精品国产毛片| 一区二区三区中文免费| 欧美三级视频在线播放| 日本不卡视频一二三区| 久久精品一区蜜桃臀影院| 国产91精品一区二区麻豆网站| 中文天堂在线一区| 在线亚洲一区二区| 三级精品在线观看| 久久精品夜色噜噜亚洲a∨| 懂色av一区二区在线播放| 亚洲欧美国产77777| 欧美精品久久一区二区三区| 国产精品一区二区果冻传媒| 亚洲男同性恋视频| 欧美日韩www| 国产精品一区二区三区乱码| 亚洲色图在线看| 777色狠狠一区二区三区| 国产自产v一区二区三区c| 亚洲欧美日韩久久| 日韩欧美国产高清| 91视频xxxx| 美女高潮久久久| 亚洲少妇中出一区| 精品理论电影在线观看 | 一区二区三区电影在线播| 欧美高清一级片在线| 国产成人精品免费网站| 亚洲成人在线观看视频| 中文字幕欧美国产| 337p亚洲精品色噜噜噜| 99免费精品视频| 久久se精品一区二区| 亚洲精品你懂的| 欧美国产乱子伦 | 色呦呦国产精品| 激情伊人五月天久久综合| 夜夜操天天操亚洲| 日本一区二区三区久久久久久久久不| 欧美性淫爽ww久久久久无| 国产成人av资源| 免费成人av在线| 亚洲一区二区3| 亚洲一区二区3| 亚洲美女屁股眼交| 国产偷国产偷亚洲高清人白洁| 欧美久久一区二区| 91一区在线观看| 成+人+亚洲+综合天堂| 精品一区二区三区的国产在线播放| 亚洲精品国久久99热| 国产精品不卡一区二区三区| 精品国产乱码久久久久久图片| 777午夜精品免费视频| 欧美色图激情小说| 91精品办公室少妇高潮对白| 99久久精品99国产精品| 成人短视频下载| 国产99一区视频免费| 国产麻豆精品一区二区| 老司机精品视频一区二区三区| 偷偷要91色婷婷| 日韩极品在线观看| 日韩和欧美的一区| 日本va欧美va瓶| 免费av网站大全久久| 另类调教123区| 精久久久久久久久久久| 国产精品中文字幕欧美| 国产精品一二二区| 成人免费毛片嘿嘿连载视频| 成人午夜视频免费看| 成人av免费在线播放| 色综合久久天天| 欧美日韩精品一区二区三区四区 | 首页欧美精品中文字幕| 日韩不卡在线观看日韩不卡视频| 国产传媒日韩欧美成人| 懂色av噜噜一区二区三区av | 国产精品国产自产拍高清av王其| 国产嫩草影院久久久久| 亚洲欧美自拍偷拍| 亚洲免费观看高清完整版在线观看| 亚洲综合色成人| 免费精品视频在线| 国产乱人伦偷精品视频不卡 | 日本欧美一区二区在线观看| 日韩不卡手机在线v区| 国产麻豆视频一区二区| 91亚洲大成网污www| 欧美日韩亚洲综合一区| 欧美成人官网二区| 综合中文字幕亚洲| 午夜精品福利久久久| 国产精品一区不卡| 91国偷自产一区二区开放时间| 欧美日韩高清影院| 久久在线免费观看| 亚洲男人的天堂在线观看| 日韩精彩视频在线观看| 国产91综合网| 4438x成人网最大色成网站| 国产午夜精品一区二区| 亚洲第一激情av| 国产精品123区| 欧美区一区二区三区| 国产精品久久久久久一区二区三区| 一片黄亚洲嫩模| 国产白丝精品91爽爽久久 | 日韩国产欧美在线观看|