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

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

?? gen_ho.c

?? package of develop dns
?? C
字號:
/* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") * 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 rcsid[] = "$Id: gen_ho.c,v 1.1.206.2 2004/03/17 01:49:39 marka Exp $";#endif /* LIBC_SCCS and not lint *//* Imports */#include "port_before.h"#include <sys/types.h>#include <netinet/in.h>#include <arpa/nameser.h>#include <errno.h>#include <stdlib.h>#include <netdb.h>#include <resolv.h>#include <stdio.h>#include <string.h>#include <isc/memcluster.h>#include <irs.h>#include "port_after.h"#include "irs_p.h"#include "gen_p.h"/* Definitions */struct pvt {	struct irs_rule *	rules;	struct irs_rule *	rule;	struct irs_ho *		ho;	struct __res_state *	res;	void			(*free_res)(void *);};/* Forwards */static void		ho_close(struct irs_ho *this);static struct hostent *	ho_byname(struct irs_ho *this, const char *name);static struct hostent *	ho_byname2(struct irs_ho *this, const char *name,				   int af);static struct hostent *	ho_byaddr(struct irs_ho *this, const void *addr,				  int len, int af);static struct hostent *	ho_next(struct irs_ho *this);static void		ho_rewind(struct irs_ho *this);static void		ho_minimize(struct irs_ho *this);static struct __res_state * ho_res_get(struct irs_ho *this);static void		ho_res_set(struct irs_ho *this,				   struct __res_state *res,				   void (*free_res)(void *));static struct addrinfo * ho_addrinfo(struct irs_ho *this, const char *name,				     const struct addrinfo *pai);static int		init(struct irs_ho *this);/* Exports */struct irs_ho *irs_gen_ho(struct irs_acc *this) {	struct gen_p *accpvt = (struct gen_p *)this->private;	struct irs_ho *ho;	struct pvt *pvt;	if (!(pvt = memget(sizeof *pvt))) {		errno = ENOMEM;		return (NULL);	}	memset(pvt, 0, sizeof *pvt);	if (!(ho = memget(sizeof *ho))) {		memput(pvt, sizeof *pvt);		errno = ENOMEM;		return (NULL);	}	memset(ho, 0x5e, sizeof *ho);	pvt->rules = accpvt->map_rules[irs_ho];	pvt->rule = pvt->rules;	ho->private = pvt;	ho->close = ho_close;	ho->byname = ho_byname;	ho->byname2 = ho_byname2;	ho->byaddr = ho_byaddr;	ho->next = ho_next;	ho->rewind = ho_rewind;	ho->minimize = ho_minimize;	ho->res_get = ho_res_get;	ho->res_set = ho_res_set;	ho->addrinfo = ho_addrinfo;	return (ho);}/* Methods. */static voidho_close(struct irs_ho *this) {	struct pvt *pvt = (struct pvt *)this->private;	ho_minimize(this);	if (pvt->res && pvt->free_res)		(*pvt->free_res)(pvt->res);	memput(pvt, sizeof *pvt);	memput(this, sizeof *this);}static struct hostent *ho_byname(struct irs_ho *this, const char *name) {	struct pvt *pvt = (struct pvt *)this->private;	struct irs_rule *rule;	struct hostent *rval;	struct irs_ho *ho;	int therrno = NETDB_INTERNAL;	int softerror = 0;	if (init(this) == -1)		return (NULL);	for (rule = pvt->rules; rule; rule = rule->next) {		ho = rule->inst->ho;		RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);		errno = 0;		rval = (*ho->byname)(ho, name);		if (rval != NULL)			return (rval);		if (softerror == 0 &&		    pvt->res->res_h_errno != HOST_NOT_FOUND &&		    pvt->res->res_h_errno != NETDB_INTERNAL) {			softerror = 1;			therrno = pvt->res->res_h_errno;		}		if (rule->flags & IRS_CONTINUE)			continue;		/*		 * The value TRY_AGAIN can mean that the service		 * is not available, or just that this particular name		 * cannot be resolved now.  We use the errno ECONNREFUSED		 * to distinguish.  If a lookup sets that errno when		 * H_ERRNO is TRY_AGAIN, we continue to try other lookup		 * functions, otherwise we return the TRY_AGAIN error.		 */		if (pvt->res->res_h_errno != TRY_AGAIN || errno != ECONNREFUSED)			break;	}	if (softerror != 0 && pvt->res->res_h_errno == HOST_NOT_FOUND)		RES_SET_H_ERRNO(pvt->res, therrno);	return (NULL);}static struct hostent *ho_byname2(struct irs_ho *this, const char *name, int af) {	struct pvt *pvt = (struct pvt *)this->private;	struct irs_rule *rule;	struct hostent *rval;	struct irs_ho *ho;	int therrno = NETDB_INTERNAL;	int softerror = 0;	if (init(this) == -1)		return (NULL);	for (rule = pvt->rules; rule; rule = rule->next) {		ho = rule->inst->ho;		RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);		errno = 0;		rval = (*ho->byname2)(ho, name, af);		if (rval != NULL)			return (rval);		if (softerror == 0 &&		    pvt->res->res_h_errno != HOST_NOT_FOUND &&		    pvt->res->res_h_errno != NETDB_INTERNAL) {			softerror = 1;			therrno = pvt->res->res_h_errno;		}		if (rule->flags & IRS_CONTINUE)			continue;		/*		 * See the comments in ho_byname() explaining		 * the interpretation of TRY_AGAIN and ECONNREFUSED.		 */		if (pvt->res->res_h_errno != TRY_AGAIN || errno != ECONNREFUSED)			break;	}	if (softerror != 0 && pvt->res->res_h_errno == HOST_NOT_FOUND)		RES_SET_H_ERRNO(pvt->res, therrno);	return (NULL);}static struct hostent *ho_byaddr(struct irs_ho *this, const void *addr, int len, int af) {	struct pvt *pvt = (struct pvt *)this->private;	struct irs_rule *rule;	struct hostent *rval;	struct irs_ho *ho;	int therrno = NETDB_INTERNAL;	int softerror = 0;	if (init(this) == -1)		return (NULL);	for (rule = pvt->rules; rule; rule = rule->next) {		ho = rule->inst->ho;		RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);		errno = 0;		rval = (*ho->byaddr)(ho, addr, len, af);		if (rval != NULL)			return (rval);		if (softerror == 0 &&		    pvt->res->res_h_errno != HOST_NOT_FOUND &&		    pvt->res->res_h_errno != NETDB_INTERNAL) {			softerror = 1;			therrno = pvt->res->res_h_errno;		}		if (rule->flags & IRS_CONTINUE)			continue;		/*		 * See the comments in ho_byname() explaining		 * the interpretation of TRY_AGAIN and ECONNREFUSED.		 */		if (pvt->res->res_h_errno != TRY_AGAIN || errno != ECONNREFUSED)			break;	}	if (softerror != 0 && pvt->res->res_h_errno == HOST_NOT_FOUND)		RES_SET_H_ERRNO(pvt->res, therrno);	return (NULL);}static struct hostent *ho_next(struct irs_ho *this) {	struct pvt *pvt = (struct pvt *)this->private;	struct hostent *rval;	struct irs_ho *ho;	while (pvt->rule) {		ho = pvt->rule->inst->ho;		rval = (*ho->next)(ho);		if (rval)			return (rval);		if (!(pvt->rule->flags & IRS_CONTINUE))			break;		pvt->rule = pvt->rule->next;		if (pvt->rule) {			ho = pvt->rule->inst->ho;			(*ho->rewind)(ho);		}	}	return (NULL);}static voidho_rewind(struct irs_ho *this) {	struct pvt *pvt = (struct pvt *)this->private;	struct irs_ho *ho;	pvt->rule = pvt->rules;	if (pvt->rule) {		ho = pvt->rule->inst->ho;		(*ho->rewind)(ho);	}}static voidho_minimize(struct irs_ho *this) {	struct pvt *pvt = (struct pvt *)this->private;	struct irs_rule *rule;	if (pvt->res)		res_nclose(pvt->res);	for (rule = pvt->rules; rule != NULL; rule = rule->next) {		struct irs_ho *ho = rule->inst->ho;		(*ho->minimize)(ho);	}}static struct __res_state *ho_res_get(struct irs_ho *this) {	struct pvt *pvt = (struct pvt *)this->private;	if (!pvt->res) {		struct __res_state *res;		res = (struct __res_state *)malloc(sizeof *res);		if (!res) {			errno = ENOMEM;			return (NULL);		}		memset(res, 0, sizeof *res);		ho_res_set(this, res, free);	}	return (pvt->res);}static voidho_res_set(struct irs_ho *this, struct __res_state *res,		void (*free_res)(void *)) {	struct pvt *pvt = (struct pvt *)this->private;	struct irs_rule *rule;	if (pvt->res && pvt->free_res) {		res_nclose(pvt->res);		(*pvt->free_res)(pvt->res);	}	pvt->res = res;	pvt->free_res = free_res;	for (rule = pvt->rules; rule != NULL; rule = rule->next) {		struct irs_ho *ho = rule->inst->ho;		(*ho->res_set)(ho, pvt->res, NULL);	}}static struct addrinfo *ho_addrinfo(struct irs_ho *this, const char *name, const struct addrinfo *pai){	struct pvt *pvt = (struct pvt *)this->private;	struct irs_rule *rule;	struct addrinfo *rval = NULL;	struct irs_ho *ho;	int therrno = NETDB_INTERNAL;	int softerror = 0;	if (init(this) == -1)		return (NULL);	for (rule = pvt->rules; rule; rule = rule->next) {		ho = rule->inst->ho;		RES_SET_H_ERRNO(pvt->res, NETDB_INTERNAL);		errno = 0;		if (ho->addrinfo == NULL) /* for safety */			continue;		rval = (*ho->addrinfo)(ho, name, pai);		if (rval != NULL)			return (rval);		if (softerror == 0 &&		    pvt->res->res_h_errno != HOST_NOT_FOUND &&		    pvt->res->res_h_errno != NETDB_INTERNAL) {			softerror = 1;			therrno = pvt->res->res_h_errno;		}		if (rule->flags & IRS_CONTINUE)			continue;		/*		 * See the comments in ho_byname() explaining		 * the interpretation of TRY_AGAIN and ECONNREFUSED.		 */		if (pvt->res->res_h_errno != TRY_AGAIN ||		    errno != ECONNREFUSED)			break;	}	if (softerror != 0 && pvt->res->res_h_errno == HOST_NOT_FOUND)		RES_SET_H_ERRNO(pvt->res, therrno);	if (rval)		freeaddrinfo(rval);	return (NULL);}static intinit(struct irs_ho *this) {	struct pvt *pvt = (struct pvt *)this->private;        if (!pvt->res && !ho_res_get(this))                return (-1);        if (((pvt->res->options & RES_INIT) == 0U) &&            (res_ninit(pvt->res) == -1))                return (-1);        return (0);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲综合色| 日韩精品福利网| 99这里都是精品| 成人免费一区二区三区视频 | 日韩精品国产欧美| 91精品国产综合久久精品| 免费观看久久久4p| 精品久久99ma| 成人av网站免费观看| 中文字幕一区在线观看视频| 日本高清不卡在线观看| 午夜欧美电影在线观看| 欧美成人a∨高清免费观看| 国产精品一区二区男女羞羞无遮挡| 欧美国产精品劲爆| 91久久精品网| 久久超碰97中文字幕| 欧美激情一区二区三区| 欧美亚洲国产一区在线观看网站| 日日摸夜夜添夜夜添国产精品| 精品少妇一区二区三区日产乱码| 国产成人免费在线视频| 亚洲精品伦理在线| 欧美成人a在线| 91精品福利视频| 麻豆国产欧美日韩综合精品二区| 国产午夜精品久久久久久免费视| 色综合欧美在线视频区| 青娱乐精品视频在线| 国产精品免费视频一区| 91麻豆精品国产91久久久| 国产v综合v亚洲欧| 天天影视色香欲综合网老头| 国产视频视频一区| 欧美日韩成人一区二区| 成人在线一区二区三区| 日韩电影免费在线观看网站| 中国av一区二区三区| 制服视频三区第一页精品| 国产成人av资源| 国产精品自拍av| 欧美日韩国产在线观看| 国产成人免费在线视频| 蜜桃视频免费观看一区| 亚洲精品伦理在线| 国产精品久线在线观看| 日韩午夜中文字幕| 欧美亚洲尤物久久| 99综合电影在线视频| 国产一区二区三区最好精华液| 亚洲欧美日韩在线不卡| 26uuu精品一区二区三区四区在线| 色综合天天天天做夜夜夜夜做| 精品一区中文字幕| 日韩精彩视频在线观看| 一区二区三区免费网站| 国产精品家庭影院| 久久久91精品国产一区二区精品| 91精品欧美久久久久久动漫| 色偷偷一区二区三区| 成人免费高清视频在线观看| 久久国产乱子精品免费女| 偷拍一区二区三区四区| 亚洲综合成人网| 亚洲丝袜另类动漫二区| 国产精品国产精品国产专区不蜜| 精品成人佐山爱一区二区| 日韩一级二级三级精品视频| 337p亚洲精品色噜噜狠狠| 精品1区2区3区| 欧美日韩性生活| 欧美日韩一区二区在线观看视频| 色天天综合久久久久综合片| 91同城在线观看| 91视频.com| 在线看日本不卡| 欧美日韩中文字幕精品| 欧美日韩一区二区在线视频| 欧美日韩国产123区| 欧美久久婷婷综合色| 欧美精品一二三区| 日韩一区国产二区欧美三区| 日韩视频在线永久播放| 337p日本欧洲亚洲大胆精品| 26uuu国产电影一区二区| 久久婷婷国产综合精品青草| 国产色产综合色产在线视频| 国产区在线观看成人精品| 中文字幕av不卡| 亚洲色图欧美在线| 亚洲国产综合在线| 日本亚洲电影天堂| 国产一区二区三区最好精华液| 国产成人精品影视| 色综合久久久网| 欧美日韩美少妇| 精品日韩欧美一区二区| 国产欧美一区二区精品性| 一区在线播放视频| 亚洲成人动漫av| 精品影院一区二区久久久| 成人免费毛片片v| 欧美亚洲国产一区二区三区| 91精品国产一区二区三区蜜臀 | 91免费在线视频观看| 日本二三区不卡| 9191国产精品| 国产情人综合久久777777| 亚洲欧美日韩国产一区二区三区| 午夜伦欧美伦电影理论片| 蜜臀99久久精品久久久久久软件| 国产成人免费视频一区| 在线观看不卡视频| 26uuu亚洲综合色欧美| 亚洲同性同志一二三专区| 三级久久三级久久久| 东方欧美亚洲色图在线| 色网站国产精品| 久久九九国产精品| 亚洲国产中文字幕在线视频综合| 精品一区二区三区在线播放| 一本大道久久精品懂色aⅴ| 欧美一区二区三区在线视频| 国产精品色一区二区三区| 日韩成人免费在线| 99re66热这里只有精品3直播| 欧美日韩亚洲国产综合| 中文字幕中文字幕一区二区| 青青国产91久久久久久| 91美女在线观看| 久久综合久久综合久久综合| 亚洲第一主播视频| 成人黄色免费短视频| 日韩欧美一级片| 午夜一区二区三区在线观看| 成人国产在线观看| 精品粉嫩超白一线天av| 亚洲成av人影院| 99re66热这里只有精品3直播| 久久婷婷国产综合国色天香| 日韩福利电影在线观看| 色88888久久久久久影院野外| 国产亚洲成aⅴ人片在线观看 | 亚洲你懂的在线视频| 精品亚洲成a人| 69堂精品视频| 亚洲自拍偷拍网站| 99久久夜色精品国产网站| 久久久久久久av麻豆果冻| 日韩成人午夜精品| 欧美日本韩国一区二区三区视频| 亚洲欧美日本在线| 成人高清免费在线播放| 久久美女艺术照精彩视频福利播放| 午夜精品福利在线| 欧美午夜精品久久久久久超碰| 国产精品欧美久久久久一区二区| 国产一区视频在线看| 欧美电影免费观看高清完整版在线| 亚洲国产精品久久久久婷婷884| 91视频91自| 夜夜爽夜夜爽精品视频| 91麻豆123| 亚洲影视在线观看| 欧洲色大大久久| 亚洲一区二区3| 欧美午夜片在线看| 亚洲成人av电影| 欧美嫩在线观看| 青草av.久久免费一区| 欧美一区二区在线播放| 蜜臀久久99精品久久久久久9| 日韩午夜中文字幕| 国产美女精品在线| 国产欧美精品一区二区三区四区| 国产高清精品网站| 中文字幕在线一区免费| 色综合色综合色综合| 午夜国产精品一区| 欧美一级理论片| 国产经典欧美精品| 国产精品激情偷乱一区二区∴| 一本久久a久久免费精品不卡| 亚洲午夜免费视频| 日韩免费电影一区| 国产精品一级片| 自拍偷拍亚洲综合| 欧美图区在线视频| 久久精品国产一区二区三区免费看| 欧美tk—视频vk| 成人免费视频app| 亚洲黄色片在线观看| 911精品产国品一二三产区| 久久69国产一区二区蜜臀| 国产午夜精品一区二区三区视频| 成人免费av在线| 亚洲成人动漫精品| 久久久电影一区二区三区| 色综合久久99| 美女在线视频一区|