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

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

?? res_send.c

?? vxworks source code, used for develop vxworks system.
?? C
字號(hào):
/* res_send.c - *//* Copyright 1984-2001 Wind River Systems, Inc. */#include "copyright_wrs.h"/* * Copyright (c) 1985, 1989 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--------------------01c,05nov01,vvv fixed compilation warning; cleaned up use of register01b,04sep01,vvv fixed to correctly query multiple servers (SPR #67238);                fixed compilation warnings01a,13dec96,jag Cleaned up.  Added resolv prefix. Man pages can be found in                files resolvLib.c.  Added code for pdnsDebugFunc.*//* * Send query to name server and wait for reply. */#include <sys/times.h>#include <resolvLib.h>#include <sockLib.h>#include <net/uio.h>#include <unistd.h>#include <string.h>#include "ioLib.h"extern FUNCPTR pdnsDebugFunc;#ifndef FD_SET#define	NFDBITS		32#define	FD_SETSIZE	32#define	FD_SET(n, p)	((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))#define	FD_CLR(n, p)	((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))#define	FD_ISSET(n, p)	((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))#define FD_ZERO(p)	bzero((char *)(p), sizeof(*(p)))#endifint resolvSend(buf, buflen, answer, anslen)	const char *buf;	int buflen;	char *answer;	int anslen;{	int n = 0;	int try, v_circuit, resplen, ns;	int gotsomewhere = 0, connected = 0;	int connreset = 0;	u_short id, len;	char *cp;	fd_set dsmask;	struct timeval timeout;	HEADER *hp = (HEADER *) buf;	HEADER *anhp = (HEADER *) answer;	struct iovec iov[2];	int terrno = ETIMEDOUT;	char junk[512];	int start;      /* pointer to server we start querying with */        int s = -1;	/* socket used for communications */        struct sockaddr no_addr;        bzero ((char*) &no_addr, sizeof no_addr);#ifdef ORG_RESOLVER#ifdef DEBUG	if (_res.options & RES_DEBUG) {		printf("resSend()\n");		__p_query(buf);	}#endif /* DEBUG */#else	if (pdnsDebugFunc != (FUNCPTR) NULL)	    {	    printf("resolvSend()\n");	    (*pdnsDebugFunc)(buf);	    }#endif /* ORG_RESOLVER */#ifdef ORG_RESOLVER	/* Unecessary test under VxWorks */	if (!(_res.options & RES_INIT))		if (res_init() == -1) {			return(ERROR);		}#endif /* ORG_RESOLVER */	v_circuit = (_res.options & RES_USEVC) || buflen > PACKETSZ;	id = hp->id;	/*	 * Send request, RETRY times, or until successful	 */	for (try = 0; try < _res.retry; try++) {	   start = MAXDNSLUS;	   for (ns = 0; ns < _res.nscount; ns++) {		/*		 * Only query servers marked active or appearing after		 * a server marked as active. This prevents this loop		 * from rescanning the entire array every time resolvSend 	         * is called		 */		if ((_res.lookups [ns] != 'a') && (ns < start))		    continue;		if (ns > start)		    _res.lookups [ns] = 'd';  /* mark as 'done' */		start = ns;#ifdef DEBUG		if (_res.options & RES_DEBUG)			printf("Querying server (# %d) address = %s\n", ns+1,			      inet_ntoa(_res.nsaddr_list[ns].sin_addr));#endif /* DEBUG */	usevc:		if (v_circuit) {			int truncated = 0;			/*			 * Use virtual circuit;			 * at most one attempt per server.			 */			try = _res.retry;			if (s < 0) {				s = socket(AF_INET, SOCK_STREAM, 0);				if (s < 0) {					terrno = errno;#ifdef DEBUG					if (_res.options & RES_DEBUG)					    perror("socket (vc) failed");#endif /* DEBUG */					continue;				}				if (connect(s,				    (struct sockaddr *)&(_res.nsaddr_list[ns]),				    sizeof(struct sockaddr)) < 0) {					terrno = errno;#ifdef DEBUG					if (_res.options & RES_DEBUG)					    perror("connect failed");#endif /* DEBUG */					(void) close(s);					s = -1;					continue;				}			}			/*			 * Send length & message			 */			len = htons((u_short)buflen);			iov[0].iov_base = (caddr_t)&len;			iov[0].iov_len = sizeof(len);			iov[1].iov_base = (char *)buf;			iov[1].iov_len = buflen;			if (writev(s, iov, 2) != sizeof(len) + buflen) {				terrno = errno;#ifdef DEBUG				if (_res.options & RES_DEBUG)					perror("write failed");#endif /* DEBUG */				(void) close(s);				s = -1;				continue;			}			/*			 * Receive length & response			 */			cp = answer;			len = sizeof(short);			while (len != 0 &&			    (n = read(s, (char *)cp, (int)len)) > 0) {				cp += n;				len -= n;			}			if (n <= 0) {				terrno = errno;#ifdef DEBUG				if (_res.options & RES_DEBUG)					perror("read failed");#endif /* DEBUG */				(void) close(s);				s = -1;				/*				 * A long running process might get its TCP				 * connection reset if the remote server was				 * restarted.  Requery the server instead of				 * trying a new one.  When there is only one				 * server, this means that a query might work				 * instead of failing.  We only allow one reset				 * per query to prevent looping.				 */				if (terrno == ECONNRESET && !connreset) {					connreset = 1;					ns--;				}				continue;			}			cp = answer;			if ((resplen = ntohs(*(u_short *)cp)) > anslen) {#ifdef DEBUG				if (_res.options & RES_DEBUG)					fprintf(stderr, "response truncated\n");#endif /* DEBUG */				len = anslen;				truncated = 1;			} else				len = resplen;			while (len != 0 &&			   (n = read(s, (char *)cp, (int)len)) > 0) {				cp += n;				len -= n;			}			if (n <= 0) {				terrno = errno;#ifdef DEBUG				if (_res.options & RES_DEBUG)					perror("read failed");#endif /* DEBUG */				(void) close(s);				s = -1;				continue;			}			if (truncated) {				/*				 * Flush rest of answer				 * so connection stays in synch.				 */				anhp->tc = 1;				len = resplen - anslen;				while (len != 0) {					n = (len > sizeof(junk) ?					    sizeof(junk) : len);					if ((n = read(s, junk, n)) > 0)						len -= n;					else						break;				}			}		} else {			/*			 * Use datagrams.			 */			if (s < 0) {				s = socket(AF_INET, SOCK_DGRAM, 0);				if (s < 0) {					terrno = errno;#ifdef DEBUG					if (_res.options & RES_DEBUG)					    perror("socket (dg) failed");#endif /* DEBUG */					continue;				}			}#if	BSD >= 43			/*			 * I'm tired of answering this question, so:			 * On a 4.3BSD+ machine (client and server,			 * actually), sending to a nameserver datagram			 * port with no nameserver will cause an			 * ICMP port unreachable message to be returned.			 * If our datagram socket is "connected" to the			 * server, we get an ECONNREFUSED error on the next			 * socket operation, and select returns if the			 * error message is received.  We can thus detect			 * the absence of a nameserver without timing out.			 * If we have sent queries to at least two servers,			 * however, we don't want to remain connected,			 * as we wish to receive answers from the first			 * server to respond.			 */			if (_res.nscount == 1 || (try == 0 && ns == 0)) {				/*				 * Don't use connect if we might				 * still receive a response				 * from another server.				 */				if (connected == 0) {			if (connect(s, (struct sockaddr *)&_res.nsaddr_list[ns],					    sizeof(struct sockaddr)) < 0) {#ifdef DEBUG						if (_res.options & RES_DEBUG)							perror("connect");#endif /* DEBUG */						continue;					}					connected = 1;				}				if (send(s, buf, buflen, 0) != buflen) {#ifdef DEBUG					if (_res.options & RES_DEBUG)						perror("send");#endif /* DEBUG */					continue;				}			} else {				/*				 * Disconnect if we want to listen				 * for responses from more than one server.				 */				if (connected) {					(void) connect(s, &no_addr,					    sizeof(no_addr));					connected = 0;				}#endif /* BSD */				if (sendto(s, (char *) buf, buflen, 0,				    (struct sockaddr *)&_res.nsaddr_list[ns],				    sizeof(struct sockaddr)) != buflen) {#ifdef DEBUG					if (_res.options & RES_DEBUG)						perror("sendto");#endif /* DEBUG */					continue;				}#if	BSD >= 43			}#endif			/*			 * Wait for reply			 */			timeout.tv_sec = (_res.retrans << try);			if (try > 0)				timeout.tv_sec /= _res.nscount;			if (timeout.tv_sec <= 0)				timeout.tv_sec = 1;			timeout.tv_usec = 0;wait:			FD_ZERO(&dsmask);			FD_SET(s, &dsmask);			n = select(s+1, &dsmask, (fd_set *)NULL,				(fd_set *)NULL, &timeout);			if (n < 0) {#ifdef DEBUG				if (_res.options & RES_DEBUG)					perror("select");#endif /* DEBUG */				continue;			}			if (n == 0) {				/*				 * timeout				 */#ifdef DEBUG				if (_res.options & RES_DEBUG)					printf("timeout\n");#endif /* DEBUG */#if BSD >= 43				gotsomewhere = 1;#endif				continue;			}			if ((resplen = recv(s, answer, anslen, 0)) <= 0) {#ifdef DEBUG				if (_res.options & RES_DEBUG)					perror("recvfrom");#endif /* DEBUG */				continue;			}			gotsomewhere = 1;			if (id != anhp->id) {				/*				 * response from old query, ignore it				 */#ifdef ORG_RESOLVER#ifdef DEBUG				if (_res.options & RES_DEBUG) {					printf("old answer:\n");					__p_query(answer);				}#endif /* DEBUG */#else				if (pdnsDebugFunc != (FUNCPTR) NULL)				    {				    printf("old answer:\n");				    (*pdnsDebugFunc)(answer);				    }#endif /* ORG_RESOLVER */				goto wait;			}			if (!(_res.options & RES_IGNTC) && anhp->tc) {				/*				 * get rest of answer;				 * use TCP with same server.				 */#ifdef DEBUG				if (_res.options & RES_DEBUG)					printf("truncated answer\n");#endif /* DEBUG */				(void) close(s);				s = -1;				v_circuit = 1;				goto usevc;			}		}#ifdef ORG_RESOLVER#ifdef DEBUG		if (_res.options & RES_DEBUG) {			printf("got answer:\n");			__p_query(answer);		}#endif /* DEBUG */#else		if (pdnsDebugFunc != (FUNCPTR) NULL)		    {		    printf("got answer:\n");		    (*pdnsDebugFunc)(answer);		    }#endif /* ORG_RESOLVER */		/*		 * If using virtual circuits, we assume that the first server		 * is preferred * over the rest (i.e. it is on the local		 * machine) and only keep that one open.		 * If we have temporarily opened a virtual circuit,		 * or if we haven't been asked to keep a socket open,		 * close the socket.		 */		if ((v_circuit &&		    ((_res.options & RES_USEVC) == 0 || ns != 0)) ||		    (_res.options & RES_STAYOPEN) == 0) {			(void) close(s);			s = -1;		}		return (resplen);	   }	}	if (s >= 0) {		(void) close(s);		s = -1;	}	if (v_circuit == 0)		if (gotsomewhere == 0)			errno = ECONNREFUSED;	/* no nameservers found */		else			errno = ETIMEDOUT;	/* no answer obtained */	else		errno = terrno;	return (ERROR);}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩亚洲国产综合| 日韩欧美亚洲另类制服综合在线| 一区二区三区加勒比av| 制服丝袜激情欧洲亚洲| 国产成a人无v码亚洲福利| 亚洲精品福利视频网站| 欧美成人福利视频| 一本大道综合伊人精品热热| 久久精品国产免费看久久精品| 亚洲日本va午夜在线电影| 欧美一卡二卡在线观看| 色诱视频网站一区| 大桥未久av一区二区三区中文| 五月婷婷激情综合| 亚洲猫色日本管| 日本一区二区三区四区| 日韩精品一区二区三区视频| 欧美亚洲另类激情小说| 99久久国产综合精品女不卡 | 亚洲国产视频直播| 中文字幕电影一区| 久久亚洲私人国产精品va媚药| 欧美探花视频资源| 91首页免费视频| 成人av资源在线观看| 韩日精品视频一区| 麻豆91精品视频| 日本亚洲最大的色成网站www| 亚洲欧美日韩精品久久久久| 国产精品嫩草影院av蜜臀| 国产亚洲一区二区三区| 久久尤物电影视频在线观看| 日韩一区二区不卡| 日韩一区二区不卡| 欧美xxx久久| 精品国产凹凸成av人导航| 日韩片之四级片| 欧美一区二区成人6969| 3atv一区二区三区| 日韩三级中文字幕| 日韩精品中文字幕在线一区| 欧美一区二区三区在线看| 91精品久久久久久蜜臀| 欧美老女人第四色| 欧美一区二区在线视频| 日韩三级视频在线观看| 日韩精品中午字幕| 久久久影院官网| 国产蜜臀97一区二区三区| 国产日本欧洲亚洲| 中文字幕一区二区三区四区不卡 | 欧美亚洲动漫精品| 欧美色视频在线观看| 欧美浪妇xxxx高跟鞋交| 日韩一区二区高清| 久久精品一区二区三区不卡| 日本一区二区三区免费乱视频| 久久噜噜亚洲综合| 亚洲天堂福利av| 亚洲五码中文字幕| 三级不卡在线观看| 国产伦精品一区二区三区视频青涩| 国产成人综合在线播放| 99re这里都是精品| 欧美日韩精品一区二区天天拍小说 | 亚洲视频免费观看| 亚洲综合在线免费观看| 免费亚洲电影在线| 成人综合婷婷国产精品久久蜜臀| 91麻豆自制传媒国产之光| 欧美日韩一级二级| 久久久一区二区三区捆绑**| 日韩毛片精品高清免费| 天堂成人国产精品一区| 国产一区二区不卡在线| 色哟哟在线观看一区二区三区| 欧美日韩久久久一区| 国产偷国产偷精品高清尤物| 亚洲欧洲综合另类在线| 美女视频第一区二区三区免费观看网站| 国产一区不卡在线| 在线观看免费成人| 久久丝袜美腿综合| 夜夜嗨av一区二区三区中文字幕 | 久久精品99国产精品| 99久精品国产| 日韩一区二区三区免费看 | 国产精品久久精品日日| 亚洲成人动漫在线免费观看| 黑人巨大精品欧美一区| 欧美视频一区二区三区四区| 久久久91精品国产一区二区精品 | 国产精品久久久久aaaa樱花| 日韩av一区二| 色综合激情五月| 久久久不卡网国产精品二区| 亚洲一区二区av在线| 国产在线精品一区二区不卡了 | 精品久久久影院| 一区二区三区在线视频观看 | 亚洲第一综合色| 成人黄色免费短视频| 欧美一卡2卡三卡4卡5免费| 国产精品萝li| 韩国三级中文字幕hd久久精品| 欧美系列日韩一区| 国产婷婷一区二区| 久久精品国产精品亚洲精品| 欧洲精品在线观看| 成人欧美一区二区三区| 激情成人综合网| 91精品在线麻豆| 亚洲一二三区在线观看| 99视频一区二区| 国产日产欧美一区| 国内精品国产成人国产三级粉色| 欧美精品丝袜久久久中文字幕| 亚洲伦理在线免费看| 成人综合在线网站| 国产视频亚洲色图| 国产在线国偷精品产拍免费yy| 欧美一级精品大片| 日韩av在线发布| 7799精品视频| 亚洲v中文字幕| 欧美性色aⅴ视频一区日韩精品| 国产精品的网站| 成人av在线一区二区| 国产午夜亚洲精品理论片色戒| 韩国av一区二区三区四区| 日韩视频一区二区在线观看| 青青草原综合久久大伊人精品| 欧美日韩高清在线| 亚洲va国产天堂va久久en| 欧美网站大全在线观看| 亚洲综合久久久久| 欧美视频中文字幕| 午夜免费久久看| 欧美高清dvd| 日本欧美肥老太交大片| 91精品国产综合久久久久久| 日韩电影在线一区| 欧美成人午夜电影| 狠狠网亚洲精品| 国产性天天综合网| 不卡一区二区在线| 一区二区三区中文在线观看| 欧美无砖专区一中文字| 日日摸夜夜添夜夜添精品视频 | 免费看日韩a级影片| 日韩精品一区二区三区蜜臀| 加勒比av一区二区| 欧美激情一二三区| 色婷婷国产精品久久包臀 | 成人中文字幕合集| 亚洲天堂久久久久久久| 欧美日韩精品电影| 日本伊人午夜精品| 久久久久久久久久电影| 波多野结衣中文字幕一区二区三区 | 日韩一区在线播放| 在线亚洲+欧美+日本专区| 无码av中文一区二区三区桃花岛| 欧美一三区三区四区免费在线看 | 99精品久久免费看蜜臀剧情介绍| 亚洲男人天堂一区| 欧美久久久久久久久中文字幕| 蜜桃视频在线观看一区| 久久精品视频免费| 一本大道av伊人久久综合| 青青草精品视频| 中文字幕亚洲在| 欧美乱熟臀69xxxxxx| 国产大陆精品国产| 亚洲国产成人av网| 久久精品视频一区| 欧美久久久久中文字幕| 粉嫩欧美一区二区三区高清影视| 一区二区三区在线视频免费| 欧美成人精品高清在线播放| 91麻豆福利精品推荐| 蜜臀国产一区二区三区在线播放| 国产女同互慰高潮91漫画| 欧美精品第1页| 成人高清在线视频| 日韩高清欧美激情| **网站欧美大片在线观看| 日韩一区二区三免费高清| 成人污视频在线观看| 日韩av午夜在线观看| 中文字幕一区二区在线播放| 日韩亚洲欧美一区| 一本到不卡免费一区二区| 国产老女人精品毛片久久| 一区二区三区在线播| 国产午夜一区二区三区| 日韩一区二区三区高清免费看看| 色香蕉久久蜜桃| 国产精品18久久久久久久网站| 午夜精品福利一区二区三区蜜桃|