Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
syntax-tree.h File Reference
#include <stdio.h>
#include <inttypes.h>
#include <wsutil/ws_assert.h>
#include <wsutil/wslog.h>
#include <epan/ftypes/ftypes.h>
#include "dfilter-loc.h"

Go to the source code of this file.

Classes

struct  sttype_t
 
struct  stnode
 

Macros

#define ASSERT_STTYPE_NOT_REACHED(st)    ws_error("Invalid syntax node type '%s'.", sttype_name(st))
 
#define ASSERT_STNODE_OP_NOT_REACHED(op)    ws_error("Invalid stnode op '%s'.", stnode_op_name(op))
 
#define STFLAG_UNPARSED   (1 << 0)
 
#define stnode_todisplay(node)   stnode_tostr(node, true)
 
#define stnode_todebug(node)   stnode_tostr(node, false)
 
#define log_node(node)   (void)0
 
#define log_test(node)   (void)0
 
#define LOG_NODE(node)   (void)0
 
#define ws_assert_magic(obj, mnum)   (void)0
 

Typedefs

typedef void *(* STTypeNewFunc) (void *)
 
typedef void *(* STTypeDupFunc) (const void *)
 
typedef void(* STTypeFreeFunc) (void *)
 
typedef char *(* STTypeToStrFunc) (const void *, bool pretty)
 
typedef struct stnode stnode_t
 

Enumerations

enum  sttype_id_t {
  STTYPE_UNINITIALIZED , STTYPE_TEST , STTYPE_UNPARSED , STTYPE_LITERAL ,
  STTYPE_REFERENCE , STTYPE_STRING , STTYPE_CHARCONST , STTYPE_NUMBER ,
  STTYPE_FIELD , STTYPE_FVALUE , STTYPE_SLICE , STTYPE_FUNCTION ,
  STTYPE_SET , STTYPE_PCRE , STTYPE_ARITHMETIC , STTYPE_NUM_TYPES
}
 
enum  stnumber_t { STNUM_NONE = 0 , STNUM_INTEGER , STNUM_UNSIGNED , STNUM_FLOAT }
 
enum  stnode_op_t {
  STNODE_OP_UNINITIALIZED , STNODE_OP_NOT , STNODE_OP_AND , STNODE_OP_OR ,
  STNODE_OP_ALL_EQ , STNODE_OP_ANY_EQ , STNODE_OP_ALL_NE , STNODE_OP_ANY_NE ,
  STNODE_OP_GT , STNODE_OP_GE , STNODE_OP_LT , STNODE_OP_LE ,
  STNODE_OP_CONTAINS , STNODE_OP_MATCHES , STNODE_OP_IN , STNODE_OP_NOT_IN ,
  STNODE_OP_BITWISE_AND , STNODE_OP_UNARY_MINUS , STNODE_OP_ADD , STNODE_OP_SUBTRACT ,
  STNODE_OP_MULTIPLY , STNODE_OP_DIVIDE , STNODE_OP_MODULO
}
 
enum  stmatch_t { STNODE_MATCH_DEF , STNODE_MATCH_ANY , STNODE_MATCH_ALL }
 

Functions

void sttype_register_field (void)
 
void sttype_register_function (void)
 
void sttype_register_number (void)
 
void sttype_register_pointer (void)
 
void sttype_register_set (void)
 
void sttype_register_slice (void)
 
void sttype_register_string (void)
 
void sttype_register_opers (void)
 
void sttype_init (void)
 
void sttype_cleanup (void)
 
void sttype_register (sttype_t *type)
 
WS_DLL_PUBLIC const char * sttype_name (sttype_id_t type)
 
WS_DLL_PUBLIC const char * stnode_op_name (stnode_op_t op)
 
WS_DLL_PUBLIC stnode_tstnode_new (sttype_id_t type_id, void *data, char *token, df_loc_t loc)
 
WS_DLL_PUBLIC stnode_tstnode_new_empty (sttype_id_t type_id)
 
WS_DLL_PUBLIC stnode_tstnode_dup (const stnode_t *org)
 
WS_DLL_PUBLIC void stnode_clear (stnode_t *node)
 
WS_DLL_PUBLIC void stnode_init (stnode_t *node, sttype_id_t type_id, void *data, char *token, df_loc_t loc)
 
WS_DLL_PUBLIC void stnode_replace (stnode_t *node, sttype_id_t type_id, void *data)
 
WS_DLL_PUBLIC void stnode_mutate (stnode_t *node, sttype_id_t type_id)
 
WS_DLL_PUBLIC void stnode_free (stnode_t *node)
 
WS_DLL_PUBLIC const char * stnode_type_name (stnode_t *node)
 
WS_DLL_PUBLIC sttype_id_t stnode_type_id (stnode_t *node)
 
WS_DLL_PUBLIC void * stnode_data (stnode_t *node)
 
WS_DLL_PUBLIC GString * stnode_string (stnode_t *node)
 
WS_DLL_PUBLIC void * stnode_steal_data (stnode_t *node)
 
WS_DLL_PUBLIC const char * stnode_token (stnode_t *node)
 
WS_DLL_PUBLIC df_loc_t stnode_location (stnode_t *node)
 
WS_DLL_PUBLIC void stnode_set_location (stnode_t *node, df_loc_t loc)
 
WS_DLL_PUBLIC bool stnode_get_flags (stnode_t *node, uint16_t flags)
 
WS_DLL_PUBLIC void stnode_set_flags (stnode_t *node, uint16_t flags)
 
void stnode_merge_location (stnode_t *dst, stnode_t *n1, stnode_t *n2)
 
WS_DLL_PUBLIC const char * stnode_tostr (stnode_t *node, bool pretty)
 
void log_node_full (enum ws_log_level level, const char *file, int line, const char *func, stnode_t *node, const char *msg)
 
void log_test_full (enum ws_log_level level, const char *file, int line, const char *func, stnode_t *node, const char *msg)
 
char * dump_syntax_tree_str (stnode_t *root)
 
void log_syntax_tree (enum ws_log_level, stnode_t *root, const char *msg, char **cache_ptr)
 

Typedef Documentation

◆ stnode_t

typedef struct stnode stnode_t

Node (type instance) information