From 45c332f037bf54134df5335ba9c888aea0c24d4d Mon Sep 17 00:00:00 2001 From: Shawn Routhier Date: Mon, 13 Jul 2015 12:06:50 -0700 Subject: [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. --- common/parse.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'common/parse.c') 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. */ -- cgit v1.2.1