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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? gethostnamadr.c

?? vxworks的源代碼
?? C
字號(hào):
/* gethostnamadr.c - *//* Copyright 1984-2003 Wind River Systems, Inc. */#include "copyright_wrs.h"/* * Copyright (c) 1985, 1988 Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software *    must display the following acknowledgement: *	This product includes software developed by the University of *	California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. *//*modification history--------------------01f,16jan03,hsh  fixed buffer overflow in resolver lib (SPR #80386)01e,14jan03,rae  Merged from velocecp branch (SPR #83515)01d,05nov01,vvv  fixed compilation warnings01c,04sep01,vvv  fixed to correctly query multiple servers (SPR #67238);		 fixed compilation warnings01b,11feb96,jag  Fix the formating of the hostent structure in  _gethostbyname                 when invoked with an IP address. Cleaned up warnings.01a,13dec96,jag  Cleaned up and rename user I/F functions with the resolv		 prefix.  Man pages for these functions appear in resolvLib*/#include <vxWorks.h>#include <resolvLib.h>#include <semLib.h>#include <stdio.h>#include <ctype.h>#include <errno.h>#include <string.h>#include <stdlib.h>#include <inetLib.h>#define  MAX_RR_TTL  172800         /* Maximum of Two days in seconds */#if PACKETSZ > 1024#define	MAXPACKET	PACKETSZ#else#define	MAXPACKET	1024#endiftypedef union {	HEADER hdr;	u_char buf[MAXPACKET];} querybuf;typedef union {	int32_t	al;	char ac;} align;static int qcomp (struct in_addr **, struct in_addr **);LOCAL struct hostent *getanswer (querybuf *, int, int, struct hostent *, 				 char *, int);LOCAL struct hostent *getanswer(answer, anslen, iquery, pHost, hostbuf, bufLen)	querybuf *answer;	int anslen;	int iquery;	struct hostent   *  pHost;	char *           hostbuf;	int              bufLen;{	register HEADER *hp;	register u_char *cp;	register int n;	u_char *eom;	char *bp, **ap;	int type, class, ancount, qdcount;	int haveanswer, getclass = C_ANY;	char **hap;	char *hostbufEnd;	unsigned int rrttl;		/* RR time to live field */	eom = answer->buf + anslen;	/*	 * find first satisfactory answer	 */	hp = &answer->hdr;	ancount = ntohs(hp->ancount);	qdcount = ntohs(hp->qdcount);	bp = hostbuf;        hostbufEnd = hostbuf + bufLen - 1;	cp = answer->buf + sizeof(HEADER);	/* Process the "questions section" of the DNS response */	if (qdcount) {			    /* Check if this is a Pointer query */		if (iquery) {			if ((n = resolvDNExpand((u_char *)answer->buf,			    (u_char *)eom, (u_char *)cp, (u_char *)bp,			    bufLen)) < 0) {				errno = S_resolvLib_NO_RECOVERY;				return ((struct hostent *) NULL);			}			cp += n + QFIXEDSZ;			pHost->h_name = bp;			n = strlen(bp) + 1;			bp += n;			bufLen -= n;		} else			cp += __dn_skipname(cp, eom) + QFIXEDSZ;		while (--qdcount > 0)			cp += __dn_skipname(cp, eom) + QFIXEDSZ;	} else if (iquery) {		if (hp->aa)			errno = S_resolvLib_HOST_NOT_FOUND;		else			errno = S_resolvLib_TRY_AGAIN;		return ((struct hostent *) NULL);	}	/* Set everything up to process the resource records */	ap = pHost->h_aliases;	*ap = NULL;		hap = pHost->h_addr_list;	*hap = NULL;	pHost->h_ttl = MAX_RR_TTL;  /* Maximum of Two days in seconds */	haveanswer = 0;	while (--ancount >= 0 && cp < eom) {		if ((n = resolvDNExpand((u_char *)answer->buf, (u_char *)eom,		    (u_char *)cp, (u_char *)bp, bufLen)) < 0)			break;		cp += n;		type = _getshort(cp);		/* Get RR type field */ 		cp += sizeof(uint16_t);         /* Skip size of type field */		class = _getshort(cp);		/* Get RR class field */ 		cp += sizeof(uint16_t);         /* Skip size of class field */		rrttl = _getlong(cp);	        /* Get RR TTL field */		cp += sizeof(uint32_t);	        /* Skip size of TTL field */		n = _getshort(cp);		/* Get RR data length field */		cp += sizeof(uint16_t);		/* Skip size of length filed */		if (type == T_CNAME) {			cp += n;			if (ap >= & pHost->h_aliases [MAXALIASES-1])				continue;			*ap++ = bp;			n = strlen(bp) + 1;			bp += n;			bufLen -= n;			if (rrttl < pHost->h_ttl)			    pHost->h_ttl = rrttl;			continue;		}		if (iquery && type == T_PTR) {			if ((n = resolvDNExpand((u_char *)answer->buf,			    (u_char *)eom, (u_char *)cp, (u_char *)bp,			    bufLen)) < 0)				break;			cp += n;			pHost->h_name = bp;			if (rrttl < pHost->h_ttl)			    pHost->h_ttl = rrttl;			return (pHost);		}		if (iquery || type != T_A)  {#ifdef DEBUG			if (_res.options & RES_DEBUG)				printf("unexpected answer type %d, size %d\n",					type, n);#endif			cp += n;			continue;		}		if (haveanswer) {			if (n != pHost->h_length) {				cp += n;				continue;			}			if (class != getclass) {				cp += n;				continue;			}		} else {			pHost->h_length = n;			getclass = class;			pHost->h_addrtype = (class == C_IN) ? AF_INET : AF_UNSPEC;			if (!iquery) {			    pHost->h_name = bp;			    bp += strlen(bp) + 1;			    bufLen -= strlen(bp) + 1;			    if (rrttl < pHost->h_ttl)				pHost->h_ttl = rrttl;			}		}		bufLen -= sizeof(align) - ((u_long)bp % sizeof(align));		bp += sizeof(align) - ((u_long)bp % sizeof(align));		if (bp + n >= hostbufEnd) {#ifdef DEBUG			if (_res.options & RES_DEBUG)				printf("size (%d) too big\n", n);#endif			break;		}		bcopy(cp, *hap++ = bp, n);		bp +=n;		bufLen -=n;		cp += n;		haveanswer++;	}	if (haveanswer) {		*ap = NULL;		*hap = NULL;		if (_res.nsort) {			qsort(pHost->h_addr_list, haveanswer,			    sizeof(struct in_addr),			    (int (*)__P((const void *, const void *)))qcomp);		}		return (pHost);	} else {		errno = S_resolvLib_TRY_AGAIN;		return ((struct hostent *) NULL);	}}struct hostent *_gethostbyname(name, pHost, hostbuf, bufLen)	const char *name;	struct hostent *pHost;        char        *hostbuf;        int         bufLen;{	querybuf buf;	register const char *cp;	int n, i;	register struct hostent *hp;	char lookups[MAXDNSLUS];	/*	 * disallow names consisting only of digits/dots, unless	 * they end in a dot.	 */	if (isdigit((int) name[0]))		for (cp = name;; ++cp) {			if (!*cp) {				if (*--cp == '.')					break;				/*				 * All-numeric, no dot at the end.				 * Fake up a hostent as if we'd actually				 * done a lookup.				 */				pHost->h_addr_list[0] = hostbuf;				hostbuf += sizeof(uint32_t);											if (inet_aton((char *) name, 					      (struct in_addr *) pHost->h_addr_list[0]) 					   == ERROR) 				    {					errno = S_resolvLib_HOST_NOT_FOUND;					return((struct hostent *) NULL);				    }				pHost->h_name = (char *)name;				pHost->h_aliases[0] = NULL;				pHost->h_addrtype = AF_INET;				pHost->h_length = sizeof(uint32_t);				pHost->h_addr_list [1] = NULL;				/* Maximum of Two days in seconds */				pHost->h_ttl = MAX_RR_TTL;				return (pHost);			}			if (!isdigit((int) *cp) && *cp != '.') 				break;		}	bcopy(_res.lookups, lookups, sizeof lookups);	if (lookups[0] == '\0')		strncpy(lookups, "bf", sizeof lookups);	hp = (struct hostent *)NULL;		for (i = 0; i < MAXDNSLUS && hp == NULL && lookups[i]; i++) {		/*		 * if resolvSend has already contacted this server, lookup		 * is 'd' indicating 'done'. In this case the server will		 * not be contacted again and lookup is reset.		 */		if (_res.lookups [i] == 'd')		    {		    _res.lookups [i] = 'b';		    continue;		    }		switch (lookups[i]) {		case 'b':			/*		         * Set this server to be the active server - 			 * resolvSend will start its querying from this			 * server, skipping the previous servers			 */			_res.lookups[i] = 'a';			if ((n = resSearch(name, C_IN, T_A, buf.buf,			    sizeof(buf))) < 0) {#ifdef DEBUG				if (_res.options & RES_DEBUG)					printf("resSearch failed\n");#endif				break;			}			hp = getanswer(&buf, n, 0, pHost, hostbuf, bufLen );			/* 			 * Validate the address returned by the server - 			 * should not be a network or broadcast address			 * (SPR #67238)			 */			if (((hp->h_addr [3] & 0xff) == 0) ||			    ((hp->h_addr [3] & 0xff) == 0xff))			    {			    hp = NULL;			    errno = S_resolvLib_INVALID_ADDRESS;			    }			break;		}		if (_res.lookups [i] != 'f')		    _res.lookups [i] = 'b'; 	}	return (hp);}struct hostent *_gethostbyaddr(addr, len, type, pHost, hostbuf, bufLen)	const char *addr;	int len, type;	struct hostent *pHost;	char *           hostbuf;	int             bufLen;{	int n, i;	querybuf buf;	register struct hostent *hp;	char qbuf[MAXDNAME];	char lookups[MAXDNSLUS];		if (type != AF_INET)		return ((struct hostent *) NULL);	(void)sprintf(qbuf, "%u.%u.%u.%u.in-addr.arpa",		((unsigned)addr[3] & 0xff),		((unsigned)addr[2] & 0xff),		((unsigned)addr[1] & 0xff),		((unsigned)addr[0] & 0xff));	bcopy(_res.lookups, lookups, sizeof lookups);	if (lookups[0] == '\0')		strncpy(lookups, "bf", sizeof lookups);	hp = (struct hostent *)NULL;	for (i = 0; i < MAXDNSLUS && hp == NULL && lookups[i]; i++) {		/*		 * if resolvSend has already contacted this server, lookup		 * is 'd' indicating 'done'. In this case the server will		 * not be contacted again and lookup is reset.		 */		if (_res.lookups [i] == 'd')		    {		    _res.lookups [i] = 'b';		    continue;		    }		switch (lookups[i]) {		case 'b':			/*		         * Set this server to be the active server - 			 * resolvSend will start its querying from this			 * server, skipping the previous servers			 */			_res.lookups[i] = 'a';			n = resolvQuery(qbuf, C_IN, T_PTR, (char *)&buf, 					sizeof(buf));			if (n == ERROR) {#ifdef DEBUG				if (_res.options & RES_DEBUG)					printf("resolvQuery failed\n");#endif				break;			}			hp = getanswer(&buf, n, 1, pHost, hostbuf, bufLen);			if (hp == NULL)				break;			hp->h_addrtype = type;			hp->h_length = len;            		pHost->h_addr_list [1] = NULL;            		bcopy (addr, (char *) &pHost->h_addr_list [2], 4);            		pHost->h_addr_list [0] =  (char*) & pHost->h_addr_list [2];			break;		}		if (_res.lookups [i] != 'f')		    _res.lookups [i] = 'b';	}	return (hp);}static intqcomp(a1, a2)	struct in_addr **a1, **a2;{	int pos1, pos2;	for (pos1 = 0; pos1 < _res.nsort; pos1++)		if (_res.sort_list[pos1].addr.s_addr ==		    ((*a1)->s_addr & _res.sort_list[pos1].mask))			break;	for (pos2 = 0; pos2 < _res.nsort; pos2++)		if (_res.sort_list[pos2].addr.s_addr ==		    ((*a2)->s_addr & _res.sort_list[pos2].mask))			break;	return pos1 - pos2;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线亚洲一区二区| 老司机精品视频一区二区三区| 国产一区二区在线免费观看| 日韩你懂的电影在线观看| 激情伊人五月天久久综合| 精品国产不卡一区二区三区| 国产盗摄精品一区二区三区在线| 久久久久国产一区二区三区四区| 国产不卡视频一区二区三区| 国产精品网曝门| 91亚洲国产成人精品一区二区三| 亚洲最新在线观看| 日韩一区二区三区电影| 国产一区二区三区综合| 久久99精品国产麻豆婷婷洗澡| 精品福利视频一区二区三区| 国产成人免费网站| 亚洲欧美日韩国产综合在线| 欧美日韩国产小视频| 美女爽到高潮91| 国产精品免费视频观看| 欧美系列亚洲系列| 精彩视频一区二区| 亚洲人成伊人成综合网小说| 欧美精品tushy高清| 国产精品一级在线| 一区二区三区四区乱视频| 欧美一区二区三区四区久久| 国产精品77777| 一级做a爱片久久| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 一区二区三区在线免费观看| 在线电影一区二区三区| 国产成人福利片| 午夜精品久久久久久久久| 久久精品人人做人人爽97| 欧美午夜精品久久久久久超碰| 精品一区二区三区免费播放 | 亚洲天堂网中文字| 日韩一区二区三区av| 99久久国产综合色|国产精品| 天天综合日日夜夜精品| 中文一区二区在线观看| 欧美一区午夜精品| 91视视频在线观看入口直接观看www | 色一情一伦一子一伦一区| 久久国产精品99久久久久久老狼 | 精品国产乱码久久久久久老虎| 一本色道久久综合亚洲aⅴ蜜桃 | 亚洲成va人在线观看| 欧美激情一区二区三区全黄| 91精品国产欧美一区二区18 | 久久天堂av综合合色蜜桃网 | 欧美日韩电影在线| 色综合色综合色综合| 国产高清不卡一区| 日本不卡高清视频| 亚洲一区欧美一区| 综合激情网...| 国产精品视频你懂的| 亚洲精品在线三区| 欧美一级黄色大片| 欧美日本国产一区| 在线视频欧美区| 99精品一区二区| 不卡av在线免费观看| 国内精品久久久久影院色| 日韩av网站免费在线| 亚洲国产精品久久久男人的天堂| 亚洲女与黑人做爰| 国产精品高潮久久久久无| 久久久99精品久久| 久久久精品tv| 国产亚洲短视频| 久久久青草青青国产亚洲免观| 精品国产91洋老外米糕| 欧美一区二区三区四区久久| 欧美二区三区91| 欧美日韩一级大片网址| 欧美日韩一区二区三区四区五区| 欧洲一区二区三区在线| 欧美做爰猛烈大尺度电影无法无天| 91社区在线播放| 在线亚洲一区观看| 欧美日韩国产电影| 欧美一区二区在线视频| 日韩欧美电影在线| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 国产精品天美传媒| 日本一区二区在线不卡| 亚洲欧洲三级电影| 尤物在线观看一区| 午夜视频久久久久久| 热久久一区二区| 精品中文字幕一区二区| 国产曰批免费观看久久久| 国产精品影视在线观看| 成人网男人的天堂| 一本一本久久a久久精品综合麻豆| 91麻豆国产自产在线观看| 欧美日精品一区视频| 91精品免费观看| 久久奇米777| 亚洲视频一区二区在线观看| 亚洲一区在线观看视频| 欧美a级一区二区| 国产91色综合久久免费分享| 99精品一区二区| 欧美一区二区视频在线观看| 日本一区二区视频在线| 亚洲国产中文字幕在线视频综合| 美女看a上一区| 不卡一区二区三区四区| 欧美日韩成人一区| 久久久99精品免费观看不卡| 一区二区三区产品免费精品久久75| 免费一级欧美片在线观看| 东方欧美亚洲色图在线| 在线观看免费一区| 2021国产精品久久精品| 亚洲精品ww久久久久久p站| 久久成人18免费观看| 91啪在线观看| 精品999在线播放| 亚洲国产精品一区二区www | 欧美日韩国产一区二区三区地区| 精品久久久久久久久久久久包黑料| 国产精品热久久久久夜色精品三区 | 亚洲地区一二三色| 国产成人免费9x9x人网站视频| 欧美天堂一区二区三区| 国产色综合一区| 日韩成人免费在线| 91免费在线视频观看| 久久夜色精品一区| 视频一区二区三区入口| 99久久精品免费精品国产| 日韩欧美卡一卡二| 午夜天堂影视香蕉久久| 99久免费精品视频在线观看| 精品国产污污免费网站入口| 午夜欧美视频在线观看| 色婷婷国产精品久久包臀 | 一区免费观看视频| 国产精品系列在线播放| 欧美日韩国产另类一区| 亚洲人成精品久久久久| 成人做爰69片免费看网站| 欧美一区二区三区在线观看视频 | 91黄色在线观看| 国产精品免费aⅴ片在线观看| 精品一区二区影视| 日韩一区二区三区免费观看| 天天操天天干天天综合网| 91天堂素人约啪| 综合激情成人伊人| 成人av网站免费| 欧美高清在线精品一区| 国产乱国产乱300精品| 欧美哺乳videos| 男人的天堂亚洲一区| 欧美一级片免费看| 日本不卡视频在线| 欧美一卡2卡3卡4卡| 日韩av电影天堂| 欧美乱妇23p| 日本亚洲一区二区| 91精品国产91综合久久蜜臀| 丝瓜av网站精品一区二区| 欧美日韩大陆在线| 奇米一区二区三区| 日韩美女在线视频| 精品综合久久久久久8888| 欧美成人vps| 韩国av一区二区三区在线观看 | 久久综合狠狠综合久久综合88| 精品一区二区精品| 久久网站热最新地址| 国产麻豆成人传媒免费观看| 久久天天做天天爱综合色| 国产很黄免费观看久久| 中国av一区二区三区| 色综合天天做天天爱| 亚洲成人av中文| 欧美一级高清片| 国产99久久久国产精品| 欧美韩国日本一区| 一本大道av伊人久久综合| 亚洲国产aⅴ天堂久久| 日韩美一区二区三区| 大桥未久av一区二区三区中文| 亚洲欧洲精品一区二区三区不卡| 日本久久一区二区三区| 五月婷婷综合网| 2020国产成人综合网| 99在线热播精品免费| 五月激情综合网| 久久人人超碰精品| 日本福利一区二区| 麻豆国产精品视频|