mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-31 06:15:55 +00:00
Support client-side vendor option space definitions.
This commit is contained in:
@@ -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)
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user