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

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

?? proxyarplib.c

?? vxwork源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* proxyArpLib.c - proxy Address Resolution Protocol (ARP) server library *//* Copyright 1984 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01p,07may02,kbw  man page edits01o,26mar02,vvv  fixed proxy broadcast storm (SPR #74518)01n,07dec01,vvv  fixed proxy broadcast forwarding enabled by proxyPortFwdOn		 (SPR #71656)01m,05nov01,vvv  fixed transfer of broadcasts across networks (SPR #70768)01l,15oct01,rae  merge from truestack ver 01p, base o1h (cleanup)01k,26feb01,spm  fixed transfer of broadcasts across networks (SPR #31718)0ij,07feb01,spm  added merge record for 30jan01 update from version 01i of                 tor2_0_x branch (base 01h) and fixed modification history;                 removed excess code from merge01i,30jan01,ijm  merged SPR# 28602 fixes (proxy ARP services are obsolete);                 added permanent flag to proxy ARP entries and fixed handling                 of ARP requests for local addresses01h,09feb99,fle  doc: put the library description chart inside .CS / .CE                 markups		 + and removed dash line to stay in the INTERNAL field01g,14dec97,jdi  doc: cleanup.01f,25oct97,kbw  fixed man page problems found in beta review01e,15apr97,kbw  fixed minor format problems in man page01d,29jan97,vin  replaced routeCmd with proxyRouteCmd which adds an 		 explicit network mask of 0xffffffff. Always added		 the route before adding the arp entry.01c,22nov96,vin  added cluster support replaced m_gethdr(..) with 		 mHdrClGet(..).01h,11aug93,jmm  Changed ioctl.h and socket.h to sys/ioctl.h and sys/socket.h01g,13nov92,dnw  added include of semLibP.h01f,21sep92,jdi  Documentation cleanup.01e,16aug92,elh  documentation changes.01d,15jun92,elh  changed parameters, general cleanup. 01c,04jun92,ajm  quieted ansi warnings on netTypeAdd parameters01b,26may92,rrr  the tree shuffle		 -changed includes to have absolute path from h/01a,20sep91,elh	 written.*//*DESCRIPTIONThis library implements a proxy ARP server that uses the Address ResolutionProtocol (ARP) to make physically distinct networks appear as one logicalnetwork (that is, the networks share the same address space). The serverforwards ARP messages between the separate networks so that hosts on themain network can access hosts on the proxy network without altering theirrouting tables.The proxyArpLibInit() initializes the server and adds this library to theVxWorks image.  This happens automatically if INCLUDE_PROXY_SERVER isdefined at the time the image is built.  The proxyNetCreate() andproxyNetDelete() routines will enable and disable the forwarding of ARPmessages between networks. The proxyNetShow() routine displays the currentset of proxy networks and the main network and known clients for each.By default, this server automatically adds a client when it first detectsan ARP message from that host. A VxWorks target can also register asa client with the proxyReg() routine and remove that registration withthe proxyUnreg() routine. See the proxyLib manual pages for details.To minimize traffic on the main network, the proxy server will only forwardbroadcast packets to the specified destination ports visible with theproxyPortShow() routine.  The proxyPortFwdOn() and proxyPortFwdOff() routineswill alter the current settings. Initially, broadcast forwarding is notactive for any ports.INCLUDE FILES: proxyArpLib.hSEE ALSO: proxyLib, RFC 925, RFC 1027, RFC 826INTERNALProxy Server StructuresThe proxy server must hold information about each of the proxy networks.A proxy network is defined by a proxy network structure (PROXY_NET) whichcontains the local interface addresses for each network and a list of thecurrent proxy clients. The proxyNetList variable stores all of the proxynetwork information.Proxy ClientsA proxy client corresponds to a host on a proxy network.  The proxy serverstores information about each proxy client in the PROXY_CLNT structure.By default, the server adds a client when it detects the initial ARP messagefrom the host. Clients may also be added and deleted explicitly withproxyLib routines.The proxy client information is available as both a hash table and a linkedlist. The hash table (called clientTbl) provides fast lookup using theclient IP address as the key.  Each proxy network structure provides athird method for accessing a particular proxy client on that network throughthe clientList element of the structure.The combined collection of proxy ARP structures (i.e the proxyNetList, andthe clientTbl) are protected by a single mutual exclusion semaphore.Registering and Unregistering Proxy ClientsA vxWorks target can explicitly register and unregister itself as a proxy client by generating and sending messages of an unused Ethernettype to the server. These messages use the format given by the PROXY_MSGstructure and have either operation type PROXY_REG or PROXY_UNREG.  Ifthe proxy server receives one of these messages it performs the appropriateaction by either adding or deleting the node as a proxy client.  The servernotifies the client on completion by sending back an ACK message. By default, the proxy server registers a client when it detects the initialARP message from a host and never removes that registration. As a result,the proxy client component is normally not required. The explicit registrationwhich that library allows is only necessary for protocols such as BOOTPthat may require proxy ARP services before configuring an interface withan IP address (which sends a gratuitous ARP message).There are two main hooks into this library from the network modules.  Thein_arpinput() routine in if_ether.c uses the first hook to handle specialARP processing.  When the server is active, that routine processes all validARP messages as follows:                    if (proxyArpHook == NULL ||                        (* proxyArpHook)                         ( (struct arpcom *)m->m_pkthdr.rcvif, m) == FALSE)                        in_arpinput(m);The proxyArpHook function pointer uses the proxyArpInput() routine to forwardany ARP requests or replies as appropriate. That routine typically returnsFALSE since the standard ARP processing handles most cases correctly.The ipintr() routine in ip_input.c uses a similar function pointer(proxyBroadcastHook) so that the proxy ARP server may forward selectedbroadcast packets to and from the main network with the proxyBroadcastInputroutine.VXWORKS AE PROTECTION DOMAINSUnder VxWorks AE, the functions you assign for either 'proxyArpHook' or 'proxyBroadcastHook' must be valid within the kernel protection domain. This restriction does not apply under non-AE versions of VxWorks.  Structure Chart:.CS				 v	      	  v		   	    proxyArpLibInit  proxyNetShow	       (in_arpinput)		     v ----------------proxyArpInput------------------------------------------/     /			|  	        \ \      	        \        \      v			|		|  |  			 |	  || proxyArpReplyFwd------|---------------|--|---------------------|-------->|             |         v		|  |  	                 |        |v	      | proxyArpRequestFwd---- -|--|---------------------|-------->proxyArpReply |  / 	 		|  |     	         |        |       |      | | 	 		|  |     	         |        |       v      v v  		        |  |                     |        |      proxyArpSend    	    		|  |     	         |        |					|  |     	         |        |					|  |  		   	 |        |	(ipintr)			|  |     	         |        |           v				|  |     	         |        |  --proxyBroadcastInput-----------------|-->     	         |        | /           |		   \	        |  |     	         |        | v     	     ------   	    <-----------/  |     (do_protocol)	 |        |proxyBroadcast |	    |		   |      	v        |        |               |	    |		   |   proxyMsgInput----->        |             |----/    	    |		   |   	       	       | |        |             |		    |		   |                   | |        |             |	            |		   v            |      | |        |             |              |		proxyIsAMainNet |      | |        |             |	    v       |	        		| /---/  |        |	     |proxyNetCreate|   	       		| |      |        |	     |      v	    | 		    	  	| |      v        |	     |proxyNetDelete|       ----------------------|-proxyClientAdd|	     |	    v 	    v      / 			| v     v	  |	     |	    proxyNetFind<-/			|proxyClientDelete|	     |						v       v         |	     \						proxyClientFind<-/	      ------------\     v	  		  |		v		   vproxyPortFwdOn	          |        proxyPortFwdOff	proxyPortShow      |	                  |         |     		  |    |      \------------------>|<-------/<--------------------/     v       			  v	   			 proxyPortPrint        	  proxyPortTblFind.CE*//* includes */#include "vxWorks.h"#include "netinet/if_ether.h"#include "proxyArpLib.h"#include "sys/socket.h"#include "net/if_arp.h"#include "net/route.h"#include "net/if.h"#include "net/mbuf.h"#include "netinet/in_systm.h"#include "netinet/ip.h"#include "sys/ioctl.h"#include "netinet/in.h"#include "errno.h"#include "hashLib.h"#include "netinet/ip_var.h"#include "netinet/udp.h"#include "netinet/udp_var.h"#include "inetLib.h"#include "string.h"#include "stdlib.h"#include "logLib.h"#include "arpLib.h"#include "routeLib.h"#include "stdio.h"#include "net/unixLib.h"#include "net/if_subr.h"#include "private/semLibP.h"#include "memPartLib.h"#ifdef VIRTUAL_STACK#include "netinet/vsLib.h"#include "netinet/vsProxyArp.h"#endif/* defines */#define CLNT_TBL_SZ		8	/* default client table sz 2^8	*/#define PORT_TBL_SZ		8	/* default port table sz 2^8	*//* useful macros */#define proxyIsAproxyNet(pAddr)	((proxyNetFind (pAddr) == NULL) ? 	\					(FALSE) : (TRUE))#define proxyIsAClient(pAddr)	((proxyClientFind ((pAddr)) == NULL) ?	\					(FALSE) : (TRUE))#define NODE_TO_CLIENT(pNode)	(PROXY_CLNT *) 			\			((u_long)(pNode + 1) - sizeof (PROXY_CLNT))					/* fill in sockaddr_in structure */#define SIN_FILL(pSin, family, addr, port)				\    {									\    bzero ((caddr_t) (pSin), sizeof (struct sockaddr_in));		\    (pSin)->sin_len		= sizeof(struct sockaddr_in);		\    (pSin)->sin_family		= (family);				\    (pSin)->sin_addr.s_addr	= (addr);				\    (pSin)->sin_port		= (port);				\    }/* globals */#ifndef VIRTUAL_STACK/* debug variables */BOOL		arpDebug              = FALSE;	/* ARP debug messages */BOOL		proxyArpVerbose	      = FALSE;	/* proxy ARP messages */BOOL		proxyBroadcastVerbose = FALSE;	/* broadcast messages *//* enabling variables */BOOL		proxyBroadcastFwd     = TRUE;	/* forward broadcasts */BOOL		arpRegister	      = TRUE;	/* use ARP message to */					 	/* register clients */int		clientTblSizeDefault  = CLNT_TBL_SZ; /* default size  */int		portTblSizeDefault    = PORT_TBL_SZ; /* default size  *//* locals *//* * proxy semahore & semid and options and structures * protected by proxySem (clientTbl, proxyNetList) */LOCAL SEMAPHORE	proxySem;			/* proxy ARP semphore */LOCAL SEM_ID	proxySemId 	    = &proxySem;int		proxySemOptions	    = (SEM_Q_FIFO | SEM_DELETE_SAFE );LOCAL HASH_ID	clientTbl	    = NULL;	/* hashed clients     */LOCAL LIST	proxyNetList;			/* proxy network list *//* port table sem semid and options, and port table*/LOCAL SEMAPHORE	portTblSem;LOCAL SEM_ID    portTblSemId	    = &portTblSem;int		portTblSemOptions   = (SEM_Q_FIFO | SEM_DELETE_SAFE );LOCAL HASH_ID	portTbl	      	    = NULL;	/* hashed ports	      */LOCAL BOOL	proxyLibInitialized = FALSE;	/* server initialized */LOCAL int	hashKeyArg 	    = 425871; 	/* hash key 	      */#endif /* VIRTUAL_STACK *//* forward declarations */IMPORT FUNCPTR		proxyArpHook;IMPORT FUNCPTR		proxyBroadcastHook;IMPORT int		in_cksum ();IMPORT int		in_broadcast ();/* locals */							/* hook routines */LOCAL void proxyBroadcastInput (struct mbuf *pMbuf, struct ifnet * pIf);LOCAL BOOL proxyArpInput (struct arpcom * pArpcom, struct mbuf * pMbuf);LOCAL void proxyMsgInput (struct arpcom * pArpcom, struct mbuf * pMbuf, 			  int len);LOCAL void proxyArpReply (struct arpcom * pArpcom, struct mbuf * pMbuf,			  int proto);LOCAL void proxyArpRequestFwd (struct in_addr * pClientAddr, 			       struct mbuf * pMbuf);LOCAL void proxyArpReplyFwd (PROXY_CLNT * pClient, struct mbuf * pMbuf);LOCAL void proxyArpSend (struct ifnet * pIf, int op, int proto,		         u_char * srcProtoAddr, u_char * dstHwAddr,			 u_char * dstProtoAddr);LOCAL void proxyBroadcast (struct ifnet * pIf, struct mbuf * pMbuf, int ttl);LOCAL PROXY_NET * proxyNetFind (struct in_addr * pProxyAddr);LOCAL PROXY_CLNT * proxyClientFind (struct in_addr * clientAddr);LOCAL BOOL proxyIsAMainNet (struct in_addr * pMainAddr);LOCAL PORT_NODE * portTblFind (int port);LOCAL BOOL proxyPortPrint (PORT_NODE * pPort);LOCAL STATUS proxyRouteCmd (int destInetAddr, int gateInetAddr, int ioctlCmd); LOCAL STATUS proxyClientAdd (struct arpcom * pArpcom,                             struct in_addr * pClientAddr,                             u_char * pClientHwAddr);LOCAL STATUS proxyClientDelete (struct in_addr * pClientAddr);LOCAL void proxyClientRemove (PROXY_CLNT * pClient);LOCAL M_BLK_ID proxyPacketDup (M_BLK_ID pMblk);/********************************************************************************* proxyArpLibInit - initialize proxy ARP** This routine starts the proxy ARP server by initializing the required data* structures and installing the necessary input hooks.  It should be called*  only once; subsequent calls have no effect. The <clientSizeLog2> and* <portSizeLog2> parameters specify the internal hash table sizes. Each* must be equal to a power of two, or zero to use a default size value.** RETURNS: OK, or ERROR if unsuccessful.*/STATUS proxyArpLibInit    (    int		clientSizeLog2,		/* client table size as power of two */    int		portSizeLog2		/* port table size as power of two   */    )    {    if (proxyLibInitialized)		/* already initialized */	return (OK);#ifdef VIRTUAL_STACK/* need to initialize vars */arpDebug              = FALSE;  /* ARP debug messages */proxyArpVerbose       = FALSE;  /* proxy ARP messages */proxyBroadcastVerbose = FALSE;  /* broadcast messages *//* enabling variables */proxyBroadcastFwd     = TRUE;   /* forward broadcasts */arpRegister           = TRUE;   /* use ARP message to */				/* to register clients */clientTblSizeDefault  = CLNT_TBL_SZ; /* default size  */portTblSizeDefault    = PORT_TBL_SZ; /* default size  */proxySemId          = &proxySem;proxySemOptions     = (SEM_Q_FIFO | SEM_DELETE_SAFE );clientTbl           = NULL;     /* hashed clients     *//* port table sem semid and options, and port table*/portTblSemId        = &portTblSem;portTblSemOptions   = (SEM_Q_FIFO | SEM_DELETE_SAFE );portTbl             = NULL;     /* hashed ports       */proxyLibInitialized = FALSE;    /* server initialized */hashKeyArg          = 425871;   /* hash key           */#endif /* VIRTUAL_STACK */    /* use default values if zero passed */    clientSizeLog2 = (clientSizeLog2 == 0) ? clientTblSizeDefault :					     clientSizeLog2;    portSizeLog2   = (portSizeLog2 == 0) ? portTblSizeDefault : portSizeLog2;    lstInit (&proxyNetList);    if ((proxySemId = semMCreate (proxySemOptions)) == NULL) 	return (ERROR);    if ((portTblSemId = semMCreate (portTblSemOptions)) == NULL)	{	semDelete (proxySemId);	return (ERROR);	}    if ((clientTbl = hashTblCreate (clientSizeLog2, hashKeyCmp, hashFuncModulo,				    hashKeyArg)) == NULL)	{	semDelete (proxySemId);	semDelete (portTblSemId);	return (ERROR);	}    if ((portTbl = hashTblCreate (portSizeLog2, hashKeyCmp, hashFuncModulo,				  hashKeyArg)) == NULL)	{	semDelete (proxySemId);	semDelete (portTblSemId);	hashTblDelete (clientTbl);	return (ERROR);	}    proxyBroadcastHook = (FUNCPTR) proxyBroadcastInput;    netTypeAdd (PROXY_TYPE, (FUNCPTR) proxyMsgInput);    proxyArpHook = (FUNCPTR) proxyArpInput;    proxyLibInitialized = TRUE;    return (OK);    }/********************************************************************************* proxyArpInput - proxy ARP input hook** The proxyArpInput routine completes the gateway transparency between a* proxy network and the main network, allowing the physically distinct* hosts to share the same logical subnet. The standard ARP processing is* able to manage all ARP messages except requests from a proxy client for* a host on the main network. The arpintr routine in the if_ether.c module* calls this routine to relay those requests to the destination network and* return the replies. The routine returns TRUE for those messages to prevent* redundant (and usually incorrect) processing by the in_arpinput routine.** The <pArpcom> parameter identifies the interface which received the* ARP message contained in the <pMbuf> mbuf chain.** RETURNS: TRUE if message handled, or FALSE otherwise.** NOMANUAL*/LOCAL BOOL proxyArpInput    (    struct arpcom *		pArpcom,	/* arpcom structure 	*/    struct mbuf *		pMbuf		/* mbuf chain		*/    )    {    struct ether_arp * 	pArp; 		/* ARP message */    struct in_addr 	srcAddr; 	/* source address */    struct in_addr 	dstAddr; 	/* destination address */    u_short 		arpOp; 		/* ARP operation */    PROXY_CLNT * 	pClient; 	/* registration of proxy client */    PROXY_NET *         pNet;           /* proxy network */    /*     * Extract information from the ARP message which the arpintr()     * routine has validated.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久97三级| 麻豆成人免费电影| 欧美一级高清大全免费观看| 青青国产91久久久久久| 久久免费国产精品| 欧美性色综合网| 美美哒免费高清在线观看视频一区二区 | 国产欧美精品区一区二区三区| 国产suv精品一区二区6| 日韩高清在线不卡| 一区二区三区资源| 日韩西西人体444www| 国产成人精品亚洲日本在线桃色| 一区二区免费看| 久久久国产精品午夜一区ai换脸| 色成年激情久久综合| 成人av高清在线| 国产成人免费视频网站| 精品一二三四区| 日韩和欧美的一区| 亚洲一区国产视频| 亚洲欧美日韩中文字幕一区二区三区| 久久久久久亚洲综合影院红桃| 欧美一区二区在线看| 欧美午夜一区二区| 91久久精品一区二区| 94色蜜桃网一区二区三区| 懂色中文一区二区在线播放| 国产资源在线一区| 韩国成人在线视频| 国产综合色产在线精品| 另类小说欧美激情| 免费观看91视频大全| 视频一区二区中文字幕| 午夜精品成人在线视频| 亚洲成人你懂的| 亚洲成人免费在线观看| 天天色天天操综合| 蜜桃视频在线观看一区| 奇米精品一区二区三区四区| 日本美女一区二区三区视频| 日韩va欧美va亚洲va久久| 美女网站在线免费欧美精品| 久久精品国内一区二区三区| 精品一区二区三区香蕉蜜桃 | 成人黄页在线观看| 波波电影院一区二区三区| av影院午夜一区| 欧美系列一区二区| 欧美一区永久视频免费观看| 91麻豆精品国产91久久久资源速度| 欧美乱妇一区二区三区不卡视频| 欧美精三区欧美精三区| 欧美一级淫片007| 久久久天堂av| 中文字幕一区二区三区乱码在线| 成人欧美一区二区三区| 一区二区三区毛片| 日韩综合在线视频| 狠狠久久亚洲欧美| 99麻豆久久久国产精品免费优播| 91成人看片片| 日韩一级欧美一级| 日本一区二区成人| 亚洲午夜电影在线观看| 午夜电影久久久| 国产综合色视频| 色94色欧美sute亚洲13| 7777精品伊人久久久大香线蕉最新版 | 精一区二区三区| 成人美女在线视频| 欧美日韩高清影院| 国产日韩欧美制服另类| 亚洲精品国产a| 久久国产尿小便嘘嘘尿| jlzzjlzz亚洲日本少妇| 在线成人午夜影院| 国产精品久久午夜夜伦鲁鲁| 午夜精品久久久久久久久| 亚洲自拍都市欧美小说| 99久久精品费精品国产一区二区| 中文字幕一区二区三中文字幕| 亚洲国产中文字幕| 亚洲国产精品人人做人人爽| 国产一区二区福利视频| 在线观看免费视频综合| 久久久久久久久久电影| 亚洲大型综合色站| 成人一区二区三区中文字幕| 欧美嫩在线观看| 中文字幕在线观看一区二区| 日本不卡视频一二三区| 波多野结衣精品在线| 日韩女优av电影| 亚洲国产欧美一区二区三区丁香婷| 日韩毛片一二三区| 久久狠狠亚洲综合| 欧美性生活一区| 国产欧美日韩不卡免费| 3d成人动漫网站| 亚洲精品你懂的| 国产乱码精品一品二品| 欧美理论片在线| 亚洲激情欧美激情| 国产成人啪午夜精品网站男同| 91小视频在线| 欧美国产日本视频| 精品在线播放免费| 69堂国产成人免费视频| 亚洲人吸女人奶水| 国产不卡视频一区二区三区| 日韩欧美自拍偷拍| 午夜精品一区二区三区电影天堂 | 91在线视频观看| 日韩欧美二区三区| 亚洲高清中文字幕| 国产精品影视在线观看| 激情综合网最新| 欧美xxxxxxxxx| 亚洲国产精品一区二区www| 99r精品视频| 欧美激情一区二区三区在线| 1区2区3区国产精品| 麻豆91精品视频| 成人午夜免费视频| 欧美一卡在线观看| 日韩国产欧美三级| 欧美日韩色一区| 亚洲大片精品永久免费| 99久久99久久精品国产片果冻| 国产亚洲欧美日韩俺去了| 国产一区二区久久| 亚洲精品一区二区在线观看| 强制捆绑调教一区二区| 欧美一区二区三区在线| 伦理电影国产精品| 精品少妇一区二区| 国产综合色产在线精品| 国产无一区二区| 不卡的av电影| 一区二区三区美女视频| 在线观看www91| 午夜欧美视频在线观看| 在线观看欧美精品| 日韩高清在线不卡| 精品福利一区二区三区| 国产精品资源在线看| 久久精品欧美日韩| 国产a级毛片一区| 中文字幕一区二区三区在线播放| 色综合天天视频在线观看| 亚洲综合久久久| 777a∨成人精品桃花网| 精品一二三四区| 国产精品私房写真福利视频| 成人激情免费电影网址| 亚洲乱码中文字幕| 欧美日韩中文字幕一区二区| 日韩综合在线视频| 国产三区在线成人av| 99re这里都是精品| 亚洲码国产岛国毛片在线| 91最新地址在线播放| 午夜视频一区在线观看| 欧美岛国在线观看| 97se亚洲国产综合在线| 午夜精品久久久久| 国产亲近乱来精品视频| 91在线码无精品| 日韩中文字幕亚洲一区二区va在线 | 首页综合国产亚洲丝袜| 欧美精品一区二区三区视频| 91在线观看成人| 午夜久久久久久久久久一区二区| 欧美成人性战久久| 91网站在线观看视频| 亚洲成人免费影院| 国产欧美一区二区精品秋霞影院 | 欧美人狂配大交3d怪物一区| 久久99久久精品| 成人激情午夜影院| www.色综合.com| 亚洲国产综合视频在线观看| 欧美专区亚洲专区| 国产夫妻精品视频| 亚洲自拍都市欧美小说| 日韩理论片中文av| 欧美亚洲一区二区在线| 久久久国产精品午夜一区ai换脸| 91丨九色丨蝌蚪丨老版| 精品一区二区三区在线观看| 久久伊99综合婷婷久久伊| 国产自产2019最新不卡| 亚洲精品国产第一综合99久久| 久久午夜色播影院免费高清| 色综合久久天天综合网| 国产在线不卡视频| 国产视频一区二区在线| 精品视频一区三区九区| 国产91精品久久久久久久网曝门 |