aboutsummaryrefslogtreecommitdiffstats
path: root/epan/protobuf-helper.c
AgeCommit message (Collapse)AuthorFilesLines
2020-01-06Get rid of %debug, so protobuf_lang.y can be processed by Berkeley YACC.Guy Harris1-1/+1
If somebody wants to debug the parser, they can add it if necessary in their version. Bug: 16306 Change-Id: I00e5924058d9401176e3fab40833932dc5757e6a Reviewed-on: https://code.wireshark.org/review/35665 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-12-19Protobuf: add dissecting protobuf fields as wireshark fields preferences, etc.Huang Qiangxiong1-1/+26
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>
2019-10-07protobuf: add support for Protocol Buffers Language (*.proto) filesHuang Qiangxiong1-0/+215
1. A C-style Protocol Buffers Language (PBL) parser for *.proto file is added. It contains protobuf_lang_scanner.l (lex scanner), epan/protobuf_lang.y (grammar parser), and protobuf_lang_tree.h/c (grammar tree implementation). 2. The protobuf-helper.h/cpp is an interface wrapper layer. If one day C++ is allowed, we can create a protobuf-helper.cpp file, which using offical protobuf C++ library, to replace protobuf-helper.c. That keeps packet-protobuf.c unchanged. 3. User can specify protobuf search paths, and the UDP ports to protobuf message type maps at the Protobuf protocol preferences. 4. Other dissectors can pass the message type to Protobuf dissector by data parameter or pinfo->private_table["pb_msg_type"] (pinfo.private["pb_msg_type"] in lua). Some Sample of GRPC with Protobuf captures can be found in Bug: 13932. Bug: 13932 Change-Id: Ife16c2f7b381296f8db4740dabe5f8362a456f48 Reviewed-on: https://code.wireshark.org/review/22892 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>