From: Ted Lemon Date: Thu, 25 Jan 2001 08:32:57 +0000 (+0000) Subject: Add log_facility config parameter. X-Git-Tag: V3-BETA-2-PATCH-15~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee5a7404e70f5a273dfe7491e0d4a0ff4332d45b;p=thirdparty%2Fdhcp.git Add log_facility config parameter. --- diff --git a/server/dhcpd.c b/server/dhcpd.c index 6d386a7bb..b83b38068 100644 --- a/server/dhcpd.c +++ b/server/dhcpd.c @@ -3,7 +3,7 @@ DHCP Server Daemon. */ /* - * Copyright (c) 1996-2000 Internet Software Consortium. + * Copyright (c) 1996-2001 Internet Software Consortium. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,11 +43,11 @@ #ifndef lint static char ocopyright[] = -"$Id: dhcpd.c,v 1.108 2001/01/11 23:16:31 mellon Exp $ Copyright 1995-2000 Internet Software Consortium."; +"$Id: dhcpd.c,v 1.109 2001/01/25 08:32:57 mellon Exp $ Copyright 1995-2001 Internet Software Consortium."; #endif static char copyright[] = -"Copyright 1995-2000 Internet Software Consortium."; +"Copyright 1995-2001 Internet Software Consortium."; static char arr [] = "All rights reserved."; static char message [] = "Internet Software Consortium DHCP Server"; static char url [] = "For info, please visit http://www.isc.org/products/DHCP"; @@ -374,6 +374,7 @@ int main (argc, argv, envp) /* Add the ddns update style enumeration prior to parsing. */ add_enumeration (&ddns_styles); + add_enumeration (&syslog_enum); if (!group_allocate (&root_group, MDL)) log_fatal ("Can't allocate root group!"); @@ -560,6 +561,36 @@ int main (argc, argv, envp) "dhcpd.conf manual page."); } + oc = lookup_option (&server_universe, options, SV_LOG_FACILITY); + if (oc) { + if (evaluate_option_cache (&db, (struct packet *)0, + (struct lease *)0, + (struct client_state *)0, + options, + (struct option_state *)0, + &global_scope, oc, MDL)) { + if (db.len == 1) { + closelog (); +#ifdef SYSLOG_4_2 + openlog ("dhcpd", LOG_NDELAY); + log_priority = db.data [0]; +#else + openlog ("dhcpd", + LOG_NDELAY, db.data [0]); +#endif + if (!quiet) { + log_info ("%s %s", + message, DHCP_VERSION); + log_info (copyright); + log_info (arr); + log_info (url); + } + } else + log_fatal ("invalid log facility"); + data_string_forget (&db, MDL); + } + } + /* Don't need the options anymore. */ option_state_dereference (&options, MDL); @@ -728,6 +759,10 @@ int main (argc, argv, envp) dmalloc_outstanding = 0; #endif +#if defined (DEBUG_RC_HISTORY_EXHAUSTIVELY) + dump_rc_history (); +#endif + /* Receive packets and dispatch them... */ dispatch ();