Deleted Added
full compact
res_data.c (156956) res_data.c (157308)
1/*
2 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (c) 1995-1999 by Internet Software Consortium.
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *

--- 5 unchanged lines hidden (view full) ---

14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
15 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#if defined(LIBC_SCCS) && !defined(lint)
19static const char rcsid[] = "$Id: res_data.c,v 1.1.206.2 2004/03/16 12:34:18 marka Exp $";
20#endif /* LIBC_SCCS and not lint */
21#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (c) 1995-1999 by Internet Software Consortium.
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *

--- 5 unchanged lines hidden (view full) ---

14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
15 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#if defined(LIBC_SCCS) && !defined(lint)
19static const char rcsid[] = "$Id: res_data.c,v 1.1.206.2 2004/03/16 12:34:18 marka Exp $";
20#endif /* LIBC_SCCS and not lint */
21#include <sys/cdefs.h>
22__FBSDID("$FreeBSD: head/lib/libc/resolv/res_data.c 156956 2006-03-21 15:37:16Z ume $");
22__FBSDID("$FreeBSD: head/lib/libc/resolv/res_data.c 157308 2006-03-30 20:15:53Z ume $");
23
24#include "port_before.h"
25
26#include <sys/types.h>
27#include <sys/param.h>
28#include <sys/socket.h>
29#include <sys/time.h>
30
31#include <netinet/in.h>
32#include <arpa/inet.h>
33#include <arpa/nameser.h>
34
35#include <ctype.h>
36#include <netdb.h>
37#include <resolv.h>
23
24#include "port_before.h"
25
26#include <sys/types.h>
27#include <sys/param.h>
28#include <sys/socket.h>
29#include <sys/time.h>
30
31#include <netinet/in.h>
32#include <arpa/inet.h>
33#include <arpa/nameser.h>
34
35#include <ctype.h>
36#include <netdb.h>
37#include <resolv.h>
38#ifndef _LIBC
39#include <res_update.h>
38#include <res_update.h>
40#endif
41#include <stdio.h>
42#include <stdlib.h>
43#include <string.h>
44#include <unistd.h>
45
46#include "port_after.h"
47
48const char *_res_opcodes[] = {

--- 102 unchanged lines hidden (view full) ---

151 RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
152 return (-1);
153 }
154 return (res_nmkquery(&_res, op, dname, class, type,
155 data, datalen,
156 newrr_in, buf, buflen));
157}
158
39#include <stdio.h>
40#include <stdlib.h>
41#include <string.h>
42#include <unistd.h>
43
44#include "port_after.h"
45
46const char *_res_opcodes[] = {

--- 102 unchanged lines hidden (view full) ---

149 RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
150 return (-1);
151 }
152 return (res_nmkquery(&_res, op, dname, class, type,
153 data, datalen,
154 newrr_in, buf, buflen));
155}
156
159#ifndef _LIBC
160int
161res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
162 if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
163 RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
164 return (-1);
165 }
166
167 return (res_nmkupdate(&_res, rrecp_in, buf, buflen));
168}
157int
158res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
159 if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
160 RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
161 return (-1);
162 }
163
164 return (res_nmkupdate(&_res, rrecp_in, buf, buflen));
165}
169#endif
170
171int
172res_query(const char *name, /* domain name */
173 int class, int type, /* class and type of query */
174 u_char *answer, /* buffer to put answer */
175 int anslen) /* size of answer buffer */
176{
177 if ((_res.options & RES_INIT) == 0U && res_init() == -1) {

--- 44 unchanged lines hidden (view full) ---

222}
223#endif
224
225void
226res_close(void) {
227 res_nclose(&_res);
228}
229
166
167int
168res_query(const char *name, /* domain name */
169 int class, int type, /* class and type of query */
170 u_char *answer, /* buffer to put answer */
171 int anslen) /* size of answer buffer */
172{
173 if ((_res.options & RES_INIT) == 0U && res_init() == -1) {

--- 44 unchanged lines hidden (view full) ---

218}
219#endif
220
221void
222res_close(void) {
223 res_nclose(&_res);
224}
225
230#ifndef _LIBC
231int
232res_update(ns_updrec *rrecp_in) {
233 if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
234 RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
235 return (-1);
236 }
237
238 return (res_nupdate(&_res, rrecp_in, NULL));
239}
226int
227res_update(ns_updrec *rrecp_in) {
228 if ((_res.options & RES_INIT) == 0U && res_init() == -1) {
229 RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
230 return (-1);
231 }
232
233 return (res_nupdate(&_res, rrecp_in, NULL));
234}
240#endif
241
242int
243res_search(const char *name, /* domain name */
244 int class, int type, /* class and type of query */
245 u_char *answer, /* buffer to put answer */
246 int anslen) /* size of answer */
247{
248 if ((_res.options & RES_INIT) == 0U && res_init() == -1) {

--- 76 unchanged lines hidden ---
235
236int
237res_search(const char *name, /* domain name */
238 int class, int type, /* class and type of query */
239 u_char *answer, /* buffer to put answer */
240 int anslen) /* size of answer */
241{
242 if ((_res.options & RES_INIT) == 0U && res_init() == -1) {

--- 76 unchanged lines hidden ---