diff options
author | Adam Goldman <adam.goldman@intel.com> | 2016-07-26 09:54:23 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-06-11 20:24:54 +0000 |
commit | 2047d688724cbebb3ad908d9248561e16ffed7ff (patch) | |
tree | 863c20a59a6650fa7fb7ff20b5401ffa85677151 | |
parent | 53a18406266cdabde5f619c72d77b2471e89b13e (diff) |
opa-fe: Add Support for Reassembly of FE TCP Packets
Used tcp_dissect_pdus API to reassemble FE TCP packets.
Change-Id: I82bb270bacbd3f5790c015c5a876981417e271fa
Signed-off-by: Adam Goldman <adam.goldman@intel.com>
Reviewed-on: https://code.wireshark.org/review/28203
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r-- | epan/dissectors/packet-opa-fe.c | 19 | ||||
-rw-r--r-- | epan/dissectors/packet-opa-mad.c | 6 |
2 files changed, 21 insertions, 4 deletions
diff --git a/epan/dissectors/packet-opa-fe.c b/epan/dissectors/packet-opa-fe.c index 5c86200790..a5a8056132 100644 --- a/epan/dissectors/packet-opa-fe.c +++ b/epan/dissectors/packet-opa-fe.c @@ -15,6 +15,7 @@ #include <epan/prefs.h> #include "packet-ssl.h" +#include "packet-tcp.h" void proto_reg_handoff_opa_fe(void); void proto_register_opa_fe(void); @@ -22,6 +23,8 @@ void proto_register_opa_fe(void); #define OPA_FE_TCP_RANGE "3245-3248" /* Not IANA registered */ #define OPA_FE_SSL_RANGE "3249-3252" +#define OPA_FE_HEADER_LEN 24 + /* Wireshark ID */ static gint proto_opa_fe = -1; @@ -43,7 +46,11 @@ static range_t *global_fe_ssl_range = NULL; static range_t *fe_ssl_range = NULL; -static int dissect_opa_fe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +static guint get_opa_fe_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_) +{ + return tvb_get_ntohl(tvb, offset + 4); +} +static int dissect_opa_fe_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { gint offset = 0; /* Current Offset */ proto_item *FE_item; @@ -54,7 +61,7 @@ static int dissect_opa_fe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v tree = proto_tree_get_root(tree); - FE_item = proto_tree_add_item(tree, proto_opa_fe, tvb, offset, 24, ENC_NA); + FE_item = proto_tree_add_item(tree, proto_opa_fe, tvb, offset, OPA_FE_HEADER_LEN, ENC_NA); FE_tree = proto_item_add_subtree(FE_item, ett_fe); proto_tree_add_item(FE_tree, hf_opa_fe_magicnumber, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -73,6 +80,14 @@ static int dissect_opa_fe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v return tvb_captured_length(tvb); } +static int dissect_opa_fe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +{ + tcp_dissect_pdus(tvb, pinfo, tree, TRUE, OPA_FE_HEADER_LEN, + get_opa_fe_message_len, dissect_opa_fe_message, data); + + return tvb_reported_length(tvb); +} + static void range_delete_fe_ssl_callback(guint32 port, gpointer ptr _U_) { ssl_dissector_delete(port, opa_fe_handle); diff --git a/epan/dissectors/packet-opa-mad.c b/epan/dissectors/packet-opa-mad.c index f537b6014e..249f07c0ab 100644 --- a/epan/dissectors/packet-opa-mad.c +++ b/epan/dissectors/packet-opa-mad.c @@ -5940,6 +5940,7 @@ static void parse_SUBNADMN(proto_tree *parentTree, packet_info *pinfo, tvbuff_t guint r, records, length; proto_tree *SA_record_tree; const guchar *label; + gboolean parent_was_opa_fe = proto_is_frame_protocol(pinfo->layers, "opa.fe"); if (!parse_MAD_Common(parentTree, pinfo, tvb, offset, &MAD)) { return; @@ -5956,7 +5957,7 @@ static void parse_SUBNADMN(proto_tree *parentTree, packet_info *pinfo, tvbuff_t return; } - if (pref_attempt_rmpp_defragment + if (!parent_was_opa_fe && pref_attempt_rmpp_defragment && (RMPP.resptime_flags & RMPP_FLAG_ACTIVE_MASK) && (RMPP.Type == RMPP_DATA) && !((RMPP.resptime_flags & RMPP_FLAG_FIRST_MASK) && (RMPP.resptime_flags & RMPP_FLAG_LAST_MASK))) { @@ -8163,6 +8164,7 @@ static void parse_PERFADMN(proto_tree *parentTree, packet_info *pinfo, tvbuff_t fragment_head *frag_head = NULL; tvbuff_t *old_tvb = NULL; gint old_offset; + gboolean parent_was_opa_fe = proto_is_frame_protocol(pinfo->layers, "opa.fe"); if (!parse_MAD_Common(parentTree, pinfo, tvb, offset, &MAD)) { return; @@ -8179,7 +8181,7 @@ static void parse_PERFADMN(proto_tree *parentTree, packet_info *pinfo, tvbuff_t return; } - if (pref_attempt_rmpp_defragment + if (!parent_was_opa_fe && pref_attempt_rmpp_defragment && (RMPP.resptime_flags & RMPP_FLAG_ACTIVE_MASK) && (RMPP.Type == RMPP_DATA) && !((RMPP.resptime_flags & RMPP_FLAG_FIRST_MASK) && (RMPP.resptime_flags & RMPP_FLAG_LAST_MASK))) { |