Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/dhcp Fix various makefile glitches



details:   https://anonhg.NetBSD.org/src/rev/3476474acfa7
branches:  trunk
changeset: 507908:3476474acfa7
user:      mellon <mellon%NetBSD.org@localhost>
date:      Tue Apr 03 00:49:15 2001 +0000

description:
Fix various makefile glitches

diffstat:

 usr.sbin/dhcp/Makefile          |    2 +-
 usr.sbin/dhcp/Makefile.inc      |    5 +-
 usr.sbin/dhcp/common/Makefile   |    2 +-
 usr.sbin/dhcp/dst/Makefile      |    2 +-
 usr.sbin/dhcp/minires/Makefile  |    4 +-
 usr.sbin/dhcp/minires/support.c |  462 ----------------------------------------
 usr.sbin/dhcp/omapip/Makefile   |    2 +-
 usr.sbin/dhcp/server/Makefile   |    2 +-
 8 files changed, 10 insertions(+), 471 deletions(-)

diffs (truncated from 556 to 300 lines):

diff -r dbf43f2afb50 -r 3476474acfa7 usr.sbin/dhcp/Makefile
--- a/usr.sbin/dhcp/Makefile    Tue Apr 03 00:01:32 2001 +0000
+++ b/usr.sbin/dhcp/Makefile    Tue Apr 03 00:49:15 2001 +0000
@@ -30,6 +30,6 @@
 # OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-SUBDIR= dhcpctl minires omapip common .WAIT server client relay
+SUBDIR= dhcpctl dst minires omapip common server client relay
 
 .include <bsd.subdir.mk>
diff -r dbf43f2afb50 -r 3476474acfa7 usr.sbin/dhcp/Makefile.inc
--- a/usr.sbin/dhcp/Makefile.inc        Tue Apr 03 00:01:32 2001 +0000
+++ b/usr.sbin/dhcp/Makefile.inc        Tue Apr 03 00:49:15 2001 +0000
@@ -37,10 +37,11 @@
 COBJDIR!=cd $(.CURDIR)/../common && ${PRINTOBJDIR}
 OMOBJDIR!=cd $(.CURDIR)/../omapip && ${PRINTOBJDIR}
 MROBJDIR!=cd $(.CURDIR)/../minires && ${PRINTOBJDIR}
+DSTOBJDIR!=cd $(.CURDIR)/../minires && ${PRINTOBJDIR}
 
 CPPFLAGS+= -I${.CURDIR}/.. -I${.CURDIR}/../includes
-LDADD=  ${OMOBJDIR}/libomapi.a ${COBJDIR}/libdhcp.a ${MROBJDIR}/libminires.a
-DPADD=  ${OMOBJDIR}/libomapi.a ${COBJDIR}/libdhcp.a ${MROBJDIR}/libminires.a
+LDADD=  ${OMOBJDIR}/libomapi.a ${COBJDIR}/libdhcp.a ${MROBJDIR}/libminires.a ${DSTOBJDIR}/libdst.a
+DPADD=  ${OMOBJDIR}/libomapi.a ${COBJDIR}/libdhcp.a ${MROBJDIR}/libminires.a ${DSTOBJDIR}/libdst.a
 
 .if exists(${.CURDIR}/../../Makefile.inc)
 .include "${.CURDIR}/../../Makefile.inc"
diff -r dbf43f2afb50 -r 3476474acfa7 usr.sbin/dhcp/common/Makefile
--- a/usr.sbin/dhcp/common/Makefile     Tue Apr 03 00:01:32 2001 +0000
+++ b/usr.sbin/dhcp/common/Makefile     Tue Apr 03 00:49:15 2001 +0000
@@ -33,7 +33,7 @@
 LIB    = dhcp
 SRCS   = raw.c parse.c nit.c icmp.c dispatch.c conflex.c upf.c bpf.c socket.c \
         lpf.c dlpi.c packet.c tr.c ethernet.c memory.c print.c options.c \
-        inet.c tree.c tables.c alloc.c fddi.c \
+        inet.c tree.c tables.c alloc.c fddi.c ctrace.c \
         dns.c resolv.c execute.c discover.c comapi.c
 
 MKLINT=        no
diff -r dbf43f2afb50 -r 3476474acfa7 usr.sbin/dhcp/dst/Makefile
--- a/usr.sbin/dhcp/dst/Makefile        Tue Apr 03 00:01:32 2001 +0000
+++ b/usr.sbin/dhcp/dst/Makefile        Tue Apr 03 00:49:15 2001 +0000
@@ -30,7 +30,7 @@
 #
 
 LIB    = dst
-SRC    = dst_support.c dst_api.c hmac_link.c md5_dgst.c base64.c prandom.c
+SRCS    = dst_support.c dst_api.c hmac_link.c md5_dgst.c base64.c prandom.c
 
 MKLINT=        no
 MKPIC= no
diff -r dbf43f2afb50 -r 3476474acfa7 usr.sbin/dhcp/minires/Makefile
--- a/usr.sbin/dhcp/minires/Makefile    Tue Apr 03 00:01:32 2001 +0000
+++ b/usr.sbin/dhcp/minires/Makefile    Tue Apr 03 00:49:15 2001 +0000
@@ -32,8 +32,8 @@
 LIB    = minires
 SRCS   = res_mkupdate.c res_init.c res_update.c res_send.c res_comp.c \
         res_sendsigned.c res_findzonecut.c res_query.c res_mkquery.c \
-        ns_date.c ns_parse.c ns_sign.c ns_name.c ns_samedomain.c ns_verify.c \
-        support.c
+        ns_date.c ns_parse.c ns_sign.c ns_name.c ns_samedomain.c \
+        ns_verify.c toisc.c
 
 MKLINT=        no
 MKPIC= no
diff -r dbf43f2afb50 -r 3476474acfa7 usr.sbin/dhcp/minires/support.c
--- a/usr.sbin/dhcp/minires/support.c   Tue Apr 03 00:01:32 2001 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,462 +0,0 @@
-static const char rcsid[] = "$Header: /cvsroot/src/usr.sbin/dhcp/minires/Attic/support.c,v 1.1.1.1 2000/04/22 07:11:55 mellon Exp $";
-
-
-/*
- * Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
- *
- * Permission to use, copy modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND TRUSTED INFORMATION SYSTEMS
- * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL
- * TRUSTED INFORMATION SYSTEMS BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THE SOFTWARE.
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <memory.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include "minires/minires.h"
-#include "arpa/nameser.h"
-
-#include "dst_internal.h"
-
-/*
- * dst_s_conv_bignum_u8_to_b64
- *     This function converts binary data stored as a u_char[] to a
- *     base-64 string.  Leading zeroes are discarded.  If a header is
- *     supplied, it is prefixed to the input prior to encoding.  The
- *     output is \n\0 terminated (the \0 is not included in output length).
- * Parameters
- *     out_buf   binary data to convert
- *     header    character string to prefix to the output (label)
- *     bin_data  binary data
- *     bin_len   size of binary data
- * Return
- *     -1     not enough space in output work area
- *     0     no output
- *     >0     number of bytes written to output work area
- */
-
-int
-dst_s_conv_bignum_u8_to_b64(char *out_buf, const unsigned out_len,
-                           const char *header, const u_char *bin_data,
-                           const unsigned bin_len)
-{
-       const u_char *bp = bin_data;
-       char *op = out_buf;
-       unsigned lenh = 0, len64 = 0;
-       unsigned local_in_len = bin_len;
-       unsigned local_out_len = out_len;
-
-       if (bin_data == NULL)   /* no data no */
-               return (0);
-
-       if (out_buf == NULL || out_len <= 0)    /* no output_work area */
-               return (-1);
-
-       /* suppress leading \0  */
-       for (; (*bp == 0x0) && (local_in_len > 0); local_in_len--)
-               bp++;
-
-       if (header) {           /* add header to output string */
-               lenh = strlen(header);
-               if (lenh < out_len)
-                       memcpy(op, header, lenh);
-               else
-                       return (-1);
-               local_out_len -= lenh;
-               op += lenh;
-       }
-       len64 = b64_ntop(bp, local_in_len, op, local_out_len - 2);
-       if (len64 < 0)
-               return (-1);
-       op += len64++;
-       *(op++) = '\n';         /* put CR in the output */
-       *op = '\0';             /* make sure output is 0 terminated */
-       return (lenh + len64);
-}
-
-
-/*
- * dst_s_verify_str()
- *     Validate that the input string(*str) is at the head of the input
- *     buffer(**buf).  If so, move the buffer head pointer (*buf) to
- *     the first byte of data following the string(*str).
- * Parameters
- *     buf     Input buffer.
- *     str     Input string.
- * Return
- *     0       *str is not the head of **buff
- *     1       *str is the head of **buff, *buf is is advanced to
- *     the tail of **buf.
- */
-
-int
-dst_s_verify_str(const char **buf, const char *str)
-{
-       unsigned b, s;
-       if (*buf == NULL)       /* error checks */
-               return (0);
-       if (str == NULL || *str == '\0')
-               return (1);
-
-       b = strlen(*buf);       /* get length of strings */
-       s = strlen(str);
-       if (s > b || strncmp(*buf, str, s))     /* check if same */
-               return (0);     /* not a match */
-       (*buf) += s;            /* advance pointer */
-       return (1);
-}
-
-
-/*
- * dst_s_conv_bignum_b64_to_u8
- *     Read a line of base-64 encoded string from the input buffer,
- *     convert it to binary, and store it in an output area.  The
- *     input buffer is read until reaching a newline marker or the
- *     end of the buffer.  The binary data is stored in the last X
- *     number of bytes of the output area where X is the size of the
- *     binary output.  If the operation is successful, the input buffer
- *     pointer is advanced.  This procedure does not do network to host
- *     byte order conversion.
- * Parameters
- *     buf     Pointer to encoded input string. Pointer is updated if
- *        function is successfull.
- *     loc     Output area.
- *     loclen  Size in bytes of output area.
- * Return
- *     >0      Return = number of bytes of binary data stored in loc.
- *      0      Failure.
- */
-
-int
-dst_s_conv_bignum_b64_to_u8(const char **buf,
-                           u_char *loc, const unsigned loclen)
-{
-       unsigned blen;
-       char *bp;
-       u_char bstr[RAW_KEY_SIZE];
-
-       if (buf == NULL || *buf == NULL) {      /* error checks */
-               EREPORT(("dst_s_conv_bignum_b64_to_u8: null input buffer.\n"));
-               return (0);
-       }
-       bp = strchr(*buf, '\n');        /* find length of input line */
-       if (bp != NULL)
-               *bp = (u_char) NULL;
-
-       blen = b64_pton(*buf, bstr, sizeof(bstr));
-       if (blen <= 0) {
-               EREPORT(("dst_s_conv_bignum_b64_to_u8: decoded value is null.\n"));
-               return (0);
-       }
-       else if (loclen < blen) {
-               EREPORT(("dst_s_conv_bignum_b64_to_u8: decoded value is longer than output buffer.\n"));
-               return (0);
-       }
-       if (bp)
-               *buf = bp;      /* advancing buffer past \n */
-       memset(loc, 0, loclen - blen);  /* clearing unused output area */
-       memcpy(loc + loclen - blen, bstr, blen);        /* write last blen bytes  */
-       return (blen);
-}
-
-
-/*
- * dst_s_calculate_bits
- *     Given a binary number represented in a u_char[], determine
- *     the number of significant bits used.
- * Parameters
- *     str       An input character string containing a binary number.
- *     max_bits The maximum possible significant bits.
- * Return
- *     N       The number of significant bits in str.
- */
-
-int
-dst_s_calculate_bits(const u_char *str, const int max_bits)
-{
-       const u_char *p = str;
-       u_char i, j = 0x80;
-       int bits;
-       for (bits = max_bits; *p == 0x00 && bits > 0; p++)
-               bits -= 8;
-       for (i = *p; (i & j) != j; j >>= 1)
-               bits--;
-       return (bits);
-}
-
-
-/*
- * calculates a checksum used in kmt for a id.
- * takes an array of bytes and a length.
- * returns a 16  bit checksum.
- */
-u_int16_t
-dst_s_id_calc(const u_char *key, const unsigned keysize)
-{
-       u_int32_t ac;
-       const u_char *kp = key;
-       unsigned size = keysize;
-
-       if (!key)
-               return 0;
- 
-       for (ac = 0; size > 1; size -= 2, kp += 2)
-               ac += ((*kp) << 8) + *(kp + 1);
-
-       if (size > 0)
-               ac += ((*kp) << 8);
-       ac += (ac >> 16) & 0xffff;
-
-       return (ac & 0xffff);
-}
-
-/* 
- * dst_s_dns_key_id() Function to calculated DNSSEC footprint from KEY reocrd
- *   rdata (all of  record)
- * Input:
- *     dns_key_rdata: the raw data in wire format 



Home | Main Index | Thread Index | Old Index