aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iser.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-iser.c')
-rw-r--r--epan/dissectors/packet-iser.c41
1 files changed, 22 insertions, 19 deletions
diff --git a/epan/dissectors/packet-iser.c b/epan/dissectors/packet-iser.c
index 5ca26fd22c..65082cb3e1 100644
--- a/epan/dissectors/packet-iser.c
+++ b/epan/dissectors/packet-iser.c
@@ -13,7 +13,6 @@
#include "config.h"
#include <stdlib.h>
-#include <errno.h>
#include <epan/packet.h>
#include <epan/prefs.h>
@@ -52,27 +51,29 @@
void proto_reg_handoff_iser(void);
void proto_register_iser(void);
-static int proto_iser = -1;
+static dissector_handle_t iser_handle;
+
+static int proto_iser;
static dissector_handle_t iscsi_handler;
-static int proto_ib = -1;
+static int proto_ib;
/* iSER Header */
-static int hf_iser_flags = -1;
-static int hf_iser_opcode_f = -1;
-static int hf_iser_RSV_f = -1;
-static int hf_iser_WSV_f = -1;
-static int hf_iser_REJ_f = -1;
-static int hf_iser_write_stag = -1;
-static int hf_iser_write_va = -1;
-static int hf_iser_read_stag = -1;
-static int hf_iser_read_va = -1;
-static int hf_iser_ird = -1;
-static int hf_iser_ord = -1;
+static int hf_iser_flags;
+static int hf_iser_opcode_f;
+static int hf_iser_RSV_f;
+static int hf_iser_WSV_f;
+static int hf_iser_REJ_f;
+static int hf_iser_write_stag;
+static int hf_iser_write_va;
+static int hf_iser_read_stag;
+static int hf_iser_read_va;
+static int hf_iser_ird;
+static int hf_iser_ord;
/* Initialize the subtree pointers */
-static gint ett_iser = -1;
-static gint ett_iser_flags = -1;
+static gint ett_iser;
+static gint ett_iser_flags;
/* global preferences */
static range_t *gPORT_RANGE;
@@ -222,14 +223,14 @@ dissect_iser(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
will not work since we do not have the source QP. this WILL succeed when we're still
in the process of CM negotiations */
conv = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
- ENDPOINT_IBQP, pinfo->srcport, pinfo->destport, 0);
+ CONVERSATION_IBQP, pinfo->srcport, pinfo->destport, 0);
if (!conv) {
/* if not, try to find an established RC channel. recall Infiniband conversations are
registered with one side of the channel. since the packet is only guaranteed to
contain the qpn of the destination, we'll use this */
conv = find_conversation(pinfo->num, &pinfo->dst, &pinfo->dst,
- ENDPOINT_IBQP, pinfo->destport, pinfo->destport, NO_ADDR_B|NO_PORT_B);
+ CONVERSATION_IBQP, pinfo->destport, pinfo->destport, NO_ADDR_B|NO_PORT_B);
if (!conv)
return FALSE; /* nothing to do with no conversation context */
@@ -343,6 +344,8 @@ proto_register_iser(void)
"Range of iSER target ports"
"(default " TCP_PORT_ISER_RANGE ")",
&gPORT_RANGE, MAX_TCP_PORT);
+
+ iser_handle = register_dissector("iser", dissect_packet, proto_iser );
}
void
@@ -351,7 +354,7 @@ proto_reg_handoff_iser(void)
heur_dissector_add("infiniband.payload", dissect_iser, "iSER Infiniband", "iser_infiniband", proto_iser, HEURISTIC_ENABLE);
heur_dissector_add("infiniband.mad.cm.private", dissect_iser, "iSER in PrivateData of CM packets", "iser_ib_private", proto_iser, HEURISTIC_ENABLE);
- dissector_add_for_decode_as("infiniband", create_dissector_handle( dissect_packet, proto_iser ) );
+ dissector_add_for_decode_as("infiniband", iser_handle);
iscsi_handler = find_dissector_add_dependency("iscsi", proto_iser);
proto_ib = proto_get_id_by_filter_name( "infiniband" );