diff options
author | Huang Qiangxiong <qiangxiong.huang@qq.com> | 2019-11-17 20:25:15 +0800 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2019-12-19 05:04:17 +0000 |
commit | 623b347d1e863f7cd2d331926106321d3182d169 (patch) | |
tree | 6302532ea8d5e29ef20459dd06b8acd0a39e6ea9 /epan/protobuf-helper.h | |
parent | 5d342b01e3311d52dc6d84fc6c5381fd2004b142 (diff) |
Protobuf: add dissecting protobuf fields as wireshark fields preferences, etc.
Two enhancements and one fixed bug:
1. Add dissecting protobuf fields as wireshark (header) fields preferences. User
can input the full names of protobuf fields or messages in Filter toolbar for
searching.
2. Add 'protobuf_field' dissector table. Dissector based on protobuf can register
itself to 'protobuf_field' keyed with the full names of fields of BYETS or STRING
types.
3. A bug about search MESSAGE or ENUM type in context is fixed.
4. Another small enhancement is adding prefs_set_preference_effect_fields() which
can mark a preference that affects fields change (triggering FieldsChanged event).
See the linked bug for sample capture file and .proto files.
Ping-Bug: 16209
Change-Id: Ibc3c45a6d596a8bb983b0d847dd6a22801af7e04
Reviewed-on: https://code.wireshark.org/review/35111
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/protobuf-helper.h')
-rw-r--r-- | epan/protobuf-helper.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/epan/protobuf-helper.h b/epan/protobuf-helper.h index 3dada793eb..c92e7f6d0b 100644 --- a/epan/protobuf-helper.h +++ b/epan/protobuf-helper.h @@ -177,6 +177,14 @@ pbw_EnumDescriptor_name(const PbwEnumDescriptor* anEnum); const char* pbw_EnumDescriptor_full_name(const PbwEnumDescriptor* anEnum); +/* like EnumDescriptor::value_count() */ +int +pbw_EnumDescriptor_value_count(const PbwEnumDescriptor* anEnum); + +/* like EnumDescriptor::value() */ +const PbwEnumValueDescriptor* +pbw_EnumDescriptor_value(const PbwEnumDescriptor* anEnum, int value_index); + /* like EnumDescriptor::FindValueByNumber() */ const PbwEnumValueDescriptor* pbw_EnumDescriptor_FindValueByNumber(const PbwEnumDescriptor* anEnum, int number); @@ -189,6 +197,14 @@ pbw_EnumValueDescriptor_name(const PbwEnumValueDescriptor* enumValue); const char* pbw_EnumValueDescriptor_full_name(const PbwEnumValueDescriptor* enumValue); +/* like EnumValueDescriptor::number() */ +int +pbw_EnumValueDescriptor_number(const PbwEnumValueDescriptor* enumValue); + +/* visit all messages of this pool */ +void +pbw_foreach_message(const PbwDescriptorPool* pool, void (*cb)(const PbwDescriptor* message, void* userdata), void* userdata); + #ifdef __cplusplus } #endif /* __cplusplus */ |