diff options
author | Ted Lemon <source@isc.org> | 2001-01-16 22:49:31 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 2001-01-16 22:49:31 +0000 |
commit | c5b5e7d1600975bf04696775c73c086ee8399e01 (patch) | |
tree | 127ab3dc83994f68d118cc009d06c93867858c0d | |
parent | 76981d9fcc1ff0408c897ce85dcff1c8572ac5ec (diff) | |
download | isc-dhcp-c5b5e7d1600975bf04696775c73c086ee8399e01.tar.gz |
Let the generic parser parse send statements.
-rw-r--r-- | client/clparse.c | 61 |
1 files changed, 10 insertions, 51 deletions
diff --git a/client/clparse.c b/client/clparse.c index abfc8339..0a6910ce 100644 --- a/client/clparse.c +++ b/client/clparse.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: clparse.c,v 1.52 2000/11/28 22:07:09 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: clparse.c,v 1.53 2001/01/16 22:49:31 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -312,24 +312,6 @@ void parse_client_statement (cfile, ip, config) } break; - case SEND: - p = &config -> on_transmission -> statements; - op = supersede_option_statement; - do_option: - token = next_token (&val, cfile); - known = 0; - option = parse_option_name (cfile, 0, &known); - if (!option) - return; - stmt = (struct executable_statement *)0; - if (!parse_option_statement (&stmt, cfile, 1, option, op)) - return; - for (; *p; p = &((*p) -> next)) - ; - executable_statement_reference (p, stmt, MDL); - stmt -> next = (struct executable_statement *)0; - return; - case OPTION: token = next_token (&val, cfile); @@ -369,26 +351,6 @@ void parse_client_statement (cfile, ip, config) free_option (option, MDL); return; - case DEFAULT: - p = &config -> on_receipt -> statements; - op = default_option_statement; - goto do_option; - - case SUPERSEDE: - p = &config -> on_receipt -> statements; - op = supersede_option_statement; - goto do_option; - - case APPEND: - p = &config -> on_receipt -> statements; - op = append_option_statement; - goto do_option; - - case PREPEND: - p = &config -> on_receipt -> statements; - op = prepend_option_statement; - goto do_option; - case MEDIA: token = next_token (&val, cfile); parse_string_list (cfile, &config -> media, 1); @@ -549,18 +511,15 @@ void parse_client_statement (cfile, ip, config) skip_to_semi (cfile); } } else { - if (!config -> on_receipt -> statements) { - executable_statement_reference - (&config -> on_receipt -> statements, - stmt, MDL); - } else { - struct executable_statement *s; - for (s = config -> on_receipt -> statements; - s -> next; s = s -> next) - ; - executable_statement_reference (&s -> next, - stmt, MDL); - } + struct executable_statement **eptr; + if (stmt -> op == send_option_statement) + eptr = &config -> on_transmission -> statements; + else + eptr = &config -> on_receipt -> statements; + + for (; *eptr; eptr = &(*eptr) -> next) + ; + executable_statement_reference (eptr, stmt, MDL); return; } break; |