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

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

?? pinglib.c

?? vxworks的完整的源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* pingLib.c - Packet InterNet Groper (PING) library *//* Copyright 1994 - 2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01r,22apr02,rae  Note that PING_OPT_DONTROUTE affects pinging localhost                 (SPR #72917), other minor changes01q,11mar02,rae  Print stats when task killed (SPR #73570)01p,08jan02,rae  Don't print error messages when PING_OPT_SILENT (SPR #69537)01o,15oct01,rae  merge from truestack ver 01q, base 01k (SPRs 67440,                 30151, 66062, etc.)01n,30oct00,gnn  Added PING_OPT_NOHOST flag to deal with SPR 2276601m,08nov99,pul  T2 cumulative patch 201l,22sep99,cno  corrected ping error for pingRxPrint() (SPR22571)01k,14mar99,jdi  doc: removed refs to config.h and/or configAll.h (SPR 25663).01j,12mar99,p_m  Fixed SPR 8742 by documentating ping() configuration global                 variables.01i,05feb99,dgp  document errno values01h,17mar98,jmb  merge jmb patch of 04apr97 from HPSIM: corrected                 creation/deletion of task delete hook.01g,30oct97,cth  changed stack size of tPingTxn from 3000 to 6000 (SPR 8222).01f,26aug97,spm  removed compiler warnings (SPR #7866)01e,30sep96,spm  corrected ping error for little-endian machines (SPR #4235)01d,13mar95,dzb  changed to use free() instead of cfree() (SPR #4113)01c,24jan95,jdi  doc tweaks01b,10nov94,rhp  minor edits to man pages01a,25oct94,dzb  written*//*DESCRIPTIONThis library contains the ping() utility, which tests the reachabilityof a remote host.The routine ping() is typically called from the VxWorks shell to check thenetwork connection to another VxWorks target or to a UNIX host.  ping()may also be used programmatically by applications that require such a test.The remote host must be running TCP/IP networking code that responds toICMP echo request packets.  The ping() routine is re-entrant, thus maybe called by many tasks concurrently.The routine pingLibInit() initializes the ping() utility and allocatesresources used by this library.  It is called automatically whenINCLUDE_PING is defined.*//* includes */#include "vxWorks.h"#include "string.h"#include "stdioLib.h"#include "wdLib.h"#include "netLib.h"#include "sockLib.h"#include "inetLib.h"#include "semLib.h"#include "taskLib.h"#include "hostLib.h"#include "ioLib.h"#include "tickLib.h"#include "taskHookLib.h"#include "sysLib.h"#include "vxLib.h"#include "netinet/in_systm.h"#include "netinet/ip.h"#include "netinet/ip_icmp.h"#include "netinet/icmp_var.h"#include "pingLib.h"#include "errnoLib.h"#include "kernelLib.h"#ifdef VIRTUAL_STACK#include "netinet/vsLib.h"#endif /* VIRTUAL_STACK *//* defines */#define pingError(pPS)	{ pPS->flags |= PING_OPT_SILENT; goto release; }/* globals */int	_pingTxLen = 64;			/* size of icmp echo packet */int	_pingTxInterval = PING_INTERVAL;	/* packet interval in seconds */int	_pingTxTmo = PING_TMO;			/* packet timeout in seconds */extern	int errno;/* locals */LOCAL PING_STAT	*	pingHead = NULL;	/* ping list head */LOCAL SEM_ID		pingSem = NULL;		/* mutex for list access *//* static forward declarations */LOCAL STATUS pingRxPrint (PING_STAT *pPS, int len, struct sockaddr_in *from,                          ulong_t now);LOCAL void pingFinish (WIND_TCB *);/********************************************************************************* pingLibInit - initialize the ping() utility** This routine allocates resources used by the ping() utility.* It is called automatically when INCLUDE_PING is defined.** RETURNS:* OK*/STATUS pingLibInit (void)    {    if (pingSem == NULL)			/* already initialized ? */	{	if ((pingSem = semMCreate (SEM_Q_PRIORITY | SEM_DELETE_SAFE |	    SEM_INVERSION_SAFE)) == NULL)	    return (ERROR);        }    return (OK);    }/********************************************************************************* ping - test that a remote host is reachable** This routine tests that a remote host is reachable by sending ICMP* echo request packets, and waiting for replies.  It may called from* the VxWorks shell as follows:* .CS*    -> ping "remoteSystem", 1, 0* .CE* where <remoteSystem> is either a host name that has been previously added* to the remote host table by a call to hostAdd(), or an Internet address in* dot notation (for example, "90.0.0.2").** The second parameter, <numPackets>, specifies the number of ICMP packets* to receive from the remote host.  If <numPackets> is 1, this routine waits* for a single echo reply packet, and then prints a short message* indicating whether the remote host is reachable.  For all other values* of <numPackets>, timing and sequence information is printed as echoed* packets are received.  If <numPackets> is 0, this routine runs continuously.* * If no replies are received within a 5-second timeout period, the* routine exits.  An ERROR status is returned if no echo replies* are received from the remote host.** The following flags may be given through the <options> parameter:* .iP PING_OPT_SILENT* Suppress output.  This option is useful for applications that * use ping() programmatically to examine the return status.* .iP PING_OPT_DONTROUTE* Do not route packets past the local network.  This also prevents pinging* local addresses (i.e. the IP address of the host itself).  The 127.x.x.x * addresses will still work however.* .iP PING_OPT_NOHOST* Suppress host lookup.  This is useful when you have the DNS resolver* but the DNS server is down and not returning host names.* .iP PING_OPT_DEBUG* Enables debug output.* .RS 4 4* \&NOTE: The following global variables can be set from the target shell* or Windsh to configure the ping() parameters:* .iP _pingTxLen * Size of the ICMP echo packet (default 64).* .iP _pingTxInterval* Packet interval in seconds (default 1 second).* .iP _pingTxTmo* Packet timeout in seconds (default 5 seconds).**.RE* * RETURNS:* OK, or ERROR if the remote host is not reachable.** ERRNO: EINVAL, S_pingLib_NOT_INITIALIZED, S_pingLib_TIMEOUT**/STATUS ping    (    char *		host,		/* host to ping */    int			numPackets,	/* number of packets to receive */    ulong_t		options		/* option flags */    )    {    PING_STAT *		pPS;			/* current ping stat struct */    struct sockaddr_in	to;			/* addr of Tx packet */    struct sockaddr_in	from;			/* addr of Rx packet */    int			fromlen = sizeof (from);/* size of Rx addr */    int			ix = 1;			/* bytes read */    int			txInterval;		/* packet interval in ticks */    STATUS		status = ERROR;		/* return status */    struct fd_set	readFd;    struct timeval	pingTmo;    ulong_t		now;    int			sel;#ifndef ALT_PING_PAR_SEMANTIC    if (numPackets < 0)                         /* numPackets positive ? */        {        errno = EINVAL;        return (ERROR);        }#else /* alternative parameter semantic for numPackets */    if (numPackets < -1)		/* numPackets positive or -1 ? */	{	errno = EINVAL;	return (ERROR);	}    if (numPackets == 0)    	numPackets = 3;		/* don't do infinite by default */    if (numPackets == -1)    	numPackets = 0;		/* infinite */#endif /* ALT_PING_PAR_SEMANTIC */    /* allocate size for ping statistics/info structure */    if ((pPS = (PING_STAT *) calloc (1, sizeof (PING_STAT))) == NULL)	return (ERROR);#ifdef VIRTUAL_STACK    virtualStackIdCheck();    pPS->vsid = myStackNum;#endif /* VIRTUAL_STACK */    semTake (pingSem, WAIT_FOREVER);		/* get access to list */    pPS->statNext = pingHead;			/* push session onto list */    if (pingHead == NULL && !(options & PING_OPT_SILENT))        if (taskDeleteHookAdd ((FUNCPTR) pingFinish) == ERROR)	    {	    free ((char *) pPS);	    semGive (pingSem);			/* give up access to list */            if (options & PING_OPT_DEBUG)            	printf ("ping: unable to add task Delete hook\n");	    return (ERROR);	    }    pingHead = pPS;    semGive (pingSem);				/* give up access to list */    pPS->tMin = 999999999;			/* init min rt time */    pPS->numPacket = numPackets;		/* save num to send */    pPS->flags = options;			/* save flags field */    pPS->clkTick = sysClkRateGet ();		/* save sys clk rate */    txInterval = _pingTxInterval * pPS->clkTick;/* init interval value */    pingTmo.tv_sec = _pingTxTmo;    pingTmo.tv_usec = 0;    pPS->pBufIcmp = (struct icmp *) pPS->bufTx;	/* pointer to icmp header out */    pPS->pBufTime = (ulong_t *) (pPS->bufTx + 8);/* pointer to time out */    pPS->idRx = taskIdSelf ();			/* get own task Id  */    /* initialize the socket address struct */    to.sin_family = AF_INET;    if ((to.sin_addr.s_addr = inet_addr (host)) == (u_long) ERROR)	{	if ((to.sin_addr.s_addr = hostGetByName (host)) == (u_long) ERROR)	    {            if (!(options & PING_OPT_SILENT))	        printf ("ping: unknown host %s\n", host);	    pingError (pPS);	    }	inet_ntoa_b (to.sin_addr, pPS->toInetName);        }        strcpy (pPS->toHostName, host);		   /* save host name */    _pingTxLen = max (_pingTxLen, PING_MINPACKET); /* sanity check global */    _pingTxLen = min (_pingTxLen, PING_MAXPACKET); /* sanity check global */    pPS->dataLen = _pingTxLen - 8;		   /* compute size of data */    /* open raw socket for ICMP communication */    if ((pPS->pingFd = socket (AF_INET, SOCK_RAW, ICMP_PROTO)) < 0)	pingError (pPS);    if (options & PING_OPT_DONTROUTE)		/* disallow packet routing ? */        if (setsockopt (pPS->pingFd, SOL_SOCKET, SO_DONTROUTE, (char *) &ix,	    sizeof (ix)) == ERROR)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区三区不卡| 久久免费精品国产久精品久久久久| 2欧美一区二区三区在线观看视频| 一区二区中文字幕在线| 久久狠狠亚洲综合| 色一区在线观看| 久久日一线二线三线suv| 亚洲一区二区三区四区在线| 国产·精品毛片| 日韩欧美一区二区在线视频| 亚洲男人的天堂一区二区| 国产东北露脸精品视频| 欧美一区二区三级| 亚洲第一激情av| 色综合中文字幕国产| 精品国产乱码久久久久久久| 婷婷激情综合网| 在线视频一区二区免费| 中文字幕日韩精品一区| 国产在线观看免费一区| 欧美自拍丝袜亚洲| 国产在线精品国自产拍免费| 久久99精品国产91久久来源| 91久久精品日日躁夜夜躁欧美| 国产尤物一区二区| 91精品黄色片免费大全| 亚洲电影你懂得| 色国产精品一区在线观看| 国产欧美一区二区三区鸳鸯浴 | 亚洲欧洲日韩av| 国产真实乱对白精彩久久| 日韩欧美自拍偷拍| 久久精品国产一区二区| 欧美成人国产一区二区| 日韩极品在线观看| 91麻豆精品国产自产在线观看一区 | 一区二区高清视频在线观看| 岛国一区二区在线观看| 国产女人18水真多18精品一级做| 国产资源精品在线观看| 久久久www成人免费毛片麻豆| 国产综合久久久久影院| 2019国产精品| 成人综合在线观看| 国产精品美女久久久久久久久| 成人美女视频在线看| 中文字幕巨乱亚洲| 99久久久无码国产精品| 一区二区三区在线免费视频| 在线看国产日韩| 五月天激情小说综合| 91精品国产欧美日韩| 麻豆传媒一区二区三区| 精品久久久久久最新网址| 国产在线视频精品一区| 国产日韩成人精品| 成人国产视频在线观看 | 91精品国产综合久久精品| 日韩二区在线观看| 精品国产乱码久久久久久久| 国产大陆a不卡| 最新中文字幕一区二区三区 | 成人高清伦理免费影院在线观看| 国产精品污网站| 色综合天天综合网天天狠天天| 亚洲国产精品视频| 欧美一级黄色片| 国产成人免费视频网站高清观看视频 | 91国内精品野花午夜精品| 午夜精品久久久久久久久| 日韩一区二区三区在线| 国产精品亚洲一区二区三区妖精 | 日本亚洲最大的色成网站www| 日韩免费高清av| 国产不卡视频在线观看| 亚洲日本一区二区三区| 欧美久久久久久久久久 | 亚洲永久精品大片| 日韩亚洲欧美中文三级| 高清成人免费视频| 亚洲国产日韩综合久久精品| 日韩欧美国产精品| 99综合电影在线视频| 亚洲成人免费看| 久久先锋影音av| 色拍拍在线精品视频8848| 美女视频一区二区三区| 国产精品国产三级国产普通话蜜臀 | 欧美亚日韩国产aⅴ精品中极品| 日本女人一区二区三区| 日本一区二区成人在线| 欧美三级午夜理伦三级中视频| 极品美女销魂一区二区三区| 日韩美女精品在线| 欧美mv日韩mv亚洲| 色999日韩国产欧美一区二区| 免费成人在线视频观看| 国产精品国产三级国产aⅴ中文 | 欧美日韩一区小说| 国产999精品久久久久久绿帽| 亚洲国产综合在线| 国产女人aaa级久久久级| 欧美久久久久久久久| 不卡高清视频专区| 久久黄色级2电影| 亚洲综合免费观看高清完整版在线| 26uuu欧美| 欧美日韩另类国产亚洲欧美一级| 成人在线一区二区三区| 免费日韩伦理电影| 亚洲精品你懂的| 国产日产亚洲精品系列| 欧美一级一区二区| 色婷婷综合激情| 成人免费观看av| 精品系列免费在线观看| 亚洲图片欧美一区| 亚洲欧美日韩国产中文在线| 国产午夜精品理论片a级大结局 | www..com久久爱| 精品在线视频一区| 视频一区视频二区中文字幕| 一区二区中文视频| 国产亚洲精品bt天堂精选| 欧美一区二区在线免费播放 | 国产成人综合视频| 日本欧美一区二区| 午夜电影一区二区| 亚洲一区二区三区自拍| 亚洲人吸女人奶水| 国产精品全国免费观看高清| www国产亚洲精品久久麻豆| 欧美老年两性高潮| 欧美网站大全在线观看| 不卡高清视频专区| 成人国产精品免费网站| 国产一区二区视频在线| 秋霞国产午夜精品免费视频| 亚洲国产一区二区三区青草影视| 亚洲久本草在线中文字幕| 国产精品入口麻豆原神| 国产欧美一区二区精品性色 | 2欧美一区二区三区在线观看视频| 7799精品视频| 精品视频在线视频| 欧美午夜寂寞影院| 色丁香久综合在线久综合在线观看| 99re在线精品| 99视频在线观看一区三区| 成人听书哪个软件好| 丰满亚洲少妇av| 国产经典欧美精品| 国产精品羞羞答答xxdd| 国产自产高清不卡| 国产91丝袜在线18| 成人一区在线观看| 成人亚洲一区二区一| 国产suv精品一区二区三区| 国产精品资源在线| 成人午夜在线播放| 不卡一卡二卡三乱码免费网站| jlzzjlzz亚洲日本少妇| av亚洲精华国产精华精| 91丨九色porny丨蝌蚪| 91老师片黄在线观看| 欧洲精品在线观看| 欧美日本高清视频在线观看| 7777精品伊人久久久大香线蕉| 欧美一级在线观看| 久久午夜老司机| 国产精品免费aⅴ片在线观看| 国产精品的网站| 亚洲一区二区美女| 视频一区二区三区入口| 日本强好片久久久久久aaa| 久久99精品视频| 国产91富婆露脸刺激对白 | 麻豆精品在线视频| 国产在线观看一区二区| 成人精品亚洲人成在线| 色综合天天综合在线视频| 欧美年轻男男videosbes| 日韩欧美一区二区在线视频| 国产夜色精品一区二区av| 日韩美女视频一区二区| 图片区日韩欧美亚洲| 久久99久久99小草精品免视看| 国产精品一区二区在线看| 不卡一区在线观看| 欧美二区在线观看| 国产亚洲欧美日韩在线一区| 亚洲精品免费一二三区| 日产精品久久久久久久性色| 国产精品123| 欧美亚洲图片小说| 精品国产成人系列| 一区二区在线观看免费| 日日夜夜免费精品视频| 精品国产不卡一区二区三区| 亚洲人xxxx|