One more time! diffs for aging of leases files

HIBBS, BARR (PB) RBHIBBS at msg.pacbell.com
Thu Sep 9 22:52:44 UTC 1999


...the prior comments about the nature of the diff file remain...

--Barr

>  <<leasename_diff.txt>> 


-- Attached file included as plaintext by Listar --
-- File: leasename_diff.txt

diff -rnc dhcp-3.0b1pl0/Makefile.conf dhcp-contrib/Makefile.conf
*** dhcp-3.0b1pl0/Makefile.conf	Wed Sep  8 11:17:03 1999
--- dhcp-contrib/Makefile.conf	Thu Sep  9 11:49:09 1999
***************
*** 152,157 ****
--- 152,180 ----
  #SCRIPT=freebsd
  ##--freebsd--
  
+ ## HP-UX
+ ##--hpux--
+ #CF = cf/hpux.h
+ #COPTS = -w
+ #INSTALL = install -i
+ #ADMMANEXT = .8
+ #FFMANEXT = .5
+ #MANINSTALL = install -i -m 444
+ #SCRIPT = hpux
+ ##--hpux--
+ 
+ ## HP-UX with gcc
+ ##--hpux-gcc--
+ #CC = gcc
+ #CF = cf/hpux.h
+ #DEBUG = -g
+ #INSTALL = install -i
+ #ADMMANEXT = .8
+ #FFMANEXT = .5
+ #MANINSTALL = install -i -m 444
+ #SCRIPT = hpux
+ ##--hpux-gcc--
+ 
  ## Rhapsody
  ##--rhapsody--
  #CF = cf/rhapsody.h
Common subdirectories: dhcp-3.0b1pl0/client and dhcp-contrib/client
Common subdirectories: dhcp-3.0b1pl0/common and dhcp-contrib/common
diff -rnc dhcp-3.0b1pl0/configure dhcp-contrib/configure
*** dhcp-3.0b1pl0/configure	Wed Sep  8 11:16:59 1999
--- dhcp-contrib/configure	Thu Sep  9 11:49:05 1999
***************
*** 52,61 ****
        sysname=netbsd;;
      FreeBSD)
        sysname=freebsd;;
!     hpux)
!       sysname=hpux;;
!     HP-UX)
!       sysname=hpux;;
      QNX)
        sysname=qnx;;
      NEXTSTEP)
--- 52,64 ----
        sysname=netbsd;;
      FreeBSD)
        sysname=freebsd;;
! 	hpux | HP-UX)
! 	  set `which gcc`
! 	  if [ $# = 1 ]; then
! 		sysname=hpux-gcc
! 	  else
! 		sysname=hpux
! 	  fi;;
      QNX)
        sysname=qnx;;
      NEXTSTEP)
Common subdirectories: dhcp-3.0b1pl0/doc and dhcp-contrib/doc
Common subdirectories: dhcp-3.0b1pl0/includes and dhcp-contrib/includes
Common subdirectories: dhcp-3.0b1pl0/relay and dhcp-contrib/relay
Common subdirectories: dhcp-3.0b1pl0/server and dhcp-contrib/server
Common subdirectories: dhcp-3.0b1pl0/client/scripts and dhcp-contrib/client/scripts
diff -rnc dhcp-3.0b1pl0/common/errwarn.c dhcp-contrib/common/errwarn.c
*** dhcp-3.0b1pl0/common/errwarn.c	Wed Sep  8 11:15:54 1999
--- dhcp-contrib/common/errwarn.c	Thu Sep  9 11:47:06 1999
***************
*** 46,52 ****
  
  void log_fatal (ANSI_DECL(char *) fmt, VA_DOTDOTDOT)
       KandR (char *fmt;)
!      va_dcl
  {
    va_list list;
    extern int logged_in;
--- 46,52 ----
  
  void log_fatal (ANSI_DECL(char *) fmt, VA_DOTDOTDOT)
       KandR (char *fmt;)
! /*     va_dcl  */
  {
    va_list list;
    extern int logged_in;
***************
*** 80,86 ****
  
  int log_error (ANSI_DECL (char *) fmt, VA_DOTDOTDOT)
       KandR (char *fmt;)
!      va_dcl
  {
    va_list list;
  
--- 80,86 ----
  
  int log_error (ANSI_DECL (char *) fmt, VA_DOTDOTDOT)
       KandR (char *fmt;)
! /*     va_dcl  */
  {
    va_list list;
  
***************
*** 106,112 ****
  
  int log_info (ANSI_DECL (char *) fmt, VA_DOTDOTDOT)
       KandR (char *fmt;)
!      va_dcl
  {
    va_list list;
  
--- 106,112 ----
  
  int log_info (ANSI_DECL (char *) fmt, VA_DOTDOTDOT)
       KandR (char *fmt;)
! /*     va_dcl  */
  {
    va_list list;
  
***************
*** 132,138 ****
  
  int log_debug (ANSI_DECL (char *) fmt, VA_DOTDOTDOT)
       KandR (char *fmt;)
!      va_dcl
  {
    va_list list;
  
--- 132,138 ----
  
  int log_debug (ANSI_DECL (char *) fmt, VA_DOTDOTDOT)
       KandR (char *fmt;)
! /*     va_dcl  */
  {
    va_list list;
  
***************
*** 199,205 ****
  
  int parse_warn (ANSI_DECL (char *) fmt, VA_DOTDOTDOT)
  	KandR (char *fmt;)
! 	va_dcl
  {
  	va_list list;
  	static char spaces [] = "                                                                                ";
--- 199,205 ----
  
  int parse_warn (ANSI_DECL (char *) fmt, VA_DOTDOTDOT)
  	KandR (char *fmt;)
! /*	va_dcl    */
  {
  	va_list list;
  	static char spaces [] = "                                                                                ";
diff -rnc dhcp-3.0b1pl0/common/icmp.c dhcp-contrib/common/icmp.c
*** dhcp-3.0b1pl0/common/icmp.c	Wed Sep  8 11:16:32 1999
--- dhcp-contrib/common/icmp.c	Thu Sep  9 11:47:00 1999
***************
*** 27,34 ****
  #endif /* not lint */
  
  #include "dhcpd.h"
! #include "netinet/ip.h"
! #include "netinet/ip_icmp.h"
  
  static int icmp_protocol_initialized;
  static int icmp_protocol_fd;
--- 27,34 ----
  #endif /* not lint */
  
  #include "dhcpd.h"
! #include "includes/netinet/ip.h"
! #include "includes/netinet/ip_icmp.h"
  
  static int icmp_protocol_initialized;
  static int icmp_protocol_fd;
Common subdirectories: dhcp-3.0b1pl0/includes/arpa and dhcp-contrib/includes/arpa
Common subdirectories: dhcp-3.0b1pl0/includes/cf and dhcp-contrib/includes/cf
Common subdirectories: dhcp-3.0b1pl0/includes/netinet and dhcp-contrib/includes/netinet
diff -rnc dhcp-3.0b1pl0/includes/cf/hpux.h dhcp-contrib/includes/cf/hpux.h
*** dhcp-3.0b1pl0/includes/cf/hpux.h	Wed Sep  8 11:12:00 1999
--- dhcp-contrib/includes/cf/hpux.h	Thu Sep  9 11:55:45 1999
***************
*** 1,62 ****
  /* hpux.h */
  /*
!  * Copyright (c) 1996-1999 Internet Software Consortium.
!  * Use is subject to license terms which appear in the file named
!  * ISC-LICENSE that should have accompanied this file when you
!  * received it.   If a file named ISC-LICENSE did not accompany this
!  * file, or you are not sure the one you have is correct, you may
   * obtain an applicable copy of the license at:
   *
!  *             http://www.isc.org/isc-license-1.0.html. 
   *
!  * This file is part of the ISC DHCP distribution.   The documentation
!  * associated with this file is listed in the file DOCUMENTATION,
!  * included in the top-level directory of this release.
   *
!  * Support and other services are available for ISC products - see
!  * http://www.isc.org for more information.
   */
  
! #define int8_t		char
! #define int16_t		short
! #define int32_t		long
  
  #define u_int8_t	unsigned char
  #define u_int16_t	unsigned short 
  #define u_int32_t	unsigned long 
  
! #include <sys/types.h>
  
! #include <syslog.h>
  
! #include <string.h>
! #include <errno.h>
! #include <unistd.h>
! #include <sys/wait.h>
! #include <signal.h>
! #include <setjmp.h>
! #include <limits.h>
  
  extern int h_errno;
  
! #include <net/if.h>
! #include <net/if_arp.h>
  
  #ifndef _PATH_DHCPD_PID
  #define _PATH_DHCPD_PID	"/etc/dhcpd.pid"
  #endif
  #ifndef _PATH_DHCLIENT_PID
! #define _PATH_DHCLIENT_PID "/etc/dhclient.pid"
  #endif
  #ifndef _PATH_DHCRELAY_PID
! #define _PATH_DHCRELAY_PID "/etc/dhcrelay.pid"
  #endif
  
! #include <varargs.h>
  #define VA_DOTDOTDOT va_alist
  #define VA_start(list, last) va_start (list)
  
! #define vsnprintf(buf, size, fmt, list) vsprintf (buf, fmt, list)
  #define NO_SNPRINTF
  
  #define USE_SOCKETS	1
--- 1,83 ----
  /* hpux.h */
  /*
!  * Copyright (c) 1996-1999	Internet Software Consortium.
!  * Use is subject to license terms	which appear in	the	file named
!  * ISC-LICENSE	that should	have accompanied this file when	you
!  * received it.   If a	file named ISC-LICENSE did not accompany this
!  * file,	or you are not sure the one you have is correct, you may
   * obtain an applicable copy of the license at:
   *
!  *		http://www.isc.org/isc-license-1.0.html. 
   *
!  * This file is part of the ISC DHCP distribution.	  The documentation
!  * associated with	this file is listed	in the file	DOCUMENTATION,
!  * included in	the	top-level directory	of this	release.
   *
!  * Support and	other services are available for ISC products -	see
!  * http://www.isc.org for more	information.
   */
  
! #if !defined( __GNUC__	)
! #define int8_t  char
! #define int16_t short 
! #define int32_t long 
! #endif  /* !__GNUC__ */
  
+ #define int8_t	  char
+ #define int16_t  short
+ #define int32_t  long
+ 
  #define u_int8_t	unsigned char
  #define u_int16_t	unsigned short 
  #define u_int32_t	unsigned long 
  
! #include	<sys/types.h>
  
! #include	<syslog.h>
  
! #include	<string.h>
! #include	<errno.h>
! #include	<unistd.h>
! #include	<sys/wait.h>
! #include	<signal.h>
! #include	<setjmp.h>
! #include	<limits.h>
  
  extern int h_errno;
  
! #include	<net/if.h>
! #include	<net/if_arp.h>
  
  #ifndef _PATH_DHCPD_PID
  #define _PATH_DHCPD_PID	"/etc/dhcpd.pid"
  #endif
  #ifndef _PATH_DHCLIENT_PID
! #define _PATH_DHCLIENT_PID	"/etc/dhclient.pid"
  #endif
  #ifndef _PATH_DHCRELAY_PID
! #define _PATH_DHCRELAY_PID	"/etc/dhcrelay.pid"
  #endif
  
! #if !defined( __GNUC__	)
! #define random  rand							 
! /*#include <varargs.h>*/
! #endif  /* !__GNUC__ */						   
! 
! #include	<varargs.h>
! 
! #if defined( __GNUC__ )
! #define VA_DOTDOTDOT ...						  
! #if defined( _STDARG_INCLUDED )
! #define VA_start(list, last) va_start (list, last)
! #else
! #define VA_start(list, last) va_start (list)
! #endif  /* _STDARG_INCLUDED */
! #else
  #define VA_DOTDOTDOT va_alist
  #define VA_start(list, last) va_start (list)
+ #endif  /* __GNUC__ */							   
  
! #define vsnprintf(buf,	size, fmt, list) vsprintf (buf,	fmt, list)
  #define NO_SNPRINTF
  
  #define USE_SOCKETS	1
***************
*** 63,69 ****
  #define EOL '\n'
  #define VOIDPTR void *
  
! #include <time.h>
  
  #define TIME time_t
  #define GET_TIME(x)	time ((x))
--- 84,90 ----
  #define EOL '\n'
  #define VOIDPTR void *
  
! #include	<time.h>
  
  #define TIME time_t
  #define GET_TIME(x)	time ((x))
***************
*** 70,74 ****
  
  #define random	rand
  
! #define BYTE_ORDER BIG_ENDIAN
! #define BIG_ENDIAN 1
--- 91,95 ----
  
  #define random	rand
  
! #define BYTE_ORDER	BIG_ENDIAN
! #define BIG_ENDIAN	1
diff -rnc dhcp-3.0b1pl0/server/db.c dhcp-contrib/server/db.c
*** dhcp-3.0b1pl0/server/db.c	Wed Sep  8 11:07:59 1999
--- dhcp-contrib/server/db.c	Thu Sep  9 11:47:15 1999
***************
*** 281,290 ****
  		fclose (db_file);
  	}
  
! 	/* Make a temporary lease file... */
  	GET_TIME (&t);
  	sprintf (newfname, "%s.%d", path_dhcpd_db, (int)t);
! 	db_fd = open (newfname, O_WRONLY | O_TRUNC | O_CREAT, 0664);
  	if (db_fd < 0) {
  		log_fatal ("Can't create new lease file: %m");
  	}
--- 281,300 ----
  		fclose (db_file);
  	}
  
! 	/* new lease file name is the old file name with a numeric
! 	 * value derived from the system clock as a suffix 
! 	 */
  	GET_TIME (&t);
  	sprintf (newfname, "%s.%d", path_dhcpd_db, (int)t);
! 	if (rename(path_dhcpd_db, newfname) < 0) {
! 	    log_fatal ("Can't rename file %s to %s", 
! 		  path_dhcpd_db, newfname);
! 	}
! 	else
! 	    log_info ("File %s renamed %s", 
! 		  path_dhcpd_db, newfname);
! 	/* Now, create a new leases file */
! 	db_fd = open (path_dhcpd_db, O_WRONLY | O_TRUNC | O_CREAT, 0664);
  	if (db_fd < 0) {
  		log_fatal ("Can't create new lease file: %m");
  	}



More information about the dhcp-hackers mailing list