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

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

?? res_init.c

?? package of develop dns
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (c) 1985, 1989, 1993 *    The 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. *//* * Portions Copyright (c) 1993 by Digital Equipment Corporation. *  * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. *  * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS * SOFTWARE. *//* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") * Portions Copyright (c) 1996-1999 by Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */#if defined(LIBC_SCCS) && !defined(lint)static const char sccsid[] = "@(#)res_init.c	8.1 (Berkeley) 6/7/93";static const char rcsid[] = "$Id: res_init.c,v 1.9.2.5.4.2 2004/03/16 12:34:18 marka Exp $";#endif /* LIBC_SCCS and not lint */#include "port_before.h"#include <sys/types.h>#include <sys/param.h>#include <sys/socket.h>#include <sys/time.h>#include <netinet/in.h>#include <arpa/inet.h>#include <arpa/nameser.h>#include <ctype.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <netdb.h>#include "port_after.h"/* ensure that sockaddr_in6 and IN6ADDR_ANY_INIT are declared / defined */#include <resolv.h>#include "res_private.h"/* Options.  Should all be left alone. */#define RESOLVSORT#define DEBUGstatic void res_setoptions __P((res_state, const char *, const char *));#ifdef RESOLVSORTstatic const char sort_mask[] = "/&";#define ISSORTMASK(ch) (strchr(sort_mask, ch) != NULL)static u_int32_t net_mask __P((struct in_addr));#endif#if !defined(isascii)	/* XXX - could be a function */# define isascii(c) (!(c & 0200))#endif/* * Resolver state default settings. *//* * Set up default settings.  If the configuration file exist, the values * there will have precedence.  Otherwise, the server address is set to * INADDR_ANY and the default domain name comes from the gethostname(). * * An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1 * rather than INADDR_ANY ("0.0.0.0") as the default name server address * since it was noted that INADDR_ANY actually meant ``the first interface * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface, * it had to be "up" in order for you to reach your own name server.  It * was later decided that since the recommended practice is to always  * install local static routes through 127.0.0.1 for all your network * interfaces, that we could solve this problem without a code change. * * The configuration file should always be used, since it is the only way * to specify a default domain.  If you are running a server on your local * machine, you should say "nameserver 0.0.0.0" or "nameserver 127.0.0.1" * in the configuration file. * * Return 0 if completes successfully, -1 on error */intres_ninit(res_state statp) {	extern int __res_vinit(res_state, int);	return (__res_vinit(statp, 0));}/* This function has to be reachable by res_data.c but not publically. */int__res_vinit(res_state statp, int preinit) {	register FILE *fp;	register char *cp, **pp;	register int n;	char buf[BUFSIZ];	int nserv = 0;    /* number of nameserver records read from file */	int haveenv = 0;	int havesearch = 0;#ifdef RESOLVSORT	int nsort = 0;	char *net;#endif	int dots;	union res_sockaddr_union u[2];	if (!preinit) {		statp->retrans = RES_TIMEOUT;		statp->retry = RES_DFLRETRY;		statp->options = RES_DEFAULT;		statp->id = res_randomid();	}	if ((statp->options & RES_INIT) != 0U)		res_ndestroy(statp);	memset(u, 0, sizeof(u));#ifdef USELOOPBACK	u[nserv].sin.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1);#else	u[nserv].sin.sin_addr.s_addr = INADDR_ANY;#endif	u[nserv].sin.sin_family = AF_INET;	u[nserv].sin.sin_port = htons(NAMESERVER_PORT);#ifdef HAVE_SA_LEN	u[nserv].sin.sin_len = sizeof(struct sockaddr_in);#endif	nserv++;#ifdef HAS_INET6_STRUCTS#ifdef USELOOPBACK	u[nserv].sin6.sin6_addr = in6addr_loopback;#else	u[nserv].sin6.sin6_addr = in6addr_any;#endif	u[nserv].sin6.sin6_family = AF_INET6;	u[nserv].sin6.sin6_port = htons(NAMESERVER_PORT);#ifdef HAVE_SA_LEN	u[nserv].sin6.sin6_len = sizeof(struct sockaddr_in6);#endif	nserv++;#endif	statp->nscount = 0;	statp->ndots = 1;	statp->pfcode = 0;	statp->_vcsock = -1;	statp->_flags = 0;	statp->qhook = NULL;	statp->rhook = NULL;	statp->_u._ext.nscount = 0;	statp->_u._ext.ext = malloc(sizeof(*statp->_u._ext.ext));	if (statp->_u._ext.ext != NULL) {	        memset(statp->_u._ext.ext, 0, sizeof(*statp->_u._ext.ext));		statp->_u._ext.ext->nsaddrs[0].sin = statp->nsaddr;		strcpy(statp->_u._ext.ext->nsuffix, "ip6.arpa");		strcpy(statp->_u._ext.ext->nsuffix2, "ip6.int");	}#ifdef RESOLVSORT	statp->nsort = 0;#endif	res_setservers(statp, u, nserv);	/* Allow user to override the local domain definition */	if ((cp = getenv("LOCALDOMAIN")) != NULL) {		(void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);		statp->defdname[sizeof(statp->defdname) - 1] = '\0';		haveenv++;		/*		 * Set search list to be blank-separated strings		 * from rest of env value.  Permits users of LOCALDOMAIN		 * to still have a search list, and anyone to set the		 * one that they want to use as an individual (even more		 * important now that the rfc1535 stuff restricts searches)		 */		cp = statp->defdname;		pp = statp->dnsrch;		*pp++ = cp;		for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) {			if (*cp == '\n')	/* silly backwards compat */				break;			else if (*cp == ' ' || *cp == '\t') {				*cp = 0;				n = 1;			} else if (n) {				*pp++ = cp;				n = 0;				havesearch = 1;			}		}		/* null terminate last domain if there are excess */		while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n')			cp++;		*cp = '\0';		*pp++ = 0;	}#define	MATCH(line, name) \	(!strncmp(line, name, sizeof(name) - 1) && \	(line[sizeof(name) - 1] == ' ' || \	 line[sizeof(name) - 1] == '\t'))	nserv = 0;	if ((fp = fopen(_PATH_RESCONF, "r")) != NULL) {	    /* read the config file */	    while (fgets(buf, sizeof(buf), fp) != NULL) {		/* skip comments */		if (*buf == ';' || *buf == '#')			continue;		/* read default domain name */		if (MATCH(buf, "domain")) {		    if (haveenv)	/* skip if have from environ */			    continue;		    cp = buf + sizeof("domain") - 1;		    while (*cp == ' ' || *cp == '\t')			    cp++;		    if ((*cp == '\0') || (*cp == '\n'))			    continue;		    strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);		    statp->defdname[sizeof(statp->defdname) - 1] = '\0';		    if ((cp = strpbrk(statp->defdname, " \t\n")) != NULL)			    *cp = '\0';		    havesearch = 0;		    continue;		}		/* set search list */		if (MATCH(buf, "search")) {		    if (haveenv)	/* skip if have from environ */			    continue;		    cp = buf + sizeof("search") - 1;		    while (*cp == ' ' || *cp == '\t')			    cp++;		    if ((*cp == '\0') || (*cp == '\n'))			    continue;		    strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);		    statp->defdname[sizeof(statp->defdname) - 1] = '\0';		    if ((cp = strchr(statp->defdname, '\n')) != NULL)			    *cp = '\0';		    /*		     * Set search list to be blank-separated strings		     * on rest of line.		     */		    cp = statp->defdname;		    pp = statp->dnsrch;		    *pp++ = cp;		    for (n = 0; *cp && pp < statp->dnsrch + MAXDNSRCH; cp++) {			    if (*cp == ' ' || *cp == '\t') {				    *cp = 0;				    n = 1;			    } else if (n) {				    *pp++ = cp;				    n = 0;			    }		    }		    /* null terminate last domain if there are excess */		    while (*cp != '\0' && *cp != ' ' && *cp != '\t')			    cp++;		    *cp = '\0';		    *pp++ = 0;		    havesearch = 1;		    continue;		}		/* read nameservers to query */		if (MATCH(buf, "nameserver") && nserv < MAXNS) {		    struct addrinfo hints, *ai;		    char sbuf[NI_MAXSERV];		    const size_t minsiz =		        sizeof(statp->_u._ext.ext->nsaddrs[0]);		    cp = buf + sizeof("nameserver") - 1;		    while (*cp == ' ' || *cp == '\t')			cp++;		    cp[strcspn(cp, ";# \t\n")] = '\0';		    if ((*cp != '\0') && (*cp != '\n')) {			memset(&hints, 0, sizeof(hints));			hints.ai_family = PF_UNSPEC;			hints.ai_socktype = SOCK_DGRAM;	/*dummy*/			hints.ai_flags = AI_NUMERICHOST;			sprintf(sbuf, "%u", NAMESERVER_PORT);			if (getaddrinfo(cp, sbuf, &hints, &ai) == 0 &&			    ai->ai_addrlen <= minsiz) {			    if (statp->_u._ext.ext != NULL) {				memcpy(&statp->_u._ext.ext->nsaddrs[nserv],				    ai->ai_addr, ai->ai_addrlen);			    }			    if (ai->ai_addrlen <=			        sizeof(statp->nsaddr_list[nserv])) {				memcpy(&statp->nsaddr_list[nserv],				    ai->ai_addr, ai->ai_addrlen);			    } else				statp->nsaddr_list[nserv].sin_family = 0;			    freeaddrinfo(ai);			    nserv++;			}		    }		    continue;		}#ifdef RESOLVSORT		if (MATCH(buf, "sortlist")) {		    struct in_addr a;		    cp = buf + sizeof("sortlist") - 1;		    while (nsort < MAXRESOLVSORT) {			while (*cp == ' ' || *cp == '\t')			    cp++;			if (*cp == '\0' || *cp == '\n' || *cp == ';')			    break;			net = cp;			while (*cp && !ISSORTMASK(*cp) && *cp != ';' &&			       isascii(*cp) && !isspace((unsigned char)*cp))				cp++;			n = *cp;			*cp = 0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品视频在线| 在线免费不卡电影| 亚洲精品乱码久久久久| 精品美女一区二区| 精品婷婷伊人一区三区三| 国产91在线看| 裸体在线国模精品偷拍| 亚洲一区二区在线观看视频| 国产精品三级视频| 日本一区二区三区四区在线视频| 日韩一区二区在线看| 欧美日韩高清一区二区| 精品视频一区二区不卡| 欧美怡红院视频| 欧美优质美女网站| 日本韩国精品在线| 色94色欧美sute亚洲线路一久| 成人av综合一区| 成人不卡免费av| 成人白浆超碰人人人人| 99久久精品国产网站| 国产成人精品三级| 成人伦理片在线| 成人av免费观看| 91看片淫黄大片一级在线观看| 国产成人午夜精品影院观看视频 | 午夜精品久久久久久久久| 国产精品久久久久久一区二区三区| 欧美大尺度电影在线| 精品国产免费一区二区三区香蕉| 一本色道久久综合精品竹菊| av一二三不卡影片| 在线一区二区视频| aaa国产一区| 91久久精品日日躁夜夜躁欧美| 在线欧美一区二区| 51午夜精品国产| 精品国产乱码久久久久久浪潮| 久久综合色天天久久综合图片| 久久综合色8888| 国产精品午夜电影| 一区二区三区在线视频观看58| 日韩中文字幕亚洲一区二区va在线 | 中文字幕在线一区| 成人免费视频播放| 日韩免费性生活视频播放| 成人免费视频视频| 精品视频1区2区| 国产精品沙发午睡系列990531| 亚洲一区二区欧美日韩| 国产精品一区免费在线观看| 欧美日韩一区不卡| 中文字幕一区在线| 久久99热99| 欧美挠脚心视频网站| 日韩久久一区二区| 国产一区二区视频在线| 欧美另类变人与禽xxxxx| 久久久亚洲精华液精华液精华液| 亚洲va欧美va人人爽| 丰满少妇在线播放bd日韩电影| 狠狠色丁香久久婷婷综合丁香| 欧美亚日韩国产aⅴ精品中极品| 91丨九色丨蝌蚪富婆spa| 国产精品白丝在线| 麻豆精品国产91久久久久久| 欧美日韩午夜精品| 一个色综合网站| 99久久精品免费| 国产精品欧美一级免费| 国产成人精品午夜视频免费| 欧美精品一区二区高清在线观看| 日本午夜精品视频在线观看| 欧美在线观看视频一区二区| 亚洲精品水蜜桃| 97国产精品videossex| 国产精品国产a级| 成人精品亚洲人成在线| 中文字幕不卡在线播放| 不卡视频在线观看| 国产精品成人免费| 99久久精品国产网站| 久久国产尿小便嘘嘘| 日韩成人dvd| 亚洲欧美日韩综合aⅴ视频| 亚洲成av人在线观看| av中文字幕一区| 国产精品萝li| 色婷婷久久一区二区三区麻豆| 国产精品美日韩| 色婷婷av一区二区| 亚洲成a人v欧美综合天堂| 91精品福利在线一区二区三区| 日韩不卡一区二区三区 | 国产剧情一区在线| 欧美国产欧美亚州国产日韩mv天天看完整| 国产一区二区三区四区五区入口 | 91免费观看在线| 亚洲线精品一区二区三区八戒| 欧美精选午夜久久久乱码6080| 日韩黄色免费电影| 国产三级精品视频| 91成人免费在线视频| 一区二区视频在线看| 欧美一区二区三区男人的天堂| 激情都市一区二区| 亚洲欧美日韩在线不卡| 7777精品伊人久久久大香线蕉完整版 | 精品国产污网站| jlzzjlzz亚洲女人18| 亚洲在线成人精品| 精品国产伦一区二区三区免费| 国产69精品久久久久777| 亚洲精品亚洲人成人网| 精品少妇一区二区三区在线视频| 粉嫩一区二区三区在线看| 亚洲国产色一区| 久久精品亚洲麻豆av一区二区| 91日韩在线专区| 狠狠色伊人亚洲综合成人| 亚洲人成影院在线观看| 精品久久久久久久久久久院品网| 波多野结衣一区二区三区| 日韩成人一级片| 亚洲人精品午夜| 久久久久国产精品人| 精品污污网站免费看| 北条麻妃国产九九精品视频| 午夜精品久久久久久久| 亚洲欧洲精品一区二区精品久久久| 欧美狂野另类xxxxoooo| 99久久亚洲一区二区三区青草| 日本不卡一区二区| 一区二区三区中文字幕| 中文字幕电影一区| 亚洲精品一区二区三区香蕉| 欧美揉bbbbb揉bbbbb| 色综合一个色综合| 成人h精品动漫一区二区三区| 555夜色666亚洲国产免| 日本高清成人免费播放| 色播五月激情综合网| 成人一级视频在线观看| 麻豆成人久久精品二区三区红| 亚洲国产综合色| 一区二区三区国产精华| 亚洲视频 欧洲视频| 中文欧美字幕免费| 国产精品国产三级国产三级人妇| 亚洲精品在线电影| 精品久久久三级丝袜| 欧美va亚洲va香蕉在线| 欧美一区二区三区在线视频| 欧美日韩1区2区| 欧美日韩精品专区| 56国语精品自产拍在线观看| 91 com成人网| 欧美一区二区精品在线| 911精品产国品一二三产区| 欧美日韩www| 91精品国产欧美一区二区成人| 欧美精选午夜久久久乱码6080| 欧美日韩一区二区三区在线看| 欧美日韩国产乱码电影| 91精品国产日韩91久久久久久| 欧美一区二区三区视频免费| 欧美一区三区二区| 久久综合成人精品亚洲另类欧美| 国产午夜精品理论片a级大结局 | 国产精品乱码妇女bbbb| 亚洲视频在线一区| 亚洲国产精品久久人人爱| 水野朝阳av一区二区三区| 麻豆国产精品一区二区三区 | 色婷婷精品久久二区二区蜜臀av | 精品人伦一区二区色婷婷| 久久综合色鬼综合色| 国产精品日韩成人| 亚洲资源在线观看| 免费xxxx性欧美18vr| 国产伦精品一区二区三区在线观看| 国v精品久久久网| 色婷婷综合久久久中文字幕| 欧美日韩国产综合一区二区| 精品第一国产综合精品aⅴ| 中文字幕乱码一区二区免费| 一区二区理论电影在线观看| 丝袜亚洲另类欧美| 国产91精品精华液一区二区三区| 色av综合在线| 精品999在线播放| 亚洲人成网站在线| 精品一区二区免费看| 99久久婷婷国产| 欧美一级xxx| 亚洲猫色日本管| 国产在线精品一区二区不卡了| 日本高清无吗v一区| 久久久国产精华| 天天色综合天天|