Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Macros | Typedefs | Functions
protobuf-helper.h File Reference
#include <epan/value_string.h>

Go to the source code of this file.

Macros

#define protobuf_field_type_VALUE_STRING_LIST(XXX)
 
#define PROTOBUF_MAX_FIELD_TYPE   18
 

Typedefs

typedef struct PbwDescriptorPool PbwDescriptorPool
 
typedef struct PbwMethodDescriptor PbwMethodDescriptor
 
typedef struct PbwDescriptor PbwDescriptor
 
typedef struct PbwFieldDescriptor PbwFieldDescriptor
 
typedef struct PbwEnumDescriptor PbwEnumDescriptor
 
typedef struct PbwEnumValueDescriptor PbwEnumValueDescriptor
 
typedef void(* pbw_report_error_cb_t) (const char *msg_format,...)
 

Functions

 VALUE_STRING_ENUM (protobuf_field_type)
 
 VALUE_STRING_ARRAY_GLOBAL_DCL (protobuf_field_type)
 
void pbw_reinit_DescriptorPool (PbwDescriptorPool **pool, const char **directories, pbw_report_error_cb_t error_cb)
 
int pbw_load_proto_file (PbwDescriptorPool *pool, const char *filename)
 
const PbwMethodDescriptor * pbw_DescriptorPool_FindMethodByName (const PbwDescriptorPool *pool, const char *name)
 
const char * pbw_MethodDescriptor_name (const PbwMethodDescriptor *method)
 
const char * pbw_MethodDescriptor_full_name (const PbwMethodDescriptor *method)
 
const PbwDescriptor * pbw_MethodDescriptor_input_type (const PbwMethodDescriptor *method)
 
const PbwDescriptor * pbw_MethodDescriptor_output_type (const PbwMethodDescriptor *method)
 
const PbwDescriptor * pbw_DescriptorPool_FindMessageTypeByName (const PbwDescriptorPool *pool, const char *name)
 
const char * pbw_Descriptor_name (const PbwDescriptor *message)
 
const char * pbw_Descriptor_full_name (const PbwDescriptor *message)
 
int pbw_Descriptor_field_count (const PbwDescriptor *message)
 
const PbwFieldDescriptor * pbw_Descriptor_field (const PbwDescriptor *message, int field_index)
 
const PbwFieldDescriptor * pbw_Descriptor_FindFieldByNumber (const PbwDescriptor *message, int number)
 
const PbwFieldDescriptor * pbw_Descriptor_FindFieldByName (const PbwDescriptor *message, const char *name)
 
const char * pbw_FieldDescriptor_full_name (const PbwFieldDescriptor *field)
 
const char * pbw_FieldDescriptor_name (const PbwFieldDescriptor *field)
 
int pbw_FieldDescriptor_number (const PbwFieldDescriptor *field)
 
int pbw_FieldDescriptor_type (const PbwFieldDescriptor *field)
 
int pbw_FieldDescriptor_is_repeated (const PbwFieldDescriptor *field)
 
int pbw_FieldDescriptor_is_packed (const PbwFieldDescriptor *field)
 
const char * pbw_FieldDescriptor_typeName (int field_type)
 
const PbwDescriptor * pbw_FieldDescriptor_message_type (const PbwFieldDescriptor *field)
 
const PbwEnumDescriptor * pbw_FieldDescriptor_enum_type (const PbwFieldDescriptor *field)
 
bool pbw_FieldDescriptor_is_required (const PbwFieldDescriptor *field)
 
bool pbw_FieldDescriptor_has_default_value (const PbwFieldDescriptor *field)
 
int32_t pbw_FieldDescriptor_default_value_int32 (const PbwFieldDescriptor *field)
 
int64_t pbw_FieldDescriptor_default_value_int64 (const PbwFieldDescriptor *field)
 
uint32_t pbw_FieldDescriptor_default_value_uint32 (const PbwFieldDescriptor *field)
 
uint64_t pbw_FieldDescriptor_default_value_uint64 (const PbwFieldDescriptor *field)
 
float pbw_FieldDescriptor_default_value_float (const PbwFieldDescriptor *field)
 
double pbw_FieldDescriptor_default_value_double (const PbwFieldDescriptor *field)
 
bool pbw_FieldDescriptor_default_value_bool (const PbwFieldDescriptor *field)
 
const char * pbw_FieldDescriptor_default_value_string (const PbwFieldDescriptor *field, int *size)
 
const PbwEnumValueDescriptor * pbw_FieldDescriptor_default_value_enum (const PbwFieldDescriptor *field)
 
const char * pbw_EnumDescriptor_name (const PbwEnumDescriptor *anEnum)
 
const char * pbw_EnumDescriptor_full_name (const PbwEnumDescriptor *anEnum)
 
int pbw_EnumDescriptor_value_count (const PbwEnumDescriptor *anEnum)
 
const PbwEnumValueDescriptor * pbw_EnumDescriptor_value (const PbwEnumDescriptor *anEnum, int value_index)
 
const PbwEnumValueDescriptor * pbw_EnumDescriptor_FindValueByNumber (const PbwEnumDescriptor *anEnum, int number)
 
const PbwEnumValueDescriptor * pbw_EnumDescriptor_FindValueByName (const PbwEnumDescriptor *anEnum, const char *name)
 
const char * pbw_EnumValueDescriptor_name (const PbwEnumValueDescriptor *enumValue)
 
const char * pbw_EnumValueDescriptor_full_name (const PbwEnumValueDescriptor *enumValue)
 
int pbw_EnumValueDescriptor_number (const PbwEnumValueDescriptor *enumValue)
 
void pbw_foreach_message (const PbwDescriptorPool *pool, void(*cb)(const PbwDescriptor *message, void *userdata), void *userdata)
 

Detailed Description

C Wrapper Layer of Protocol Buffers Language library. 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

Macro Definition Documentation

◆ protobuf_field_type_VALUE_STRING_LIST

#define protobuf_field_type_VALUE_STRING_LIST (   XXX)
Value:
XXX(PROTOBUF_TYPE_NONE, 0, "") \
XXX(PROTOBUF_TYPE_DOUBLE, 1, "double") \
XXX(PROTOBUF_TYPE_FLOAT, 2, "float") \
XXX(PROTOBUF_TYPE_INT64, 3, "int64") \
XXX(PROTOBUF_TYPE_UINT64, 4, "uint64") \
XXX(PROTOBUF_TYPE_INT32, 5, "int32") \
XXX(PROTOBUF_TYPE_FIXED64, 6, "fixed64") \
XXX(PROTOBUF_TYPE_FIXED32, 7, "fixed32") \
XXX(PROTOBUF_TYPE_BOOL, 8, "bool") \
XXX(PROTOBUF_TYPE_STRING, 9, "string") \
XXX(PROTOBUF_TYPE_GROUP, 10, "group") \
XXX(PROTOBUF_TYPE_MESSAGE, 11, "message") \
XXX(PROTOBUF_TYPE_BYTES, 12, "bytes") \
XXX(PROTOBUF_TYPE_UINT32, 13, "uint32") \
XXX(PROTOBUF_TYPE_ENUM, 14, "enum") \
XXX(PROTOBUF_TYPE_SFIXED32, 15, "sfixed32") \
XXX(PROTOBUF_TYPE_SFIXED64, 16, "sfixed64") \
XXX(PROTOBUF_TYPE_SINT32, 17, "sint32") \
XXX(PROTOBUF_TYPE_SINT64, 18, "sint64")

Function Documentation

◆ pbw_reinit_DescriptorPool()

void pbw_reinit_DescriptorPool ( PbwDescriptorPool **  pool,
const char **  directories,
pbw_report_error_cb_t  error_cb 
)

Reinitialize PbwDescriptorPool according to proto files directories.

Parameters
poolThe output DescriptorPool 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.