diff -rNc2 DHCPD-BETA-5.9/TODO DHCPD-BETA-5.10/TODO *** DHCPD-BETA-5.9/TODO Mon Sep 9 00:13:56 1996 --- DHCPD-BETA-5.10/TODO Tue Sep 10 23:48:52 1996 *************** *** 1,29 **** Things to do, not in any particular order... - - Use GNU autoconf instead of per-system config files? - - Perl scripts to convert from other DHCP and BOOTP servers' config files to the ISC DHCPD format. ! - Low level networking interfaces; e.g., ! - Berkeley Packet Filter interface ! - Sun NIT interface ! ! - Ethernet support for low-level interfaces ! ! - Token ring support for low-level interfaces ! - FDDI support for low-level interfaces - Other network hardware support for low-level interfaces? - Raw socket support for single-interface machines - IPv6/DHCPv6 support ! - MacOS Open Transport support ! ! - Windows/NT support ! - Windows95 support --- 1,23 ---- Things to do, not in any particular order... - Perl scripts to convert from other DHCP and BOOTP servers' config files to the ISC DHCPD format. ! - Token ring support for bpf/nit interfaces ! - FDDI support for bpf/nit interfaces - Other network hardware support for low-level interfaces? + - Standard socket API for sending to all-ones broadcast and figuring + out which interface a packet came in on? + - Raw socket support for single-interface machines - IPv6/DHCPv6 support ! - Dhcpd running on MacOS Open Transport ! - Dhcpd running on Windows/NT + - Dhcpd running on Windows95 diff -rNc2 DHCPD-BETA-5.9/bootp.c DHCPD-BETA-5.10/bootp.c *** DHCPD-BETA-5.9/bootp.c Mon Sep 9 00:13:58 1996 --- DHCPD-BETA-5.10/bootp.c Tue Sep 10 23:48:55 1996 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: bootp.c,v 1.17 1996/08/27 09:33:41 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: bootp.c,v 1.18 1996/09/11 05:50:54 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 185,189 **** pack options into the filename and server name buffers. */ ! cons_options (packet, &outgoing, options, 0); if (outgoing.packet_length < BOOTP_MIN_LEN) outgoing.packet_length = BOOTP_MIN_LEN; --- 185,189 ---- pack options into the filename and server name buffers. */ ! cons_options (packet, &outgoing, options, 0, 0); if (outgoing.packet_length < BOOTP_MIN_LEN) outgoing.packet_length = BOOTP_MIN_LEN; diff -rNc2 DHCPD-BETA-5.9/cf/alphaosf.h DHCPD-BETA-5.10/cf/alphaosf.h *** DHCPD-BETA-5.9/cf/alphaosf.h Mon Sep 9 00:15:22 1996 --- DHCPD-BETA-5.10/cf/alphaosf.h Tue Sep 10 23:50:23 1996 *************** *** 68,72 **** --- 68,74 ---- #define VA_start(list, last) va_start (list) + #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" + #endif #define EOL '\n' diff -rNc2 DHCPD-BETA-5.9/cf/bsdos.h DHCPD-BETA-5.10/cf/bsdos.h *** DHCPD-BETA-5.9/cf/bsdos.h Mon Sep 9 00:15:23 1996 --- DHCPD-BETA-5.10/cf/bsdos.h Tue Sep 10 23:50:23 1996 *************** *** 60,65 **** --- 60,69 ---- #define VA_start(list, last) va_start (list, last) + #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" + #endif + #ifndef _PATH_DHCPD_DB #define _PATH_DHCPD_DB "/var/db/dhcpd.leases" + #endif #define EOL '\n' diff -rNc2 DHCPD-BETA-5.9/cf/freebsd.h DHCPD-BETA-5.10/cf/freebsd.h *** DHCPD-BETA-5.9/cf/freebsd.h Mon Sep 9 00:15:23 1996 --- DHCPD-BETA-5.10/cf/freebsd.h Tue Sep 10 23:50:24 1996 *************** *** 62,67 **** --- 62,71 ---- #define VA_start(list, last) va_start (list, last) + #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" + #endif + #ifndef _PATH_DHCPD_DB #define _PATH_DHCPD_DB "/var/db/dhcpd.leases" + #endif #define EOL '\n' diff -rNc2 DHCPD-BETA-5.9/cf/linux.h DHCPD-BETA-5.10/cf/linux.h *** DHCPD-BETA-5.9/cf/linux.h Mon Sep 9 00:15:24 1996 --- DHCPD-BETA-5.10/cf/linux.h Tue Sep 10 23:50:24 1996 *************** *** 57,70 **** #include #include - #include extern int h_errno; #include ! #include #include /* gettimeofday()*/ #include /* also necessary */ #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" /* Varargs stuff... */ --- 57,74 ---- #include #include extern int h_errno; #include ! ! #define ARPHRD_ETHER 1 ! #define ARPHRD_IEEE802 6 ! #include /* gettimeofday()*/ #include /* also necessary */ + #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" + #endif /* Varargs stuff... */ diff -rNc2 DHCPD-BETA-5.9/cf/netbsd.h DHCPD-BETA-5.10/cf/netbsd.h *** DHCPD-BETA-5.9/cf/netbsd.h Mon Sep 9 00:15:24 1996 --- DHCPD-BETA-5.10/cf/netbsd.h Tue Sep 10 23:50:25 1996 *************** *** 60,65 **** --- 60,69 ---- #define VA_start(list, last) va_start (list, last) + #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" + #endif + #ifndef _PATH_DHCPD_DB #define _PATH_DHCPD_DB "/var/db/dhcpd.leases" + #endif #define EOL '\n' diff -rNc2 DHCPD-BETA-5.9/cf/qnx.h DHCPD-BETA-5.10/cf/qnx.h *** DHCPD-BETA-5.9/cf/qnx.h Mon Sep 9 00:15:25 1996 --- DHCPD-BETA-5.10/cf/qnx.h Tue Sep 10 23:50:27 1996 *************** *** 62,66 **** --- 62,68 ---- #define VA_start(list, last) va_start (list, last) + #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/etc/dhcpd.pid" + #endif #define EOL '\n' diff -rNc2 DHCPD-BETA-5.9/cf/sunos5-5.h DHCPD-BETA-5.10/cf/sunos5-5.h *** DHCPD-BETA-5.9/cf/sunos5-5.h Mon Sep 9 00:15:29 1996 --- DHCPD-BETA-5.10/cf/sunos5-5.h Tue Sep 10 23:50:30 1996 *************** *** 86,90 **** #endif ! #ifdef __GNUC__ /* Varargs stuff: use stdarg.h instead ... */ #include --- 86,90 ---- #endif ! #if defined (__GNUC__) || defined (__SVR4) /* Varargs stuff: use stdarg.h instead ... */ #include *************** *** 121,122 **** --- 121,124 ---- #define TIME time_t #define GET_TIME(x) time ((x)) + + #define random() rand() diff -rNc2 DHCPD-BETA-5.9/cf/ultrix.h DHCPD-BETA-5.10/cf/ultrix.h *** DHCPD-BETA-5.9/cf/ultrix.h Mon Sep 9 00:15:30 1996 --- DHCPD-BETA-5.10/cf/ultrix.h Tue Sep 10 23:50:30 1996 *************** *** 53,63 **** #include - /*#define _PATH_DHCPD_PID "/var/run/dhcpd.pid"*/ - - /* - * Ultrix systems don't have /var/run, but some sites have added it. - * if yours is one, edit this file or define _PATH_DHCPD_PID externally. - */ - #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/etc/dhcpd.pid" --- 53,56 ---- diff -rNc2 DHCPD-BETA-5.9/confpars.c DHCPD-BETA-5.10/confpars.c *** DHCPD-BETA-5.9/confpars.c Mon Sep 9 00:14:11 1996 --- DHCPD-BETA-5.10/confpars.c Tue Sep 10 23:49:07 1996 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: confpars.c,v 1.33 1996/09/09 07:04:28 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: confpars.c,v 1.34 1996/09/11 06:36:17 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 326,332 **** if (!tree_evaluate (cache)) error ("server-identifier is not known"); - group -> next_server.len = 4; - memcpy (server_identifier.iabuf, - cache -> value, server_identifier.len); } token = next_token (&val, cfile); --- 326,329 ---- diff -rNc2 DHCPD-BETA-5.9/dhclient.c DHCPD-BETA-5.10/dhclient.c *** DHCPD-BETA-5.9/dhclient.c Mon Sep 9 00:14:14 1996 --- DHCPD-BETA-5.10/dhclient.c Tue Sep 10 23:49:13 1996 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: dhclient.c,v 1.19 1996/08/29 09:15:35 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: dhclient.c,v 1.20 1996/09/11 05:51:25 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 260,264 **** /* Set up the option buffer... */ ! cons_options ((struct packet *)0, &outgoing, options, 0); memset (&raw.ciaddr, 0, sizeof raw.ciaddr); --- 260,264 ---- /* Set up the option buffer... */ ! cons_options ((struct packet *)0, &outgoing, options, 0, 0); memset (&raw.ciaddr, 0, sizeof raw.ciaddr); *************** *** 359,363 **** /* Set up the option buffer... */ ! cons_options ((struct packet *)0, &outgoing, options, 0); memset (&raw.ciaddr, 0, sizeof raw.ciaddr); --- 359,363 ---- /* Set up the option buffer... */ ! cons_options ((struct packet *)0, &outgoing, options, 0, 0); memset (&raw.ciaddr, 0, sizeof raw.ciaddr); diff -rNc2 DHCPD-BETA-5.9/dhcp.c DHCPD-BETA-5.10/dhcp.c *** DHCPD-BETA-5.9/dhcp.c Mon Sep 9 00:14:21 1996 --- DHCPD-BETA-5.10/dhcp.c Tue Sep 10 23:49:19 1996 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: dhcp.c,v 1.33 1996/09/05 23:52:10 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: dhcp.c,v 1.34 1996/09/11 05:52:18 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 363,367 **** /* Set up the option buffer... */ ! cons_options (packet, &outgoing, options, 0); /* memset (&raw.ciaddr, 0, sizeof raw.ciaddr);*/ --- 363,367 ---- /* Set up the option buffer... */ ! cons_options (packet, &outgoing, options, 0, 0); /* memset (&raw.ciaddr, 0, sizeof raw.ciaddr);*/ *************** *** 808,812 **** } ! cons_options (packet, &outgoing, options, bufs); if (!offer && outgoing.packet_length < BOOTP_MIN_LEN) outgoing.packet_length = BOOTP_MIN_LEN; --- 808,819 ---- } ! /* See if this is a Microsoft client that NUL-terminates its ! strings and expects us to do likewise... */ ! if (packet -> options [DHO_HOST_NAME].data && ! packet -> options [DHO_HOST_NAME].data ! [packet -> options [DHO_HOST_NAME].len - 1] == '\0') ! cons_options (packet, &outgoing, options, bufs, 1); ! else ! cons_options (packet, &outgoing, options, bufs, 0); if (!offer && outgoing.packet_length < BOOTP_MIN_LEN) outgoing.packet_length = BOOTP_MIN_LEN; diff -rNc2 DHCPD-BETA-5.9/dhcpd.c DHCPD-BETA-5.10/dhcpd.c *** DHCPD-BETA-5.9/dhcpd.c Mon Sep 9 00:14:25 1996 --- DHCPD-BETA-5.10/dhcpd.c Tue Sep 10 23:49:24 1996 *************** *** 49,53 **** "Copyright 1995, 1996 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCPD $Name: BETA_5_9 $"; #include "dhcpd.h" --- 49,53 ---- "Copyright 1995, 1996 The Internet Software Consortium."; static char arr [] = "All rights reserved."; ! static char message [] = "Internet Software Consortium DHCPD $Name: BETA_5_10 $"; #include "dhcpd.h" diff -rNc2 DHCPD-BETA-5.9/dhcpd.h DHCPD-BETA-5.10/dhcpd.h *** DHCPD-BETA-5.9/dhcpd.h Mon Sep 9 00:14:48 1996 --- DHCPD-BETA-5.10/dhcpd.h Tue Sep 10 23:49:48 1996 *************** *** 258,268 **** void parse_option_buffer PROTO ((struct packet *, unsigned char *, int)); void cons_options PROTO ((struct packet *, struct packet *, ! struct tree_cache **, int)); ! /* void new_cons_options PROTO ((struct packet *, struct packet *, ! struct tree_cache **, int)); */ int store_options PROTO ((unsigned char *, int, struct tree_cache **, ! unsigned char *, int, int, int)); ! /* int store_option PROTO ((struct tree_cache **, unsigned char, ! unsigned char *, int, int *)); */ char *pretty_print_option PROTO ((unsigned char, unsigned char *, int)); --- 258,264 ---- void parse_option_buffer PROTO ((struct packet *, unsigned char *, int)); void cons_options PROTO ((struct packet *, struct packet *, ! struct tree_cache **, int, int)); int store_options PROTO ((unsigned char *, int, struct tree_cache **, ! unsigned char *, int, int, int, int)); char *pretty_print_option PROTO ((unsigned char, unsigned char *, int)); diff -rNc2 DHCPD-BETA-5.9/dispatch.c DHCPD-BETA-5.10/dispatch.c *** DHCPD-BETA-5.9/dispatch.c Mon Sep 9 00:14:56 1996 --- DHCPD-BETA-5.10/dispatch.c Tue Sep 10 23:49:56 1996 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: dispatch.c,v 1.23 1996/09/05 23:55:39 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: dispatch.c,v 1.25 1996/09/11 06:35:16 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 62,66 **** struct interface_info *tmp; struct interface_info *last; ! static char buf [8192]; struct ifconf ic; struct ifreq ifr; --- 62,66 ---- struct interface_info *tmp; struct interface_info *last; ! char buf [8192]; struct ifconf ic; struct ifreq ifr; *************** *** 140,144 **** error ("Insufficient memory to %s %s", "record interface", ifp -> ifr_name); - memset (tmp, 0, sizeof *tmp); strcpy (tmp -> name, ifp -> ifr_name); tmp -> next = interfaces; --- 140,143 ---- diff -rNc2 DHCPD-BETA-5.9/options.c DHCPD-BETA-5.10/options.c *** DHCPD-BETA-5.9/options.c Mon Sep 9 00:15:09 1996 --- DHCPD-BETA-5.10/options.c Tue Sep 10 23:50:09 1996 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: options.c,v 1.18 1996/09/05 23:57:33 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: options.c,v 1.19 1996/09/11 05:52:18 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 156,164 **** of vendor options using the same routine. */ ! void cons_options (inpacket, outpacket, options, overload) struct packet *inpacket; struct packet *outpacket; struct tree_cache **options; int overload; /* Overload flags that may be set. */ { unsigned char priority_list [300]; --- 156,165 ---- of vendor options using the same routine. */ ! void cons_options (inpacket, outpacket, options, overload, terminate) struct packet *inpacket; struct packet *outpacket; struct tree_cache **options; int overload; /* Overload flags that may be set. */ + int terminate; { unsigned char priority_list [300]; *************** *** 221,225 **** main_buffer_size, (main_buffer_size + ! ((overload & 1) ? DHCP_FILE_LEN : 0))); /* Put the cookie up front... */ --- 222,227 ---- main_buffer_size, (main_buffer_size + ! ((overload & 1) ? DHCP_FILE_LEN : 0)), ! terminate); /* Put the cookie up front... */ *************** *** 288,292 **** int store_options (buffer, buflen, options, priority_list, priority_len, ! first_cutoff, second_cutoff) unsigned char *buffer; int buflen; --- 290,294 ---- int store_options (buffer, buflen, options, priority_list, priority_len, ! first_cutoff, second_cutoff, terminate) unsigned char *buffer; int buflen; *************** *** 295,298 **** --- 297,301 ---- int priority_len; int first_cutoff, second_cutoff; + int terminate; { int bufix = 0; *************** *** 300,303 **** --- 303,307 ---- int i; int ix; + int tto; /* Zero out the stored-lengths array. */ *************** *** 334,337 **** --- 338,349 ---- length = options [code] -> len; + /* Do we add a NUL? */ + if (terminate && dhcp_options [code].format [0] == 't') { + length++; + tto = 1; + } else { + tto = 0; + } + /* Try to store the option. */ *************** *** 367,372 **** buffer [bufix] = code; buffer [bufix + 1] = incr; ! memcpy (buffer + bufix + 2, ! options [code] -> value + ix, incr); length -= incr; ix += incr; --- 379,391 ---- buffer [bufix] = code; buffer [bufix + 1] = incr; ! if (tto && incr == length) { ! memcpy (buffer + bufix + 2, ! options [code] -> value + ix, ! incr - 1); ! buffer [bufix + 2 + incr - 1] = 0; ! } else { ! memcpy (buffer + bufix + 2, ! options [code] -> value + ix, incr); ! } length -= incr; ix += incr; diff -rNc2 DHCPD-BETA-5.9/osdep.h DHCPD-BETA-5.10/osdep.h *** DHCPD-BETA-5.9/osdep.h Mon Sep 9 00:15:10 1996 --- DHCPD-BETA-5.10/osdep.h Tue Sep 10 23:50:10 1996 *************** *** 63,67 **** #if defined (sun) ! # if defined (__svr4__) # include "cf/sunos5-5.h" # else --- 63,67 ---- #if defined (sun) ! # if defined (__svr4__) || defined (__SVR4) # include "cf/sunos5-5.h" # else diff -rNc2 DHCPD-BETA-5.9/tables.c DHCPD-BETA-5.10/tables.c *** DHCPD-BETA-5.9/tables.c Mon Sep 9 00:15:19 1996 --- DHCPD-BETA-5.10/tables.c Tue Sep 10 23:50:19 1996 *************** *** 43,47 **** #ifndef lint static char copyright[] = ! "$Id: tables.c,v 1.10 1996/09/04 07:07:51 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ --- 43,47 ---- #ifndef lint static char copyright[] = ! "$Id: tables.c,v 1.11 1996/09/11 06:34:25 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ *************** *** 386,389 **** --- 386,407 ---- DHO_X_DISPLAY_MANAGER, DHO_DHCP_PARAMETER_REQUEST_LIST, + + /* Presently-undefined options... */ + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, };