aboutsummaryrefslogtreecommitdiffstats
path: root/epan/protobuf_lang_scanner.l
AgeCommit message (Collapse)AuthorFilesLines
2019-10-14Protobuf: Add show_details preferences. Fix two bugs.Huang Qiangxiong1-2/+2
1. Add show_details preferences. Disable it will hidden names of message/field/enum, field number, and other details. 2. Have only one popup message with all the errors listed, that are found during parsing .proto files. (Buffer errors and print once) Loading .proto files and checking message types of UDP port will be done only when protobuf dissector has been called. 3. Support parsing .proto files in legacy MAC file format (that newline is '\r') or mixed newline (\r + \n) file format. Change-Id: I97bcde000957e4cd1cce98a7f61120d03027423e Reviewed-on: https://code.wireshark.org/review/34736 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-10-07protobuf: add support for Protocol Buffers Language (*.proto) filesHuang Qiangxiong1-0/+199
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>