yp_dnslookup.c (50479) | yp_dnslookup.c (60833) |
---|---|
1/* 2 * Copyright (c) 1995, 1996 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#ifndef lint 34static const char rcsid[] = | 1/* 2 * Copyright (c) 1995, 1996 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#ifndef lint 34static const char rcsid[] = |
35 "$FreeBSD: head/usr.sbin/ypserv/yp_dnslookup.c 50479 1999-08-28 01:35:59Z peter $"; | 35 "$FreeBSD: head/usr.sbin/ypserv/yp_dnslookup.c 60833 2000-05-23 20:41:01Z jake $"; |
36#endif /* not lint */ 37 38/* 39 * Do standard and reverse DNS lookups using the resolver library. 40 * Take care of all the dirty work here so the main program only has to 41 * pass us a pointer to an array of characters. 42 * 43 * We have to use direct resolver calls here otherwise the YP server --- 56 unchanged lines hidden (view full) --- 100#define MAXPACKET 1024 101#define DEF_TTL 50 102 103#define BY_DNS_ID 1 104#define BY_RPC_XID 2 105 106extern struct hostent *__dns_getanswer __P((char *, int, char *, int)); 107 | 36#endif /* not lint */ 37 38/* 39 * Do standard and reverse DNS lookups using the resolver library. 40 * Take care of all the dirty work here so the main program only has to 41 * pass us a pointer to an array of characters. 42 * 43 * We have to use direct resolver calls here otherwise the YP server --- 56 unchanged lines hidden (view full) --- 100#define MAXPACKET 1024 101#define DEF_TTL 50 102 103#define BY_DNS_ID 1 104#define BY_RPC_XID 2 105 106extern struct hostent *__dns_getanswer __P((char *, int, char *, int)); 107 |
108static CIRCLEQ_HEAD(dns_qhead, circleq_dnsentry) qhead; | 108static CIRCLEQ_HEAD(dns_qhead, struct circleq_dnsentry) qhead; |
109 110struct circleq_dnsentry { 111 SVCXPRT *xprt; 112 unsigned long xid; 113 struct sockaddr_in client_addr; 114 unsigned long ypvers; 115 unsigned long id; 116 unsigned long ttl; 117 unsigned long type; 118 unsigned short prot_type; 119 char **domain; 120 char *name; 121 struct in_addr addr; | 109 110struct circleq_dnsentry { 111 SVCXPRT *xprt; 112 unsigned long xid; 113 struct sockaddr_in client_addr; 114 unsigned long ypvers; 115 unsigned long id; 116 unsigned long ttl; 117 unsigned long type; 118 unsigned short prot_type; 119 char **domain; 120 char *name; 121 struct in_addr addr; |
122 CIRCLEQ_ENTRY(circleq_dnsentry) links; | 122 CIRCLEQ_ENTRY(struct circleq_dnsentry) links; |
123}; 124 125static int pending = 0; 126 127int yp_init_resolver() 128{ 129 CIRCLEQ_INIT(&qhead); 130 if (!(_res.options & RES_INIT) && res_init() == -1) { --- 412 unchanged lines hidden --- | 123}; 124 125static int pending = 0; 126 127int yp_init_resolver() 128{ 129 CIRCLEQ_INIT(&qhead); 130 if (!(_res.options & RES_INIT) && res_init() == -1) { --- 412 unchanged lines hidden --- |