]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Support client-side vendor option space definitions.
authorTed Lemon <source@isc.org>
Tue, 10 Oct 2000 19:44:39 +0000 (19:44 +0000)
committerTed Lemon <source@isc.org>
Tue, 10 Oct 2000 19:44:39 +0000 (19:44 +0000)
client/clparse.c
client/dhclient.c

index 979152536f00e58368165f60056b93cb9761daff..2cf5654b8724e6f319c0e70d9cb435123c385fc6 100644 (file)
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: clparse.c,v 1.49 2000/08/03 20:59:31 neild Exp $ Copyright (c) 1996-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: clparse.c,v 1.50 2000/10/10 19:44:39 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -206,6 +206,7 @@ void read_client_leases ()
        REBOOT number |
        SELECT_TIMEOUT number |
        SCRIPT string |
+       VENDOR_SPACE string |
        interface-declaration |
        LEASE client-lease-statement |
        ALIAS client-lease-statement |
@@ -226,7 +227,7 @@ void parse_client_statement (cfile, ip, config)
        struct data_string key_id;
        enum policy policy;
        int known;
-       int tmp;
+       int tmp, i;
 
        switch (peek_token (&val, cfile)) {
              case KEY:
@@ -471,6 +472,31 @@ void parse_client_statement (cfile, ip, config)
                config -> script_name = parse_string (cfile);
                return;
 
+             case VENDOR:
+               token = next_token (&val, cfile);
+               token = next_token (&val, cfile);
+               if (token != OPTION) {
+                       parse_warn (cfile, "expecting 'vendor option space'");
+                       skip_to_semi (cfile);
+                       return;
+               }
+               token = next_token (&val, cfile);
+               if (token != SPACE) {
+                       parse_warn (cfile, "expecting 'vendor option space'");
+                       skip_to_semi (cfile);
+                       return;
+               }
+               config -> vendor_space_name = parse_string (cfile);
+               for (i = 0; i < universe_count; i++)
+                       if (!strcmp (universes [i] -> name,
+                                    config -> vendor_space_name))
+                               break;
+               if (i == universe_count) {
+                       log_error ("vendor option space %s not found.",
+                                  config -> vendor_space_name);
+               }
+               return;
+
              case INTERFACE:
                token = next_token (&val, cfile);
                if (ip)
index 83bf372dab87283396dabcc0412f7780f7076cd0..5dc71b3bc992962d8cdf88a3242e718da5e5815e 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhclient.c,v 1.114 2000/09/27 19:31:45 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhclient.c,v 1.115 2000/10/10 19:44:37 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -1740,7 +1740,8 @@ void make_discover (client, lease)
                cons_options ((struct packet *)0, &client -> packet,
                              (struct lease *)0, 0,
                              (struct option_state *)0, options,
-                             &global_scope, 0, 0, 0, (struct data_string *)0);
+                             &global_scope, 0, 0, 0, (struct data_string *)0,
+                             client -> config -> vendor_space_name);
        if (client -> packet_length < BOOTP_MIN_LEN)
                client -> packet_length = BOOTP_MIN_LEN;
 
@@ -1808,7 +1809,8 @@ void make_request (client, lease)
                cons_options ((struct packet *)0, &client -> packet,
                              (struct lease *)0, 0,
                              (struct option_state *)0, options,
-                             &global_scope, 0, 0, 0, (struct data_string *)0);
+                             &global_scope, 0, 0, 0, (struct data_string *)0,
+                             client -> config -> vendor_space_name);
        if (client -> packet_length < BOOTP_MIN_LEN)
                client -> packet_length = BOOTP_MIN_LEN;
 
@@ -1873,7 +1875,8 @@ void make_decline (client, lease)
                cons_options ((struct packet *)0, &client -> packet,
                              (struct lease *)0, 0,
                              (struct option_state *)0, options,
-                             &global_scope, 0, 0, 0, (struct data_string *)0);
+                             &global_scope, 0, 0, 0, (struct data_string *)0,
+                             client -> config -> vendor_space_name);
        if (client -> packet_length < BOOTP_MIN_LEN)
                client -> packet_length = BOOTP_MIN_LEN;
        option_state_dereference (&options, MDL);
@@ -1930,7 +1933,8 @@ void make_release (client, lease)
                cons_options ((struct packet *)0, &client -> packet,
                              (struct lease *)0, 0,
                              (struct option_state *)0, options,
-                             &global_scope, 0, 0, 0, (struct data_string *)0);
+                             &global_scope, 0, 0, 0, (struct data_string *)0,
+                             client -> config -> vendor_space_name);
        if (client -> packet_length < BOOTP_MIN_LEN)
                client -> packet_length = BOOTP_MIN_LEN;
        option_state_dereference (&options, MDL);