|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
#include <wsutil/regex.h>#include "dfilter-int.h"#include "syntax-tree.h"#include "drange.h"#include "dfunctions.h"Go to the source code of this file.
Classes | |
| struct | dfvm_value_t |
| Represents a typed value used in display filter virtual machine (DFVM) operations. More... | |
| struct | dfvm_insn_t |
Macros | |
| #define | ASSERT_DFVM_OP_NOT_REACHED(op) ws_error("Invalid dfvm opcode '%s'.", dfvm_opcode_tostr(op)) |
| #define | dfvm_value_get_fvalue(val) ((val)->value.fvalue_p->pdata[0]) |
Functions | |
| const char * | dfvm_opcode_tostr (dfvm_opcode_t code) |
| Converts a DFVM opcode to its string representation. | |
| dfvm_insn_t * | dfvm_insn_new (dfvm_opcode_t op) |
| Creates a new DFVM instruction with the specified opcode. | |
| void | dfvm_insn_replace_no_op (dfvm_insn_t *insn) |
| Replaces an instruction with a no-op. | |
| void | dfvm_insn_free (dfvm_insn_t *insn) |
| Free a DFVM instruction. | |
| dfvm_value_t * | dfvm_value_new (dfvm_value_type_t type) |
| Create a new DFVM value. | |
| dfvm_value_t * | dfvm_value_ref (dfvm_value_t *v) |
| Increment the reference count of a dfvm_value_t. | |
| void | dfvm_value_unref (dfvm_value_t *v) |
| Decrements the reference count of a dfvm_value_t object and frees it if the reference count reaches zero. | |
| dfvm_value_t * | dfvm_value_new_fvalue (fvalue_t *fv) |
| Creates a new DFVM value of type FVALUE. | |
| dfvm_value_t * | dfvm_value_new_hfinfo (header_field_info *hfinfo, bool raw, bool val_str) |
| Create a new dfvm_value_t with header field information. | |
| dfvm_value_t * | dfvm_value_new_register (int reg) |
| Creates a new dfvm_value_t representing a register. | |
| dfvm_value_t * | dfvm_value_new_drange (drange_t *dr) |
| Creates a new dfvm_value_t with type DRANGE. | |
| dfvm_value_t * | dfvm_value_new_funcdef (df_func_def_t *funcdef) |
| Create a new DFVM value of type FUNCTION_DEF. | |
| dfvm_value_t * | dfvm_value_new_pcre (ws_regex_t *re) |
| Creates a new PCRE value. | |
| dfvm_value_t * | dfvm_value_new_uint (unsigned num) |
| Create a new DFVM value with an unsigned integer. | |
| void | dfvm_dump (FILE *f, dfilter_t *df, uint16_t flags) |
| Dumps the bytecode of a dfilter_t to a file. | |
| char * | dfvm_dump_str (wmem_allocator_t *alloc, dfilter_t *df, uint16_t flags) |
| Dumps a string representation of a dfilter. | |
| bool | dfvm_apply (dfilter_t *df, proto_tree *tree) |
| Applies a display filter to a protocol tree. | |
| bool | dfvm_apply_full (dfilter_t *df, proto_tree *tree, GPtrArray **fvals) |
| Apply a full Dissector Filter VM (DFVM) to a protocol tree. | |
| fvalue_t * | dfvm_get_raw_fvalue (const field_info *fi) |
| Retrieves the raw value of a field as a GByteArray. | |
Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 2001 Gerald Combs
SPDX-License-Identifier: GPL-2.0-or-later
| bool dfvm_apply | ( | dfilter_t * | df, |
| proto_tree * | tree | ||
| ) |
Applies a display filter to a protocol tree.
| df | The display filter to apply. |
| tree | The protocol tree to which the filter will be applied. |
| bool dfvm_apply_full | ( | dfilter_t * | df, |
| proto_tree * | tree, | ||
| GPtrArray ** | fvals | ||
| ) |
Apply a full Dissector Filter VM (DFVM) to a protocol tree.
This function executes all instructions in the DFVM on the given protocol tree, updating the filter values accordingly.
| df | The Dissector Filter VM to apply. |
| tree | The protocol tree to process. |
| fvals | Pointer to an array of filter values, or NULL if not needed. |
| void dfvm_dump | ( | FILE * | f, |
| dfilter_t * | df, | ||
| uint16_t | flags | ||
| ) |
Dumps the bytecode of a dfilter_t to a file.
| f | The file pointer where the bytecode will be written. |
| df | The dfilter_t whose bytecode is to be dumped. |
| flags | Flags that control the dumping process. |
| char * dfvm_dump_str | ( | wmem_allocator_t * | alloc, |
| dfilter_t * | df, | ||
| uint16_t | flags | ||
| ) |
Dumps a string representation of a dfilter.
| alloc | Memory allocator for the buffer. |
| df | The dfilter to dump. |
| flags | Flags controlling what information is included in the dump. |
| fvalue_t * dfvm_get_raw_fvalue | ( | const field_info * | fi | ) |
Retrieves the raw value of a field as a GByteArray.
| fi | Pointer to the field_info structure containing the field information. |
| void dfvm_insn_free | ( | dfvm_insn_t * | insn | ) |
Free a DFVM instruction.
This function frees a DFVM instruction and unrefs any arguments it may have.
| insn | The DFVM instruction to free. |
| dfvm_insn_t * dfvm_insn_new | ( | dfvm_opcode_t | op | ) |
Creates a new DFVM instruction with the specified opcode.
| op | The operation code for the new instruction. |
| void dfvm_insn_replace_no_op | ( | dfvm_insn_t * | insn | ) |
Replaces an instruction with a no-op.
This function replaces the given instruction with a no-op (no operation) instruction. It unrefs any arguments associated with the original instruction before setting it to no-op.
| insn | Pointer to the instruction to be replaced. |
| const char * dfvm_opcode_tostr | ( | dfvm_opcode_t | code | ) |
Converts a DFVM opcode to its string representation.
| code | The DFVM opcode to convert. |
| dfvm_value_t * dfvm_value_new | ( | dfvm_value_type_t | type | ) |
Create a new DFVM value.
| type | The type of the value to create. |
| dfvm_value_t * dfvm_value_new_drange | ( | drange_t * | dr | ) |
Creates a new dfvm_value_t with type DRANGE.
| dr | Pointer to the drange_t structure. |
| dfvm_value_t * dfvm_value_new_funcdef | ( | df_func_def_t * | funcdef | ) |
Create a new DFVM value of type FUNCTION_DEF.
| funcdef | Pointer to the function definition. |
| dfvm_value_t * dfvm_value_new_fvalue | ( | fvalue_t * | fv | ) |
Creates a new DFVM value of type FVALUE.
| fv | Pointer to the fvalue_t structure. |
| dfvm_value_t * dfvm_value_new_hfinfo | ( | header_field_info * | hfinfo, |
| bool | raw, | ||
| bool | val_str | ||
| ) |
Create a new dfvm_value_t with header field information.
| hfinfo | Pointer to the header field information. |
| raw | Flag indicating if the value is in raw format. |
| val_str | Flag indicating if the value is a string. |
| dfvm_value_t * dfvm_value_new_pcre | ( | ws_regex_t * | re | ) |
Creates a new PCRE value.
| re | The PCRE regular expression to be stored in the value. |
| dfvm_value_t * dfvm_value_new_register | ( | int | reg | ) |
Creates a new dfvm_value_t representing a register.
| reg | The register value to be stored in the dfvm_value_t. |
| dfvm_value_t * dfvm_value_new_uint | ( | unsigned | num | ) |
Create a new DFVM value with an unsigned integer.
| num | The unsigned integer value to store in the new DFVM value. |
| dfvm_value_t * dfvm_value_ref | ( | dfvm_value_t * | v | ) |
Increment the reference count of a dfvm_value_t.
| v | Pointer to the dfvm_value_t whose reference count is to be incremented. |
| void dfvm_value_unref | ( | dfvm_value_t * | v | ) |
Decrements the reference count of a dfvm_value_t object and frees it if the reference count reaches zero.
| v | Pointer to the dfvm_value_t object to be unreferenced. |