2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 14:25:41 +00:00

[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.
This commit is contained in:
Shawn Routhier
2015-07-13 12:06:50 -07:00
parent 3496e9bc0e
commit 45c332f037
9 changed files with 164 additions and 9 deletions

View File

@@ -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. */