Start of adding Protobuf (Protocol Buffers) dissector.
1. Protobuf dissector supports the almost all basic protobuf types of
varint, sint, string, and so on.
2. Protobuf messages are not self-described protocol, for example,
varint in protobuf may be int32, int64, uint32, uint64, sint32,
sint64, bool or enum. Currently dissector will dissect field without
detail definition in common way, for numeric field it show uint32 or
uint64, for length-delimited field it just show as bytes. But user
turn the try_dissect_all_length_delimited_field_as_string or
show_all_possible_field_types options on, that dissect will show all
possible value for each field according to wire type. (for example,
a numeric field will parsed in int32, uint32, sint32, sint64 and so
on).
Ping-Bug: 13932
Change-Id: Idfe49307b1c84fe461603756f75daeb3e410a905
Reviewed-on: https://code.wireshark.org/review/23814
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-31 15:26:57 +00:00
|
|
|
/* packet-protobuf.h
|
|
|
|
* Routines for Google Protocol Buffers dissection
|
|
|
|
* Copyright 2017, Huang Qiangxiong <qiangxiong.huang@qq.com>
|
|
|
|
*
|
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
2018-02-12 11:23:27 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
Start of adding Protobuf (Protocol Buffers) dissector.
1. Protobuf dissector supports the almost all basic protobuf types of
varint, sint, string, and so on.
2. Protobuf messages are not self-described protocol, for example,
varint in protobuf may be int32, int64, uint32, uint64, sint32,
sint64, bool or enum. Currently dissector will dissect field without
detail definition in common way, for numeric field it show uint32 or
uint64, for length-delimited field it just show as bytes. But user
turn the try_dissect_all_length_delimited_field_as_string or
show_all_possible_field_types options on, that dissect will show all
possible value for each field according to wire type. (for example,
a numeric field will parsed in int32, uint32, sint32, sint64 and so
on).
Ping-Bug: 13932
Change-Id: Idfe49307b1c84fe461603756f75daeb3e410a905
Reviewed-on: https://code.wireshark.org/review/23814
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-31 15:26:57 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PACKET_PROTOBUF_H__
|
|
|
|
#define __PACKET_PROTOBUF_H__
|
|
|
|
|
|
|
|
/* Protobuf wire type. Must be kept in sync with WireType of protobuf wire_format_lite.h
|
|
|
|
0 used for int32, int64, uint32, uint64, sint32, sint64, bool, enum
|
|
|
|
1 used for fixed64, sfixed64, double
|
|
|
|
2 used for string, bytes, embedded messages, packed repeated fields
|
|
|
|
3 used for groups (deprecated)
|
|
|
|
4 used for groups (deprecated)
|
|
|
|
5 used for fixed32, sfixed32, float
|
|
|
|
*/
|
|
|
|
#define protobuf_wire_type_VALUE_STRING_LIST(XXX) \
|
|
|
|
XXX(PROTOBUF_WIRETYPE_VARINT, 0, "varint") \
|
|
|
|
XXX(PROTOBUF_WIRETYPE_FIXED64, 1, "64-bit") \
|
|
|
|
XXX(PROTOBUF_WIRETYPE_LENGTH_DELIMITED, 2, "Length-delimited") \
|
|
|
|
XXX(PROTOBUF_WIRETYPE_START_GROUP, 3, "Start group (deprecated)") \
|
|
|
|
XXX(PROTOBUF_WIRETYPE_END_GROUP, 4, "End group (deprecated)") \
|
|
|
|
XXX(PROTOBUF_WIRETYPE_FIXED32, 5, "32-bit")
|
|
|
|
|
|
|
|
VALUE_STRING_ENUM(protobuf_wire_type);
|
|
|
|
VALUE_STRING_ARRAY_GLOBAL_DCL(protobuf_wire_type);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
2019-07-26 18:43:17 +00:00
|
|
|
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
Start of adding Protobuf (Protocol Buffers) dissector.
1. Protobuf dissector supports the almost all basic protobuf types of
varint, sint, string, and so on.
2. Protobuf messages are not self-described protocol, for example,
varint in protobuf may be int32, int64, uint32, uint64, sint32,
sint64, bool or enum. Currently dissector will dissect field without
detail definition in common way, for numeric field it show uint32 or
uint64, for length-delimited field it just show as bytes. But user
turn the try_dissect_all_length_delimited_field_as_string or
show_all_possible_field_types options on, that dissect will show all
possible value for each field according to wire type. (for example,
a numeric field will parsed in int32, uint32, sint32, sint64 and so
on).
Ping-Bug: 13932
Change-Id: Idfe49307b1c84fe461603756f75daeb3e410a905
Reviewed-on: https://code.wireshark.org/review/23814
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-07-31 15:26:57 +00:00
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|