summaryrefslogtreecommitdiffstats
path: root/contrib/bind/lib/nameser
diff options
context:
space:
mode:
authorasmodai <asmodai@FreeBSD.org>2001-01-28 23:00:22 +0000
committerasmodai <asmodai@FreeBSD.org>2001-01-28 23:00:22 +0000
commit1f243835b5b81bfd6b9e5f666730965fe5d60ed6 (patch)
tree4c0925b2692b57db0c0c1044db977bbc4c0899d7 /contrib/bind/lib/nameser
parent43c4a8b07e19a2567390a7f788929e5c908a4d7b (diff)
downloadFreeBSD-src-1f243835b5b81bfd6b9e5f666730965fe5d60ed6.zip
FreeBSD-src-1f243835b5b81bfd6b9e5f666730965fe5d60ed6.tar.gz
Virgin import of BIND v8.2.3-REL
Diffstat (limited to 'contrib/bind/lib/nameser')
-rw-r--r--contrib/bind/lib/nameser/Makefile6
-rw-r--r--contrib/bind/lib/nameser/ns_parse.c6
-rw-r--r--contrib/bind/lib/nameser/ns_print.c44
-rw-r--r--contrib/bind/lib/nameser/ns_sign.c3
4 files changed, 51 insertions, 8 deletions
diff --git a/contrib/bind/lib/nameser/Makefile b/contrib/bind/lib/nameser/Makefile
index b221793..1ab67ef 100644
--- a/contrib/bind/lib/nameser/Makefile
+++ b/contrib/bind/lib/nameser/Makefile
@@ -15,12 +15,12 @@
# SOFTWARE.
#
-# $Id: Makefile,v 8.20 2000/07/11 06:41:42 vixie Exp $
+# $Id: Makefile,v 8.21 2000/12/23 08:03:02 vixie Exp $
# these are only appropriate for BSD 4.4 or derivatives, and are used in
# development. normal builds will be done in the top level directory and
# this Makefile will be invoked with a lot of overrides for the following:
-SYSTYPE= bsdos
+SYSTYPE= freebsd
DESTDIR =
DESTLIB = /usr/local/lib
O=o
@@ -28,7 +28,7 @@ A=a
CC= cc
LD= ld
SHELL= /bin/sh
-CDEBUG= -g
+CDEBUG= -g -Wall
TOP= ../..
INCL = ${TOP}/include
PORTINCL = ${TOP}/port/${SYSTYPE}/include
diff --git a/contrib/bind/lib/nameser/ns_parse.c b/contrib/bind/lib/nameser/ns_parse.c
index 35f7f40..6858a91 100644
--- a/contrib/bind/lib/nameser/ns_parse.c
+++ b/contrib/bind/lib/nameser/ns_parse.c
@@ -16,7 +16,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$Id: ns_parse.c,v 8.13 1999/10/13 16:39:35 vixie Exp $";
+static const char rcsid[] = "$Id: ns_parse.c,v 8.15 2000/12/23 08:14:55 vixie Exp $";
#endif
/* Import. */
@@ -64,6 +64,10 @@ struct _ns_flagdata _ns_flagdata[16] = {
{ 0x0000, 0 }, /* expansion (6/6). */
};
+int ns_msg_getflag(ns_msg handle, int flag) {
+ return(((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift);
+}
+
int
ns_skiprr(const u_char *ptr, const u_char *eom, ns_sect section, int count) {
const u_char *optr = ptr;
diff --git a/contrib/bind/lib/nameser/ns_print.c b/contrib/bind/lib/nameser/ns_print.c
index 6c47882..41b4d65 100644
--- a/contrib/bind/lib/nameser/ns_print.c
+++ b/contrib/bind/lib/nameser/ns_print.c
@@ -16,7 +16,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$Id: ns_print.c,v 8.18 2000/02/29 05:48:12 vixie Exp $";
+static const char rcsid[] = "$Id: ns_print.c,v 8.21 2000/12/09 00:15:38 marka Exp $";
#endif
/* Import. */
@@ -123,7 +123,9 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
T(addstr("\t\t\t", 3, &buf, &buflen));
} else {
len = prune_origin(name, origin);
- if (len == 0) {
+ if (*name == '\0') {
+ goto root;
+ } else if (len == 0) {
T(addstr("@\t\t\t", 4, &buf, &buflen));
} else {
T(addstr(name, len, &buf, &buflen));
@@ -131,6 +133,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
if (((origin == NULL || origin[0] == '\0') ||
(origin[0] != '.' && origin[1] != '\0' &&
name[len] == '\0')) && name[len - 1] != '.') {
+ root:
T(addstr(".", 1, &buf, &buflen));
len++;
}
@@ -145,6 +148,8 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
addlen(x, &buf, &buflen);
len = SPRINTF((tmp, " %s %s", p_class(class), p_type(type)));
T(addstr(tmp, len, &buf, &buflen));
+ if (rdlen == 0)
+ return (buf - obuf);
T(spaced = addtab(x + len, 16, spaced, &buf, &buflen));
/*
@@ -605,6 +610,36 @@ ns_sprintrrf(const u_char *msg, size_t msglen,
break;
}
+ case ns_t_tkey: {
+ /* KJD - need to complete this */
+ u_long t;
+ int mode, err, keysize;
+
+ /* Algorithm name. */
+ T(addname(msg, msglen, &rdata, origin, &buf, &buflen));
+ T(addstr(" ", 1, &buf, &buflen));
+
+ /* Inception. */
+ t = ns_get32(rdata); rdata += NS_INT32SZ;
+ len = SPRINTF((tmp, "%s ", p_secstodate(t)));
+ T(addstr(tmp, len, &buf, &buflen));
+
+ /* Experation. */
+ t = ns_get32(rdata); rdata += NS_INT32SZ;
+ len = SPRINTF((tmp, "%s ", p_secstodate(t)));
+ T(addstr(tmp, len, &buf, &buflen));
+
+ /* Mode , Error, Key Size. */
+ /* Priority, Weight, Port. */
+ mode = ns_get16(rdata); rdata += NS_INT16SZ;
+ err = ns_get16(rdata); rdata += NS_INT16SZ;
+ keysize = ns_get16(rdata); rdata += NS_INT16SZ;
+ len = SPRINTF((tmp, "%u %u %u ", mode, err, keysize));
+ T(addstr(tmp, len, &buf, &buflen));
+
+ /* needs to dump key, print otherdata length & other data */
+ break;
+ }
case ns_t_tsig: {
/* BEW - need to complete this */
int n;
@@ -752,7 +787,9 @@ addname(const u_char *msg, size_t msglen,
if (n < 0)
goto enospc; /* Guess. */
newlen = prune_origin(*buf, origin);
- if (newlen == 0) {
+ if (**buf == '\0') {
+ goto root;
+ } else if (newlen == 0) {
/* Use "@" instead of name. */
if (newlen + 2 > *buflen)
goto enospc; /* No room for "@\0". */
@@ -763,6 +800,7 @@ addname(const u_char *msg, size_t msglen,
(origin[0] != '.' && origin[1] != '\0' &&
(*buf)[newlen] == '\0')) && (*buf)[newlen - 1] != '.') {
/* No trailing dot. */
+ root:
if (newlen + 2 > *buflen)
goto enospc; /* No room for ".\0". */
(*buf)[newlen++] = '.';
diff --git a/contrib/bind/lib/nameser/ns_sign.c b/contrib/bind/lib/nameser/ns_sign.c
index 75af894..05a038a 100644
--- a/contrib/bind/lib/nameser/ns_sign.c
+++ b/contrib/bind/lib/nameser/ns_sign.c
@@ -16,7 +16,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$Id: ns_sign.c,v 8.8 1999/10/13 16:39:36 vixie Exp $";
+static const char rcsid[] = "$Id: ns_sign.c,v 8.9 2000/12/23 08:14:57 vixie Exp $";
#endif
/* Import. */
@@ -37,6 +37,7 @@ static const char rcsid[] = "$Id: ns_sign.c,v 8.8 1999/10/13 16:39:36 vixie Exp
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include <unistd.h>
#include <isc/dst.h>
OpenPOWER on IntegriCloud