From: Ted Lemon Date: Tue, 16 Jan 2001 22:49:31 +0000 (+0000) Subject: Let the generic parser parse send statements. X-Git-Tag: V3-BETA-2-PATCH-12~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5b5e7d1600975bf04696775c73c086ee8399e01;p=thirdparty%2Fdhcp.git Let the generic parser parse send statements. --- diff --git a/client/clparse.c b/client/clparse.c index abfc8339c..0a6910ce1 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;