make dn_skipname, fp_query, hostalias, p_cdname, p_class, p_query,
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 22 Feb 1991 08:23:40 +0000 (00:23 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 22 Feb 1991 08:23:40 +0000 (00:23 -0800)
p_rr, p_time, p_type, putlong and putshort hidden

SCCS-vsn: lib/libc/net/Makefile.inc 5.3
SCCS-vsn: lib/libc/net/gethostnamadr.c 6.42
SCCS-vsn: lib/libc/net/res_comp.c 6.19
SCCS-vsn: lib/libc/net/res_debug.c 5.32
SCCS-vsn: lib/libc/net/res_mkquery.c 6.14
SCCS-vsn: lib/libc/net/res_query.c 5.8
SCCS-vsn: lib/libc/net/res_send.c 6.26

usr/src/lib/libc/net/Makefile.inc
usr/src/lib/libc/net/gethostnamadr.c
usr/src/lib/libc/net/res_comp.c
usr/src/lib/libc/net/res_debug.c
usr/src/lib/libc/net/res_mkquery.c
usr/src/lib/libc/net/res_query.c
usr/src/lib/libc/net/res_send.c

index 8ddd7db..768b0f9 100644 (file)
@@ -1,4 +1,4 @@
-#      @(#)Makefile.inc        5.2 (Berkeley) %G%
+#      @(#)Makefile.inc        5.3 (Berkeley) %G%
 
 # net sources
 .PATH: ${.CURDIR}/${MACHINE}/net ${.CURDIR}/net
 
 # net sources
 .PATH: ${.CURDIR}/${MACHINE}/net ${.CURDIR}/net
@@ -40,3 +40,6 @@ MLINKS+=inet.3 addr.3 inet.3 inet_addr.3 inet.3 inet_lnaof.3 \
        inet.3 inet_ntoa.3 inet.3 network.3 inet.3 ntoa.3
 MLINKS+=ns.3 ns_addr.3 ns.3 ns_ntoa.3
 MLINKS+=rcmd.3 rresvport.3 rcmd.3 ruserok.3
        inet.3 inet_ntoa.3 inet.3 network.3 inet.3 ntoa.3
 MLINKS+=ns.3 ns_addr.3 ns.3 ns_ntoa.3
 MLINKS+=rcmd.3 rresvport.3 rcmd.3 ruserok.3
+MLINKS+=resolver.3 dn_comp.3 resolver.3 dn_expand.3 resolver.3 res_init.3 \
+       resolver.3 res_mkquery.3 resolver.3 res_send.3 resolver.3 res_query.3 \
+       resolver.3 res_search.3
index aec6392..b044261 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c    6.41 (Berkeley) %G%";
+static char sccsid[] = "@(#)gethostnamadr.c    6.42 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
@@ -93,9 +93,9 @@ getanswer(answer, anslen, iquery)
                        bp += n;
                        buflen -= n;
                } else
                        bp += n;
                        buflen -= n;
                } else
-                       cp += dn_skipname(cp, eom) + QFIXEDSZ;
+                       cp += __dn_skipname(cp, eom) + QFIXEDSZ;
                while (--qdcount > 0)
                while (--qdcount > 0)
-                       cp += dn_skipname(cp, eom) + QFIXEDSZ;
+                       cp += __dn_skipname(cp, eom) + QFIXEDSZ;
        } else if (iquery) {
                if (hp->aa)
                        h_errno = HOST_NOT_FOUND;
        } else if (iquery) {
                if (hp->aa)
                        h_errno = HOST_NOT_FOUND;
index e4b9ceb..497d921 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_comp.c 6.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)res_comp.c 6.19 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
@@ -179,7 +179,7 @@ dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr)
 /*
  * Skip over a compressed domain name. Return the size or -1.
  */
 /*
  * Skip over a compressed domain name. Return the size or -1.
  */
-dn_skipname(comp_dn, eom)
+__dn_skipname(comp_dn, eom)
        u_char *comp_dn, *eom;
 {
        register u_char *cp;
        u_char *comp_dn, *eom;
 {
        register u_char *cp;
@@ -295,21 +295,18 @@ _getlong(msgp)
        return (u | *p);
 }
 
        return (u | *p);
 }
 
-
-putshort(s, msgp)
+__putshort(s, msgp)
        register u_short s;
        register u_char *msgp;
 {
        register u_short s;
        register u_char *msgp;
 {
-
        msgp[1] = s;
        msgp[0] = s >> 8;
 }
 
        msgp[1] = s;
        msgp[0] = s >> 8;
 }
 
-putlong(l, msgp)
+__putlong(l, msgp)
        register u_long l;
        register u_char *msgp;
 {
        register u_long l;
        register u_char *msgp;
 {
-
        msgp[3] = l;
        msgp[2] = (l >>= 8);
        msgp[1] = (l >>= 8);
        msgp[3] = l;
        msgp[2] = (l >>= 8);
        msgp[1] = (l >>= 8);
index 24a8679..df3f0e7 100644 (file)
@@ -4,11 +4,11 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)res_debug.c 5.31 (Berkeley) %G%
+ *     @(#)res_debug.c 5.32 (Berkeley) %G%
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_debug.c        5.31 (Berkeley) %G%";
+static char sccsid[] = "@(#)res_debug.c        5.32 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
@@ -16,8 +16,8 @@ static char sccsid[] = "@(#)res_debug.c       5.31 (Berkeley) %G%";
 #include <stdio.h>
 #include <arpa/nameser.h>
 
 #include <stdio.h>
 #include <arpa/nameser.h>
 
-extern char *p_cdname(), *p_rr(), *p_type(), *p_class(), *p_time();
 extern char *inet_ntoa();
 extern char *inet_ntoa();
+static char *p_cdname(), *p_class(), *p_rr(), *p_time(), *p_type();
 
 char *_res_opcodes[] = {
        "QUERY",
 
 char *_res_opcodes[] = {
        "QUERY",
@@ -57,7 +57,7 @@ char *_res_resultcodes[] = {
        "NOCHANGE",
 };
 
        "NOCHANGE",
 };
 
-p_query(msg)
+__p_query(msg)
        char *msg;
 {
        fp_query(msg,stdout);
        char *msg;
 {
        fp_query(msg,stdout);
@@ -67,6 +67,7 @@ p_query(msg)
  * Print the contents of a query.
  * This is intended to be primarily a debugging routine.
  */
  * Print the contents of a query.
  * This is intended to be primarily a debugging routine.
  */
+static
 fp_query(msg,file)
        char *msg;
        FILE *file;
 fp_query(msg,file)
        char *msg;
        FILE *file;
@@ -113,7 +114,8 @@ fp_query(msg,file)
                                return;
                        fprintf(file,", type = %s", p_type(_getshort(cp)));
                        cp += sizeof(u_short);
                                return;
                        fprintf(file,", type = %s", p_type(_getshort(cp)));
                        cp += sizeof(u_short);
-                       fprintf(file,", class = %s\n\n", p_class(_getshort(cp)));
+                       fprintf(file,
+                           ", class = %s\n\n", p_class(_getshort(cp)));
                        cp += sizeof(u_short);
                }
        }
                        cp += sizeof(u_short);
                }
        }
@@ -155,7 +157,7 @@ fp_query(msg,file)
        }
 }
 
        }
 }
 
-char *
+static char *
 p_cdname(cp, msg, file)
        char *cp, *msg;
        FILE *file;
 p_cdname(cp, msg, file)
        char *cp, *msg;
        FILE *file;
@@ -176,7 +178,7 @@ p_cdname(cp, msg, file)
 /*
  * Print resource record fields in human readable form.
  */
 /*
  * Print resource record fields in human readable form.
  */
-char *
+static char *
 p_rr(cp, msg, file)
        char *cp, *msg;
        FILE *file;
 p_rr(cp, msg, file)
        char *cp, *msg;
        FILE *file;
@@ -358,7 +360,7 @@ static      char nbuf[40];
 /*
  * Return a string for the type
  */
 /*
  * Return a string for the type
  */
-char *
+static char *
 p_type(type)
        int type;
 {
 p_type(type)
        int type;
 {
@@ -418,7 +420,7 @@ p_type(type)
 /*
  * Return a mnemonic for class
  */
 /*
  * Return a mnemonic for class
  */
-char *
+static char *
 p_class(class)
        int class;
 {
 p_class(class)
        int class;
 {
@@ -439,7 +441,7 @@ p_class(class)
 /*
  * Return a mnemonic for a time to live
  */
 /*
  * Return a mnemonic for a time to live
  */
-char *
+static char *
 p_time(value)
        u_long value;
 {
 p_time(value)
        u_long value;
 {
index 9f4ba69..f7880b0 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_mkquery.c      6.13 (Berkeley) %G%";
+static char sccsid[] = "@(#)res_mkquery.c      6.14 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
@@ -68,9 +68,9 @@ res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen)
                        return (-1);
                cp += n;
                buflen -= n;
                        return (-1);
                cp += n;
                buflen -= n;
-               putshort(type, cp);
+               __putshort(type, cp);
                cp += sizeof(u_short);
                cp += sizeof(u_short);
-               putshort(class, cp);
+               __putshort(class, cp);
                cp += sizeof(u_short);
                hp->qdcount = htons(1);
                if (op == QUERY || data == NULL)
                cp += sizeof(u_short);
                hp->qdcount = htons(1);
                if (op == QUERY || data == NULL)
@@ -83,13 +83,13 @@ res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen)
                        return (-1);
                cp += n;
                buflen -= n;
                        return (-1);
                cp += n;
                buflen -= n;
-               putshort(T_NULL, cp);
+               __putshort(T_NULL, cp);
                cp += sizeof(u_short);
                cp += sizeof(u_short);
-               putshort(class, cp);
+               __putshort(class, cp);
                cp += sizeof(u_short);
                cp += sizeof(u_short);
-               putlong(0, cp);
+               __putlong(0, cp);
                cp += sizeof(u_long);
                cp += sizeof(u_long);
-               putshort(0, cp);
+               __putshort(0, cp);
                cp += sizeof(u_short);
                hp->arcount = htons(1);
                break;
                cp += sizeof(u_short);
                hp->arcount = htons(1);
                break;
@@ -101,13 +101,13 @@ res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen)
                if (buflen < 1 + RRFIXEDSZ + datalen)
                        return (-1);
                *cp++ = '\0';   /* no domain name */
                if (buflen < 1 + RRFIXEDSZ + datalen)
                        return (-1);
                *cp++ = '\0';   /* no domain name */
-               putshort(type, cp);
+               __putshort(type, cp);
                cp += sizeof(u_short);
                cp += sizeof(u_short);
-               putshort(class, cp);
+               __putshort(class, cp);
                cp += sizeof(u_short);
                cp += sizeof(u_short);
-               putlong(0, cp);
+               __putlong(0, cp);
                cp += sizeof(u_long);
                cp += sizeof(u_long);
-               putshort(datalen, cp);
+               __putshort(datalen, cp);
                cp += sizeof(u_short);
                if (datalen) {
                        bcopy(data, cp, datalen);
                cp += sizeof(u_short);
                if (datalen) {
                        bcopy(data, cp, datalen);
@@ -135,13 +135,13 @@ res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen)
                if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
                        return (-1);
                cp += n;
                if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
                        return (-1);
                cp += n;
-               putshort(type, cp);
+               __putshort(type, cp);
                 cp += sizeof(u_short);
                 cp += sizeof(u_short);
-                putshort(class, cp);
+                __putshort(class, cp);
                 cp += sizeof(u_short);
                 cp += sizeof(u_short);
-               putlong(0, cp);
+               __putlong(0, cp);
                cp += sizeof(u_long);
                cp += sizeof(u_long);
-               putshort(datalen, cp);
+               __putshort(datalen, cp);
                 cp += sizeof(u_short);
                if (datalen) {
                        bcopy(data, cp, datalen);
                 cp += sizeof(u_short);
                if (datalen) {
                        bcopy(data, cp, datalen);
@@ -158,13 +158,13 @@ res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen)
                if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
                        return (-1);
                cp += n;
                if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0)
                        return (-1);
                cp += n;
-               putshort(newrr->r_type, cp);
+               __putshort(newrr->r_type, cp);
                 cp += sizeof(u_short);
                 cp += sizeof(u_short);
-                putshort(newrr->r_class, cp);
+                __putshort(newrr->r_class, cp);
                 cp += sizeof(u_short);
                 cp += sizeof(u_short);
-               putlong(0, cp);
+               __putlong(0, cp);
                cp += sizeof(u_long);
                cp += sizeof(u_long);
-               putshort(newrr->r_size, cp);
+               __putshort(newrr->r_size, cp);
                 cp += sizeof(u_short);
                if (newrr->r_size) {
                        bcopy(newrr->r_data, cp, newrr->r_size);
                 cp += sizeof(u_short);
                if (newrr->r_size) {
                        bcopy(newrr->r_data, cp, newrr->r_size);
index 9ef0575..b483b94 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_query.c        5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)res_query.c        5.8 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
@@ -121,7 +121,7 @@ res_search(name, class, type, answer, anslen)
 {
        register char *cp, **domain;
        int n, ret, got_nodata = 0;
 {
        register char *cp, **domain;
        int n, ret, got_nodata = 0;
-       char *hostalias();
+       static char *hostalias();
 
        if ((_res.options & RES_INIT) == 0 && res_init() == -1)
                return (-1);
 
        if ((_res.options & RES_INIT) == 0 && res_init() == -1)
                return (-1);
@@ -221,7 +221,7 @@ res_querydomain(name, domain, class, type, answer, anslen)
        return (res_query(longname, class, type, answer, anslen));
 }
 
        return (res_query(longname, class, type, answer, anslen));
 }
 
-char *
+static char *
 hostalias(name)
        register char *name;
 {
 hostalias(name)
        register char *name;
 {
index 5e27339..58fd4b6 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)res_send.c 6.25 (Berkeley) %G%";
+static char sccsid[] = "@(#)res_send.c 6.26 (Berkeley) %G%";
 #endif /* LIBC_SCCS and not lint */
 
 /*
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -61,7 +61,7 @@ res_send(buf, buflen, answer, anslen)
 #ifdef DEBUG
        if (_res.options & RES_DEBUG) {
                printf("res_send()\n");
 #ifdef DEBUG
        if (_res.options & RES_DEBUG) {
                printf("res_send()\n");
-               p_query(buf);
+               __p_query(buf);
        }
 #endif DEBUG
        if (!(_res.options & RES_INIT))
        }
 #endif DEBUG
        if (!(_res.options & RES_INIT))
@@ -332,7 +332,7 @@ wait:
 #ifdef DEBUG
                                if (_res.options & RES_DEBUG) {
                                        printf("old answer:\n");
 #ifdef DEBUG
                                if (_res.options & RES_DEBUG) {
                                        printf("old answer:\n");
-                                       p_query(answer);
+                                       __p_query(answer);
                                }
 #endif DEBUG
                                goto wait;
                                }
 #endif DEBUG
                                goto wait;
@@ -355,7 +355,7 @@ wait:
 #ifdef DEBUG
                if (_res.options & RES_DEBUG) {
                        printf("got answer:\n");
 #ifdef DEBUG
                if (_res.options & RES_DEBUG) {
                        printf("got answer:\n");
-                       p_query(answer);
+                       __p_query(answer);
                }
 #endif DEBUG
                /*
                }
 #endif DEBUG
                /*