diff options
author | Ted Lemon <source@isc.org> | 1999-07-16 21:34:14 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 1999-07-16 21:34:14 +0000 |
commit | 79a65726f0c4e83eea3f65e8c1fc88f882b06c12 (patch) | |
tree | 25dc1c97cbf23ca4be19ffa893bb62804d431249 /common/execute.c | |
parent | 343729b9b1e136cc7e734fa8606bf10ff97ecddf (diff) | |
download | isc-dhcp-79a65726f0c4e83eea3f65e8c1fc88f882b06c12.tar.gz |
Massive rototill to support some new DDNS features.
Diffstat (limited to 'common/execute.c')
-rw-r--r-- | common/execute.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/common/execute.c b/common/execute.c index 2c4eb8c4..72e5245d 100644 --- a/common/execute.c +++ b/common/execute.c @@ -22,7 +22,7 @@ #ifndef lint static char copyright[] = -"$Id: execute.c,v 1.10 1999/07/02 20:57:24 mellon Exp $ Copyright (c) 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: execute.c,v 1.11 1999/07/16 21:33:58 mellon Exp $ Copyright (c) 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -43,6 +43,46 @@ int execute_statements (packet, lease, in_options, out_options, statements) for (r = statements; r; r = r -> next) { switch (r -> op) { + case statements_statement: + log_info ("exec: statements"); + if (!execute_statements (packet, lease, + in_options, out_options, + r -> data.statements.car)) + return 0; + if (!execute_statements (packet, lease, + in_options, out_options, + r -> data.statements.cdr)) + return 0; + break; + + case on_statement: + if (lease) { + struct executable_statement **d; + switch (r -> data.on.evtype) { + case expiry: + d = &lease -> on_expiry; + break; + case commit: + d = &lease -> on_commit; + break; + case release: + d = &lease -> on_release; + break; + default: + log_fatal ("unknown event type %d %s", + r -> data.on.evtype, + "in on statement."); + break; + } + if (*d) + executable_statement_dereference + (d, "execute_statements"); + executable_statement_reference + (d, r -> data.on.statements, + "execute_statements"); + } + break; + case if_statement: status = evaluate_boolean_expression (&result, packet, |