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

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

?? res_query.c

?? vxworks的源代碼
?? C
字號(hào):
/* res_query.c - DNS Client query module *//* Copyright 1984-2001 Wind River Systems, Inc. *//* * Copyright (c) 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--------------------01b,17sep01,vvv  fixed compilation warnings01a,13dec96,jag  Eliminated call to initialization and support for the file                 HOSTALIASES.*/#include <resolvLib.h>#include <stdio.h>#include <ctype.h>#include <errno.h>#include <stdlib.h>#include <string.h>#if PACKETSZ > 1024#define MAXPACKET	PACKETSZ#else#define MAXPACKET	1024#endif#ifdef ORG_RESOLVERchar *__hostalias __P((const char *));#endif /* ORG_RESOLVER */#ifdef ORG_RESOLVERint h_errno;#endif/* locals */int res_querydomain (char *name, char *domain, int class, int type,		     u_char *answer, int anslen);/* * Formulate a normal query, send, and await answer. * Returned answer is placed in supplied buffer "answer". * Perform preliminary check of answer, returning success only * if no error is indicated and the answer count is nonzero. * Return the size of the response on success, ERROR on error. * Error number is left in h_errno. * Caller must parse answer and determine whether it answers the question. */intresolvQuery(name, class, type, answer, anslen)	char *name;		/* domain name */	int class, type;	/* class and type of query */	u_char *answer;		/* buffer to put answer */	int anslen;		/* size of answer buffer */{	char buf[MAXPACKET];	HEADER *hp;	int n;#ifdef ORG_RESOLVER	/* 	 * Unecessary test under VxWorks; initialization is done from	 * usrNetwork.c	 */	if ((_res.options & RES_INIT) == 0 && res_init() == -1)		return (ERROR);#endif /* ORG_RESOLVER */#ifdef DEBUG	if (_res.options & RES_DEBUG)		printf(";; resolvQuery(%s, %d, %d)\n", name, class, type);#endif	n = resolvMkQuery(QUERY, name, class, type, (char *)NULL, 0, NULL,	    buf, sizeof(buf));	if (n == ERROR) {#ifdef DEBUG		if (_res.options & RES_DEBUG)			printf(";; resolvQuery: mkquery failed\n");#endif		errno = S_resolvLib_NO_RECOVERY;		return (n);	}	n = resolvSend(buf, n, (char *)answer, anslen);	if (n == ERROR) {#ifdef DEBUG		if (_res.options & RES_DEBUG)			printf(";; resolvQuery: send error\n");#endif		errno = S_resolvLib_TRY_AGAIN;		return (n);	}	hp = (HEADER *) answer;	if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) {#ifdef DEBUG		if (_res.options & RES_DEBUG)			printf(";; rcode = %d, ancount=%d\n", hp->rcode,			    ntohs(hp->ancount));#endif		switch (hp->rcode) {			case NXDOMAIN:				errno = S_resolvLib_HOST_NOT_FOUND;				break;			case SERVFAIL:				errno = S_resolvLib_TRY_AGAIN;				break;			case NOERROR:				errno = S_resolvLib_NO_DATA;				break;			case FORMERR:			case NOTIMP:			case REFUSED:			default:				errno = S_resolvLib_NO_RECOVERY;				break;		}		return (ERROR);	}	return (n);}/* * Formulate a normal query, send, and retrieve answer in supplied buffer. * Return the size of the response on success, -1 on error. * If enabled, implement search rules until answer or unrecoverable failure * is detected.  Error number is left in h_errno. * Only useful for queries in the same name hierarchy as the local host * (not, for example, for host address-to-name lookups in domain in-addr.arpa). */intresSearch(name, class, type, answer, anslen)	const char *name;	/* domain name */	int class, type;	/* class and type of query */	u_char *answer;		/* buffer to put answer */	int anslen;		/* size of answer */{	register char *cp, **domain;	int dots, trailing_dot, ret, got_nodata, saved_herrno, tried_as_is;#if ORG_RESOLVER		/* Unecessary test under VxWorks */	if ((_res.options & RES_INIT) == 0 && res_init() == -1)		return (-1);#endif /* ORG_RESOLVER */	got_nodata = 0;#ifdef ORG_RESOLVER	errno = 0;#endif /* ORG_RESOLVER */	errno = S_resolvLib_HOST_NOT_FOUND;	/* default, if we never query */	dots = 0;	for (cp = (char *)name; *cp; cp++) {		if (*cp == '.')			dots++;	}	trailing_dot = 0;	if ((cp > name) && (*--cp == '.'))		trailing_dot++;#ifdef ORG_RESOLVER	/* In VxWorks we don't support the HOSTALIASES environment variable	 * or the file pointed by HOSTALIASES.  This concept is described in	 * the BSD man page for hostname. For now we just ignore this option.	 */	/*	 * if there aren't any dots, it could be a user-level alias	 */	if (!dots && (cp = __hostalias(name)))		return (resolvQuery(cp, class, type, answer, anslen));#endif /* ORG_RESOLVER */	/*	 * If there are dots in the name already, let's just give it a try	 * 'as is'.  The threshold can be set with the "ndots" option.	 */	saved_herrno = -1;	tried_as_is = 0;	if (dots >= _res.ndots) {		ret = res_querydomain((char *)name, NULL, class, type, answer, 				      anslen);		if (ret > 0)			return (ret);		saved_herrno = errno;		tried_as_is++;	}	/*	 * We do at least one level of search if	 *	- there is no dot and RES_DEFNAME is set, or	 *	- there is at least one dot, there is no trailing dot,	 *	  and RES_DNSRCH is set.	 */	if ((!dots && (_res.options & RES_DEFNAMES)) ||	    (dots && !trailing_dot && (_res.options & RES_DNSRCH))) {		for (domain = _res.dnsrch; *domain; domain++) {			int done = 0;			ret = res_querydomain((char *)name, *domain, class, type,			    answer, anslen);			if (ret > 0)				return (ret);			/*			 * If no server present, give up.			 * If name isn't found in this domain,			 * keep trying higher domains in the search list			 * (if that's enabled).			 * On a NO_DATA error, keep trying, otherwise			 * a wildcard entry of another type could keep us			 * from finding this entry higher in the domain.			 * If we get some other error (negative answer or			 * server failure), then stop searching up,			 * but try the input name below in case it's			 * fully-qualified.			 */			if (errno == ECONNREFUSED) {				errno = S_resolvLib_TRY_AGAIN;				return (-1);			}			switch (errno) {			case NO_DATA:				got_nodata++;				/* FALLTHROUGH */			case HOST_NOT_FOUND:				/* keep trying */				break;			default:				/* anything else implies that we're done */				done++;			}			/*			 * if we got here for some reason other than DNSRCH,			 * we only wanted one iteration of the loop, so stop.			 */			if (!(_res.options & RES_DNSRCH))			        done++;			if (done)				break;		}	}	/*	 * if we have not already tried the name "as is", do that now.	 * note that we do this regardless of how many dots were in the	 * name or whether it ends with a dot.	 */	if (!tried_as_is) {		ret = res_querydomain((char *)name, NULL, class, type, answer, 				      anslen);		if (ret > 0)			return (ret);		saved_herrno = errno;	}	/*	 * if we got here, we didn't satisfy the search.	 * if we did an initial full query, return that query's h_errno	 * (note that we wouldn't be here if that query had succeeded).	 * else if we ever got a nodata, send that back as the reason.	 * else send back meaningless h_errno, that being the one from	 * the last DNSRCH we did.	 */	if (saved_herrno != -1)		errno = saved_herrno;	else if (got_nodata)		errno = S_resolvLib_NO_DATA;	return (-1);}/* * Perform a call on resolvQuery on the concatenation of name and domain, * removing a trailing dot from name if domain is NULL. */intres_querydomain(name, domain, class, type, answer, anslen)	char *name, *domain;	int class, type;	/* class and type of query */	u_char *answer;		/* buffer to put answer */	int anslen;		/* size of answer */{	char nbuf[2*MAXDNAME+2];	char *longname = nbuf;	int n;#ifdef DEBUG	if (_res.options & RES_DEBUG)		printf(";; res_querydomain(%s, %s, %d, %d)\n",		    name, domain, class, type);#endif	if (domain == NULL) {		/*		 * Check for trailing '.';		 * copy without '.' if present.		 */		n = strlen(name) - 1;		if (n != (0 - 1) && name[n] == '.' && n < sizeof(nbuf) - 1) {			bcopy(name, nbuf, n);			nbuf[n] = '\0';		} else			longname = name;	} else		(void)sprintf(nbuf, "%.*s.%.*s",		    MAXDNAME, name, MAXDNAME, domain);	return (resolvQuery(longname, class, type, answer, anslen));}#ifdef ORG_RESOLVER/* In VxWorks we don't support the HOSTALIASES environment variable * or the file pointed by HOSTALIASES.  This concept is described in * the BSD man page for hostname. For now we just ignore this option.  This * function is only invoked in this module. */char *__hostalias(name)	register const char *name;{	register char *cp1, *cp2;	FILE *fp;	char *file, *getenv(), *strcpy(), *strncpy();	char buf[BUFSIZ];	static char abuf[MAXDNAME];	file = getenv("HOSTALIASES");	if (file == NULL || (fp = fopen(file, "r")) == NULL)		return (NULL);	buf[sizeof(buf) - 1] = '\0';	while (fgets(buf, sizeof(buf), fp)) {		for (cp1 = buf; *cp1 && !isspace(*cp1); ++cp1);		if (!*cp1)			break;		*cp1 = '\0';		if (!strcasecmp(buf, name)) {			while (isspace(*++cp1));			if (!*cp1)				break;			for (cp2 = cp1 + 1; *cp2 && !isspace(*cp2); ++cp2);			abuf[sizeof(abuf) - 1] = *cp2 = '\0';			(void)strncpy(abuf, cp1, sizeof(abuf) - 1);			fclose(fp);			return (abuf);		}	}	fclose(fp);	return (NULL);}#endif /* ORG_RESOLVER */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美一区二区在线观看| 中文字幕日本乱码精品影院| 日韩一区二区三区免费看| 日韩亚洲欧美高清| 亚洲视频电影在线| 青青草原综合久久大伊人精品优势| 久久精品国产99久久6| 成人av网在线| 精品福利一二区| 亚洲国产日日夜夜| 国产成人午夜视频| 日韩一本二本av| 亚洲一级二级在线| 成人午夜电影小说| 久久一夜天堂av一区二区三区| 亚洲最大成人网4388xx| 麻豆精品国产传媒mv男同| 色偷偷成人一区二区三区91 | 亚洲精品一区二区精华| 亚洲欧洲成人自拍| 国产成人在线看| 日韩一区二区电影在线| 中文字幕av免费专区久久| 麻豆精品视频在线| 欧美日韩情趣电影| 亚洲精品久久久久久国产精华液| 国产精品一区三区| 精品少妇一区二区三区视频免付费| 一区二区免费看| 欧美亚洲禁片免费| 亚洲二区在线视频| 欧美电影影音先锋| 美女被吸乳得到大胸91| 日韩一级免费观看| 视频一区二区三区中文字幕| 精品视频在线看| 日本不卡一区二区三区| 欧美一区二区三区电影| 美女脱光内衣内裤视频久久网站 | 日韩欧美国产成人一区二区| 亚洲综合另类小说| 欧美三级日韩在线| 激情伊人五月天久久综合| 久久久激情视频| 色婷婷久久久久swag精品| 亚洲mv在线观看| 26uuu国产电影一区二区| 972aa.com艺术欧美| 日韩在线播放一区二区| 久久奇米777| 91福利小视频| 国产白丝精品91爽爽久久| 亚洲欧美日韩精品久久久久| 91精品国产色综合久久| 成人激情文学综合网| 日产欧产美韩系列久久99| 国产精品不卡在线观看| 欧美电视剧免费观看| 欧美影视一区二区三区| 成人h动漫精品| 久久国产精品99久久久久久老狼| 亚洲毛片av在线| 日韩精品一区二| 欧美精品三级日韩久久| 99久久精品免费观看| 国产精品白丝av| 久久99热这里只有精品| 午夜私人影院久久久久| 亚洲精品视频在线| 国产日韩精品一区二区三区| 日韩欧美色综合| 欧美日韩精品一区二区三区| a在线欧美一区| 99久久久国产精品| 粉嫩av一区二区三区| 国产一区二区美女| 国产在线视频不卡二| 麻豆精品视频在线观看| 视频在线在亚洲| 免费看日韩精品| 精彩视频一区二区| 老司机免费视频一区二区| 久久成人久久鬼色| 国产精品一卡二卡在线观看| 国产精品亚洲一区二区三区在线| 国产综合成人久久大片91| 成人午夜av电影| 99riav一区二区三区| 在线观看一区二区精品视频| 欧美日本在线观看| 精品国产乱码久久| 国产精品久久久久一区二区三区共| 国产精品卡一卡二| 午夜欧美视频在线观看| 蜜桃91丨九色丨蝌蚪91桃色| 国产.欧美.日韩| 欧美三级在线视频| 国产午夜精品理论片a级大结局 | 日韩中文欧美在线| 成人激情综合网站| 日韩欧美高清一区| 亚洲三级在线免费| 国产一区二区不卡| 欧美色视频在线| 亚洲国产精品国自产拍av| 天天操天天综合网| 91啪九色porn原创视频在线观看| 日韩欧美在线影院| 亚洲精品免费在线观看| 国模娜娜一区二区三区| 欧美精品三级在线观看| 亚洲女人小视频在线观看| 国产成人自拍网| 欧美一级二级三级乱码| 亚洲国产婷婷综合在线精品| 大陆成人av片| 中文字幕欧美三区| 国产成人av网站| 国产色综合久久| 国产精品一区二区在线播放 | 韩国一区二区视频| 日韩精品专区在线| 久久精品99久久久| 欧美大白屁股肥臀xxxxxx| 日本成人在线一区| 2024国产精品| 顶级嫩模精品视频在线看| 国产精品不卡视频| 日本道色综合久久| 亚洲成人黄色影院| 欧美成人乱码一区二区三区| 久久国产三级精品| 国产女人水真多18毛片18精品视频| 亚洲自拍偷拍九九九| 久久免费国产精品| 成人免费三级在线| 亚洲男人天堂av网| 日韩午夜精品电影| 99国产精品一区| 日本中文字幕一区二区有限公司| 日韩女优电影在线观看| 国产成都精品91一区二区三| 玉足女爽爽91| 久久久久久**毛片大全| 91在线精品一区二区| 奇米色777欧美一区二区| 国产欧美一区二区精品性色| 一本久道久久综合中文字幕| 热久久久久久久| 国产日韩精品一区二区三区在线| 91激情在线视频| 国产成人午夜电影网| 日韩精品亚洲一区| 亚洲欧美一区二区三区孕妇| 日韩免费观看高清完整版在线观看 | 91精品国产综合久久精品麻豆| 国产一区二区成人久久免费影院| 亚洲黄色尤物视频| 国产精品女上位| 国产欧美视频在线观看| 这里只有精品免费| 7777精品伊人久久久大香线蕉最新版| 99精品欧美一区二区蜜桃免费 | 久久久久九九视频| 日韩欧美国产综合在线一区二区三区 | 欧美人与性动xxxx| 欧美日韩精品系列| 欧美精品在线视频| 日韩一区二区三区免费观看| 欧洲精品中文字幕| 欧美日韩不卡在线| 欧美精品在线视频| 日韩一区二区三区三四区视频在线观看 | 亚洲免费观看在线视频| 国产精品久久免费看| 欧美国产禁国产网站cc| 国产精品沙发午睡系列990531| 欧美高清在线视频| 亚洲欧美视频在线观看视频| 亚洲精品欧美专区| 日韩高清在线一区| 国产剧情一区二区| 欧美在线视频你懂得| 欧美一三区三区四区免费在线看 | 国产传媒久久文化传媒| 日本高清无吗v一区| 日韩欧美在线影院| 国产精品成人一区二区三区夜夜夜 | 视频一区视频二区在线观看| 国产精品18久久久久久久久久久久 | 91麻豆精品国产91久久久资源速度| 91精品国产综合久久久蜜臀图片| 久久综合色综合88| 亚洲成精国产精品女| 国产成人aaaa| 久久亚洲私人国产精品va媚药| 亚洲精品v日韩精品| 成人听书哪个软件好| 精品国产一区二区三区不卡| 亚洲一区在线视频观看|