aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-erf.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2008-03-14 17:47:53 +0000
committerGerald Combs <gerald@wireshark.org>2008-03-14 17:47:53 +0000
commit68d23708bc686821b0df3c3ffaaf233cca6e4eee (patch)
tree73c5653c388e74ea09b7f70042a978dc23b9f2f2 /epan/dissectors/packet-erf.c
parent14e0b8f79233987dde0b88aec2667cf9244c9585 (diff)
From Stephen Donnelly via bug 2235:
This plugin implements a dissector for Infiniband. It is released under the GPL v2. Rather than using say libpcap to capture raw (unframed) IP packets from near the top of an IPoIB stack, this plugin dissects link level Infiniband frames. Infiniband trace files can be read from Endace ERF format trace files, or from libpcap DLT_ERF files containing ERF TYPE_INFINIBAND records. There is currently no native DLT_INFINIBAND in libpcap. Each record contains a hardware timestamp, capture metadata such as port Id, and a complete link level Infiniband frame starting from the Local Route Header. svn path=/trunk/; revision=24628
Diffstat (limited to 'epan/dissectors/packet-erf.c')
-rw-r--r--epan/dissectors/packet-erf.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c
index 69a01b9202..10bd8ff597 100644
--- a/epan/dissectors/packet-erf.c
+++ b/epan/dissectors/packet-erf.c
@@ -143,6 +143,11 @@ static gint ett_erf_eth = -1;
/* Default subdissector, display raw hex data */
static dissector_handle_t data_handle;
+// Possible there will be more in the future
+#define ERF_INFINIBAND 1
+gint erf_infiniband_default = ERF_INFINIBAND;
+static dissector_handle_t erf_infiniband_dissector[ERF_INFINIBAND];
+
typedef enum {
ERF_HDLC_CHDLC = 1,
ERF_HDLC_PPP = 2,
@@ -267,6 +272,7 @@ static const value_string erf_type_vals[] = {
{ ERF_TYPE_COLOR_MC_HDLC_POS,"COLOR_MC_HDLC_POS"},
{ ERF_TYPE_AAL2,"AAL2"},
{ ERF_TYPE_PAD,"PAD"},
+ { ERF_TYPE_INFINIBAND, "INFINIBAND"},
{0, NULL}
};
/* Copy of atm_guess_traffic_type from atm.c in /wiretap */
@@ -608,6 +614,10 @@ dissect_erf_header(tvbuff_t *erf_tvb, packet_info *pinfo, proto_tree *erf_tree,
switch(erf_type) {
+ case ERF_TYPE_INFINIBAND:
+ //if(data_handle) // no infiniband header but there might be later on
+ // call_dissector(data_handle, tvb, pinfo, tree);
+ break;
case ERF_TYPE_LEGACY:
case ERF_TYPE_IP_COUNTER:
case ERF_TYPE_TCP_FLOW_COUNTER:
@@ -756,6 +766,8 @@ dissect_erf_header(tvbuff_t *erf_tvb, packet_info *pinfo, proto_tree *erf_tree,
static void
dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
+ guint8 erf_type = 0;
+ dissector_handle_t infiniband_dissector = NULL;
proto_item *erf_item = NULL;
proto_tree *erf_tree = NULL;
@@ -768,6 +780,17 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
};
dissect_erf_header(tvb, pinfo, erf_tree, tree);
+
+ if (pinfo->pseudo_header)
+ {
+ erf_type = pinfo->pseudo_header->erf.phdr.type;
+ }
+ if(erf_type == ERF_TYPE_INFINIBAND)
+ {
+ infiniband_dissector = find_dissector("infiniband");
+ call_dissector(infiniband_dissector, tvb, pinfo, erf_tree);
+ }
+
}
void
@@ -933,6 +956,10 @@ proto_reg_handoff_erf(void)
/* Dissector called to dump raw data, or unknown protocol */
data_handle = find_dissector("data");
+
+ /* Create ERF_INFINIBAND dissectors */
+ erf_infiniband_dissector[ERF_INFINIBAND] = find_dissector("infiniband");
+
/* Create ERF_HDLC dissectors table */
erf_hdlc_dissector[ERF_HDLC_CHDLC] = find_dissector("chdlc");