From: Ted Lemon Date: Thu, 9 Sep 1999 21:11:27 +0000 (+0000) Subject: Support host declarations in lease database file. X-Git-Tag: V3-BETA-1-PATCH-2~5^2~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52e79d128318b09d1319d3c39826202824eb8c82;p=thirdparty%2Fdhcp.git Support host declarations in lease database file. --- diff --git a/server/confpars.c b/server/confpars.c index 048793220..70ebdb811 100644 --- a/server/confpars.c +++ b/server/confpars.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: confpars.c,v 1.77 1999/09/08 01:49:56 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: confpars.c,v 1.78 1999/09/09 21:11:21 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -98,16 +98,18 @@ void read_leases () token = next_token (&val, cfile); if (token == EOF) break; - if (token != LEASE) { - log_error ("Corrupt lease file - possible data loss!"); - skip_to_semi (cfile); - } else { + if (token == LEASE) { struct lease *lease; lease = parse_lease_declaration (cfile); if (lease) enter_lease (lease); else parse_warn ("possibly corrupt lease file"); + } else if (token == HOST) { + parse_host_declaration (cfile, &root_group); + } else { + log_error ("Corrupt lease file - possible data loss!"); + skip_to_semi (cfile); } } while (1); @@ -944,7 +946,7 @@ void parse_host_declaration (cfile, group) declaration); } while (1); - enter_host (host, dynamicp); + enter_host (host, dynamicp, 0); } /* class-declaration :== STRING LBRACE parameters declarations RBRACE diff --git a/server/dhcpd.c b/server/dhcpd.c index 7fa2a8c15..d55b93c33 100644 --- a/server/dhcpd.c +++ b/server/dhcpd.c @@ -22,7 +22,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhcpd.c,v 1.72 1999/09/08 01:50:19 mellon Exp $ Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium."; +"$Id: dhcpd.c,v 1.73 1999/09/09 21:11:27 mellon Exp $ Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium."; #endif static char copyright[] = @@ -214,6 +214,16 @@ int main (argc, argv, envp) /* Set up the client classification system. */ classification_setup (); + /* Initialize the omapi system. */ + status = omapi_init (); + if (status != ISC_R_SUCCESS) + log_fatal ("Can't initialize OMAPI: %s\n", + isc_result_totext (status)); + + /* Set up the OMAPI wrappers for various server database internal + objects. */ + dhcp_db_objects_setup (); + /* Read the dhcpd.conf file... */ if (!readconf ()) log_fatal ("Configuration file errors encountered -- exiting"); @@ -256,11 +266,7 @@ int main (argc, argv, envp) OMAPI_PROTOCOL_PORT, 1); if (status != ISC_R_SUCCESS) log_fatal ("Can't start OMAPI protocol: %s", - isc_result_totext (result)); - - /* Set up the OMAPI wrappers for various server database internal - objects. */ - dhcp_db_objects_setup (); + isc_result_totext (status)); #ifndef DEBUG if (daemon) {