diff --git a/usr.sbin/dhcpd/bpf.c b/usr.sbin/dhcpd/bpf.c index 0f9d484a74cc..ffcab7499512 100644 --- a/usr.sbin/dhcpd/bpf.c +++ b/usr.sbin/dhcpd/bpf.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: bpf.c,v 1.1.1.1 1996/10/03 06:33:24 mrg Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: bpf.c,v 1.2 1996/10/03 06:57:18 mrg Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -55,9 +55,15 @@ static char copyright[] = #include #endif #include +#ifdef __NetBSD__ +#include +#include +#include +#else #include "includes/netinet/ip.h" #include "includes/netinet/udp.h" #include "includes/netinet/if_ether.h" +#endif /* Called by get_interface_list for each interface that's discovered. Opens a packet filter for each interface and adds it to the select diff --git a/usr.sbin/dhcpd/dhcp2netbsd b/usr.sbin/dhcpd/dhcp2netbsd new file mode 100644 index 000000000000..cdbeb6dd2503 --- /dev/null +++ b/usr.sbin/dhcpd/dhcp2netbsd @@ -0,0 +1,96 @@ +#! /bin/sh +# +# $NetBSD +# +# Copyright (c) 1996 Matthew R. Green +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. All advertising materials mentioning features or use of this software +# must display the following acknowledgement: +# This product includes software developed by Matthew R. Green. +# 4. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +# dhcp2netbsd: convert a dhcp directory into a netbsd source tree. + +if [ $# -ne 2 ]; then echo "dhcp2netbsd src dest"; exit 1; fi + +r=$1 +d=$2/dhcpd + + +echo preparing directory $d +rm -rf $d +mkdir -p $d + +echo copying tree from $r into $d +cd $r +pax -rw . $d + +cd $d + +# based on Makefile.dist +echo updating manual page pathnames +perl -pi -e 's#ETCDIR#/etc#g; s#RUNDIR#/var/run#g; s#DBDIR#/var/db#g; ' dhcpd.8 + +echo creating subdirectories +mkdir dhclient + +echo creating Makefile +cat > Makefile<<'__eof_makefile' +# $NetBSD: dhcp2netbsd,v 1.1 1996/10/03 06:57:19 mrg Exp $ + +# XXX - are these useful for users? +#SUBDIR= dhclient + +PROG= dhcpd +SRCS= options.c errwarn.c convert.c tree.c memory.c alloc.c print.c hash.c \ + tables.c inet.c dispatch.c bpf.c packet.c raw.c nit.c socket.c dhcpd.c \ + dhcp.c bootp.c conflex.c confpars.c db.c +MAN= dhcpd.8 dhcpd.conf.5 + +.include +.include +__eof_makefile + +echo creating dhclient Makefile +cat > dhclient/Makefile<<'__eof_dhclient_makefile' +# $NetBSD: dhcp2netbsd,v 1.1 1996/10/03 06:57:19 mrg Exp $ + +SRCS= dhclient.c options.c errwarn.c convert.c tree.c memory.c alloc.c \ + print.c hash.c tables.c inet.c dispatch.c bpf.c packet.c raw.c nit.c \ + socket.c +PROG= dhclient +NOMAN= 1 +.PATH: ${.CURDIR}/.. + +.include +__eof_dhclient_makefile + +echo deleting processed manuals, old BSD includes, configuration program +echo and old translation tools + +rm -rf includes configure *.cat? dhcpxlt.c + +echo done +exit 0 diff --git a/usr.sbin/dhcpd/dhcpd.c b/usr.sbin/dhcpd/dhcpd.c index d8f0eaf128ba..b1b3153bb847 100644 --- a/usr.sbin/dhcpd/dhcpd.c +++ b/usr.sbin/dhcpd/dhcpd.c @@ -42,7 +42,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhcpd.c,v 1.1.1.1 1996/10/03 06:33:25 mrg Exp $ Copyright 1995, 1996 The Internet Software Consortium."; +"$Id: dhcpd.c,v 1.2 1996/10/03 06:57:19 mrg Exp $ Copyright 1995, 1996 The Internet Software Consortium."; #endif static char copyright[] = @@ -103,9 +103,11 @@ int main (argc, argv, envp) setlogmask (LOG_UPTO (LOG_INFO)); #endif #endif +#ifndef __NetBSD__ note (message); note (copyright); note (arr); +#endif for (i = 1; i < argc; i++) { if (!strcmp (argv [i], "-p")) { diff --git a/usr.sbin/dhcpd/nit.c b/usr.sbin/dhcpd/nit.c index fd140ec20948..bbe2491554f3 100644 --- a/usr.sbin/dhcpd/nit.c +++ b/usr.sbin/dhcpd/nit.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: nit.c,v 1.1.1.1 1996/10/03 06:33:25 mrg Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: nit.c,v 1.2 1996/10/03 06:57:20 mrg Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -59,9 +59,15 @@ static char copyright[] = #include #include +#ifdef __NetBSD__ +#include +#include +#incldue +#else #include "includes/netinet/ip.h" #include "includes/netinet/udp.h" #include "includes/netinet/if_ether.h" +#endif /* Called by get_interface_list for each interface that's discovered. Opens a packet filter for each interface and adds it to the select diff --git a/usr.sbin/dhcpd/packet.c b/usr.sbin/dhcpd/packet.c index 71675ee5a8ad..5ae4f059eca9 100644 --- a/usr.sbin/dhcpd/packet.c +++ b/usr.sbin/dhcpd/packet.c @@ -42,15 +42,21 @@ #ifndef lint static char copyright[] = -"$Id: packet.c,v 1.1.1.1 1996/10/03 06:33:25 mrg Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: packet.c,v 1.2 1996/10/03 06:57:21 mrg Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" #if defined (PACKET_ASSEMBLY) || defined (PACKET_DECODING) #include +#ifdef __NetBSD__ +#include +#include +#include +#else #include "includes/netinet/ip.h" #include "includes/netinet/udp.h" #include "includes/netinet/if_ether.h" +#endif static u_int32_t checksum PROTO ((unsigned char *, int, u_int32_t)); static u_int32_t wrapsum PROTO ((u_int32_t));