update some minor things for netbsd. add dhcp2netbsd script.

This commit is contained in:
mrg 1996-10-03 06:57:18 +00:00
parent f6be9247c0
commit 615a3ac588
5 changed files with 120 additions and 4 deletions

View File

@ -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 <net/pfilt.h>
#endif
#include <netinet/in_systm.h>
#ifdef __NetBSD__
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <netinet/if_ether.h>
#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

View File

@ -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 <bsd.subdir.mk>
.include <bsd.prog.mk>
__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 <bsd.prog.mk>
__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

View File

@ -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")) {

View File

@ -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 <net/packetfilt.h>
#include <netinet/in_systm.h>
#ifdef __NetBSD__
#include <netinet/ip.h>
#include <netinet/udp.h>
#incldue <netinet/if_ether.h>
#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

View File

@ -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 <netinet/in_systm.h>
#ifdef __NetBSD__
#include <netinet/ip.h>
#include <netinet/udp.h>
#include <netinet/if_ether.h>
#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));