]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Make universe_hash using new_hash.
authorTed Lemon <source@isc.org>
Sat, 18 Mar 2000 03:34:11 +0000 (03:34 +0000)
committerTed Lemon <source@isc.org>
Sat, 18 Mar 2000 03:34:11 +0000 (03:34 +0000)
common/options.c
common/parse.c
common/tables.c
includes/dhcpd.h
server/dhcp.c
server/dhcpd.c
server/stables.c

index 5e6e5a1f0b47d99bdde4a78915ce598520cc5452..559e3abd50f48f7651a8377a8d54f24769c085e5 100644 (file)
@@ -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);
index eb70a8c3e37a68c75caaf171fec9997df3b23f25..76ff234a8dac30c55f2940985f5ff762a524590a 100644 (file)
@@ -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);
 }
index e2fdb666a75e03d0a34f92362aa89c13a435d1c3..614f53cde54354179efcd8bb653e0552b2a5e357 100644 (file)
@@ -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);
 }
index 2ea3c42d7ffd48b839cfc90e390cebe8811d1622..40401cc5be8d2b482c7566737659c27816221779 100644 (file)
@@ -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;
 
index 9a8ac1bbfb8827d302f2ea9439814b2dbd8a6016..9efb12dba55b261edda194ad6eca581f8de0c613 100644 (file)
@@ -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;
index 9f246432eeb455a78a54aca2d3e5c9a1e9ba0a43..e7da2e21736b0e1a946a3854a1a3c7f9e405aa1a 100644 (file)
@@ -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 */
 
index 87a69dd0d8d264111ed0aa56d42aff3ba2216aa5..a6c6b4816c91a7ecea423f78eb9bad586fb7618e 100644 (file)
@@ -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);