This commit is contained in:
form 1998-04-30 03:06:36 +00:00
parent eabd07dbdf
commit cfe26f92f4
23 changed files with 1161 additions and 0 deletions

View File

@ -0,0 +1,44 @@
# New ports collection makefile for: dhcp
# Version required: 1.4.0.1
# Date created: 29 April 1998
# Whom: Oleg Safiullin <form@vs.itam.nsc.ru>
#
# $OpenBSD: Makefile,v 1.1.1.1 1998/04/30 03:06:36 form Exp $
#
DISTNAME= dhcp-1.4.0p1
PKGNAME= wide-dhcp-1.4.0.1
CATEGORIES= net
MASTER_SITES= ftp://sh.wide.ad.jp/WIDE/free-ware/dhcp/
DISTFILES= dhcp-1.4.0p1.tar.gz
MAINTAINER= form@vs.itam.nsc.ru
MAKE_ENV= OSTYPE=`uname`
MAN5= dhcpdb.server.5 dhcpdb.pool.5 dhcpdb.relay.5
MAN8= dhcpc.8 dhcps.8 relay.8 dhcpm.8
STARTUP_SCRIPT= ${PREFIX}/etc/rc.d/wide-dhcps.sh.sample
post-install:
.if !defined(NOPORTDOCS)
@if [ ! -d ${PREFIX}/share/doc/dhcp ]; then \
${MKDIR} ${PREFIX}/share/doc/dhcp; \
fi
@if [ ! -d ${PREFIX}/share/examples/dhcp ]; then \
${MKDIR} ${PREFIX}/share/examples/dhcp; \
fi
@${CP} ${WRKSRC}/README ${PREFIX}/share/doc/dhcp/
@${CP} ${WRKSRC}/README.jis ${PREFIX}/share/doc/dhcp/
@${CP} ${WRKSRC}/db_sample/dhcpdb.pool ${PREFIX}/share/examples/dhcp/dhcpdb.pool.sample
@${CP} ${WRKSRC}/db_sample/dhcpdb.relay ${PREFIX}/share/examples/dhcp/dhcpdb.relay.sample
@${CP} ${WRKSRC}/db_sample/dhcpdb.server ${PREFIX}/share/examples/dhcp/dhcpdb.server.sample
@${CP} ${WRKSRC}/db_sample/intro.dhcp ${PREFIX}/share/doc/dhcp/
@${CP} ${WRKSRC}/db_sample/intro.dhcp.jis ${PREFIX}/share/doc/dhcp/
.endif
@echo "***"
@echo "*** Don't forget to enable kernel BPF support!"
@echo "***"
.include <bsd.port.mk>

View File

@ -0,0 +1 @@
MD5 (dhcp-1.4.0p1.tar.gz) = fe1aa54a732da2e0f81303b51f636c02

View File

@ -0,0 +1,12 @@
*** README.orig Thu Apr 24 05:38:41 1997
--- README Wed Apr 29 15:32:20 1998
***************
*** 53,58 ****
--- 53,59 ----
BSD/OS 2.0.1; make OSTYPE=bsdos
SunOS 4.1.4; make OSTYPE=sunos4
FreeBSD; make OSTYPE=FreeBSD
+ OpenBSD; make OSTYPE=OpenBSD
<Inquiry>

View File

@ -0,0 +1,35 @@
*** client/Makefile.OpenBSD.orig Wed Apr 29 15:32:20 1998
--- client/Makefile.OpenBSD Wed Apr 29 15:32:20 1998
***************
*** 0 ****
--- 1,30 ----
+ INCLUDE = ../server/dhcp.h dhcpc.h common.h ../server/common_subr.h dhcpc_subr.h
+ OBJ = dhcpc_subr.o flushroute.o getmac.o common_subr.o dhcpc.o
+
+ CC = gcc
+ CFLAGS = -Wall -g -I. -I../server -DRETRY_FOREVER #-DDEBUG
+ #CC = cc
+ #CFLAGS = -g -I. -I../server -DRETRY_FOREVER #-DDEBUG
+ LDFLAGS = -lkvm
+
+ SBIN = /usr/local/sbin
+ LIBEXEC = /usr/local/libexec
+ MAN = /usr/local/man
+
+ dhcpc: ${OBJ}
+ ${CC} ${CFLAGS} -o dhcpc ${OBJ} ${LDFLAGS}
+
+ install: dhcpc
+ ${INSTALL} -m 755 -s dhcpc ${SBIN}/dhcpc
+ cp dhcpc.8 ${MAN}/man8/dhcpc.8
+ gzip ${MAN}/man8/dhcpc.8
+
+ clean:
+ rm -f *~ *.o *core* dhcpc
+
+ dhcpc.o: dhcpc.c config.h ${INCLUDE}
+ dhcpc_subr.o: dhcpc_subr.c ${INCLUDE}
+ common_subr.o: ../server/common_subr.c ../server/dhcp.h dhcpc.h common.h ../server/common_subr.h
+ ${CC} ${CFLAGS} -c ../server/common_subr.c
+ getmac.o: ../server/getmac.c
+ ${CC} ${CFLAGS} -c ../server/getmac.c

View File

@ -0,0 +1,19 @@
*** client/config.h.orig Wed Apr 29 15:32:36 1998
--- client/config.h Wed Apr 29 15:32:58 1998
***************
*** 38,44 ****
*/
#ifndef DHCP_CACHE
! #define DHCP_CACHE "/etc/dhcp_cache"
#endif
#define FIRSTTIMER 4
--- 38,44 ----
*/
#ifndef DHCP_CACHE
! #define DHCP_CACHE "/var/db/dhcp_cache"
#endif
#define FIRSTTIMER 4

View File

@ -0,0 +1,19 @@
*** client/dhcpc.8.jis.orig Wed Apr 29 15:33:42 1998
--- client/dhcpc.8.jis Wed Apr 29 15:34:01 1998
***************
*** 16,22 ****
ddhhccppcc$B$O(BRFC$B$N5,Dj$K=>$$!"%[%9%H$N(Bshutdown$B$N8e$K:F5/F0$5$l$?>l9g!"(B
$BA02s$HF1$8%"%I%l%9$r3d$jEv$F$F$b$i$&$h$&$K%5!<%P$KMW5a$9$k!#$=(B
! $B$N$?$a$K(B/etc/dhcp_cache$B$H$$$&%U%!%$%k$r:n@.$9$k!#$3$N%U%!%$%k$N(B
$B0LCV$O%3%s%Q%$%k;~$KJQ992DG=$@$,!"(Breboot$B$7$F$b>C5n$5$l$J$$$3$H(B
$B$,MW5a$5$l$k!#(B
--- 16,22 ----
ddhhccppcc$B$O(BRFC$B$N5,Dj$K=>$$!"%[%9%H$N(Bshutdown$B$N8e$K:F5/F0$5$l$?>l9g!"(B
$BA02s$HF1$8%"%I%l%9$r3d$jEv$F$F$b$i$&$h$&$K%5!<%P$KMW5a$9$k!#$=(B
! $B$N$?$a$K(B/var/db/dhcp_cache$B$H$$$&%U%!%$%k$r:n@.$9$k!#$3$N%U%!%$%k$N(B
$B0LCV$O%3%s%Q%$%k;~$KJQ992DG=$@$,!"(Breboot$B$7$F$b>C5n$5$l$J$$$3$H(B
$B$,MW5a$5$l$k!#(B

View File

@ -0,0 +1,36 @@
*** client/dhcpc.8.orig Wed Apr 29 15:33:09 1998
--- client/dhcpc.8 Wed Apr 29 15:33:30 1998
***************
*** 26,32 ****
requests server to assign the same address as before.
To get the same address,
.B dhcpc
! creates file named "/etc/dhcp_cache". This file name could be
configured when it is compiled. But it is required that the file must
remains after the host reboot. For example, the /tmp directory is not
appropriate for this purpose.
--- 26,32 ----
requests server to assign the same address as before.
To get the same address,
.B dhcpc
! creates file named "/var/db/dhcp_cache". This file name could be
configured when it is compiled. But it is required that the file must
remains after the host reboot. For example, the /tmp directory is not
appropriate for this purpose.
***************
*** 64,70 ****
.SH FILES
.PD 0
.TP 20
! .B /etc/dhcp_cache
The file to record previously assigned informations
.PD
.SH SEE ALSO
--- 64,70 ----
.SH FILES
.PD 0
.TP 20
! .B /var/db/dhcp_cache
The file to record previously assigned informations
.PD
.SH SEE ALSO

View File

@ -0,0 +1,78 @@
*** client/dhcpc.c.orig Mon Jul 7 15:08:35 1997
--- client/dhcpc.c Wed Apr 29 15:32:20 1998
***************
*** 990,997 ****
*param_list = tmpparam;
param_list->lease_origin = init_epoch;
param_list->next = NULL;
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %d secs)",
! inet_ntoa(param_list->yiaddr), param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
--- 990,997 ----
*param_list = tmpparam;
param_list->lease_origin = init_epoch;
param_list->next = NULL;
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %ld secs)",
! inet_ntoa(param_list->yiaddr), (long)param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
***************
*** 1240,1247 ****
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %d secs)",
! inet_ntoa(param_list->yiaddr), param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
--- 1240,1247 ----
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %ld secs)",
! inet_ntoa(param_list->yiaddr), (long)param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
***************
*** 1379,1386 ****
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %d secs)",
! inet_ntoa(param_list->yiaddr), param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
--- 1379,1386 ----
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %ld secs)",
! inet_ntoa(param_list->yiaddr), (long)param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
***************
*** 1659,1666 ****
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %d secs)",
! inet_ntoa(param_list->yiaddr), param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}
--- 1659,1666 ----
param_list->next = NULL;
sigsetmask(oldsigmask); /* end critical */
! syslog(LOG_INFO, "Got DHCPACK (IP = %s, duration = %ld secs)",
! inet_ntoa(param_list->yiaddr), (long)param_list->lease_duration);
arp_reply(&param_list->yiaddr, &arpif);
return(BOUND);
}

View File

@ -0,0 +1,223 @@
*** client/dhcpc_subr.c.orig Thu Jul 3 03:19:01 1997
--- client/dhcpc_subr.c Wed Apr 29 15:54:09 1998
***************
*** 1109,1115 ****
#ifndef LOG_PERROR
#define LOG_PERROR 0
#endif
! openlog("dhcpc", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL0);
sprintf(pid_filename, "%s.%s.pid", PATH_PID_PREFIX, ifp->name);
for (n = 0; n < 5; n++) {
--- 1109,1115 ----
#ifndef LOG_PERROR
#define LOG_PERROR 0
#endif
! openlog("dhcpc", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL1);
sprintf(pid_filename, "%s.%s.pid", PATH_PID_PREFIX, ifp->name);
for (n = 0; n < 5; n++) {
***************
*** 1312,1318 ****
#ifndef LOG_PERROR
#define LOG_PERROR 0
#endif
! openlog("dhcpc", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL0);
sprintf(pid_filename, "%s.%s.pid", PATH_PID_PREFIX, ifp->name);
for (n = 0; n < 5; n++) {
--- 1312,1318 ----
#ifndef LOG_PERROR
#define LOG_PERROR 0
#endif
! openlog("dhcpc", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL1);
sprintf(pid_filename, "%s.%s.pid", PATH_PID_PREFIX, ifp->name);
for (n = 0; n < 5; n++) {
***************
*** 1497,1503 ****
/*
* halt network, and reset the interface
*/
! #if defined(__bsdi__) || defined(__FreeBSD__)
void
reset_if(ifp, updown)
--- 1497,1503 ----
/*
* halt network, and reset the interface
*/
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
void
reset_if(ifp, updown)
***************
*** 1548,1554 ****
#endif
! #if defined(__bsdi__) || defined(__FreeBSD__)
/*
* ifconfig up/down
*/
--- 1548,1554 ----
#endif
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
/*
* ifconfig up/down
*/
***************
*** 1620,1626 ****
* configure network interface
* address, netmask, and broadcast address
*/
! #if defined(__bsdi__) || defined(__FreeBSD__)
int
config_if(ifp, addr, mask, brdcst)
--- 1620,1626 ----
* configure network interface
* address, netmask, and broadcast address
*/
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
int
config_if(ifp, addr, mask, brdcst)
***************
*** 1701,1707 ****
return(0);
}
! #else /* not __bsdi__ nor __FreeBSD__ */
int
config_if(ifp, addr, mask, brdcst)
--- 1701,1707 ----
return(0);
}
! #else /* not __bsdi__ not __FreeBSD__ nor __OpenBSD__ */
int
config_if(ifp, addr, mask, brdcst)
***************
*** 1777,1795 ****
return(0);
}
! #endif /* defined(__bsdi__) || defined(__FreeBSD__) */
/*
* set routing table
*/
! #if !defined(__bsdi__) && !defined(__FreeBSD__)
void
set_route(param)
struct dhcp_param *param;
{
int sockfd = 0;
! #if !defined(__bsdi__) && !defined(__FreeBSD__) && !defined(__osf__)
#define ortentry rtentry
#endif
struct ortentry rt;
--- 1777,1795 ----
return(0);
}
! #endif /* defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)*/
/*
* set routing table
*/
! #if !defined(__bsdi__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
void
set_route(param)
struct dhcp_param *param;
{
int sockfd = 0;
! #if !defined(__bsdi__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__osf__)
#define ortentry rtentry
#endif
struct ortentry rt;
***************
*** 1813,1824 ****
bzero(&dst, sizeof(struct sockaddr));
bzero(&gateway, sizeof(struct sockaddr));
rt.rt_flags = RTF_UP | RTF_GATEWAY;
! #if defined(__bsdi__) || defined(__FreeBSD__)
((struct sockaddr_in *) &dst)->sin_len = sizeof(struct sockaddr_in);
#endif
((struct sockaddr_in *) &dst)->sin_family = AF_INET;
((struct sockaddr_in *) &dst)->sin_addr.s_addr = INADDR_ANY;
! #if defined(__bsdi__) || defined(__FreeBSD__)
((struct sockaddr_in *) &gateway)->sin_len = sizeof(struct sockaddr_in);
#endif
((struct sockaddr_in *) &gateway)->sin_family = AF_INET;
--- 1813,1824 ----
bzero(&dst, sizeof(struct sockaddr));
bzero(&gateway, sizeof(struct sockaddr));
rt.rt_flags = RTF_UP | RTF_GATEWAY;
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
((struct sockaddr_in *) &dst)->sin_len = sizeof(struct sockaddr_in);
#endif
((struct sockaddr_in *) &dst)->sin_family = AF_INET;
((struct sockaddr_in *) &dst)->sin_addr.s_addr = INADDR_ANY;
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
((struct sockaddr_in *) &gateway)->sin_len = sizeof(struct sockaddr_in);
#endif
((struct sockaddr_in *) &gateway)->sin_family = AF_INET;
***************
*** 1836,1842 ****
return;
}
! #else /* It's BSD/OS 2.* or FreeBSD */
void
set_route(param)
--- 1836,1842 ----
return;
}
! #else /* It's BSD/OS 2.* or *BSD */
void
set_route(param)
***************
*** 2529,2535 ****
struct iovec bufvec[1];
int bufsize = DFLTDHCPLEN;
#if 0
! #if defined(__bsdi__) || defined(__FreeBSD__)
int on;
#endif
#endif
--- 2529,2535 ----
struct iovec bufvec[1];
int bufsize = DFLTDHCPLEN;
#if 0
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
int on;
#endif
#endif
***************
*** 3175,3181 ****
return(-1);
}
for (i = 0; i < max; i++) {
! param->mtu_plateau_table->shortnum[i] = GETHS(buf[i * 2 + 2]);
}
}
--- 3175,3181 ----
return(-1);
}
for (i = 0; i < max; i++) {
! param->mtu_plateau_table->shortnum[i] = GETHS(&buf[i * 2 + 2]);
}
}

View File

@ -0,0 +1,123 @@
*** client/flushroute.c.orig Thu Jun 19 07:27:39 1997
--- client/flushroute.c Wed Apr 29 15:41:47 1998
***************
*** 34,40 ****
* SUCH DAMAGE.
*/
! #if !defined(__bsdi__) && !defined(__FreeBSD__)
#include <stdio.h>
#include <nlist.h>
--- 34,40 ----
* SUCH DAMAGE.
*/
! #if !defined(__bsdi__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
#include <stdio.h>
#include <nlist.h>
***************
*** 88,108 ****
nlist("/vmunix", nl);
}
if (nl[N_RTHOST].n_value == 0) {
! syslog(LOG_LOCAL0|LOG_ERR, "\"rthost\", symbol not in namelist");
exit(1);
}
if (nl[N_RTNET].n_value == 0) {
! syslog(LOG_LOCAL0|LOG_ERR, "\"rtnet\", symbol not in namelist");
exit(1);
}
if (nl[N_RTHASHSIZE].n_value == 0) {
! syslog(LOG_LOCAL0|LOG_ERR,
"\"rthashsize\", symbol not in namelist");
exit(1);
}
kmem = open("/dev/kmem", 0);
if (kmem < 0) {
! syslog(LOG_LOCAL0|LOG_ERR, "/dev/kmem: %m");
exit(1);
}
lseek(kmem, nl[N_RTHASHSIZE].n_value, 0);
--- 88,108 ----
nlist("/vmunix", nl);
}
if (nl[N_RTHOST].n_value == 0) {
! syslog(LOG_LOCAL1|LOG_ERR, "\"rthost\", symbol not in namelist");
exit(1);
}
if (nl[N_RTNET].n_value == 0) {
! syslog(LOG_LOCAL1|LOG_ERR, "\"rtnet\", symbol not in namelist");
exit(1);
}
if (nl[N_RTHASHSIZE].n_value == 0) {
! syslog(LOG_LOCAL1|LOG_ERR,
"\"rthashsize\", symbol not in namelist");
exit(1);
}
kmem = open("/dev/kmem", 0);
if (kmem < 0) {
! syslog(LOG_LOCAL1|LOG_ERR, "/dev/kmem: %m");
exit(1);
}
lseek(kmem, nl[N_RTHASHSIZE].n_value, 0);
***************
*** 141,147 ****
#else /* __bsdi__ */
! /* It's BSD/OS 2.* or later or FreeBSD */
/*
* Modified by tomy@sfc.wide.ad.jp
--- 141,147 ----
#else /* __bsdi__ */
! /* It's BSD/OS 2.* or later, FreeBSD, or OpenBSD */
/*
* Modified by tomy@sfc.wide.ad.jp
***************
*** 180,188 ****
* SUCH DAMAGE.
*/
! #ifndef lint
static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
! #endif /* not lint */
#include <unistd.h>
#include <stdlib.h>
--- 180,188 ----
* SUCH DAMAGE.
*/
! #if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
! #endif /* LIBC_SCCS and not lint */
#include <unistd.h>
#include <stdlib.h>
***************
*** 259,265 ****
return(n);
}
-
/*
* Purge all entries in the routing tables not
* associated with network interfaces.
--- 259,264 ----
***************
*** 338,341 ****
close(s);
return(0);
}
! #endif /* __bsdi__ or FreeBSD*/
--- 337,340 ----
close(s);
return(0);
}
! #endif /* __bsdi__ or FreeBSD or OpenBSD*/

View File

@ -0,0 +1,37 @@
*** relay/Makefile.OpenBSD.orig Wed Apr 29 15:32:20 1998
--- relay/Makefile.OpenBSD Wed Apr 29 15:32:20 1998
***************
*** 0 ****
--- 1,32 ----
+ OBJ = relay.o getmac.o common_subr.o interface.o
+ CC = gcc
+ CFLAGS = -g -Wall -I. -I../server
+ #CC = cc
+ #CFLAGS = -g -I. -I../server
+ LDFLAGS = -lkvm
+ SBIN = /usr/local/sbin
+ LIBEXEC = /usr/local/libexec
+ MAN = /usr/local/man
+
+ relay: ${OBJ}
+ ${CC} ${CFLAGS} -o relay ${OBJ} ${LDFLAGS}
+
+ install: relay
+ ${INSTALL} -m 755 -s relay ${SBIN}/relay
+ cp relay.8 ${MAN}/man8/relay.8
+ gzip ${MAN}/man8/relay.8
+ cp dhcpdb.server.5 ${MAN}/man5/dhcpdb.server.5
+ gzip ${MAN}/man5/dhcpdb.server.5
+
+ relay.o: relay.c common.h ../server/dhcp.h ../server/common_subr.h
+ common_subr.o: ../server/common_subr.c ../server/dhcp.h common.h ../server/common_subr.h
+ ${CC} ${CFLAGS} -c ../server/common_subr.c
+
+ interface.o: ../server/interface.c common.h
+ ${CC} ${CFLAGS} -c ../server/interface.c
+
+ getmac.o: ../server/getmac.c
+ ${CC} ${CFLAGS} -c ../server/getmac.c
+
+ clean:
+ rm -f *~ *.o *core* relay

View File

@ -0,0 +1,36 @@
*** relay/relay.c.orig Wed Apr 29 15:34:57 1998
--- relay/relay.c Wed Apr 29 15:55:10 1998
***************
*** 117,123 ****
static void forwarding();
int open_if();
! void
main(argc, argv)
int argc;
char **argv;
--- 117,123 ----
static void forwarding();
int open_if();
! int
main(argc, argv)
int argc;
char **argv;
***************
*** 179,185 ****
#ifndef LOG_PERROR
#define LOG_PERROR 0
#endif
! openlog("relay", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL0);
if (debug == 0) become_daemon();
if (if_list == NULL) usage();
--- 179,185 ----
#ifndef LOG_PERROR
#define LOG_PERROR 0
#endif
! openlog("relay", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL1);
if (debug == 0) become_daemon();
if (if_list == NULL) usage();

View File

@ -0,0 +1,38 @@
*** server/Makefile.OpenBSD.orig Wed Apr 29 15:32:20 1998
--- server/Makefile.OpenBSD Wed Apr 29 15:32:20 1998
***************
*** 0 ****
--- 1,33 ----
+ OBJ = dhcps.o database.o hash.o getmac.o common_subr.o \
+ interface.o delarp.o
+ LDFLAGS = -lkvm
+ CC = gcc
+ CFLAGS = -g -Wall -I. #-DCOMPAT_RFC1541 #-DNOICMPCHK
+ #CC = cc
+ #CFLAGS = -g -I. #-DCOMPAT_RFC1541 #-DNOICMPCHK
+ SBIN = /usr/local/sbin
+ LIBEXEC = /usr/local/libexec
+ MAN = /usr/local/man
+
+ dhcps: ${OBJ}
+ ${CC} ${CFLAGS} -o dhcps ${OBJ} ${LDFLAGS}
+
+ install: dhcps
+ ${INSTALL} -m 755 -s dhcps ${SBIN}/dhcps
+ tbl dhcpdb.pool.5 >${MAN}/man5/dhcpdb.pool.5
+ gzip ${MAN}/man5/dhcpdb.pool.5
+ cp dhcpdb.relay.5 ${MAN}/man5/dhcpdb.relay.5
+ gzip ${MAN}/man5/dhcpdb.relay.5
+ cp dhcps.8 ${MAN}/man8/dhcps.8
+ gzip ${MAN}/man8/dhcps.8
+
+ clean:
+ rm -f *~ *.o *core* dhcps
+
+ dhcps.o: dhcps.c dhcp.h common.h common_subr.h hash.h dhcps.h
+ database.o: database.c dhcp.h common.h hash.h database.h
+ hash.o: hash.c hash.h
+ getmac.o: getmac.c
+ common_subr.o: common_subr.c dhcp.h common.h common_subr.h
+ interface.o: interface.c common.h
+ delarp.o: delarp.c

View File

@ -0,0 +1,70 @@
*** server/database.c.orig Tue Aug 19 14:00:36 1997
--- server/database.c Wed Apr 29 15:32:21 1998
***************
*** 250,256 ****
if (isset(rp->valid, S_SUBNET_MASK)) print_ip("snmk", rp->subnet_mask);
if (isset(rp->active, S_TIME_OFFSET)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_TIME_OFFSET))
! fprintf(dump_fp, "tmof=%ld:", ntohl(rp->time_offset));
if (isset(rp->active, S_ROUTER)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_ROUTER)) print_ips("rout", rp->router);
if (isset(rp->active, S_TIME_SERVER)) fprintf(dump_fp, "!");
--- 250,256 ----
if (isset(rp->valid, S_SUBNET_MASK)) print_ip("snmk", rp->subnet_mask);
if (isset(rp->active, S_TIME_OFFSET)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_TIME_OFFSET))
! fprintf(dump_fp, "tmof=%ld:", (long)ntohl(rp->time_offset));
if (isset(rp->active, S_ROUTER)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_ROUTER)) print_ips("rout", rp->router);
if (isset(rp->active, S_TIME_SERVER)) fprintf(dump_fp, "!");
***************
*** 299,305 ****
fprintf(dump_fp, "ditl=%u:", rp->default_ip_ttl);
if (isset(rp->active, S_MTU_AGING_TIMEOUT)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_MTU_AGING_TIMEOUT))
! fprintf(dump_fp, "mtat=%lu:", ntohl(rp->mtu_aging_timeout));
if (isset(rp->active, S_MTU_PLATEAU_TABLE)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_MTU_PLATEAU_TABLE)) {
fprintf(dump_fp, "mtpt=");
--- 299,305 ----
fprintf(dump_fp, "ditl=%u:", rp->default_ip_ttl);
if (isset(rp->active, S_MTU_AGING_TIMEOUT)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_MTU_AGING_TIMEOUT))
! fprintf(dump_fp, "mtat=%lu:", (unsigned long)ntohl(rp->mtu_aging_timeout));
if (isset(rp->active, S_MTU_PLATEAU_TABLE)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_MTU_PLATEAU_TABLE)) {
fprintf(dump_fp, "mtpt=");
***************
*** 329,335 ****
if (isset(rp->valid, S_TRAILER)) print_bool("tril", rp->trailer);
if (isset(rp->active, S_ARP_CACHE_TIMEOUT)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_ARP_CACHE_TIMEOUT))
! fprintf(dump_fp, "apct=%lu:", ntohl(rp->arp_cache_timeout));
if (isset(rp->active, S_ETHER_ENCAP)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_ETHER_ENCAP)) print_bool("encp", rp->ether_encap);
if (isset(rp->active, S_DEFAULT_TCP_TTL)) fprintf(dump_fp, "!");
--- 329,335 ----
if (isset(rp->valid, S_TRAILER)) print_bool("tril", rp->trailer);
if (isset(rp->active, S_ARP_CACHE_TIMEOUT)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_ARP_CACHE_TIMEOUT))
! fprintf(dump_fp, "apct=%lu:", (unsigned long)ntohl(rp->arp_cache_timeout));
if (isset(rp->active, S_ETHER_ENCAP)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_ETHER_ENCAP)) print_bool("encp", rp->ether_encap);
if (isset(rp->active, S_DEFAULT_TCP_TTL)) fprintf(dump_fp, "!");
***************
*** 337,343 ****
fprintf(dump_fp, "dttl=%u:", rp->default_tcp_ttl);
if (isset(rp->active, S_KEEPALIVE_INTER)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_KEEPALIVE_INTER))
! fprintf(dump_fp, "kain=%lu:", ntohl(rp->keepalive_inter));
if (isset(rp->active, S_KEEPALIVE_GARBA)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_KEEPALIVE_GARBA)) print_bool("kagb", rp->keepalive_garba);
if (isset(rp->active, S_NIS_DOMAIN)) fprintf(dump_fp, "!");
--- 337,343 ----
fprintf(dump_fp, "dttl=%u:", rp->default_tcp_ttl);
if (isset(rp->active, S_KEEPALIVE_INTER)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_KEEPALIVE_INTER))
! fprintf(dump_fp, "kain=%lu:", (unsigned long)ntohl(rp->keepalive_inter));
if (isset(rp->active, S_KEEPALIVE_GARBA)) fprintf(dump_fp, "!");
if (isset(rp->valid, S_KEEPALIVE_GARBA)) print_bool("kagb", rp->keepalive_garba);
if (isset(rp->active, S_NIS_DOMAIN)) fprintf(dump_fp, "!");

View File

@ -0,0 +1,40 @@
*** server/delarp.c.orig Thu Apr 10 22:16:30 1997
--- server/delarp.c Wed Apr 29 15:43:28 1998
***************
*** 37,45 ****
* SUCH DAMAGE.
*/
! #ifndef lint
static char sccsid[] = "@(#)arp.c 8.2 (Berkeley) 1/2/94";
! #endif /* not lint */
#include <sys/param.h>
#include <sys/socket.h>
--- 37,45 ----
* SUCH DAMAGE.
*/
! #if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)arp.c 8.2 (Berkeley) 1/2/94";
! #endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
#include <sys/socket.h>
***************
*** 60,66 ****
#include <syslog.h>
! #if defined(__bsdi__) || defined(__FreeBSD__)
/*
* delarp for BSD/OS 2.*
*/
--- 60,66 ----
#include <syslog.h>
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
/*
* delarp for BSD/OS 2.*
*/

View File

@ -0,0 +1,71 @@
*** server/dhcps.c.orig Tue Aug 19 14:14:39 1997
--- server/dhcps.c Wed Apr 29 15:39:18 1998
***************
*** 126,132 ****
char **argv_orig;
! void
main(argc, argv)
int argc;
char **argv;
--- 126,132 ----
char **argv_orig;
! int
main(argc, argv)
int argc;
char **argv;
***************
*** 211,219 ****
#define LOG_PERROR 0 /* Don't bother if not defined... */
#endif
if (debug == 1) {
! openlog("dhcps", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL0);
} else {
! openlog("dhcps", LOG_PID | LOG_CONS, LOG_LOCAL0);
}
init_db(); /* initialize databases */
--- 211,219 ----
#define LOG_PERROR 0 /* Don't bother if not defined... */
#endif
if (debug == 1) {
! openlog("dhcps", LOG_PID | LOG_CONS | LOG_PERROR, LOG_LOCAL1);
} else {
! openlog("dhcps", LOG_PID | LOG_CONS, LOG_LOCAL1);
}
init_db(); /* initialize databases */
***************
*** 2290,2296 ****
--- 2290,2300 ----
char *inserted;
char flag;
{
+ #if defined(__OpenBSD__)
+ u_int32_t *addr = 0;
+ #else
u_Long *addr = 0;
+ #endif
char option[6];
int symbol = 0;
int retval = 0;
***************
*** 2927,2933 ****
return(GOOD);
}
! #if defined(__bsdi__) || defined(__FreeBSD__)
delarp(ip);
#else
delarp(ip, sockfd);
--- 2931,2937 ----
return(GOOD);
}
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
delarp(ip);
#else
delarp(ip, sockfd);

View File

@ -0,0 +1,35 @@
*** server/dhcps.h.orig Thu Jun 19 09:04:09 1997
--- server/dhcps.h Wed Apr 29 15:32:21 1998
***************
*** 37,51 ****
* WIDE project has the rights to redistribute these changes.
*/
! #if defined(__bsdi__) || defined(__FreeBSD__)
#ifndef BINDING_DB
#define BINDING_DB "/var/db/dhcpdb.bind"
#endif
! #else /* not BSD/OS nor FreeBSD */
#ifndef BINDING_DB
#define BINDING_DB "/etc/dhcpdb.bind"
#endif
! #endif /* __bsdi__ || __FreeBSD__ */
#ifdef sony_news
#ifndef PATH_PID
--- 37,51 ----
* WIDE project has the rights to redistribute these changes.
*/
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#ifndef BINDING_DB
#define BINDING_DB "/var/db/dhcpdb.bind"
#endif
! #else /* not BSD/OS not FreeBSD nor OpenBSD */
#ifndef BINDING_DB
#define BINDING_DB "/etc/dhcpdb.bind"
#endif
! #endif /* __bsdi__ || __FreeBSD__ || __OpenBSD__ */
#ifdef sony_news
#ifndef PATH_PID

View File

@ -0,0 +1,79 @@
*** server/getmac.c.orig Tue Jun 4 10:27:49 1996
--- server/getmac.c Wed Apr 29 15:32:21 1998
***************
*** 79,92 ****
--- 79,98 ----
struct in_ifaddr in;
} ifaddr;
u_long addr = 0;
+ #if defined(__OpenBSD__)
+ #else
char name[16];
char fullname[16];
+ #endif
static kvm_t *kd = NULL;
bzero(&arpcom, sizeof(arpcom));
bzero(&ifaddr, sizeof(ifaddr));
+ #if defined(__OpenBSD__)
+ #else
bzero(name, sizeof(name));
bzero(fullname, sizeof(fullname));
+ #endif
/* Open kernel memory for reading */
kd = kvm_open(0, 0, 0, O_RDONLY, "kvm_open");
***************
*** 104,110 ****
ac = &arpcom;
ifp = &arpcom.ac_if;
! #if defined(__bsdi__) || defined(__FreeBSD__)
ep = arpcom.ac_enaddr;
#else
ep = arpcom.ac_enaddr.ether_addr_octet;
--- 110,116 ----
ac = &arpcom;
ifp = &arpcom.ac_if;
! #if defined(__bsdi__) || defined(__FreeBSD__) || defined(__OpenBSD__)
ep = arpcom.ac_enaddr;
#else
ep = arpcom.ac_enaddr.ether_addr_octet;
***************
*** 118,124 ****
--- 124,134 ----
kvm_close(kd);
return(-1);
}
+ #if defined(__OpenBSD__)
+ for ( ; addr; addr = (u_long)ifp->if_list.tqe_next) {
+ #else
for ( ; addr; addr = (u_long)ifp->if_next) {
+ #endif
if (kvm_read(kd, addr, (char *)ac, sizeof(*ac)) != sizeof(*ac)) {
syslog(LOG_ERR, "kvm_read() error in getmac(): %m");
kvm_close(kd);
***************
*** 129,134 ****
--- 139,148 ----
continue;
/* Only look at the specified interface */
+ #if defined(__OpenBSD__)
+ if (strcmp(ifp->if_xname, ifname) != 0)
+ continue;
+ #else
if (kvm_read(kd, (u_long)ifp->if_name, (char *)name, sizeof(name)) !=
sizeof(name)) {
syslog(LOG_ERR, "kvm_read() error in getmac(): %m");
***************
*** 139,144 ****
--- 153,159 ----
sprintf(fullname, "%s%d", name, ifp->if_unit);
if (strcmp(fullname, ifname) != 0)
continue;
+ #endif
kvm_close(kd);
bcopy(ep, result, 6);

View File

@ -0,0 +1,23 @@
*** tools/Makefile.OpenBSD.orig Wed Apr 29 15:32:21 1998
--- tools/Makefile.OpenBSD Wed Apr 29 15:32:21 1998
***************
*** 0 ****
--- 1,18 ----
+ CC = gcc
+ CFLAGS = -g -Wall -I. -I../server
+ #CC = cc
+ #CFLAGS = -g -I. -I../server
+ SBIN = /usr/local/sbin
+ LIBEXEC = /usr/local/libexec
+ MAN = /usr/local/man
+
+ dhcpm: dhcpm.c ../server/dhcp.h
+ $(CC) $(CFLAGS) dhcpm.c -o dhcpm
+
+ install: dhcpm
+ ${INSTALL} -m 755 -s dhcpm ${SBIN}/dhcpm
+ cp dhcpm.8 ${MAN}/man8/dhcpm.8
+ gzip ${MAN}/man8/dhcpm.8
+
+ clean:
+ rm -rf *~ *.o *core* dhcpm

View File

@ -0,0 +1,19 @@
*** tools/dhcpm.c.orig Mon Jul 7 15:07:06 1997
--- tools/dhcpm.c Wed Apr 29 15:32:21 1998
***************
*** 427,433 ****
((option = pickup_opt(rdhcp, DHCPLEN(rudp), DHCP_T2)) != NULL) ?
GETHL(OPTBODY(option)) : 0);
printf("\top: %d, xid: %lx, secs: %d, BRDCST flag: %d\n", rdhcp->op,
! ntohl(rdhcp->xid), ntohs(rdhcp->secs), ISBRDCST(rdhcp->flags) ? 1:0);
printf("\tciaddr: %s, ", inet_ntoa(rdhcp->ciaddr));
printf("yiaddr: %s, ", inet_ntoa(rdhcp->yiaddr));
printf("siaddr: %s, ", inet_ntoa(rdhcp->siaddr));
--- 427,433 ----
((option = pickup_opt(rdhcp, DHCPLEN(rudp), DHCP_T2)) != NULL) ?
GETHL(OPTBODY(option)) : 0);
printf("\top: %d, xid: %lx, secs: %d, BRDCST flag: %d\n", rdhcp->op,
! (unsigned long)ntohl(rdhcp->xid), ntohs(rdhcp->secs), ISBRDCST(rdhcp->flags) ? 1:0);
printf("\tciaddr: %s, ", inet_ntoa(rdhcp->ciaddr));
printf("yiaddr: %s, ", inet_ntoa(rdhcp->yiaddr));
printf("siaddr: %s, ", inet_ntoa(rdhcp->siaddr));

View File

@ -0,0 +1 @@
Dynamic Host Configuration Protocol, WIDE-Implimentation.

View File

@ -0,0 +1,89 @@
<< DHCP WIDE-Implementation, version 1.3 >>
October, 1995.
This package is a distribution kit of DHCP WIDE-Implementation
version 1.3. DHCP (Dynamic Host Configuration Protocol) is a
protocol which provides informations to computer when it boots.
This release includes DHCP server, relay agent, and client.
<License>
See "Copyright" included in this directory.
Also, portions of this software may fall under the copyrights which
are included the end of this file. These are included corresponded
source code files.
<Package>
You can get the latest version from;
ftp://sh.wide.ad.jp/WIDE/free-ware/dhcp/
------------------------------
** Attention for this ports file **
To use DHCP, your kernel must be rebuilt with the following
line added to your kernel config file (/sys/i386/conf/<YourMachine>):
pseudo-device bpfilter 4 #Berkeley packet filter
and make bpf devices in your /dev directory: /dev/bpf[1-3].
cd /dev
./MAKEDEV bpf1
./MAKEDEV bpf2
./MAKEDEV bpf3
** dhcpdb.relay file is need without relay agent **
Please read more information in
/usr/local/share/doc/dhcp/intro.dhcp or intro.dhcp.jis.
** CHECK_SUM Problem under FreeBSD 2.1.x **
This port collection is use tzfile.h from FreeBSD-current source
tree. Because this file is frequently changed, md5 check sum of
this file in files/md5 is ``IGNORE''.
If you use this port collection ***under FreeBSD 2.1-stable***:
2.1.0-RELEASE, 2.1.5-RELASE, 2.1.6-RELEASE, 2.1.7-RELEASE,
please use latest bsd.ports.mk and bsd.port.subdir.mk files in
/usr/share/mk or manually check checksum and delete files/md5
file.
** kernel dependence of package program files **
This compiled programs(packages) depends on kernel table as
ifconfig program.
So please use fit package to your FreeBSD (for example under
2.1.5-RELEASE, use packages-2.1.5, do not use packages-2.2) or
recompile from ports collection.
** additional function **
DHCP client(dhcpc) in this port is supported "dynamic change
/etc/resolv.conf and hostname via DHCP infomation".
o `-r' is recreate /etc/resolv.conf
(resolv.conf file is overwritten.)
o `-n' is reset HOSTNAME
** Acknowledgements to this ports file **
Special thanks to:
Hirotaka TAKETA<taketa@csk.co.jp>
Hajimu UMEMOTO<ume@calm.imasy.or.jp>
Tamotsu KANOH<kanoh@kanoh.iijnet.or.jp>
Junichi SATOH<junichi@astec.co.jp>
Hisashi HIRAMOTO<hiramoto@phys.chs.nihon-u.ac.jp>
Takeshi TAGUCHI<taguchi@tohoku.iij.ad.jp>
Keisuke INOUE<keisuke@aa.cs.keio.ac.jp>
- Yoshiro MIHIRA
(sanpei@yy.cs.keio.ac.jp)
- OpenBSD port by Oleg Safiullin
(form@vs.itam.nsc.ru)

View File

@ -0,0 +1,33 @@
sbin/dhcpc
sbin/dhcpm
sbin/relay
sbin/dhcps
man/man8/dhcpc.8.gz
man/man8/relay.8.gz
man/man8/dhcps.8.gz
man/man8/dhcpm.8.gz
man/man5/dhcpdb.server.5.gz
man/man5/dhcpdb.pool.5.gz
man/man5/dhcpdb.relay.5.gz
share/doc/dhcp/README
share/doc/dhcp/README.jis
share/doc/dhcp/intro.dhcp
share/doc/dhcp/intro.dhcp.jis
@dirrm share/doc/dhcp
share/examples/dhcp/dhcpdb.pool.sample
share/examples/dhcp/dhcpdb.relay.sample
share/examples/dhcp/dhcpdb.server.sample
@dirrm share/examples/dhcp
@exec echo "updating /etc/services"; cp /etc/services /etc/services.bak; (grep -v ^dhcps /etc/services.bak ; echo "dhcps 67/udp # dhcp server") > /etc/services
@exec echo "updating /etc/services"; cp /etc/services /etc/services.bak; (grep -v ^dhcpc /etc/services.bak ; echo "dhcpc 68/udp # dhcp client") > /etc/services
@exec touch -f /var/db/dhcpdb.bind
@exec echo "***"
@exec echo "*** Don't forget to enable kernel BPF support!"
@exec echo "***"
@unexec echo "updating /etc/services"; cp /etc/services /etc/services.bak; (grep -v ^dhcps /etc/services.bak ) > /etc/services
@unexec echo "updating /etc/services"; cp /etc/services /etc/services.bak; (grep -v ^dhcpc /etc/services.bak ) > /etc/services
@unexec rm -f /var/db/dhcp_cache /var/db/dhcpdb.bind*
@unexec echo "***"
@unexec echo "*** Remove /etc/dhcpdb.pool and /etc/dhcpdb.relay manually"
@unexec echo "*** to complete uninstallation."
@unexec echo "***"