From: Ted Lemon Date: Tue, 10 Oct 2000 19:44:39 +0000 (+0000) Subject: Support client-side vendor option space definitions. X-Git-Tag: V3-BETA-2-PATCH-7~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce75142f5e904fbeef4f6dd2e1912bc84de0039b;p=thirdparty%2Fdhcp.git Support client-side vendor option space definitions. --- diff --git a/client/clparse.c b/client/clparse.c index 979152536..2cf5654b8 100644 --- a/client/clparse.c +++ b/client/clparse.c @@ -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) diff --git a/client/dhclient.c b/client/dhclient.c index 83bf372da..5dc71b3bc 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -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);