From: Damien Neil Date: Mon, 28 Aug 2000 19:36:39 +0000 (+0000) Subject: Finished up function call support. X-Git-Tag: V3-BETA-2-PATCH-1~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b234d446fbc53a26b589337d895c6023af74b09;p=thirdparty%2Fdhcp.git Finished up function call support. --- diff --git a/client/dhclient.c b/client/dhclient.c index 2af3e9679..c33fdc501 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -41,7 +41,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhclient.c,v 1.110 2000/07/27 09:02:23 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n"; +"$Id: dhclient.c,v 1.111 2000/08/28 19:36:39 neild Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1696,7 +1696,8 @@ void make_client_options (client, lease, type, sid, rip, prl, op) /* Run statements that need to be run on transmission. */ if (client -> config -> on_transmission) execute_statements_in_scope - ((struct packet *)0, (struct lease *)0, + ((struct binding_value **)0, + (struct packet *)0, (struct lease *)0, (lease ? lease -> options : (struct option_state *)0), *op, &global_scope, client -> config -> on_transmission, @@ -2226,7 +2227,8 @@ void script_write_params (client, prefix, lease) client_envadd (client, prefix, "server_name", "%s", lease -> server_name); - execute_statements_in_scope ((struct packet *)0, + execute_statements_in_scope ((struct binding_value **)0, + (struct packet *)0, (struct lease *)0, lease -> options, lease -> options, &global_scope, client -> config -> on_receipt, diff --git a/common/conflex.c b/common/conflex.c index 28af696f0..a06e2e490 100644 --- a/common/conflex.c +++ b/common/conflex.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: conflex.c,v 1.79 2000/08/24 18:20:47 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: conflex.c,v 1.80 2000/08/28 19:36:27 neild Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -860,6 +860,8 @@ static enum dhcp_token intern (atom, dfv) return REQUIRE; if (!strcasecmp (atom + 1, "etry")) return RETRY; + if (!strcasecmp (atom + 1, "eturn")) + return RETURN; if (!strcasecmp (atom + 1, "enew")) return RENEW; if (!strcasecmp (atom + 1, "ebind")) diff --git a/common/dhcp-eval.5 b/common/dhcp-eval.5 index 7d33bd675..59cfc75bf 100644 --- a/common/dhcp-eval.5 +++ b/common/dhcp-eval.5 @@ -350,6 +350,33 @@ the current time and the time that the lease expires. Any number between zero and the maximum representable size may be specified as a numeric expression. .RE +.SH +FUNCTIONS +Functions may be defined with the \fBdefine\fR statement. A function +definition may occur anywhere that regular statement may appear. +Functions occupy the same namespace as variables, and obey the same +scoping rules. +.PP +.nf +define set-hostname(prefix) { + option host-name + concat (prefix, binary-to-ascii (16, 32, "", leased-address)); +} +.fi +.PP +A function may return a value when used in an expression with the +\fBreturn\fR statement. A function with no return statement has a +value of null. +.PP +.nf +define make-hostname(prefix) { + return concat (prefix, binary-to-ascii (16, 32, "", leased-address)); +} + +option host-name make-hostname("dyn-"); +.fi +.PP +.RE .SH REFERENCE: LOGGING Logging statements may be used to send information to the standard logging channels. A logging statement includes an optional priority (\fBfatal\fR, diff --git a/common/execute.c b/common/execute.c index e665ee795..9451bf200 100644 --- a/common/execute.c +++ b/common/execute.c @@ -43,14 +43,15 @@ #ifndef lint static char copyright[] = -"$Id: execute.c,v 1.38 2000/08/23 00:32:46 neild Exp $ Copyright (c) 1998-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: execute.c,v 1.39 2000/08/28 19:36:30 neild Exp $ Copyright (c) 1998-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" #include -int execute_statements (packet, lease, in_options, out_options, scope, +int execute_statements (result, packet, lease, in_options, out_options, scope, statements) + struct binding_value **result; struct packet *packet; struct lease *lease; struct option_state *in_options; @@ -59,7 +60,7 @@ int execute_statements (packet, lease, in_options, out_options, scope, struct executable_statement *statements; { struct executable_statement *r, *e, *next; - int result; + int rc; int status; unsigned long num; struct binding_scope *outer; @@ -74,7 +75,7 @@ int execute_statements (packet, lease, in_options, out_options, scope, next = (struct executable_statement *)0; e = (struct executable_statement *)0; executable_statement_reference (&r, statements, MDL); - while (r) { + while (r && !(result && *result)) { if (r -> next) executable_statement_reference (&next, r -> next, MDL); switch (r -> op) { @@ -82,8 +83,9 @@ int execute_statements (packet, lease, in_options, out_options, scope, #if defined (DEBUG_EXPRESSIONS) log_debug ("exec: statements"); #endif - status = execute_statements (packet, lease, in_options, - out_options, scope, + status = execute_statements (result, packet, lease, + in_options, out_options, + scope, r -> data.statements); #if defined (DEBUG_EXPRESSIONS) log_debug ("exec: statements returns %d", status); @@ -147,7 +149,7 @@ int execute_statements (packet, lease, in_options, out_options, scope, #endif if (status) { if (!(execute_statements - (packet, lease, + (result, packet, lease, in_options, out_options, scope, e))) { executable_statement_dereference (&e, MDL); @@ -164,20 +166,21 @@ int execute_statements (packet, lease, in_options, out_options, scope, case if_statement: status = (evaluate_boolean_expression - (&result, packet, lease, in_options, + (&rc, packet, lease, in_options, out_options, scope, r -> data.ie.expr)); #if defined (DEBUG_EXPRESSIONS) log_debug ("exec: if %s", (status - ? (result ? "true" : "false") + ? (rc ? "true" : "false") : "NULL")); #endif /* XXX Treat NULL as false */ if (!status) - result = 0; + rc = 0; if (!execute_statements - (packet, lease, in_options, out_options, scope, - result ? r -> data.ie.true : r -> data.ie.false)) + (result, packet, lease, + in_options, out_options, scope, + rc ? r -> data.ie.true : r -> data.ie.false)) return 0; break; @@ -192,6 +195,16 @@ int execute_statements (packet, lease, in_options, out_options, scope, #endif break; + case return_statement: + status = evaluate_expression + (result, packet, lease, in_options, + out_options, scope, r -> data.retval); +#if defined (DEBUG_EXPRESSIONS) + log_debug ("exec: return: %s", + (status ? "succeeded" : "failed")); +#endif + break; + case add_statement: #if defined (DEBUG_EXPRESSIONS) log_debug ("exec: add %s", (r -> data.add -> name @@ -244,6 +257,7 @@ int execute_statements (packet, lease, in_options, out_options, scope, break; case set_statement: + case define_statement: if (!scope) { log_error ("set %s: no scope", r -> data.set.name); @@ -286,10 +300,27 @@ int execute_statements (packet, lease, in_options, out_options, scope, if (binding -> value) binding_value_dereference (&binding -> value, MDL); - status = (evaluate_expression - (&binding -> value, packet, lease, - in_options, out_options, - scope, r -> data.set.expr)); + if (r -> op == set_statement) { + status = (evaluate_expression + (&binding -> value, packet, + lease, in_options, + out_options, scope, + r -> data.set.expr)); + } else { + if (!(binding_value_allocate + (&binding -> value, MDL))) { + dfree (binding, MDL); + binding = (struct binding *)0; + } + if (binding -> value) { + binding -> value -> type = + binding_function; + (fundef_reference + (&binding -> value -> value.fundef, + r -> data.set.expr -> data.func, + MDL)); + } + } } #if defined (DEBUG_EXPRESSIONS) log_debug ("exec: set %s%s", r -> data.set.name, @@ -372,7 +403,8 @@ int execute_statements (packet, lease, in_options, out_options, scope, binding_scope_reference (&ns -> outer, *scope, MDL); execute_statements - (packet, lease, in_options, out_options, + (result, packet, lease, + in_options, out_options, &ns, e -> data.let.statements); } if (ns) @@ -433,8 +465,9 @@ int execute_statements (packet, lease, in_options, out_options, scope, specific scopes, so we recursively traverse the scope list, executing the most outer scope first. */ -void execute_statements_in_scope (packet, lease, in_options, out_options, - scope, group, limiting_group) +void execute_statements_in_scope (result, packet, lease, in_options, + out_options, scope, group, limiting_group) + struct binding_value **result; struct packet *packet; struct lease *lease; struct option_state *in_options; @@ -478,11 +511,11 @@ void execute_statements_in_scope (packet, lease, in_options, out_options, } if (group -> next) - execute_statements_in_scope (packet, lease, + execute_statements_in_scope (result, packet, lease, in_options, out_options, scope, group -> next, limiting_group); - execute_statements (packet, lease, in_options, out_options, scope, - group -> statements); + execute_statements (result, packet, lease, in_options, out_options, + scope, group -> statements); } /* Dereference or free any subexpressions of a statement being freed. */ @@ -571,6 +604,12 @@ int executable_statement_dereference (ptr, file, line) file, line); break; + case return_statement: + if ((*ptr) -> data.eval) + expression_dereference (&(*ptr) -> data.eval, + file, line); + break; + case set_statement: if ((*ptr)->data.set.name) dfree ((*ptr)->data.set.name, file, line); @@ -722,6 +761,11 @@ void write_statements (file, statements, indent) fprintf (file, ";"); break; + case return_statement: + indent_spaces (file, indent); + fprintf (file, "return;"); + break; + case add_statement: indent_spaces (file, indent); fprintf (file, "add \"%s\"", r -> data.add -> name); diff --git a/common/parse.c b/common/parse.c index aa30e75e1..9b3f5a308 100644 --- a/common/parse.c +++ b/common/parse.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: parse.c,v 1.79 2000/08/22 21:51:30 neild Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: parse.c,v 1.80 2000/08/28 19:36:31 neild Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1650,8 +1650,29 @@ int parse_executable_statement (result, cfile, lose, case_context) parse_semi (cfile); break; + case RETURN: + token = next_token (&val, cfile); + + if (!executable_statement_allocate (result, MDL)) + log_fatal ("no memory for return statement."); + (*result) -> op = return_statement; + + if (!parse_expression (&(*result) -> data.retval, + cfile, lose, context_data, + (struct expression **)0, expr_none)) { + if (!*lose) + parse_warn (cfile, + "expecting data expression."); + else + *lose = 1; + skip_to_semi (cfile); + executable_statement_dereference (result, MDL); + return 0; + } + parse_semi (cfile); + break; + case LOG: - /** XXXDPN: At work. **/ token = next_token (&val, cfile); if (!executable_statement_allocate (result, MDL)) @@ -1772,6 +1793,31 @@ int parse_executable_statement (result, cfile, lose, case_context) supersede_option_statement); } } + + if (token == NUMBER_OR_NAME || token == NAME) { + /* This is rather ugly. Since function calls are + data expressions, fake up an eval statement. */ + if (!executable_statement_allocate (result, MDL)) + log_fatal ("no memory for eval statement."); + (*result) -> op = eval_statement; + + if (!parse_expression (&(*result) -> data.eval, + cfile, lose, context_data, + (struct expression **)0, + expr_none)) { + if (!*lose) + parse_warn (cfile, "expecting " + "function call."); + else + *lose = 1; + skip_to_semi (cfile); + executable_statement_dereference (result, MDL); + return 0; + } + parse_semi (cfile); + break; + } + *lose = 0; return 0; } diff --git a/common/tree.c b/common/tree.c index 5c0ed5d50..dd0f44fee 100644 --- a/common/tree.c +++ b/common/tree.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: tree.c,v 1.86 2000/08/22 21:21:54 neild Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: tree.c,v 1.87 2000/08/28 19:36:32 neild Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -531,27 +531,13 @@ int evaluate_expression (result, packet, lease, if (scope && *scope) binding_scope_reference (&ns -> outer, *scope, MDL); - if (execute_statements - (packet, lease, in_options, cfg_options, &ns, - binding -> value -> value.fundef -> statements)) { - if (ns -> bindings && ns -> bindings -> name) { - binding_value_reference (result, - ns -> bindings -> value, - MDL); - status = 1; - } else - status = 0; - } else - status = 0; + status = (execute_statements + (&bv, packet, lease, in_options, cfg_options, &ns, + binding -> value -> value.fundef -> statements)); binding_scope_dereference (&ns, MDL); - return status; - } else if (expr -> op == expr_funcall) { - /* XXXDPN: This can never happen. Huh? */ - if (!binding_value_allocate (&bv, MDL)) - return 0; - bv -> type = binding_function; - fundef_reference (&bv -> value.fundef, expr -> data.func, MDL); - return 1; + + if (!bv) + return 1; } else if (is_boolean_expression (expr)) { if (!binding_value_allocate (&bv, MDL)) return 0; @@ -585,6 +571,7 @@ int evaluate_expression (result, packet, lease, } else { log_error ("%s: invalid expression type: %d", "evaluate_expression", expr -> op); + return 0; } if (result) binding_value_reference (result, bv, MDL); diff --git a/includes/dhcpd.h b/includes/dhcpd.h index 1fef33ff7..bba992d0c 100644 --- a/includes/dhcpd.h +++ b/includes/dhcpd.h @@ -1790,12 +1790,14 @@ int unbill_class PROTO ((struct lease *, struct class *)); int bill_class PROTO ((struct lease *, struct class *)); /* execute.c */ -int execute_statements PROTO ((struct packet *, +int execute_statements PROTO ((struct binding_value **result, + struct packet *, struct lease *, struct option_state *, struct option_state *, struct binding_scope **, struct executable_statement *)); -void execute_statements_in_scope PROTO ((struct packet *, +void execute_statements_in_scope PROTO ((struct binding_value **result, + struct packet *, struct lease *, struct option_state *, struct option_state *, diff --git a/includes/dhctoken.h b/includes/dhctoken.h index 2dc096fa8..8adbd3ab0 100644 --- a/includes/dhctoken.h +++ b/includes/dhctoken.h @@ -283,7 +283,8 @@ enum dhcp_token { FATAL = 582, ERROR = 583, TOKEN_DEBUG = 584, - INFO = 585 + INFO = 585, + RETURN = 586 }; #define is_identifier(x) ((x) >= FIRST_TOKEN && \ diff --git a/includes/statement.h b/includes/statement.h index 808980007..0d93b36cc 100644 --- a/includes/statement.h +++ b/includes/statement.h @@ -63,7 +63,8 @@ struct executable_statement { unset_statement, let_statement, define_statement, - log_statement + log_statement, + return_statement } op; union { struct { @@ -71,6 +72,7 @@ struct executable_statement { struct expression *expr; } ie; struct expression *eval; + struct expression *retval; struct class *add; struct option_cache *option; struct option_cache *supersede; diff --git a/server/bootp.c b/server/bootp.c index 88d0694cb..24e45075c 100644 --- a/server/bootp.c +++ b/server/bootp.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: bootp.c,v 1.64 2000/08/24 18:43:11 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: bootp.c,v 1.65 2000/08/28 19:36:08 neild Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -155,20 +155,23 @@ void bootp (packet) option_state_allocate (&options, MDL); /* Execute the subnet statements. */ - execute_statements_in_scope (packet, lease, packet -> options, options, + execute_statements_in_scope ((struct binding_value **)0, + packet, lease, packet -> options, options, &lease -> scope, lease -> subnet -> group, (struct group *)0); /* Execute statements from class scopes. */ for (i = packet -> class_count; i > 0; i--) { execute_statements_in_scope - (packet, lease, packet -> options, options, + ((struct binding_value **)0, + packet, lease, packet -> options, options, &lease -> scope, packet -> classes [i - 1] -> group, lease -> subnet -> group); } /* Execute the host statements. */ - execute_statements_in_scope (packet, lease, packet -> options, options, + execute_statements_in_scope ((struct binding_value **)0, + packet, lease, packet -> options, options, &lease -> scope, hp -> group, subnet -> group); @@ -315,7 +318,8 @@ void bootp (packet) } /* Execute the commit statements, if there are any. */ - execute_statements (packet, lease, packet -> options, + execute_statements ((struct binding_value **)0, + packet, lease, packet -> options, options, &lease -> scope, lease -> on_commit); /* We're done with the option state. */ diff --git a/server/class.c b/server/class.c index d02ce08db..fb1b66b6d 100644 --- a/server/class.c +++ b/server/class.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: class.c,v 1.20 2000/05/16 23:03:36 mellon Exp $ Copyright (c) 1998-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: class.c,v 1.21 2000/08/28 19:36:09 neild Exp $ Copyright (c) 1998-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ @@ -84,7 +84,8 @@ void classification_setup () void classify_client (packet) struct packet *packet; { - execute_statements (packet, (struct lease *)0, packet -> options, + execute_statements ((struct binding_value **)0, + packet, (struct lease *)0, packet -> options, (struct option_state *)0, &global_scope, default_classification_rules); } diff --git a/server/dhcp.c b/server/dhcp.c index 399c8d55b..57ff9c3cd 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.160 2000/08/24 18:49:34 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.161 2000/08/28 19:36:10 neild Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -578,7 +578,8 @@ void dhcpdecline (packet, ms_nulltp) /* Execute statements in scope starting with the subnet scope. */ if (lease) - execute_statements_in_scope (packet, (struct lease *)0, + execute_statements_in_scope ((struct binding_value **)0, + packet, (struct lease *)0, packet -> options, options, &global_scope, lease -> subnet -> group, @@ -587,7 +588,8 @@ void dhcpdecline (packet, ms_nulltp) /* Execute statements in the class scopes. */ for (i = packet -> class_count; i > 0; i--) { execute_statements_in_scope - (packet, (struct lease *)0, packet -> options, options, + ((struct binding_value **)0, + packet, (struct lease *)0, packet -> options, options, &global_scope, packet -> classes [i - 1] -> group, lease ? lease -> subnet -> group : (struct group *)0); } @@ -718,7 +720,8 @@ void dhcpinform (packet, ms_nulltp) /* Execute statements in scope starting with the subnet scope. */ if (subnet) - execute_statements_in_scope (packet, (struct lease *)0, + execute_statements_in_scope ((struct binding_value **)0, + packet, (struct lease *)0, packet -> options, options, &global_scope, subnet -> group, (struct group *)0); @@ -726,7 +729,8 @@ void dhcpinform (packet, ms_nulltp) /* Execute statements in the class scopes. */ for (i = packet -> class_count; i > 0; i--) { execute_statements_in_scope - (packet, (struct lease *)0, packet -> options, options, + ((struct binding_value **)0, + packet, (struct lease *)0, packet -> options, options, &global_scope, packet -> classes [i - 1] -> group, subnet ? subnet -> group : (struct group *)0); } @@ -1249,7 +1253,8 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp) } /* Execute statements in scope starting with the subnet scope. */ - execute_statements_in_scope (packet, lease, + execute_statements_in_scope ((struct binding_value **)0, + packet, lease, packet -> options, state -> options, &lease -> scope, lease -> subnet -> group, @@ -1257,7 +1262,8 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp) /* If the lease is from a pool, run the pool scope. */ if (lease -> pool) - execute_statements_in_scope (packet, lease, + execute_statements_in_scope ((struct binding_value **)0, + packet, lease, packet -> options, state -> options, &lease -> scope, lease -> pool -> group, @@ -1266,7 +1272,8 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp) /* Execute statements from class scopes. */ for (i = packet -> class_count; i > 0; i--) { execute_statements_in_scope - (packet, lease, packet -> options, state -> options, + ((struct binding_value **)0, + packet, lease, packet -> options, state -> options, &lease -> scope, packet -> classes [i - 1] -> group, (lease -> pool ? lease -> pool -> group @@ -1276,7 +1283,8 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp) /* If we have a host_decl structure, run the options associated with its group. */ if (lease -> host) - execute_statements_in_scope (packet, lease, packet -> options, + execute_statements_in_scope ((struct binding_value **)0, + packet, lease, packet -> options, state -> options, &lease -> scope, lease -> host -> group, (lease -> pool @@ -1786,7 +1794,8 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp) /* If there are statements to execute when the lease is committed, execute them. */ if (lease -> on_commit && (!offer || offer == DHCPACK)) { - execute_statements (packet, lt, packet -> options, + execute_statements ((struct binding_value **)0, + packet, lt, packet -> options, state -> options, &lease -> scope, lease -> on_commit); if (lease -> on_commit) diff --git a/server/dhcpd.c b/server/dhcpd.c index b96eb8cb5..6b8351047 100644 --- a/server/dhcpd.c +++ b/server/dhcpd.c @@ -43,7 +43,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhcpd.c,v 1.99 2000/08/07 20:28:13 neild Exp $ Copyright 1995-2000 Internet Software Consortium."; +"$Id: dhcpd.c,v 1.100 2000/08/28 19:36:12 neild Exp $ Copyright 1995-2000 Internet Software Consortium."; #endif static char copyright[] = @@ -377,7 +377,8 @@ int main (argc, argv, envp) /* Now try to get the lease file name. */ option_state_allocate (&options, MDL); - execute_statements_in_scope ((struct packet *)0, + execute_statements_in_scope ((struct binding_value **)0, + (struct packet *)0, (struct lease *)0, (struct option_state *)0, options, &global_scope, diff --git a/server/mdb.c b/server/mdb.c index d9bf52a05..8475c456c 100644 --- a/server/mdb.c +++ b/server/mdb.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: mdb.c,v 1.41 2000/07/27 09:03:08 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: mdb.c,v 1.42 2000/08/28 19:36:13 neild Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1033,7 +1033,8 @@ void process_state_transition (struct lease *lease) lease -> binding_state == FTS_RESERVED) && lease -> next_binding_state != FTS_RELEASED) { if (lease -> on_expiry) { - execute_statements ((struct packet *)0, lease, + execute_statements ((struct binding_value **)0, + (struct packet *)0, lease, (struct option_state *)0, (struct option_state *)0, /* XXX */ &lease -> scope, @@ -1058,7 +1059,8 @@ void process_state_transition (struct lease *lease) lease -> binding_state == FTS_RESERVED) && lease -> next_binding_state == FTS_RELEASED) { if (lease -> on_release) { - execute_statements ((struct packet *)0, lease, + execute_statements ((struct binding_value **)0, + (struct packet *)0, lease, (struct option_state *)0, (struct option_state *)0, /* XXX */ &lease -> scope, @@ -1174,7 +1176,8 @@ void release_lease (lease, packet) /* If there are statements to execute when the lease is released, execute them. */ if (lease -> on_release) { - execute_statements (packet, lease, packet -> options, + execute_statements ((struct binding_value **)0, + packet, lease, packet -> options, (struct option_state *)0, /* XXX */ &lease -> scope, lease -> on_release); if (lease -> on_release)