#ifndef lint
static char copyright[] =
-"$Id: clparse.c,v 1.46 2000/06/12 20:08:56 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
+"$Id: clparse.c,v 1.47 2000/06/24 05:53:35 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
top_level_config.bootp_policy = P_ACCEPT;
top_level_config.script_name = "/etc/dhclient-script";
top_level_config.requested_options = default_requested_options;
+ top_level_config.omapi_port = -1;
group_allocate (&top_level_config.on_receipt, MDL);
if (!top_level_config.on_receipt)
struct data_string key_id;
enum policy policy;
int known;
+ int tmp;
switch (peek_token (&val, cfile)) {
case KEY:
parse_lease_time (cfile, &config -> select_interval);
return;
+ case OMAPI:
+ token = next_token (&val, cfile);
+ if (token != PORT) {
+ parse_warn (cfile,
+ "unexpected omapi subtype: %s", val);
+ skip_to_semi (cfile);
+ return;
+ }
+ token = next_token (&val, cfile);
+ if (token != NUMBER) {
+ parse_warn (cfile, "invalid port number: `%s'", val);
+ skip_to_semi (cfile);
+ return;
+ }
+ tmp = atoi (val);
+ if (tmp < 0 || tmp > 65535)
+ parse_warn (cfile, "invalid omapi port %d.", tmp);
+ else if (config != &top_level_config)
+ parse_warn (cfile,
+ "omapi port only works at top level.");
+ else
+ config -> omapi_port = tmp;
+ parse_semi (cfile);
+ return;
+
case REBOOT:
token = next_token (&val, cfile);
parse_lease_time (cfile, &config -> reboot_timeout);