Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
protobuf_lang_tree.h File Reference
#include <wireshark.h>
#include <stdio.h>
#include <stdarg.h>

Go to the source code of this file.

Classes

struct  pbl_descriptor_pool_t
 
struct  pbl_file_descriptor_t
 
struct  pbl_node_t
 
struct  pbl_method_descriptor_t
 
struct  pbl_message_descriptor_t
 
struct  pbl_enum_value_descriptor_t
 
struct  pbl_field_descriptor_t
 
struct  pbl_enum_descriptor_t
 
struct  pbl_option_descriptor_t
 
struct  _protobuf_lang_token_t
 
struct  _protobuf_lang_state_t
 

Macros

#define PBL_DEFAULT_PACKAGE_NAME   ""
 

Typedefs

typedef void(* pbl_report_error_cb_t) (const char *msg_format,...)
 
typedef struct pbl_node_t pbl_node_t
 
typedef struct _protobuf_lang_token_t protobuf_lang_token_t
 
typedef struct _protobuf_lang_state_t protobuf_lang_state_t
 

Enumerations

enum  pbl_node_type_t {
  PBL_UNKNOWN = 0 , PBL_PACKAGE , PBL_MESSAGE , PBL_FIELD ,
  PBL_ONEOF , PBL_MAP_FIELD , PBL_ENUM , PBL_ENUM_VALUE ,
  PBL_SERVICE , PBL_METHOD , PBL_OPTIONS , PBL_OPTION
}
 

Functions

void pbl_reinit_descriptor_pool (pbl_descriptor_pool_t **ppool, const char **directories, pbl_report_error_cb_t error_cb)
 
void pbl_free_pool (pbl_descriptor_pool_t *pool)
 
bool pbl_add_proto_file_to_be_parsed (pbl_descriptor_pool_t *pool, const char *filepath)
 
int run_pbl_parser (pbl_descriptor_pool_t *pool)
 
const pbl_method_descriptor_tpbl_message_descriptor_pool_FindMethodByName (const pbl_descriptor_pool_t *pool, const char *name)
 
const char * pbl_method_descriptor_name (const pbl_method_descriptor_t *method)
 
const char * pbl_method_descriptor_full_name (const pbl_method_descriptor_t *method)
 
const pbl_message_descriptor_tpbl_method_descriptor_input_type (const pbl_method_descriptor_t *method)
 
const pbl_message_descriptor_tpbl_method_descriptor_output_type (const pbl_method_descriptor_t *method)
 
const pbl_message_descriptor_tpbl_message_descriptor_pool_FindMessageTypeByName (const pbl_descriptor_pool_t *pool, const char *name)
 
const char * pbl_message_descriptor_name (const pbl_message_descriptor_t *message)
 
const char * pbl_message_descriptor_full_name (const pbl_message_descriptor_t *message)
 
int pbl_message_descriptor_field_count (const pbl_message_descriptor_t *message)
 
const pbl_field_descriptor_tpbl_message_descriptor_field (const pbl_message_descriptor_t *message, int field_index)
 
const pbl_field_descriptor_tpbl_message_descriptor_FindFieldByNumber (const pbl_message_descriptor_t *message, int number)
 
const pbl_field_descriptor_tpbl_message_descriptor_FindFieldByName (const pbl_message_descriptor_t *message, const char *name)
 
const char * pbl_field_descriptor_full_name (const pbl_field_descriptor_t *field)
 
const char * pbl_field_descriptor_name (const pbl_field_descriptor_t *field)
 
int pbl_field_descriptor_number (const pbl_field_descriptor_t *field)
 
int pbl_field_descriptor_type (const pbl_field_descriptor_t *field)
 
int pbl_field_descriptor_is_repeated (const pbl_field_descriptor_t *field)
 
int pbl_field_descriptor_is_packed (const pbl_field_descriptor_t *field)
 
const char * pbl_field_descriptor_TypeName (int field_type)
 
const pbl_message_descriptor_tpbl_field_descriptor_message_type (const pbl_field_descriptor_t *field)
 
const pbl_enum_descriptor_tpbl_field_descriptor_enum_type (const pbl_field_descriptor_t *field)
 
bool pbl_field_descriptor_is_required (const pbl_field_descriptor_t *field)
 
bool pbl_field_descriptor_has_default_value (const pbl_field_descriptor_t *field)
 
int32_t pbl_field_descriptor_default_value_int32 (const pbl_field_descriptor_t *field)
 
int64_t pbl_field_descriptor_default_value_int64 (const pbl_field_descriptor_t *field)
 
uint32_t pbl_field_descriptor_default_value_uint32 (const pbl_field_descriptor_t *field)
 
uint64_t pbl_field_descriptor_default_value_uint64 (const pbl_field_descriptor_t *field)
 
float pbl_field_descriptor_default_value_float (const pbl_field_descriptor_t *field)
 
double pbl_field_descriptor_default_value_double (const pbl_field_descriptor_t *field)
 
bool pbl_field_descriptor_default_value_bool (const pbl_field_descriptor_t *field)
 
const char * pbl_field_descriptor_default_value_string (const pbl_field_descriptor_t *field, int *size)
 
const pbl_enum_value_descriptor_tpbl_field_descriptor_default_value_enum (const pbl_field_descriptor_t *field)
 
const char * pbl_enum_descriptor_name (const pbl_enum_descriptor_t *anEnum)
 
const char * pbl_enum_descriptor_full_name (const pbl_enum_descriptor_t *anEnum)
 
int pbl_enum_descriptor_value_count (const pbl_enum_descriptor_t *anEnum)
 
const pbl_enum_value_descriptor_tpbl_enum_descriptor_value (const pbl_enum_descriptor_t *anEnum, int value_index)
 
const pbl_enum_value_descriptor_tpbl_enum_descriptor_FindValueByNumber (const pbl_enum_descriptor_t *anEnum, int number)
 
const pbl_enum_value_descriptor_tpbl_enum_descriptor_FindValueByName (const pbl_enum_descriptor_t *anEnum, const char *name)
 
const char * pbl_enum_value_descriptor_name (const pbl_enum_value_descriptor_t *enumValue)
 
const char * pbl_enum_value_descriptor_full_name (const pbl_enum_value_descriptor_t *enumValue)
 
int pbl_enum_value_descriptor_number (const pbl_enum_value_descriptor_t *enumValue)
 
void pbl_foreach_message (const pbl_descriptor_pool_t *pool, void(*cb)(const pbl_message_descriptor_t *, void *), void *userdata)
 
pbl_node_tpbl_create_node (pbl_file_descriptor_t *file, int lineno, pbl_node_type_t nodetype, const char *name)
 
pbl_node_tpbl_set_node_name (pbl_node_t *node, int lineno, const char *newname)
 
const char * pbl_get_node_full_name (pbl_node_t *node)
 
pbl_node_tpbl_add_child (pbl_node_t *parent, pbl_node_t *child)
 
pbl_node_tpbl_create_enum_value_node (pbl_file_descriptor_t *file, int lineno, const char *name, int number)
 
pbl_node_tpbl_merge_children (pbl_node_t *to, pbl_node_t *from)
 
pbl_node_tpbl_create_field_node (pbl_file_descriptor_t *file, int lineno, const char *label, const char *type_name, const char *name, int number, pbl_node_t *options)
 
pbl_node_tpbl_create_map_field_node (pbl_file_descriptor_t *file, int lineno, const char *name, int number, pbl_node_t *options)
 
pbl_node_tpbl_create_method_node (pbl_file_descriptor_t *file, int lineno, const char *name, const char *in_msg_type, bool in_is_stream, const char *out_msg_type, bool out_is_stream)
 
pbl_node_tpbl_create_option_node (pbl_file_descriptor_t *file, int lineno, const char *name, const char *value)
 
void pbl_free_node (void *anode)
 

Detailed Description

Routines of building and reading Protocol Buffers Language grammar tree. Copyright 2019, Huang Qiangxiong qiang.nosp@m.xion.nosp@m.g.hua.nosp@m.ng@q.nosp@m.q.com

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ pbl_reinit_descriptor_pool()

void pbl_reinit_descriptor_pool ( pbl_descriptor_pool_t **  ppool,
const char **  directories,
pbl_report_error_cb_t  error_cb 
)

Reinitialize the protocol buffers pool according to proto files directories.

Parameters
ppoolThe output descriptor_pool will be created. If *pool is not NULL, it will free it first.
directoriesThe root directories containing proto files. Must end with NULL element.
error_cbThe error reporter callback function.