1998-06-25 03:58:24 +00:00
|
|
|
/* statement.h
|
|
|
|
|
|
|
|
Definitions for executable statements... */
|
|
|
|
|
|
|
|
/*
|
2017-07-12 09:23:23 -04:00
|
|
|
* Copyright (c) 2004-2017 by Internet Systems Consortium, Inc. ("ISC")
|
2005-03-17 20:15:29 +00:00
|
|
|
* Copyright (c) 1996-2003 by Internet Software Consortium
|
1998-06-25 03:58:24 +00:00
|
|
|
*
|
2017-07-12 09:23:23 -04:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
1998-06-25 03:58:24 +00:00
|
|
|
*
|
2005-03-17 20:15:29 +00:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
|
|
|
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
1998-06-25 03:58:24 +00:00
|
|
|
*
|
2005-03-17 20:15:29 +00:00
|
|
|
* Internet Systems Consortium, Inc.
|
|
|
|
* 950 Charter Street
|
|
|
|
* Redwood City, CA 94063
|
|
|
|
* <info@isc.org>
|
2009-07-23 18:52:21 +00:00
|
|
|
* https://www.isc.org/
|
2000-03-17 04:00:32 +00:00
|
|
|
*
|
1998-06-25 03:58:24 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
struct executable_statement {
|
1999-07-16 21:34:14 +00:00
|
|
|
int refcnt;
|
1998-06-25 03:58:24 +00:00
|
|
|
struct executable_statement *next;
|
|
|
|
enum statement_op {
|
2001-01-04 00:02:06 +00:00
|
|
|
null_statement,
|
1998-06-25 03:58:24 +00:00
|
|
|
if_statement,
|
|
|
|
add_statement,
|
|
|
|
eval_statement,
|
|
|
|
break_statement,
|
|
|
|
default_option_statement,
|
|
|
|
supersede_option_statement,
|
|
|
|
append_option_statement,
|
|
|
|
prepend_option_statement,
|
1998-11-05 18:48:37 +00:00
|
|
|
send_option_statement,
|
1999-07-16 21:34:14 +00:00
|
|
|
statements_statement,
|
2000-01-08 01:41:08 +00:00
|
|
|
on_statement,
|
|
|
|
switch_statement,
|
|
|
|
case_statement,
|
|
|
|
default_statement,
|
2000-01-25 01:19:46 +00:00
|
|
|
set_statement,
|
|
|
|
unset_statement,
|
2000-02-15 19:42:09 +00:00
|
|
|
let_statement,
|
2000-08-22 21:51:39 +00:00
|
|
|
define_statement,
|
2000-08-28 19:36:39 +00:00
|
|
|
log_statement,
|
2007-01-28 23:00:19 +00:00
|
|
|
return_statement,
|
2015-07-13 12:06:50 -07:00
|
|
|
execute_statement,
|
|
|
|
vendor_opt_statement
|
1998-06-25 03:58:24 +00:00
|
|
|
} op;
|
|
|
|
union {
|
|
|
|
struct {
|
2001-06-27 00:31:20 +00:00
|
|
|
struct executable_statement *tc, *fc;
|
1998-06-25 03:58:24 +00:00
|
|
|
struct expression *expr;
|
|
|
|
} ie;
|
|
|
|
struct expression *eval;
|
2000-08-28 19:36:39 +00:00
|
|
|
struct expression *retval;
|
1998-06-25 03:58:24 +00:00
|
|
|
struct class *add;
|
|
|
|
struct option_cache *option;
|
|
|
|
struct option_cache *supersede;
|
|
|
|
struct option_cache *prepend;
|
|
|
|
struct option_cache *append;
|
1999-07-16 21:34:14 +00:00
|
|
|
struct executable_statement *statements;
|
|
|
|
struct {
|
2000-01-08 01:41:08 +00:00
|
|
|
int evtypes;
|
|
|
|
# define ON_COMMIT 1
|
|
|
|
# define ON_EXPIRY 2
|
2000-01-25 01:19:46 +00:00
|
|
|
# define ON_RELEASE 4
|
2001-01-25 08:25:37 +00:00
|
|
|
# define ON_TRANSMISSION 8
|
1999-07-16 21:34:14 +00:00
|
|
|
struct executable_statement *statements;
|
|
|
|
} on;
|
2000-01-08 01:41:08 +00:00
|
|
|
struct {
|
|
|
|
struct expression *expr;
|
|
|
|
struct executable_statement *statements;
|
|
|
|
} s_switch;
|
|
|
|
struct expression *c_case;
|
|
|
|
struct {
|
|
|
|
char *name;
|
|
|
|
struct expression *expr;
|
2000-01-25 01:19:46 +00:00
|
|
|
struct executable_statement *statements;
|
|
|
|
} set, let;
|
|
|
|
char *unset;
|
2000-08-22 21:51:39 +00:00
|
|
|
struct {
|
|
|
|
enum {
|
|
|
|
log_priority_fatal,
|
|
|
|
log_priority_error,
|
|
|
|
log_priority_debug,
|
|
|
|
log_priority_info
|
|
|
|
} priority;
|
|
|
|
struct expression *expr;
|
|
|
|
} log;
|
2007-01-28 23:00:19 +00:00
|
|
|
struct {
|
|
|
|
char *command;
|
|
|
|
struct expression *arglist;
|
|
|
|
int argc;
|
|
|
|
} execute;
|
1998-06-25 03:58:24 +00:00
|
|
|
} data;
|
|
|
|
};
|
|
|
|
|