diff options
author | Shawn Routhier <sar@isc.org> | 2015-07-13 12:06:50 -0700 |
---|---|---|
committer | Shawn Routhier <sar@isc.org> | 2015-07-13 12:06:50 -0700 |
commit | 45c332f037bf54134df5335ba9c888aea0c24d4d (patch) | |
tree | 6e71fbf81a321dd3be279d233b33f5f7fd9a2095 /common/parse.c | |
parent | 3496e9bc0e899e6120b8d4a2a7258fb30b4cf1f1 (diff) | |
download | isc-dhcp-45c332f037bf54134df5335ba9c888aea0c24d4d.tar.gz |
[master] Add code to parse a vendor option as directed by the user.
Add code to parse a vendor option. It is structured as an action
in the config language. When the statement is executed it attempts
to find a vendor option in the packet and a vendor option space
specified by the admin for use with that packet. It then calls
the proper parse routine to do the parsing.
Diffstat (limited to 'common/parse.c')
-rw-r--r-- | common/parse.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/common/parse.c b/common/parse.c index 94395cb6..22e7d582 100644 --- a/common/parse.c +++ b/common/parse.c @@ -2640,6 +2640,22 @@ int parse_executable_statement (result, cfile, lose, case_context) } break; + case PARSE_VENDOR_OPT: + /* The parse-vendor-option; The statement has no arguments. + * We simply set up the statement and when it gets executed it + * will find all information it needs in the packet and options. + */ + skip_token(&val, NULL, cfile); + if (!parse_semi(cfile)) { + *lose = 1; + return (0); + } + + if (!executable_statement_allocate(result, MDL)) + log_fatal("no memory for execute statement."); + (*result)->op = vendor_opt_statement; + break; + /* Not really a statement, but we parse it here anyway because it's appropriate for all DHCP agents with parsers. */ |