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

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

?? res_query.c

?? vxworks的完整的源代碼
?? C
字號:
/* 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 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产白丝网站精品污在线入口| 91福利在线免费观看| 久久久久久久久岛国免费| 韩国v欧美v日本v亚洲v| 成人欧美一区二区三区1314| 在线成人小视频| 丰满白嫩尤物一区二区| 亚洲日本青草视频在线怡红院| 欧美va天堂va视频va在线| 972aa.com艺术欧美| 国产另类ts人妖一区二区| 亚洲第一搞黄网站| ●精品国产综合乱码久久久久| 欧美大片日本大片免费观看| 欧美婷婷六月丁香综合色| 成人性视频网站| 久久99久久99| 肉色丝袜一区二区| 亚洲精品一二三四区| 国产精品青草综合久久久久99| 精品国产乱码久久久久久图片 | 国产成人鲁色资源国产91色综| 亚洲视频一二区| 欧美国产欧美综合| 精品国产一区二区三区久久久蜜月| 欧美性三三影院| 欧美亚洲精品一区| 91在线视频在线| 成人h动漫精品一区二区| 国产精品影音先锋| 激情文学综合网| 日韩av网站在线观看| 亚洲不卡在线观看| 亚洲成av人片| 亚洲国产一区二区视频| 一区二区三区在线观看欧美| 亚洲人成网站影音先锋播放| 精品国产123| 久久夜色精品一区| 欧美精品一区二区三区在线| www日韩大片| 久久夜色精品国产噜噜av| 国产偷国产偷亚洲高清人白洁| 久久久无码精品亚洲日韩按摩| 久久这里只有精品视频网| 久久免费看少妇高潮| 久久男人中文字幕资源站| 欧美国产欧美综合| 亚洲欧美一区二区三区国产精品 | 夜夜亚洲天天久久| 亚洲一区二区三区在线| 亚洲成av人影院在线观看网| 日韩精品久久理论片| 蜜桃一区二区三区四区| 黄一区二区三区| 国产成人免费视频一区| 91麻豆国产精品久久| 色综合久久精品| 欧美日韩综合不卡| 久久99精品一区二区三区| 懂色av一区二区三区蜜臀| 99久久精品免费| 欧美色倩网站大全免费| 日韩免费电影网站| 国产精品毛片a∨一区二区三区| 成人免费视频在线观看| 午夜久久久久久| 精品夜夜嗨av一区二区三区| 粉嫩在线一区二区三区视频| 欧美性淫爽ww久久久久无| 日韩视频免费观看高清在线视频| 久久亚洲精品小早川怜子| 日韩一级大片在线| 国产精品免费久久| 五月婷婷色综合| 国产精品亚洲人在线观看| 色综合欧美在线| 日韩欧美国产不卡| 最近日韩中文字幕| 日本不卡中文字幕| av激情综合网| 日韩午夜精品视频| 亚洲欧洲日韩女同| 蜜桃传媒麻豆第一区在线观看| 不卡影院免费观看| 欧美一区二区二区| 亚洲麻豆国产自偷在线| 麻豆国产精品视频| 色婷婷激情综合| 久久色在线视频| 一区二区三区在线免费观看| 黄色日韩网站视频| 欧美高清性hdvideosex| 中文字幕一区二区三区在线不卡 | 欧美日韩一区二区三区高清 | 国产亚洲欧洲一区高清在线观看| 亚洲麻豆国产自偷在线| 国产精品综合av一区二区国产馆| 欧美中文字幕久久| 中文字幕成人网| 精品亚洲porn| 欧美在线啊v一区| 亚洲国产高清在线| 国产伦精一区二区三区| 欧美三级电影一区| 一区二区在线看| 成人黄色软件下载| 精品国精品国产| 日韩黄色免费电影| 91免费国产在线观看| 国产欧美一区二区在线| 欧美日韩精品电影| 一区二区三区中文字幕在线观看| 成人免费观看视频| 国产亚洲美州欧州综合国| 日本一区中文字幕| 欧美日韩国产天堂| 一区二区国产视频| 一本久久a久久精品亚洲| 国产欧美日韩在线| 国产在线播放一区三区四| 色先锋久久av资源部| 国产精品国模大尺度视频| 国产成a人亚洲| 国产色综合一区| 国产精品白丝jk黑袜喷水| 2023国产一二三区日本精品2022| 日本成人超碰在线观看| 欧美一级片免费看| 视频一区二区不卡| 777欧美精品| 日本在线观看不卡视频| 欧美精品xxxxbbbb| 日本成人在线不卡视频| 欧美一级搡bbbb搡bbbb| 麻豆精品国产传媒mv男同| 欧美大肚乱孕交hd孕妇| 久草这里只有精品视频| 精品少妇一区二区三区日产乱码| 麻豆精品国产传媒mv男同| 精品久久久久久综合日本欧美| 国产一区二区美女诱惑| 国产欧美精品在线观看| 粉嫩高潮美女一区二区三区| 国产精品毛片高清在线完整版| 波多野结衣中文字幕一区| 亚洲色图.com| 欧美日韩视频专区在线播放| 三级一区在线视频先锋| 日韩精品在线网站| 国产精品中文字幕一区二区三区| 中文字幕欧美日韩一区| 99国产精品99久久久久久| 亚洲小少妇裸体bbw| 日韩一区二区电影| 高清成人在线观看| 一区二区三区精品视频| 欧美丰满嫩嫩电影| 国产一区激情在线| 国产精品女上位| 日本韩国一区二区三区视频| 亚洲v日本v欧美v久久精品| 日韩欧美另类在线| 懂色av噜噜一区二区三区av| 夜夜爽夜夜爽精品视频| 日韩欧美色综合| 97精品视频在线观看自产线路二| 视频一区二区三区入口| 欧美国产日韩a欧美在线观看| 日本久久精品电影| 激情综合网最新| 亚洲桃色在线一区| 欧美一区永久视频免费观看| 成人精品鲁一区一区二区| 亚洲高清免费视频| 欧美经典一区二区三区| 欧美唯美清纯偷拍| 黄一区二区三区| 亚洲综合色噜噜狠狠| 久久夜色精品国产噜噜av| 欧美亚洲一区三区| 国产精品影视在线观看| 亚洲18女电影在线观看| 欧美国产日本视频| 欧美一级片免费看| 91美女在线看| 国产曰批免费观看久久久| 亚洲一区二区三区四区在线观看 | 亚洲综合男人的天堂| 久久久电影一区二区三区| 欧美三级在线看| av一本久道久久综合久久鬼色| 精品在线免费观看| 亚洲一区成人在线| 国产欧美日韩三区| 日韩一区二区在线观看视频| 在线免费av一区| 韩国av一区二区三区四区| 亚洲成人激情av| 亚洲欧美日本韩国|