diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/lib/libresolv/res_comp.c | 17 | ||||
-rw-r--r-- | usr/src/lib/libresolv/res_debug.c | 5 | ||||
-rw-r--r-- | usr/src/lib/libresolv/res_gethost.c | 13 | ||||
-rw-r--r-- | usr/src/lib/libresolv/res_init.c | 5 | ||||
-rw-r--r-- | usr/src/lib/libresolv/res_mkquery.c | 7 | ||||
-rw-r--r-- | usr/src/lib/libresolv/res_query.c | 5 | ||||
-rw-r--r-- | usr/src/lib/libresolv/res_send.c | 42 | ||||
-rw-r--r-- | usr/src/lib/libresolv/res_sethost.c | 5 | ||||
-rw-r--r-- | usr/src/lib/libresolv2/common/isc/eventlib_p.h | 4 | ||||
-rw-r--r-- | usr/src/lib/libresolv2/include/port_after.h | 9 | ||||
-rw-r--r-- | usr/src/lib/libresolv2/include/port_before.h | 11 |
11 files changed, 69 insertions, 54 deletions
diff --git a/usr/src/lib/libresolv/res_comp.c b/usr/src/lib/libresolv/res_comp.c index 9835ead5df..030378fe39 100644 --- a/usr/src/lib/libresolv/res_comp.c +++ b/usr/src/lib/libresolv/res_comp.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 1996 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -45,7 +45,8 @@ #include <stdio.h> #include <arpa/nameser.h> -static dn_find(); +static int dn_find(u_char *exp_dn, u_char *msg, u_char **dnptrs, + u_char **lastdnptr); /* @@ -55,6 +56,7 @@ static dn_find(); * 'exp_dn' is a pointer to a buffer of size 'length' for the result. * Return size of compressed name or -1 if there was an error. */ +int dn_expand(msg, eomorig, comp_dn, exp_dn, length) u_char *msg, *eomorig, *comp_dn, *exp_dn; int length; @@ -134,6 +136,7 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length) * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr' * is NULL, we don't update the list. */ +int dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) u_char *exp_dn, *comp_dn; int length; @@ -212,6 +215,7 @@ dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) /* * Skip over a compressed domain name. Return the size or -1. */ +int dn_skipname(comp_dn, eom) u_char *comp_dn, *eom; { @@ -243,10 +247,8 @@ dn_skipname(comp_dn, eom) * dnptrs is the pointer to the first name on the list, * not the pointer to the start of the message. */ -static -dn_find(exp_dn, msg, dnptrs, lastdnptr) - u_char *exp_dn, *msg; - u_char **dnptrs, **lastdnptr; +static int +dn_find(u_char *exp_dn, u_char *msg, u_char **dnptrs, u_char **lastdnptr) { register u_char *dn, *cp, **cpp; register int n; @@ -328,7 +330,7 @@ _getlong(msgp) return (u | *p); } - +void putshort(s, msgp) register u_short s; register u_char *msgp; @@ -338,6 +340,7 @@ putshort(s, msgp) msgp[0] = s >> 8; } +void putlong(l, msgp) register u_long l; register u_char *msgp; diff --git a/usr/src/lib/libresolv/res_debug.c b/usr/src/lib/libresolv/res_debug.c index 2b4de0981d..47a8f2c97f 100644 --- a/usr/src/lib/libresolv/res_debug.c +++ b/usr/src/lib/libresolv/res_debug.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 1996 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -48,6 +48,7 @@ extern char *p_cdname(), *p_rr(), *p_type(), *p_class(), *p_time(); extern char *inet_ntoa(); +void fp_query(char *msg, FILE *file); char *_res_opcodes[] = { "QUERY", @@ -87,6 +88,7 @@ char *_res_resultcodes[] = { "NOCHANGE", }; +void p_query(msg) char *msg; { @@ -97,6 +99,7 @@ p_query(msg) * Print the contents of a query. * This is intended to be primarily a debugging routine. */ +void fp_query(msg, file) char *msg; FILE *file; diff --git a/usr/src/lib/libresolv/res_gethost.c b/usr/src/lib/libresolv/res_gethost.c index 9e20672a14..b7c42b335e 100644 --- a/usr/src/lib/libresolv/res_gethost.c +++ b/usr/src/lib/libresolv/res_gethost.c @@ -339,11 +339,10 @@ res_gethostbyaddr(addr, len, type) return ((struct hostent *)NULL); } -static -_sethtent(f) - int f; +static void +_sethtent(int f) { - if (__res_no_hosts_fallback()) return(0); + if (__res_no_hosts_fallback()) return; if (hostf == NULL) hostf = fopen(HOSTDB, "r"); @@ -352,10 +351,10 @@ _sethtent(f) stayopen |= f; } -static -_endhtent() +static void +_endhtent(void) { - if (__res_no_hosts_fallback()) return(0); + if (__res_no_hosts_fallback()) return; if (hostf && !stayopen) { (void) fclose(hostf); diff --git a/usr/src/lib/libresolv/res_init.c b/usr/src/lib/libresolv/res_init.c index 1c01d85271..630b45d8c8 100644 --- a/usr/src/lib/libresolv/res_init.c +++ b/usr/src/lib/libresolv/res_init.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 1999 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -82,7 +82,8 @@ struct state _res = { * * Return 0 if completes successfully, -1 on error */ -res_init() +int +res_init(void) { register FILE *fp; register char *cp, **pp; diff --git a/usr/src/lib/libresolv/res_mkquery.c b/usr/src/lib/libresolv/res_mkquery.c index acbd0ee6ed..1bc6ba1584 100644 --- a/usr/src/lib/libresolv/res_mkquery.c +++ b/usr/src/lib/libresolv/res_mkquery.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 1998 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -118,6 +118,7 @@ static int _confcheck() * Form all types of queries. * Returns the size of the result or -1. */ +int res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) int op; /* opcode of query */ char *dname; /* domain name */ @@ -136,7 +137,7 @@ res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) #ifdef DEBUG if (_res.options & RES_DEBUG) printf("res_mkquery(%d, %s, %d, %d)\n", op, dname, class, type); -#endif DEBUG +#endif /* DEBUG */ /* * Check to see if we can bailout quickly. @@ -304,7 +305,7 @@ res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) hp->ancount = htons(0); break; -#endif ALLOW_UPDATES +#endif /* ALLOW_UPDATES */ } return (cp - buf); } diff --git a/usr/src/lib/libresolv/res_query.c b/usr/src/lib/libresolv/res_query.c index 320776bf18..70d9d8be47 100644 --- a/usr/src/lib/libresolv/res_query.c +++ b/usr/src/lib/libresolv/res_query.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 1997 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -70,6 +70,7 @@ int h_errno; * Error number is left in h_errno. * Caller must parse answer and determine whether it answers the question. */ +int res_query(name, class, type, answer, anslen) char *name; /* domain name */ int class, type; /* class and type of query */ @@ -146,6 +147,7 @@ res_query(name, class, type, answer, anslen) * Only useful for queries in the same name hierarchy as the local host * (not, for example, for host address-to-name lookups in domain in-addr.arpa). */ +int res_search(name, class, type, answer, anslen) char *name; /* domain name */ int class, type; /* class and type of query */ @@ -222,6 +224,7 @@ res_search(name, class, type, answer, anslen) * Perform a call on res_query on the concatenation of name and domain, * removing a trailing dot from name if domain is NULL. */ +int res_querydomain(name, domain, class, type, answer, anslen) char *name, *domain; int class, type; /* class and type of query */ diff --git a/usr/src/lib/libresolv/res_send.c b/usr/src/lib/libresolv/res_send.c index 89a602f6d2..4d304763e3 100644 --- a/usr/src/lib/libresolv/res_send.c +++ b/usr/src/lib/libresolv/res_send.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -122,6 +122,7 @@ static int _confcheck() return (0); } +int res_send(buf, buflen, answer, anslen) char *buf; int buflen; @@ -147,7 +148,7 @@ res_send(buf, buflen, answer, anslen) printf("res_send()\n"); p_query(buf); } -#endif DEBUG +#endif if (!(_res.options & RES_INIT)) if (res_init() == -1) { return (-1); @@ -168,7 +169,7 @@ res_send(buf, buflen, answer, anslen) if (_res.options & RES_DEBUG) printf("Querying server (# %d) address = %s\n", ns+1, inet_ntoa(_res.nsaddr_list[ns].sin_addr)); -#endif DEBUG +#endif usevc: if (v_circuit) { int truncated = 0; @@ -186,7 +187,7 @@ res_send(buf, buflen, answer, anslen) if (_res.options & RES_DEBUG) { perror("socket (vc) failed"); } -#endif DEBUG +#endif continue; } if (connect(s, (struct sockaddr *) &_res.nsaddr_list[ns], @@ -196,7 +197,7 @@ res_send(buf, buflen, answer, anslen) if (_res.options & RES_DEBUG) { perror("connect failed"); } -#endif DEBUG +#endif (void) close(s); s = -1; continue; @@ -216,7 +217,7 @@ res_send(buf, buflen, answer, anslen) #ifdef DEBUG if (_res.options & RES_DEBUG) perror("write failed"); -#endif DEBUG +#endif (void) close(s); s = -1; continue; @@ -236,7 +237,7 @@ res_send(buf, buflen, answer, anslen) #ifdef DEBUG if (_res.options & RES_DEBUG) perror("read failed"); -#endif DEBUG +#endif (void) close(s); s = -1; /* @@ -262,7 +263,7 @@ res_send(buf, buflen, answer, anslen) if (_res.options & RES_DEBUG) fprintf(stderr, "response truncated\n"); -#endif DEBUG +#endif len = anslen; truncated = 1; } else @@ -278,7 +279,7 @@ res_send(buf, buflen, answer, anslen) #ifdef DEBUG if (_res.options & RES_DEBUG) perror("read failed"); -#endif DEBUG +#endif (void) close(s); s = -1; continue; @@ -320,7 +321,7 @@ res_send(buf, buflen, answer, anslen) if (_res.options & RES_DEBUG) { perror("socket (dg) failed"); } -#endif DEBUG +#endif continue; } } @@ -357,7 +358,7 @@ res_send(buf, buflen, answer, anslen) RES_DEBUG) { perror("connect"); } -#endif DEBUG +#endif continue; } connected = 1; @@ -366,7 +367,7 @@ res_send(buf, buflen, answer, anslen) #ifdef DEBUG if (_res.options & RES_DEBUG) perror("send"); -#endif DEBUG +#endif continue; } } else { @@ -379,14 +380,14 @@ res_send(buf, buflen, answer, anslen) sizeof (no_addr)); connected = 0; } -#endif BSD +#endif /* BSD */ if (sendto(s, buf, buflen, 0, (struct sockaddr *) &_res.nsaddr_list[ns], sizeof (struct sockaddr)) != buflen) { #ifdef DEBUG if (_res.options & RES_DEBUG) perror("sendto"); -#endif DEBUG +#endif continue; } #if BSD >= 43 @@ -411,7 +412,7 @@ wait: #ifdef DEBUG if (_res.options & RES_DEBUG) perror("select"); -#endif DEBUG +#endif continue; } if (n == 0) { @@ -421,7 +422,7 @@ wait: #ifdef DEBUG if (_res.options & RES_DEBUG) printf("timeout\n"); -#endif DEBUG +#endif #if BSD >= 43 gotsomewhere = 1; #endif @@ -432,7 +433,7 @@ wait: #ifdef DEBUG if (_res.options & RES_DEBUG) perror("recvfrom"); -#endif DEBUG +#endif continue; } gotsomewhere = 1; @@ -445,7 +446,7 @@ wait: printf("old answer:\n"); p_query(answer); } -#endif DEBUG +#endif goto wait; } if (!(_res.options & RES_IGNTC) && anhp->tc) { @@ -456,7 +457,7 @@ wait: #ifdef DEBUG if (_res.options & RES_DEBUG) printf("truncated answer\n"); -#endif DEBUG +#endif (void) close(s); s = -1; v_circuit = 1; @@ -468,7 +469,7 @@ wait: printf("got answer:\n"); p_query(answer); } -#endif DEBUG +#endif /* * If using virtual circuits, we assume that the first server * is preferred * over the rest (i.e. it is on the local @@ -507,6 +508,7 @@ wait: * * This routine is not expected to be user visible. */ +void _res_close() { if (s != -1) { diff --git a/usr/src/lib/libresolv/res_sethost.c b/usr/src/lib/libresolv/res_sethost.c index 4af3bd60e6..cb95cb7f0d 100644 --- a/usr/src/lib/libresolv/res_sethost.c +++ b/usr/src/lib/libresolv/res_sethost.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 1996 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -46,18 +46,21 @@ #include <netinet/in.h> #include <resolv.h> +void res_sethostent(stayopen) { if (stayopen) _res.options |= RES_STAYOPEN | RES_USEVC; } +void res_endhostent() { _res.options &= ~(RES_STAYOPEN | RES_USEVC); _res_close(); } +void res_sethostfile(name) char *name; { diff --git a/usr/src/lib/libresolv2/common/isc/eventlib_p.h b/usr/src/lib/libresolv2/common/isc/eventlib_p.h index 28aa9fb25d..32b47c1c9c 100644 --- a/usr/src/lib/libresolv2/common/isc/eventlib_p.h +++ b/usr/src/lib/libresolv2/common/isc/eventlib_p.h @@ -1,5 +1,5 @@ /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -189,7 +189,7 @@ typedef struct { ctx->field.result = lastnext; /* Any value other than EV_* values from <isc/eventlib.h> will do */ -#define EV_WASNONBLOCKING 4000000001 +#define EV_WASNONBLOCKING 4000000001U extern short *__fd_eventfield(int fd, __evEmulMask *maskp); extern short __poll_event(__evEmulMask *maskp); diff --git a/usr/src/lib/libresolv2/include/port_after.h b/usr/src/lib/libresolv2/include/port_after.h index 2f449c0a7a..45b94dbd05 100644 --- a/usr/src/lib/libresolv2/include/port_after.h +++ b/usr/src/lib/libresolv2/include/port_after.h @@ -291,4 +291,13 @@ int isc__gettimeofday(struct timeval *, struct timezone *); _u.k = konst; \ var = _u.v; \ } while (0) + +#ifndef ALIGN +#if (OS_MAJOR == 5 && OS_MINOR > 8) +#define ALIGN(x) (((uintptr_t)(x) + (sizeof(char*) - 1UL)) & ~(sizeof(char*) - 1UL)) +#else +#define ALIGN(x) (((unsigned long)(x) + (sizeof(char*) - 1UL)) & ~(sizeof(char*) - 1UL)) +#endif +#endif + #endif /* ! PORT_AFTER_H */ diff --git a/usr/src/lib/libresolv2/include/port_before.h b/usr/src/lib/libresolv2/include/port_before.h index 32595ef5e0..18b9291f3b 100644 --- a/usr/src/lib/libresolv2/include/port_before.h +++ b/usr/src/lib/libresolv2/include/port_before.h @@ -1,5 +1,5 @@ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -130,15 +130,6 @@ #define ISC_FORMAT_PRINTF(fmt, args) #endif -/* - * Several files in the ISC distribution use an ALIGN macro which doesn't - * appear to be defined anywhere. From the context, it's intended to round - * up its argument to the nearest suitable boundary. We'll guess that eight - * byte alignment is sufficient. - */ -#define ALIGN(p) (uint64_t)(((uintptr_t)(p) + (sizeof (uint64_t) - 1)) \ - & ~(sizeof (uint64_t) - 1)) - #ifdef SUNW_SYNONYMS #include "synonyms.h" #endif |