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

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

?? gethostnamadr.c

?? vxworks的完整的源代碼
?? C
字號:
/* gethostnamadr.c - *//* Copyright 1984-2001 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--------------------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;			    if (rrttl < pHost->h_ttl)				pHost->h_ttl = rrttl;			}		}		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;		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++) {		switch (lookups[i]) {		case 'b':			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;		}	}	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;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美视频一区二| 成人福利视频在线看| 亚洲视频一区二区在线观看| www欧美成人18+| 日韩视频国产视频| 欧美xxxxx裸体时装秀| 久久亚洲综合av| 日本一区二区三区视频视频| 国产精品久久久久久久岛一牛影视 | 国产精品久久综合| 欧美国产视频在线| 亚洲美女视频在线观看| 亚洲午夜一区二区| 理论电影国产精品| 国产91精品久久久久久久网曝门| 丁香婷婷综合激情五月色| 成人久久视频在线观看| 色乱码一区二区三区88| 欧美三级在线播放| 久久久九九九九| 亚洲精品自拍动漫在线| 五月天激情综合| 国产成人av电影在线观看| 色香蕉久久蜜桃| 欧美日韩视频在线一区二区| 在线成人午夜影院| 国产欧美一区二区精品久导航| 亚洲欧美影音先锋| 奇米影视在线99精品| 久久97超碰国产精品超碰| 成人h精品动漫一区二区三区| 日本精品裸体写真集在线观看 | 精品久久国产97色综合| 中文字幕av一区二区三区| 午夜精品久久久久影视| 国产99久久久久| 欧美丰满少妇xxxxx高潮对白| 国产三级精品三级在线专区| 亚洲一级二级在线| 国产一区 二区 三区一级| 日本道精品一区二区三区| 在线观看91av| 日韩理论片在线| 蜜桃视频在线观看一区二区| 91麻豆高清视频| 26uuu精品一区二区三区四区在线| 中文字幕一区二区在线观看| 精品电影一区二区三区| 中文字幕精品一区| 亚洲成精国产精品女| 久热成人在线视频| 91福利视频在线| 国产欧美一区二区精品秋霞影院| 亚洲综合无码一区二区| 久久成人久久爱| 欧美日韩国产综合一区二区三区 | 在线观看亚洲一区| 久久久精品日韩欧美| 日韩黄色一级片| 成人av先锋影音| 久久综合狠狠综合| 青青草成人在线观看| 欧美日韩久久一区二区| 1024国产精品| 成人免费视频免费观看| 精品福利一区二区三区| 天天影视网天天综合色在线播放| 97久久超碰国产精品| 国产偷v国产偷v亚洲高清| 久久99精品久久久久久动态图| 欧美裸体一区二区三区| 丝袜亚洲另类欧美| 欧美午夜精品久久久久久孕妇 | 欧美色大人视频| 一区二区在线观看免费视频播放| 成人18视频在线播放| 久久久久99精品国产片| 国产在线精品一区二区三区不卡| 日韩三级中文字幕| 久久国产三级精品| 精品99久久久久久| 国产一区二区中文字幕| 久久蜜桃一区二区| 国产精品18久久久久久久网站| 精品国产电影一区二区| 国产一区二区在线看| 久久久精品黄色| 成人影视亚洲图片在线| 亚洲色图视频网| 欧美在线不卡视频| 日韩成人一级大片| 久久毛片高清国产| 成人短视频下载| 亚洲老妇xxxxxx| 91精品午夜视频| 狠狠色狠狠色综合日日91app| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 国产精品免费丝袜| 91麻豆精品视频| 图片区日韩欧美亚洲| 26uuu色噜噜精品一区二区| 国产精品 欧美精品| 日韩毛片在线免费观看| 欧美视频一区二区在线观看| 久久99久久精品| 中文字幕人成不卡一区| 欧美日韩激情一区二区| 国产风韵犹存在线视精品| 日韩美女久久久| 精品噜噜噜噜久久久久久久久试看 | 中文字幕成人av| 欧美自拍偷拍一区| 韩日精品视频一区| 亚洲精品成人悠悠色影视| 日韩一区二区三区高清免费看看| 国产精品1区2区| 一区二区三区在线高清| 欧美精品一区二区三区在线播放| 99国产一区二区三精品乱码| 免费观看在线综合| 日韩毛片高清在线播放| 久久先锋影音av鲁色资源| 欧美午夜精品久久久久久超碰| 国产米奇在线777精品观看| 亚洲视频一区在线| 国产色产综合产在线视频| 欧美日韩三级视频| 69久久夜色精品国产69蝌蚪网| 国产精品1024| 免费一区二区视频| 亚洲无人区一区| 成人欧美一区二区三区白人| 久久综合av免费| 91精品国产综合久久婷婷香蕉 | 久久久久亚洲蜜桃| 欧美午夜电影网| 色综合亚洲欧洲| 懂色一区二区三区免费观看| 精品亚洲免费视频| 日韩av网站免费在线| 亚洲成人第一页| 亚洲激情综合网| 一区免费观看视频| 国产亚洲精品超碰| 欧美精品一区二区三区四区| 欧美精品丝袜中出| 欧美日韩一区二区欧美激情| 色成人在线视频| 色综合色狠狠天天综合色| 99热这里都是精品| av亚洲精华国产精华| 国产91精品在线观看| 国产91丝袜在线播放九色| 国产高清视频一区| 国产在线精品一区二区三区不卡| 精品亚洲porn| 国产**成人网毛片九色| 成人午夜免费视频| 99国产精品视频免费观看| 91丨porny丨户外露出| 色中色一区二区| 欧美亚州韩日在线看免费版国语版| 色素色在线综合| 欧美日韩精品专区| 日韩欧美中文字幕制服| 精品国产乱码久久久久久久久 | 成人福利视频在线| 91女厕偷拍女厕偷拍高清| 色综合久久六月婷婷中文字幕| 色8久久精品久久久久久蜜| 欧美在线色视频| 日韩视频免费观看高清在线视频| 精品久久久久久久久久久院品网 | 99精品一区二区| 欧美最猛黑人xxxxx猛交| 欧美一级黄色大片| 久久九九99视频| 亚洲老司机在线| 久久精品国产**网站演员| 成人影视亚洲图片在线| 欧美日韩国产欧美日美国产精品| 69p69国产精品| 国产亚洲欧美中文| 一区二区三区四区高清精品免费观看 | 97国产精品videossex| 欧美美女一区二区三区| 久久蜜桃av一区精品变态类天堂| 亚洲丝袜精品丝袜在线| 日本麻豆一区二区三区视频| 国产精品69毛片高清亚洲| 在线免费观看成人短视频| 精品欧美一区二区三区精品久久| 亚洲欧美在线观看| 精品一二线国产| 色天使久久综合网天天| 国产色综合久久| 日韩精品电影在线| 91亚洲大成网污www| 久久亚洲二区三区| 天堂久久久久va久久久久|