mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-02 15:25:48 +00:00
Support defining new option names and codes.
Support server-identifier keyword.
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: confpars.c,v 1.65 1999/03/16 06:37:51 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: confpars.c,v 1.66 1999/03/25 22:05:19 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -383,10 +383,48 @@ int parse_statement (cfile, group, type, host_decl, declaration)
|
|||||||
parse_semi (cfile);
|
parse_semi (cfile);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* "server-identifier" is a special hack, equivalent to
|
||||||
|
"option dhcp-server-identifier". */
|
||||||
|
case SERVER_IDENTIFIER:
|
||||||
|
option = dhcp_universe.options [DHO_DHCP_SERVER_IDENTIFIER];
|
||||||
|
token = next_token (&val, cfile);
|
||||||
|
goto finish_option;
|
||||||
|
|
||||||
case OPTION:
|
case OPTION:
|
||||||
token = next_token (&val, cfile);
|
token = next_token (&val, cfile);
|
||||||
option = parse_option_name (cfile);
|
option = parse_option_name (cfile, 1);
|
||||||
if (option) {
|
if (option) {
|
||||||
|
token = peek_token (&val, cfile);
|
||||||
|
if (token == CODE) {
|
||||||
|
if (type != ROOT_GROUP) {
|
||||||
|
parse_warn ("option definitions%s%s",
|
||||||
|
" may not currently be",
|
||||||
|
" scoped.");
|
||||||
|
skip_to_semi (cfile);
|
||||||
|
free_option (option,
|
||||||
|
"parse_statement");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
next_token (&val, cfile);
|
||||||
|
if (!parse_option_code_definition (cfile,
|
||||||
|
option))
|
||||||
|
free_option (option,
|
||||||
|
"parse_statement");
|
||||||
|
return declaration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If this wasn't an option code definition, don't
|
||||||
|
allow an unknown option. */
|
||||||
|
if (option -> code == -1) {
|
||||||
|
parse_warn ("unknown option %s.%s",
|
||||||
|
option -> universe -> name,
|
||||||
|
option -> name);
|
||||||
|
skip_to_semi (cfile);
|
||||||
|
free_option (option, "parse_statement");
|
||||||
|
return declaration;
|
||||||
|
}
|
||||||
|
|
||||||
|
finish_option:
|
||||||
et = parse_option_statement
|
et = parse_option_statement
|
||||||
(cfile, 1, option,
|
(cfile, 1, option,
|
||||||
supersede_option_statement);
|
supersede_option_statement);
|
||||||
|
Reference in New Issue
Block a user