Module Name: src
Committed By: christos
Date: Sun Mar 24 15:54:32 UTC 2013
Added Files:
src/external/bsd/dhcp: Makefile Makefile.inc dhcp2netbsd
src/external/bsd/dhcp/bin: Makefile Makefile.inc
src/external/bsd/dhcp/bin/client: Makefile
src/external/bsd/dhcp/bin/clientscript: Makefile dhclient-script
src/external/bsd/dhcp/bin/omshell: Makefile
src/external/bsd/dhcp/bin/relay: Makefile
src/external/bsd/dhcp/bin/server: Makefile
src/external/bsd/dhcp/include: config.h
src/external/bsd/dhcp/lib: Makefile Makefile.inc
src/external/bsd/dhcp/lib/common: Makefile
src/external/bsd/dhcp/lib/dhcpctl: Makefile
src/external/bsd/dhcp/lib/dst: Makefile
src/external/bsd/dhcp/lib/omapip: Makefile
src/external/bsd/dhcp/share: Makefile
src/external/bsd/dhcp/share/dhcpd: Makefile pxe.defs
Log Message:
Build gluons
NB: This will not link yet, until I commit all the bind changes.
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/Makefile \
src/external/bsd/dhcp/Makefile.inc src/external/bsd/dhcp/dhcp2netbsd
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/bin/Makefile \
src/external/bsd/dhcp/bin/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/bin/client/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/bin/clientscript/Makefile \
src/external/bsd/dhcp/bin/clientscript/dhclient-script
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/bin/omshell/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/bin/relay/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/bin/server/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/include/config.h
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/lib/Makefile \
src/external/bsd/dhcp/lib/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/lib/common/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/lib/dhcpctl/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/lib/dst/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/lib/omapip/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/share/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcp/share/dhcpd/Makefile \
src/external/bsd/dhcp/share/dhcpd/pxe.defs
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Added files:
Index: src/external/bsd/dhcp/Makefile
diff -u /dev/null src/external/bsd/dhcp/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/Makefile Sun Mar 24 11:54:29 2013
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:29 christos Exp $
+
+SUBDIR= lib share .WAIT bin
+
+.include <bsd.subdir.mk>
Index: src/external/bsd/dhcp/Makefile.inc
diff -u /dev/null src/external/bsd/dhcp/Makefile.inc:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/Makefile.inc Sun Mar 24 11:54:29 2013
@@ -0,0 +1,39 @@
+# $NetBSD: Makefile.inc,v 1.1 2013/03/24 15:54:29 christos Exp $
+
+WARNS?= 1 # XXX -Wshadow -Wcast-qual -Wsign-compare
+
+.include <bsd.own.mk>
+
+USE_FORT?= yes # network client/server
+CWARNFLAGS.clang+= -Wno-tautological-compare \
+ -Wno-conversion -Wno-constant-logical-operand \
+ -Wno-format-security
+
+DIST:= ${.PARSEDIR}/dist
+BIND:= ${.PARSEDIR}/../bind/dist
+.PATH: ${DIST}/${DHCPSRCDIR}
+
+COBJDIR!=cd ${.PARSEDIR}/lib/common && ${PRINTOBJDIR}
+OMOBJDIR!=cd ${.PARSEDIR}/lib/omapip && ${PRINTOBJDIR}
+DSTOBJDIR!=cd ${.PARSEDIR}/lib/dst && ${PRINTOBJDIR}
+
+.if (${USE_INET6} != "no")
+CPPFLAGS+= -DDHCPv6
+.endif
+CPPFLAGS+= -DISC_PLATFORM_USETHREADS
+CPPFLAGS+= -I${DIST} -I${DIST}/includes -I${DIST}/../include
+CPPFLAGS+= -I${BIND} -I${BIND}/includes -I${BIND}/../include
+.for dir in isc dns
+CPPFLAGS+= -I${BIND}/lib/${dir}/include
+CPPFLAGS+= -I${BIND}/lib/${dir}/unix/include
+CPPFLAGS+= -I${BIND}/lib/${dir}/pthreads/include
+.endfor
+CPPFLAGS+= -DLOCALSTATEDIR='"/var"'
+LDADD+= ${COBJDIR}/libdhcp.a
+LDADD+= ${OMOBJDIR}/libomapi.a ${DSTOBJDIR}/libdst.a
+LDADD+= -ldns -lisc
+LDADD+= -lipsec
+DPADD+= ${COBJDIR}/libdhcp.a
+DPADD+= ${OMOBJDIR}/libomapi.a ${DSTOBJDIR}/libdst.a
+DPADD+= ${LIBDNS} ${LIBISC}
+DPADD+= ${LIBIPSEC}
Index: src/external/bsd/dhcp/dhcp2netbsd
diff -u /dev/null src/external/bsd/dhcp/dhcp2netbsd:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/dhcp2netbsd Sun Mar 24 11:54:29 2013
@@ -0,0 +1,82 @@
+#! /bin/sh
+#
+# $NetBSD: dhcp2netbsd,v 1.1 2013/03/24 15:54:29 christos Exp $
+#
+# Copyright (c) 2003, 2011 The NetBSD Foundation, Inc.
+# 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.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``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 FOUNDATION OR CONTRIBUTORS
+# 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 source tree into a
+# format suitable for import. Works on current dir.
+# You can run this only once if you want it to work.
+#
+# based on file2netbsd
+#
+PROG="$(basename "$0")"
+
+if [ -z "$1" ]
+then
+ echo "Usage: $PROG <directory>" 1>&2
+ exit 1
+fi
+FILE="$1"
+
+### Wipe out stuff we don't want
+rm -fr bind
+
+### Remove the $'s around RCS tags
+cleantags "$FILE"
+
+### Add NetBSD RCS Id
+find "$FILE" -type f -name '*.[chly]' -print | while read c; do
+ sed -e '1{/$NetBSD/!{i\
+/* \$NetBSD\$ */\
+
+};}' -e \
+'/www.nominum.com/ {
+ N
+ N
+ a\
+#include <sys/cdefs.h>\
+__RCSID("\$NetBSD\$\");\
+
+}' $c > /tmp/dhcp1$$
+mv /tmp/dhcp1$$ $c && echo did source mods for $c
+done
+
+#### Add RCS tags to man pages
+find "$FILE" -type f -name '*.[0-9]' -print | while read m; do
+ sed -e '1{/$NetBSD/!i\
+.\\" \$NetBSD\$\
+.\\"
+
+}' $m > /tmp/dhcp2$$
+mv /tmp/dhcp2$$ $m && echo did manpage mods for $m
+done
+
+echo done
+
+echo You can import now. Use the following command:
+echo cvs -d cvs.netbsd.org:/cvsroot import src/external/bsd/dhcp/dist ISC DHCPX_Y_Z
+
+exit 0
Index: src/external/bsd/dhcp/bin/Makefile
diff -u /dev/null src/external/bsd/dhcp/bin/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/bin/Makefile Sun Mar 24 11:54:30 2013
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:30 christos Exp $
+
+SUBDIR= clientscript server client relay omshell
+
+.include <bsd.subdir.mk>
Index: src/external/bsd/dhcp/bin/Makefile.inc
diff -u /dev/null src/external/bsd/dhcp/bin/Makefile.inc:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/bin/Makefile.inc Sun Mar 24 11:54:30 2013
@@ -0,0 +1,2 @@
+.include "${.PARSEDIR}/../Makefile.inc"
+BINDIR?=/usr/sbin
Index: src/external/bsd/dhcp/bin/client/Makefile
diff -u /dev/null src/external/bsd/dhcp/bin/client/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/bin/client/Makefile Sun Mar 24 11:54:30 2013
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:30 christos Exp $
+
+BINDIR= /sbin
+.include <bsd.own.mk> # for MKDYNAMICROOT definition
+
+SRCS = dhclient.c clparse.c dhc6.c
+PROG = dhclient
+MAN = dhclient.8 dhclient.conf.5 dhclient.leases.5 dhclient-script.8
+CPPFLAGS += -DCLIENT_PATH='"PATH=/usr/bin:/usr/sbin:/bin:/sbin"'
+
+DHCPSRCDIR= client
+
+.if (${MKDYNAMICROOT} == "no")
+LDSTATIC?= -static
+.endif
+
+.include <bsd.prog.mk>
Index: src/external/bsd/dhcp/bin/clientscript/Makefile
diff -u /dev/null src/external/bsd/dhcp/bin/clientscript/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/bin/clientscript/Makefile Sun Mar 24 11:54:30 2013
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:30 christos Exp $
+
+NOOBJ= # defined
+
+SCRIPTS=dhclient-script
+SCRIPTSDIR=/sbin
+
+.include <bsd.prog.mk>
Index: src/external/bsd/dhcp/bin/clientscript/dhclient-script
diff -u /dev/null src/external/bsd/dhcp/bin/clientscript/dhclient-script:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/bin/clientscript/dhclient-script Sun Mar 24 11:54:30 2013
@@ -0,0 +1,296 @@
+#!/bin/sh
+#
+# $NetBSD: dhclient-script,v 1.1 2013/03/24 15:54:30 christos Exp $
+
+ENTERHOOKS=/etc/dhclient-enter-hooks
+EXITHOOKS=/etc/dhclient-exit-hooks
+RESOLV=/etc/resolv.conf
+SIGNATURE="# Created by dhclient from"
+INTSIG="$SIGNATURE $interface"
+
+echo_resolv_conf() {
+ echo "$INTSIG"
+ echo search $new_domain_name
+ for nameserver in $new_domain_name_servers; do
+ echo nameserver $nameserver
+ done
+}
+
+make_resolv_conf() {
+ if [ ! -z "$new_domain_name_servers" ]; then
+ if [ -x /sbin/resolvconf ]; then
+ echo_resolv_conf | /sbin/resolvconf -a $interface
+ else
+ if [ -f $RESOLV ]; then
+ while read line; do
+ case $line in
+ "$SIGNATURE"*)
+ ;;
+ *)
+ mv $RESOLV $RESOLV.save;;
+ esac
+ break
+ done < $RESOLV
+ fi
+ echo_resolv_conf > $RESOLV
+ fi
+ fi
+}
+
+restore_resolv_conf() {
+ if [ -x /sbin/resolvconf ]; then
+ /sbin/resolvconf -d $interface
+ elif [ -f $RESOLV.save -a -f $RESOLV ]; then
+ while read line; do
+ case $line in
+ "$INTSIG"*)
+ mv $RESOLV.save $RESOLV;;
+ esac
+ break
+ done < $RESOLV
+ fi
+}
+
+# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
+exit_with_hooks() {
+ exit_status=$1
+ if [ -f "$EXITHOOKS" ]; then
+ . "$EXITHOOKS"
+ fi
+ # probably should do something with exit status of the local script
+ exit $exit_status
+}
+
+
+add_new_routes() {
+ for router in $new_routers; do
+ route add default $router
+ done >/dev/null 2>&1
+
+ set -- $new_static_routes
+ while [ $# -gt 1 ]; do
+ route add $1 $2
+ shift; shift
+ done
+}
+
+delete_old_routes() {
+ for router in $old_routers; do
+ route delete default $router
+ done >/dev/null 2>&1
+
+ set -- $old_static_routes
+ while [ $# -gt 1 ]; do
+ route delete $1 $2
+ shift; shift
+ done
+
+ route -n flush -inet -llinfo -host
+}
+
+# Invoke the local dhcp client enter hooks, if they exist.
+if [ -f $ENTERHOOKS ]; then
+ exit_status=0
+ . $ENTERHOOKS
+ # allow the local script to abort processing of this state
+ # local script must set exit_status variable to nonzero.
+ if [ $exit_status -ne 0 ]; then
+ exit $exit_status
+ fi
+fi
+
+#if [ ! -z "$new_host_name" ]; then
+# echo New Host Name: $new_host_name
+#fi
+#
+#if [ ! -z "$new_nis_domain" ]; then
+# echo New NIS Domain: $new_nis_domain
+#fi
+#
+#if [ ! -z "$new_network_number" ]; then
+# echo New Network Number: $new_network_number
+#fi
+
+if [ ! -z "$new_broadcast_address" ]; then
+# echo New Broadcast Address: $new_broadcast_address
+ new_broadcast_arg="broadcast $new_broadcast_address"
+fi
+
+if [ ! -z "$old_broadcast_address" ]; then
+ old_broadcast_arg="broadcast $old_broadcast_address"
+fi
+
+if [ ! -z "$new_subnet_mask" ]; then
+ new_netmask_arg="netmask $new_subnet_mask"
+fi
+
+if [ ! -z "$old_subnet_mask" ]; then
+ old_netmask_arg="netmask $old_subnet_mask"
+fi
+
+if [ ! -z "$alias_subnet_mask" ]; then
+ alias_subnet_arg="netmask $alias_subnet_mask"
+fi
+
+case "$reason" in
+MEDIUM)
+ test -z "$medium" && exit_with_hooks 0
+ eval "ifconfig $interface $medium"
+ eval "ifconfig $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1
+
+ sleep 1
+
+ exit_with_hooks 0
+ ;;
+
+PREINIT)
+ if [ ! -z "$alias_ip_address" ]; then
+ ifconfig $interface inet \
+ -alias $alias_ip_address >/dev/null 2>&1
+ route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
+ fi
+
+ ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 \
+ broadcast 255.255.255.255 up
+
+ exit_with_hooks 0
+ ;;
+
+ARPCHECK|ARPSEND)
+ exit_with_hooks 0
+ ;;
+
+BOUND|RENEW|REBIND|REBOOT)
+ if [ ! -z "$new_nis_domain" ]; then
+ if type domainname > /dev/null 2>&1; then
+ domainname $new_nis_domain
+ fi
+ fi
+
+ if type hostname > /dev/null 2>&1; then
+ if [ \( -z "$current_hostname" \) -o \
+ \( "x$new_host_name" = "x$old_hostname" \) ]; then
+ current_hostname=`hostname`
+ fi
+ if [ \( -z "$current_hostname" \) -o \
+ \( "x$new_host_name" != "x$old_hostname" \) ]; then
+ hostname $new_host_name
+ fi
+ fi
+
+ if [ \( ! -z "$old_ip_address" \) -a \( ! -z "$alias_ip_address" \) -a \
+ \( "x$alias_ip_address" != "x$old_ip_address" \) ]; then
+ ifconfig $interface inet \
+ -alias $alias_ip_address > /dev/null 2>&1
+ route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
+ fi
+
+ if [ \( ! -z "$old_ip_address" \) -a \
+ \( "x$old_ip_address" != "x$new_ip_address" \) ]; then
+ eval "ifconfig $interface inet -alias $old_ip_address $medium"
+ route delete $old_ip_address 127.0.0.1 >/dev/null 2>&1
+
+ delete_old_routes
+ fi
+
+ if [ \( -z "$old_ip_address" \) -o \
+ \( "x$old_ip_address" != "x$new_ip_address" \) -o \
+ \( "x$reason" = "xBOUND" \) -o \( "x$reason" = "xREBOOT" \) ]; then
+ eval "ifconfig $interface inet $new_ip_address \
+ $new_netmask_arg $new_broadcast_arg $medium"
+ route add $new_ip_address 127.0.0.1 >/dev/null 2>&1
+
+ add_new_routes
+ fi
+
+ if [ \( ! -z "$alias_ip_address" \) -a \
+ \( "x$new_ip_address" != "x$alias_ip_address" \) ]; then
+ ifconfig $interface inet alias $alias_ip_address \
+ $alias_subnet_arg
+ route add $alias_ip_address 127.0.0.1
+ fi
+ make_resolv_conf
+ exit_with_hooks 0
+ ;;
+
+EXPIRE|FAIL|RELEASE|STOP)
+ if [ ! -z "$old_nis_domain" ]; then
+ if type domainname > /dev/null 2>&1; then
+ # delete the old nis domain name
+ domainname ""
+ fi
+ fi
+
+ if [ ! -z "$alias_ip_address" ]; then
+ ifconfig $interface inet -alias $alias_ip_address
+ route delete $alias_ip_address 127.0.0.1
+ fi > /dev/null 2>&1
+
+ if [ ! -z "$old_ip_address" ]; then
+ eval "ifconfig $interface inet -alias $old_ip_address $medium"
+ route delete $old_ip_address 127.0.0.1 >/dev/null 2>&1
+ delete_old_routes
+
+ fi
+
+ if [ ! -z "$alias_ip_address" ]; then
+ ifconfig $interface inet alias $alias_ip_address \
+ $alias_subnet_arg
+ route add $alias_ip_address 127.0.0.1
+ fi
+
+ restore_resolv_conf
+ exit_with_hooks 0
+ ;;
+
+TIMEOUT)
+ if [ ! -z "$alias_ip_address" ]; then
+ ifconfig $interface inet -alias $alias_ip_address
+ route delete $alias_ip_address 127.0.0.1
+ fi > /dev/null 2>&1
+
+ if [ ! -z "$new_host_name" ]; then
+ if type hostname > /dev/null 2>&1; then
+ hostname $new_host_name
+ fi
+ fi
+
+ if [ ! -z "$new_nis_domain" ]; then
+ if type domainname > /dev/null 2>&1; then
+ domainname $new_nis_domain
+ fi
+ fi
+
+ eval "ifconfig $interface inet $new_ip_address $new_netmask_arg \
+ $new_broadcast_arg $medium"
+ sleep 1
+
+ if [ ! -z "$new_routers" ]; then
+ set -- $new_routers
+ if ping -n -q -c 1 -w 1 $1; then
+ if [ \( ! -z "$alias_ip_address" \) -a \
+ \( "x$new_ip_address" != "x$alias_ip_address" \) ]
+ then
+ ifconfig $interface inet alias \
+ $alias_ip_address $alias_subnet_arg
+ route add $alias_ip_address 127.0.0.1
+ fi
+
+ route add $new_ip_address 127.0.0.1 >/dev/null 2>&1
+
+ add_new_routes
+ make_resolv_conf
+ exit_with_hooks 0
+ fi
+ fi
+
+ eval "ifconfig $interface inet -alias $new_ip_address $medium"
+
+ delete_old_routes
+
+ exit_with_hooks 1
+ ;;
+*)
+ exit_with_hooks 0
+ ;;
+esac
Index: src/external/bsd/dhcp/bin/omshell/Makefile
diff -u /dev/null src/external/bsd/dhcp/bin/omshell/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/bin/omshell/Makefile Sun Mar 24 11:54:30 2013
@@ -0,0 +1,16 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:30 christos Exp $
+
+.include <bsd.own.mk>
+
+SRCS = omshell.c
+PROG = omshell
+MAN = omshell.1
+
+DHCPSRCDIR= dhcpctl
+
+CTLOBJDIR!=cd $(.CURDIR)/../../lib/dhcpctl && ${PRINTOBJDIR}
+
+LDADD+= ${CTLOBJDIR}/libdhcpctl.a
+DPADD+= ${CTLOBJDIR}/libdhcpctl.a
+
+.include <bsd.prog.mk>
Index: src/external/bsd/dhcp/bin/relay/Makefile
diff -u /dev/null src/external/bsd/dhcp/bin/relay/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/bin/relay/Makefile Sun Mar 24 11:54:30 2013
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:30 christos Exp $
+
+SRCS = dhcrelay.c
+PROG = dhcrelay
+MAN = dhcrelay.8
+
+DHCPSRCDIR= relay
+
+.include <bsd.prog.mk>
Index: src/external/bsd/dhcp/bin/server/Makefile
diff -u /dev/null src/external/bsd/dhcp/bin/server/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/bin/server/Makefile Sun Mar 24 11:54:30 2013
@@ -0,0 +1,18 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:30 christos Exp $
+
+.include <bsd.own.mk>
+
+SRCS = dhcpd.c dhcp.c dhcpv6.c bootp.c confpars.c db.c class.c failover.c \
+ omapi.c mdb.c mdb6.c stables.c salloc.c ddns.c dhcpleasequery.c
+PROG = dhcpd
+MAN = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
+
+DHCPSRCDIR= server
+
+.if ${MKSHARE} != "no"
+FILESDIR= /usr/share/examples/dhcp
+
+FILES= dhcpd.conf
+.endif
+
+.include <bsd.prog.mk>
Index: src/external/bsd/dhcp/include/config.h
diff -u /dev/null src/external/bsd/dhcp/include/config.h:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/include/config.h Sun Mar 24 11:54:31 2013
@@ -0,0 +1,270 @@
+/* includes/config.h. Generated from config.h.in by configure. */
+/* includes/config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to compile debug-only DHCP software. */
+/* #undef DEBUG */
+
+/* Define to queue multiple DHCPACK replies per fsync. */
+/* #undef DELAYED_ACK */
+
+/* Define to BIG_ENDIAN for MSB (Motorola or SPARC CPUs) or LITTLE_ENDIAN for
+ LSB (Intel CPUs). */
+#include <sys/endian.h>
+#define DHCP_BYTE_ORDER _BYTE_ORDER
+
+#if 0
+/* Define to 1 to include DHCPv6 support. */
+/* From the Makefile */
+#define DHCPv6 1
+#endif
+
+/* Define to any value to chroot() prior to loading config. */
+/* #undef EARLY_CHROOT */
+
+/* Define to include execute() config language support. */
+#define ENABLE_EXECUTE 1
+
+/* Define to include Failover Protocol support. */
+#define FAILOVER_PROTOCOL 1
+
+/* Define to nothing if C supports flexible array members, and to 1 if it does
+ not. That way, with a declaration like `struct s { int n; double
+ d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99
+ compilers. When computing the size of such an object, don't use 'sizeof
+ (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)'
+ instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with
+ MSVC and with C++ compilers. */
+#define FLEXIBLE_ARRAY_MEMBER
+
+/* Define to 1 to use the Berkeley Packet Filter interface code. */
+#define HAVE_BPF ""
+
+/* Define to 1 if you have the /dev/random file. */
+#define HAVE_DEV_RANDOM 1
+
+/* Define to 1 to use DLPI interface code. */
+/* #undef HAVE_DLPI */
+
+/* Define to 1 if you have the <ifaddrs.h> header file. */
+#define HAVE_IFADDRS_H 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <linux/types.h> header file. */
+/* #undef HAVE_LINUX_TYPES_H */
+
+/* Define to 1 to use the Linux Packet Filter interface code. */
+/* #undef HAVE_LPF */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <net/if6.h> header file. */
+/* #undef HAVE_NET_IF6_H */
+
+/* Define to 1 if you have the <net/if_dl.h> header file. */
+#define HAVE_NET_IF_DL_H 1
+
+/* Define to 1 if you have the <regex.h> header file. */
+#define HAVE_REGEX_H 1
+
+/* Define to 1 if the sockaddr structure has a length field. */
+#define HAVE_SA_LEN
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#define HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if the system has 'struct if_laddrconf'. */
+/* #undef ISC_PLATFORM_HAVEIF_LADDRCONF */
+
+/* Define to 1 if the system has 'struct if_laddrreq'. */
+/* #undef ISC_PLATFORM_HAVEIF_LADDRREQ */
+
+/* Define to 1 if the system has 'struct lifnum'. */
+/* #undef ISC_PLATFORM_HAVELIFNUM */
+
+/* Define to 1 if the inet_aton() function is missing. */
+/* #undef NEED_INET_ATON */
+
+/* Name of package */
+#define PACKAGE "dhcp"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "[email protected]"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "DHCP"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "DHCP 4.2.3"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "dhcp"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "4.2.3"
+
+/* Define to any value to include Ari's PARANOIA patch. */
+/* #undef PARANOIA */
+
+/* The size of `struct iaddr *', as computed by sizeof. */
+#define SIZEOF_STRUCT_IADDR_P 8
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to include server activity tracing support. */
+#define TRACING 1
+
+/* Define to 1 to use the standard BSD socket API. */
+/* #undef USE_SOCKETS */
+
+/* Define to 1 to enable IPv4 packet info support. */
+/* #undef USE_V4_PKTINFO */
+
+/* Version number of package */
+#define VERSION "4.2.3"
+
+/* Define to 1 if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+/* # undef _ALL_SOURCE */
+#endif
+
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* File for dhclient6 leases. */
+/* #undef _PATH_DHCLIENT6_DB */
+
+/* File for dhclient6 process information. */
+/* #undef _PATH_DHCLIENT6_PID */
+
+/* File for dhclient leases. */
+/* #undef _PATH_DHCLIENT_DB */
+
+/* File for dhclient process information. */
+/* #undef _PATH_DHCLIENT_PID */
+
+/* File for dhcpd6 leases. */
+/* #undef _PATH_DHCPD6_DB */
+
+/* File for dhcpd6 process information. */
+/* #undef _PATH_DHCPD6_PID */
+
+/* File for dhcpd leases. */
+/* #undef _PATH_DHCPD_DB */
+
+/* File for dhcpd process information. */
+/* #undef _PATH_DHCPD_PID */
+
+/* File for dhcrelay6 process information. */
+/* #undef _PATH_DHCRELAY6_PID */
+
+/* File for dhcrelay process information. */
+/* #undef _PATH_DHCRELAY_PID */
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
+ #define below would cause a syntax error. */
+/* #undef _UINT32_T */
+
+/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
+ #define below would cause a syntax error. */
+/* #undef _UINT64_T */
+
+/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
+ <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the
+ #define below would cause a syntax error. */
+/* #undef _UINT8_T */
+
+/* Enable extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+
+/* Define to the type of a signed integer type of width exactly 16 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef int16_t */
+
+/* Define to the type of a signed integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef int32_t */
+
+/* Define to the type of a signed integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef int64_t */
+
+/* Define to the type of a signed integer type of width exactly 8 bits if such
+ a type exists and the standard includes do not define it. */
+/* #undef int8_t */
+
+/* Define a type for 16-bit unsigned integers. */
+/* #undef u_int16_t */
+
+/* Define a type for 32-bit unsigned integers. */
+/* #undef u_int32_t */
+
+/* Define a type for 64-bit unsigned integers. */
+/* #undef u_int64_t */
+
+/* Define a type for 8-bit unsigned integers. */
+/* #undef u_int8_t */
+
+/* Define to the type of an unsigned integer type of width exactly 16 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef uint16_t */
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef uint32_t */
+
+/* Define to the type of an unsigned integer type of width exactly 64 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef uint64_t */
+
+/* Define to the type of an unsigned integer type of width exactly 8 bits if
+ such a type exists and the standard includes do not define it. */
+/* #undef uint8_t */
Index: src/external/bsd/dhcp/lib/Makefile
diff -u /dev/null src/external/bsd/dhcp/lib/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/lib/Makefile Sun Mar 24 11:54:31 2013
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:31 christos Exp $
+
+SUBDIR= common dhcpctl dst omapip
+
+.include <bsd.subdir.mk>
Index: src/external/bsd/dhcp/lib/Makefile.inc
diff -u /dev/null src/external/bsd/dhcp/lib/Makefile.inc:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/lib/Makefile.inc Sun Mar 24 11:54:31 2013
@@ -0,0 +1 @@
+.include "${.PARSEDIR}/../Makefile.inc"
Index: src/external/bsd/dhcp/lib/common/Makefile
diff -u /dev/null src/external/bsd/dhcp/lib/common/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/lib/common/Makefile Sun Mar 24 11:54:31 2013
@@ -0,0 +1,14 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:31 christos Exp $
+
+LIBISPRIVATE= yes
+
+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 ctrace.c \
+ dns.c resolv.c execute.c discover.c comapi.c ns_name.c
+MAN = dhcp-options.5 dhcp-eval.5
+
+DHCPSRCDIR= common
+
+.include <bsd.lib.mk>
Index: src/external/bsd/dhcp/lib/dhcpctl/Makefile
diff -u /dev/null src/external/bsd/dhcp/lib/dhcpctl/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/lib/dhcpctl/Makefile Sun Mar 24 11:54:31 2013
@@ -0,0 +1,10 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:31 christos Exp $
+
+LIBISPRIVATE= yes
+
+LIB = dhcpctl
+SRCS = dhcpctl.c callback.c remote.c
+
+DHCPSRCDIR= dhcpctl
+
+.include <bsd.lib.mk>
Index: src/external/bsd/dhcp/lib/dst/Makefile
diff -u /dev/null src/external/bsd/dhcp/lib/dst/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/lib/dst/Makefile Sun Mar 24 11:54:31 2013
@@ -0,0 +1,12 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:31 christos Exp $
+
+LIBISPRIVATE= yes
+
+LIB = dst
+SRCS = dst_support.c dst_api.c hmac_link.c md5_dgst.c base64.c prandom.c
+
+DHCPSRCDIR= dst
+
+CFLAGS += -DMINIRES_LIB -DHMAC_MD5
+
+.include <bsd.lib.mk>
Index: src/external/bsd/dhcp/lib/omapip/Makefile
diff -u /dev/null src/external/bsd/dhcp/lib/omapip/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/lib/omapip/Makefile Sun Mar 24 11:54:31 2013
@@ -0,0 +1,13 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:31 christos Exp $
+
+LIBISPRIVATE= yes
+
+LIB = omapi
+SRCS = protocol.c buffer.c alloc.c result.c connection.c errwarn.c \
+ listener.c dispatch.c generic.c support.c handle.c message.c \
+ auth.c convert.c hash.c array.c inet_addr.c trace.c \
+ toisc.c isclib.c
+
+DHCPSRCDIR= omapip
+
+.include <bsd.lib.mk>
Index: src/external/bsd/dhcp/share/Makefile
diff -u /dev/null src/external/bsd/dhcp/share/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/share/Makefile Sun Mar 24 11:54:32 2013
@@ -0,0 +1,5 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:32 christos Exp $
+
+SUBDIR= dhcpd
+
+.include <bsd.subdir.mk>
Index: src/external/bsd/dhcp/share/dhcpd/Makefile
diff -u /dev/null src/external/bsd/dhcp/share/dhcpd/Makefile:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/share/dhcpd/Makefile Sun Mar 24 11:54:32 2013
@@ -0,0 +1,10 @@
+# $NetBSD: Makefile,v 1.1 2013/03/24 15:54:32 christos Exp $
+
+.include <bsd.own.mk>
+
+.if ${MKSHARE} != "no"
+FILES= pxe.defs
+FILESDIR=/usr/share/dhcpd
+.endif
+
+.include <bsd.prog.mk>
Index: src/external/bsd/dhcp/share/dhcpd/pxe.defs
diff -u /dev/null src/external/bsd/dhcp/share/dhcpd/pxe.defs:1.1
--- /dev/null Sun Mar 24 11:54:32 2013
+++ src/external/bsd/dhcp/share/dhcpd/pxe.defs Sun Mar 24 11:54:32 2013
@@ -0,0 +1,113 @@
+# $NetBSD: pxe.defs,v 1.1 2013/03/24 15:54:32 christos Exp $
+#
+# Copyright 2001 Wasabi Systems, Inc.
+# All rights reserved.
+#
+# Written by Jason R. Thorpe for Wasabi Systems, Inc.
+#
+# 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 for the NetBSD Project by
+# Wasabi Systems, Inc.
+# 4. The name of Wasabi Systems, Inc. may not be used to endorse
+# or promote products derived from this software without specific prior
+# written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC
+# 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.
+#
+
+#
+# A PXE client can be identified using Option 60 (vendor-class-identifier).
+# The format of the option is:
+#
+# PXEClient:Arch:xxxxx:UNDI:yyyzzz
+#
+# This allows you to select PXE clients for special treatment using
+# classes, like so:
+#
+# class "pxe-clients-ia32" {
+# match if substring (option vendor-class-identifier, 0, 20) =
+# "PXEClient:Arch:00000";
+# .
+# .
+# .
+# }
+#
+# class "pxe-clients-ia64" {
+# match if substring (option vendor-class-identifier, 0, 20) =
+# "PXEClient:Arch:00002";
+# .
+# .
+# .
+# }
+#
+
+option space PXE;
+option PXE.mtftp-ip code 1 = ip-address;
+option PXE.mtftp-cport code 2 = unsigned integer 16; # XXX little-endian!
+option PXE.mtftp-sport code 3 = unsigned integer 16; # XXX little-endian!
+option PXE.mtftp-tmout code 4 = unsigned integer 8;
+option PXE.mtftp-delay code 5 = unsigned integer 8;
+
+# PXE.discovery-control is actually a bitfield with the
+# following bits:
+# 0x01 disable broadcast discovery
+# 0x02 disable multicast discovery
+# 0x04 only use/accept servers in PXE.boot-servers
+# 0x08 if file name is present in initial DHCP OFFER,
+# download that boot file, rather than prompting,
+# displaying a menu, or performing Boot Server
+# Discovery.
+option PXE.discovery-control code 6 = unsigned integer 8;
+
+# Note, this option is REQUIRED unless PXE.discovery-control has
+# 0x02 set.
+option PXE.discovery-mcast-addr code 7 = ip-address;
+
+# XXX
+# I don't even want to think about how to represent these options
+# in dhcpd.conf syntax. See table 2-1 in the PXE spec.
+#
+# Luckily, these are options sent by the server back to the client,
+# so we don't really have to deal with them unless we want to use
+# their functionality.
+#
+# option PXE.boot-servers code 8 = ...
+# option PXE.boot-menu code 9 = ...
+# option PXE.menu-prompt code 10 = ...
+
+# XXX
+# Not sure how to represent these in dhcpd.conf syntax.
+# option PXE.mcast-addrs-alloc code 11 = ...
+# option PXE.credential-types code 12 = ...
+
+# Codes 64-127 : Loader Options : Boot Server specific
+
+# PXE.boot-item is actually two 16-bit fields packed into a single
+# 32-bit integer:
+# Boot Server type 0xffff0000
+# Boot Server layer 0x0000ffff
+option PXE.boot-item code 71 = unsigned integer 32;
+
+# Codes 128-254 : Vendor Options : Vendor NBP specific
+
+# XXX NO WAY TO REPRESENT THIS!
+# option PXE.end code 255 = void;