diff options
author | ume <ume@FreeBSD.org> | 2007-06-03 17:20:27 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2007-06-03 17:20:27 +0000 |
commit | 1f0b78cb3e02e3e161fed2e61d1cf1d0fb386365 (patch) | |
tree | 4c177bc1c465cdceae9dd1ea93c01fa64b220b93 /lib/libc/nameser | |
parent | 09efba1c33e3e58c865d7f628c4f48e47d74bcd0 (diff) | |
download | FreeBSD-src-1f0b78cb3e02e3e161fed2e61d1cf1d0fb386365.zip FreeBSD-src-1f0b78cb3e02e3e161fed2e61d1cf1d0fb386365.tar.gz |
Merge BIND 9.4.1 into main chunk.
MFC after: 2 weeks
Diffstat (limited to 'lib/libc/nameser')
-rw-r--r-- | lib/libc/nameser/ns_print.c | 31 | ||||
-rw-r--r-- | lib/libc/nameser/ns_samedomain.c | 51 |
2 files changed, 41 insertions, 41 deletions
diff --git a/lib/libc/nameser/ns_print.c b/lib/libc/nameser/ns_print.c index ca595a7..2a46379 100644 --- a/lib/libc/nameser/ns_print.c +++ b/lib/libc/nameser/ns_print.c @@ -16,7 +16,7 @@ */ #ifndef lint -static const char rcsid[] = "$Id: ns_print.c,v 1.3.2.1.4.7 2004/09/16 07:01:12 marka Exp $"; +static const char rcsid[] = "$Id: ns_print.c,v 1.6.18.4 2005/04/27 05:01:09 sra Exp $"; #endif #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); @@ -76,12 +76,11 @@ static int addtab(size_t len, size_t target, int spaced, /* Public. */ -/* - * int - * ns_sprintrr(handle, rr, name_ctx, origin, buf, buflen) +/*% * Convert an RR to presentation format. + * * return: - * Number of characters written to buf, or -1 (check errno). + *\li Number of characters written to buf, or -1 (check errno). */ int ns_sprintrr(const ns_msg *handle, const ns_rr *rr, @@ -97,13 +96,11 @@ ns_sprintrr(const ns_msg *handle, const ns_rr *rr, return (n); } -/* - * int - * ns_sprintrrf(msg, msglen, name, class, type, ttl, rdata, rdlen, - * name_ctx, origin, buf, buflen) +/*% * Convert the fields of an RR into presentation format. + * * return: - * Number of characters written to buf, or -1 (check errno). + *\li Number of characters written to buf, or -1 (check errno). */ int ns_sprintrrf(const u_char *msg, size_t msglen, @@ -656,10 +653,10 @@ ns_sprintrrf(const u_char *msg, size_t msglen, T(len = addname(msg, msglen, &rdata, origin, &buf, &buflen)); T(addstr(" ", 1, &buf, &buflen)); - rdata += 8; /* time */ + rdata += 8; /*%< time */ n = ns_get16(rdata); rdata += INT16SZ; - rdata += n; /* sig */ - n = ns_get16(rdata); rdata += INT16SZ; /* original id */ + rdata += n; /*%< sig */ + n = ns_get16(rdata); rdata += INT16SZ; /*%< original id */ sprintf(buf, "%d", ns_get16(rdata)); rdata += INT16SZ; addlen(strlen(buf), &buf, &buflen); @@ -746,7 +743,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen, /* Private. */ -/* +/*% * size_t * prune_origin(name, origin) * Find out if the name is at or under the current origin. @@ -779,7 +776,7 @@ prune_origin(const char *name, const char *origin) { return (name - oname); } -/* +/*% * int * charstr(rdata, edata, buf, buflen) * Format a <character-string> into the presentation buffer. @@ -835,7 +832,7 @@ addname(const u_char *msg, size_t msglen, n = dn_expand(msg, msg + msglen, *pp, *buf, *buflen); if (n < 0) - goto enospc; /* Guess. */ + goto enospc; /*%< Guess. */ newlen = prune_origin(*buf, origin); if (**buf == '\0') { goto root; @@ -907,3 +904,5 @@ addtab(size_t len, size_t target, int spaced, char **buf, size_t *buflen) { } return (spaced); } + +/*! \file */ diff --git a/lib/libc/nameser/ns_samedomain.c b/lib/libc/nameser/ns_samedomain.c index f532e8b..9c43c79 100644 --- a/lib/libc/nameser/ns_samedomain.c +++ b/lib/libc/nameser/ns_samedomain.c @@ -16,7 +16,7 @@ */ #ifndef lint -static const char rcsid[] = "$Id: ns_samedomain.c,v 1.1.2.2.4.2 2004/03/16 12:34:17 marka Exp $"; +static const char rcsid[] = "$Id: ns_samedomain.c,v 1.5.18.1 2005/04/27 05:01:09 sra Exp $"; #endif #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); @@ -30,21 +30,22 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" -/* - * int - * ns_samedomain(a, b) +/*% * Check whether a name belongs to a domain. + * * Inputs: - * a - the domain whose ancestory is being verified - * b - the potential ancestor we're checking against + *\li a - the domain whose ancestory is being verified + *\li b - the potential ancestor we're checking against + * * Return: - * boolean - is a at or below b? + *\li boolean - is a at or below b? + * * Notes: - * Trailing dots are first removed from name and domain. + *\li Trailing dots are first removed from name and domain. * Always compare complete subdomains, not only whether the * domain name is the trailing string of the given name. * - * "host.foobar.top" lies in "foobar.top" and in "top" and in "" + *\li "host.foobar.top" lies in "foobar.top" and in "top" and in "" * but NOT in "bar.top" */ @@ -143,9 +144,7 @@ ns_samedomain(const char *a, const char *b) { } #ifndef _LIBC -/* - * int - * ns_subdomain(a, b) +/*% * is "a" a subdomain of "b"? */ int @@ -154,30 +153,31 @@ ns_subdomain(const char *a, const char *b) { } #endif -/* - * int - * ns_makecanon(src, dst, dstsize) +/*% * make a canonical copy of domain name "src" + * * notes: + * \code * foo -> foo. * foo. -> foo. * foo.. -> foo. * foo\. -> foo\.. * foo\\. -> foo\\. + * \endcode */ int ns_makecanon(const char *src, char *dst, size_t dstsize) { size_t n = strlen(src); - if (n + sizeof "." > dstsize) { /* Note: sizeof == 2 */ + if (n + sizeof "." > dstsize) { /*%< Note: sizeof == 2 */ errno = EMSGSIZE; return (-1); } strcpy(dst, src); - while (n >= 1U && dst[n - 1] == '.') /* Ends in "." */ - if (n >= 2U && dst[n - 2] == '\\' && /* Ends in "\." */ - (n < 3U || dst[n - 3] != '\\')) /* But not "\\." */ + while (n >= 1U && dst[n - 1] == '.') /*%< Ends in "." */ + if (n >= 2U && dst[n - 2] == '\\' && /*%< Ends in "\." */ + (n < 3U || dst[n - 3] != '\\')) /*%< But not "\\." */ break; else dst[--n] = '\0'; @@ -186,14 +186,13 @@ ns_makecanon(const char *src, char *dst, size_t dstsize) { return (0); } -/* - * int - * ns_samename(a, b) +/*% * determine whether domain name "a" is the same as domain name "b" + * * return: - * -1 on error - * 0 if names differ - * 1 if names are the same + *\li -1 on error + *\li 0 if names differ + *\li 1 if names are the same */ int @@ -208,3 +207,5 @@ ns_samename(const char *a, const char *b) { else return (0); } + +/*! \file */ |