diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2016-08-25 12:44:41 +0200 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2016-08-25 11:57:40 +0000 |
commit | c661da414d5ddb506e0c23d3169cff45b6211398 (patch) | |
tree | 6186f35bb4bec03785f6d92df8d84f373af945c2 | |
parent | 8ce301704bb191208ea2486396d83c4305ba3315 (diff) |
xmpp: Add whitespace keepalive indication
RFC 6120 section 4.6.1 defines the use of a single whitespace as
"whitespace keepalive", so indicate this in the Info column.
Change-Id: I685431d91be2a37fbd66f8d1cdabe53f33092e93
Reviewed-on: https://code.wireshark.org/review/17323
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
-rw-r--r-- | epan/dissectors/packet-xmpp.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/epan/dissectors/packet-xmpp.c b/epan/dissectors/packet-xmpp.c index bea9bab5c9..ae98bd2702 100644 --- a/epan/dissectors/packet-xmpp.c +++ b/epan/dissectors/packet-xmpp.c @@ -423,13 +423,18 @@ dissect_xmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ } col_set_str(pinfo->cinfo, COL_PROTOCOL, "XMPP"); - col_clear(pinfo->cinfo, COL_INFO); /*if tree == NULL then xmpp_item and xmpp_tree will also NULL*/ xmpp_item = proto_tree_add_item(tree, proto_xmpp, tvb, 0, -1, ENC_NA); xmpp_tree = proto_item_add_subtree(xmpp_item, ett_xmpp); + if ((tvb_reported_length(tvb) == 1) && tvb_get_guint8(tvb, 0) == ' ') { + /* RFC 6120 section 4.6.1 */ + col_set_str(pinfo->cinfo, COL_INFO, "Whitespace Keepalive"); + return tvb_captured_length(tvb); + } + call_dissector_with_data(xml_handle, tvb, pinfo, xmpp_tree, NULL); /* If XML dissector is disabled, we can't do much */ @@ -523,9 +528,9 @@ dissect_xmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ xmpp_features(xmpp_tree, tvb, pinfo, packet); } else if (strcmp(packet->name, "starttls") == 0) { xmpp_starttls(xmpp_tree, tvb, pinfo, packet, xmpp_info); - }else if (strcmp(packet->name, "proceed") == 0) { + } else if (strcmp(packet->name, "proceed") == 0) { xmpp_proceed(xmpp_tree, tvb, pinfo, packet, xmpp_info); - }else { + } else { xmpp_proto_tree_show_first_child(xmpp_tree); expert_add_info_format(pinfo, xmpp_tree, &ei_xmpp_packet_unknown, "Unknown packet: %s", packet->name); col_set_str(pinfo->cinfo, COL_INFO, "UNKNOWN PACKET "); |