diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-01-31 15:24:34 +0100 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2014-02-26 09:14:57 +0000 |
commit | b84d6bebcb31416174bb693349f9f6ef076f29f9 (patch) | |
tree | d4d0b97d4463e0caed4f036143c57c1e9668557b | |
parent | 8242756aedc09108e39d30b5e9b5c92dcf983fe7 (diff) |
packet-smb-direct: register as a infiniband subdissector
This is implemented based on the documentation, I sadly don't
have a capture to verify this.
Change-Id: Ia7dc371cb5b17ea42be0e686c97797f8c06ccabd
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/358
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r-- | epan/dissectors/packet-smb-direct.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/epan/dissectors/packet-smb-direct.c b/epan/dissectors/packet-smb-direct.c index cd7af8e9e8..dd309e831d 100644 --- a/epan/dissectors/packet-smb-direct.c +++ b/epan/dissectors/packet-smb-direct.c @@ -32,6 +32,7 @@ #include "packet-windows-common.h" #include "packet-iwarp-ddp-rdmap.h" +#include "packet-infiniband.h" static int proto_smb_direct = -1; @@ -387,6 +388,40 @@ dissect_smb_direct_iwarp_heur(tvbuff_t *tvb, packet_info *pinfo, return TRUE; } +static gboolean +dissect_smb_direct_infiniband_heur(tvbuff_t *tvb, packet_info *pinfo, + proto_tree *parent_tree, void *data) +{ + struct infinibandinfo *info = (struct infinibandinfo *)data; + enum SMB_DIRECT_HDR_TYPE hdr_type; + + if (info == NULL) { + return FALSE; + } + + switch (info->opCode) { + case RC_SEND_FIRST: + case RC_SEND_MIDDLE: + case RC_SEND_LAST: + case RC_SEND_LAST_IMM: + case RC_SEND_ONLY: + case RC_SEND_ONLY_IMM: + case RC_SEND_LAST_INVAL: + case RC_SEND_ONLY_INVAL: + break; + default: + return FALSE; + } + + hdr_type = is_smb_direct(tvb, pinfo); + if (hdr_type == SMB_DIRECT_HDR_UNKNOWN) { + return FALSE; + } + + dissect_smb_direct(tvb, pinfo, parent_tree, hdr_type); + return TRUE; +} + void proto_register_smb_direct(void) { static gint *ett[] = { @@ -488,6 +523,10 @@ proto_reg_handoff_smb_direct(void) heur_dissector_add("iwarp_ddp_rdmap", dissect_smb_direct_iwarp_heur, proto_smb_direct); + heur_dissector_add("infiniband.payload", + dissect_smb_direct_infiniband_heur, + proto_smb_direct); + } /* |