3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 2001 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
13 #include <wsutil/regex.h>
14 #include "dfilter-int.h"
15 #include "syntax-tree.h"
17 #include "dfunctions.h"
19 #define ASSERT_DFVM_OP_NOT_REACHED(op) \
20 ws_error("Invalid dfvm opcode '%s'.", dfvm_opcode_tostr(op))
36 dfvm_value_type_t type
;
39 GPtrArray
*fvalue_p
; /* Always has length == 1 */
42 header_field_info
*hfinfo
;
43 df_func_def_t
*funcdef
;
50 #define dfvm_value_get_fvalue(val) ((val)->value.fvalue_p->pdata[0])
53 DFVM_NULL
, /* Null/invalid opcode */
63 DFVM_READ_REFERENCE_R
,
106 dfvm_opcode_tostr(dfvm_opcode_t code
);
117 dfvm_insn_new(dfvm_opcode_t op
);
120 dfvm_insn_replace_no_op(dfvm_insn_t
*insn
);
123 dfvm_insn_free(dfvm_insn_t
*insn
);
126 dfvm_value_new(dfvm_value_type_t type
);
129 dfvm_value_ref(dfvm_value_t
*v
);
132 dfvm_value_unref(dfvm_value_t
*v
);
135 dfvm_value_new_fvalue(fvalue_t
*fv
);
138 dfvm_value_new_hfinfo(header_field_info
*hfinfo
, bool raw
);
141 dfvm_value_new_register(int reg
);
144 dfvm_value_new_drange(drange_t
*dr
);
147 dfvm_value_new_funcdef(df_func_def_t
*funcdef
);
150 dfvm_value_new_pcre(ws_regex_t
*re
);
153 dfvm_value_new_uint(unsigned num
);
156 dfvm_dump(FILE *f
, dfilter_t
*df
, uint16_t flags
);
159 dfvm_dump_str(wmem_allocator_t
*alloc
, dfilter_t
*df
, uint16_t flags
);
162 dfvm_apply(dfilter_t
*df
, proto_tree
*tree
);
165 dfvm_apply_full(dfilter_t
*df
, proto_tree
*tree
, GPtrArray
**fvals
);
168 dfvm_get_raw_fvalue(const field_info
*fi
);