aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-json.c
diff options
context:
space:
mode:
authorHuang Qiangxiong <qiangxiong.huang@qq.com>2017-07-31 15:22:59 +0000
committerMichael Mann <mmann78@netscape.net>2017-09-26 11:26:01 +0000
commitc5c05911c62f0524c3b88086cf20dedb3d6ef769 (patch)
tree2670eeda6e9b7a53e6082bf27f34c0ec53303ee9 /epan/dissectors/packet-json.c
parentb89726db6d0bbadd607e8d43c0528d3e6e053531 (diff)
Add GRPC dissector
GRPC dissector register it self to media_type dissector table using patterns "application/grpc", "application/grpc+proto" and "application/grpc+json". GRPC stack (at least in grpc-java) can send JSON over GRPC using content-type = "application/grpc" which normally means default protobuf format. A preference is added to detect the message body, if it starts with '{', and ends with '}', will force to use JSON subdissector instead of searching in 'grpc_message_type' table. Ping-Bug: 13932 Change-Id: I910961ca06370e678d19b78cac533ca566d87628 Reviewed-on: https://code.wireshark.org/review/22891 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-json.c')
-rw-r--r--epan/dissectors/packet-json.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/epan/dissectors/packet-json.c b/epan/dissectors/packet-json.c
index c172a64a42..538d845563 100644
--- a/epan/dissectors/packet-json.c
+++ b/epan/dissectors/packet-json.c
@@ -663,6 +663,7 @@ proto_reg_handoff_json(void)
dissector_add_string("media_type", "application/json-rpc", json_handle); /* JSON-RPC over HTTP */
dissector_add_string("media_type", "application/jsonrequest", json_handle); /* JSON-RPC over HTTP */
dissector_add_string("media_type", "application/dds-web+json", json_handle); /* DDS Web Integration Service over HTTP */
+ dissector_add_string("grpc_message_type", "application/grpc+json", json_handle);
text_lines_handle = find_dissector_add_dependency("data-text-lines", proto_json);
}