diff options
author | Ted Lemon <source@isc.org> | 2000-03-18 03:34:11 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 2000-03-18 03:34:11 +0000 |
commit | 68f55908089e37c37334a36c595e1de150cb964a (patch) | |
tree | 3ec47f6a9df1a37e31ae4c14a4092fd225e01fa0 | |
parent | 0bcad76189c7b2d13515bcd02f18145ccc1fed34 (diff) | |
download | isc-dhcp-68f55908089e37c37334a36c595e1de150cb964a.tar.gz |
Make universe_hash using new_hash.
-rw-r--r-- | common/options.c | 4 | ||||
-rw-r--r-- | common/parse.c | 6 | ||||
-rw-r--r-- | common/tables.c | 10 | ||||
-rw-r--r-- | includes/dhcpd.h | 2 | ||||
-rw-r--r-- | server/dhcp.c | 6 | ||||
-rw-r--r-- | server/dhcpd.c | 95 | ||||
-rw-r--r-- | server/stables.c | 6 |
7 files changed, 65 insertions, 64 deletions
diff --git a/common/options.c b/common/options.c index 5e6e5a1f..559e3abd 100644 --- a/common/options.c +++ b/common/options.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: options.c,v 1.57 2000/03/17 03:59:01 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: options.c,v 1.58 2000/03/18 03:34:05 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #define DHCP_OPTION_DATA @@ -1192,7 +1192,7 @@ int option_space_encapsulate (result, packet, lease, { struct universe *u; - u = (struct universe *)hash_lookup (&universe_hash, + u = (struct universe *)hash_lookup (universe_hash, name -> data, name -> len); if (!u) { log_error ("unknown option space %s.", name -> data); diff --git a/common/parse.c b/common/parse.c index eb70a8c3..76ff234a 100644 --- a/common/parse.c +++ b/common/parse.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: parse.c,v 1.67 2000/03/18 02:15:37 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: parse.c,v 1.68 2000/03/18 03:34:05 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -794,7 +794,7 @@ struct option *parse_option_name (cfile, allocate, known) /* Look up the option name hash table for the specified uname. */ universe = ((struct universe *) - hash_lookup (&universe_hash, + hash_lookup (universe_hash, (unsigned char *)uname, 0)); /* If it's not there, we can't parse the rest of the declaration. */ @@ -907,7 +907,7 @@ void parse_option_space_decl (cfile) nu -> hash = new_hash (0, 0, 1); if (!nu -> hash) log_fatal ("Can't allocate %s option hash table.", nu -> name); - add_hash (&universe_hash, + add_hash (universe_hash, (const unsigned char *)nu -> name, 0, (unsigned char *)nu); parse_semi (cfile); } diff --git a/common/tables.c b/common/tables.c index e2fdb666..614f53cd 100644 --- a/common/tables.c +++ b/common/tables.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: tables.c,v 1.39 2000/03/18 02:15:37 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: tables.c,v 1.40 2000/03/18 03:34:06 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -846,7 +846,7 @@ const char *hardware_types [] = { "unknown-254", "unknown-255" }; -struct hash_table universe_hash; +struct hash_table *universe_hash; struct universe **universes; int universe_count, universe_max; @@ -920,11 +920,11 @@ void initialize_common_option_spaces() } /* Set up the hash of universes. */ - universe_hash.hash_count = DEFAULT_HASH_SIZE; - add_hash (&universe_hash, + universe_hash = new_hash (0, 0, 1); + add_hash (universe_hash, (const unsigned char *)dhcp_universe.name, 0, (unsigned char *)&dhcp_universe); - add_hash (&universe_hash, + add_hash (universe_hash, (const unsigned char *)nwip_universe.name, 0, (unsigned char *)&nwip_universe); } diff --git a/includes/dhcpd.h b/includes/dhcpd.h index 2ea3c42d..40401cc5 100644 --- a/includes/dhcpd.h +++ b/includes/dhcpd.h @@ -1491,7 +1491,7 @@ extern int dhcp_option_default_priority_list_count; extern const char *hardware_types [256]; int universe_count, universe_max; struct universe **universes; -extern struct hash_table universe_hash; +extern struct hash_table *universe_hash; void initialize_common_option_spaces PROTO ((void)); struct universe *config_universe; diff --git a/server/dhcp.c b/server/dhcp.c index 9a8ac1bb..9efb12db 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.142 2000/03/17 04:00:31 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.143 2000/03/18 03:34:10 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -726,7 +726,7 @@ void dhcpinform (packet, ms_nulltp) const struct universe *u; u = ((const struct universe *) - hash_lookup (&universe_hash, d1.data, d1.len)); + hash_lookup (universe_hash, d1.data, d1.len)); if (!u) { log_error ("unknown option space %s.", d1.data); option_state_dereference (&options, MDL); @@ -1926,7 +1926,7 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp) const struct universe *u; u = ((const struct universe *) - hash_lookup (&universe_hash, d1.data, d1.len)); + hash_lookup (universe_hash, d1.data, d1.len)); if (!u) { log_error ("unknown option space %s.", d1.data); return; diff --git a/server/dhcpd.c b/server/dhcpd.c index 9f246432..e7da2e21 100644 --- a/server/dhcpd.c +++ b/server/dhcpd.c @@ -43,7 +43,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhcpd.c,v 1.86 2000/03/17 04:00:31 mellon Exp $ Copyright 1995-2000 The Internet Software Consortium."; +"$Id: dhcpd.c,v 1.87 2000/03/18 03:34:10 mellon Exp $ Copyright 1995-2000 The Internet Software Consortium."; #endif static char copyright[] = @@ -76,52 +76,53 @@ struct in_addr limited_broadcast; at all, but as soon as I fix the resolver it should try to. */ #if defined (NSUPDATE) -char std_nsupdate [] = " \ -on commit { \ - if (not defined (ddns-fwd-name)) { \ - set ddns-fwd-name = concat (pick (config-option server.ddns-hostname, \ - option host-name), \".\", \ - pick (config-option server.ddns-domainname, \ - config-option domain-name)); \ - if defined (ddns-fwd-name) { \ - switch (ns-update (not exists (IN, A, ddns-fwd-name, null), \ - add (IN, A, ddns-fwd-name, leased-address, \ - lease-time / 2))) { \ - default: \ - unset ddns-fwd-name; \ - break; \ - \ - case NOERROR: \ - set ddns-rev-name = \ - concat (binary-to-ascii (10, 8, \".\", \ - reverse (1, leased-address)), \".\", \ - pick (config-option server.ddns-rev-domainname, \ - \".in-addr.arpa.\")); \ - switch (ns-update (delete (IN, PTR, ddns-rev-name, null), \ - add (IN, PTR, ddns-rev-name, ddns-fwd-name, \ - lease-time / 2))) \ - { \ - default: \ - unset ddns-rev-name; \ - on release or expiry { \ - eval ns-update (delete (IN, A, ddns-fwd-name, leased-address)); \ - unset ddns-fwd-name; \ - on release or expiry; \ - } \ - break; \ - \ - case NOERROR: \ - on release or expiry { \ - eval ns-update (delete (IN, A, ddns-fwd-name, leased-address)); \ - eval ns-update (delete (IN, PTR, ddns-rev-name, null)); \ - unset ddns-rev-name; \ - unset ddns-fwd-name; \ - on release or expiry; \ - } \ - } \ - } \ - } \ - } \ +char std_nsupdate [] = " \n\ +on commit { \n\ + if (not defined (ddns-fwd-name)) { \n\ + set ddns-fwd-name = concat (pick (config-option server.ddns-hostname, \n\ + option host-name), \".\", \n\ + pick (config-option server.ddns-domainname, \n\ + config-option domain-name)); \n\ + if defined (ddns-fwd-name) { \n\ + switch (ns-update (not exists (IN, A, ddns-fwd-name, null), \n\ + add (IN, A, ddns-fwd-name, leased-address, \n\ + lease-time / 2))) { \n\ + default: \n\ + unset ddns-fwd-name; \n\ + break; \n\ + \n\ + case NOERROR: \n\ + set ddns-rev-name = \n\ + concat (binary-to-ascii (10, 8, \".\", \n\ + reverse (1, \n\ + leased-address)), \".\", \n\ + pick (config-option server.ddns-rev-domainname, \n\ + \n\".in-addr.arpa.\")); \n\ + switch (ns-update (delete (IN, PTR, ddns-rev-name, null), \n\ + add (IN, PTR, ddns-rev-name, ddns-fwd-name, \n\ + lease-time / 2))) \n\ + { \n\ + default: \n\ + unset ddns-rev-name; \n\ + on release or expiry { \n\ + eval ns-update (delete (IN, A, ddns-fwd-name, leased-address)); \n\ + unset ddns-fwd-name; \n\ + on release or expiry; \n\ + } \n\ + break; \n\ + \n\ + case NOERROR: \n\ + on release or expiry { \n\ + eval ns-update (delete (IN, A, ddns-fwd-name, leased-address)); \n\ + eval ns-update (delete (IN, PTR, ddns-rev-name, null)); \n\ + unset ddns-rev-name; \n\ + unset ddns-fwd-name; \n\ + on release or expiry; \n\ + } \n\ + } \n\ + } \n\ + } \n\ + } \n\ }"; #endif /* NSUPDATE */ diff --git a/server/stables.c b/server/stables.c index 87a69dd0..a6c6b481 100644 --- a/server/stables.c +++ b/server/stables.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: stables.c,v 1.9 2000/03/18 02:15:52 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: stables.c,v 1.10 2000/03/18 03:34:11 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -748,10 +748,10 @@ void initialize_server_option_spaces() } /* Add the server and agent option spaces to the option space hash. */ - add_hash (&universe_hash, + add_hash (universe_hash, (const unsigned char *)agent_universe.name, 0, (unsigned char *)&agent_universe); - add_hash (&universe_hash, + add_hash (universe_hash, (const unsigned char *)server_universe.name, 0, (unsigned char *)&server_universe); |