diff options
Diffstat (limited to 'epan/dissectors/packet-lnet.c')
-rw-r--r-- | epan/dissectors/packet-lnet.c | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/epan/dissectors/packet-lnet.c b/epan/dissectors/packet-lnet.c index a52f18050d..dbe1b1b661 100644 --- a/epan/dissectors/packet-lnet.c +++ b/epan/dissectors/packet-lnet.c @@ -33,80 +33,81 @@ VALUE_STRING_ARRAY2(portal_index); void proto_reg_handoff_lnet(void); void proto_register_lnet(void); +static dissector_handle_t lnet_handle; /* Initialize the protocol and registered fields */ -static int proto_lnet = -1; +static int proto_lnet; -static int hf_lnet_ksm_type = -1; -static int hf_lnet_ksm_csum = -1; -static int hf_lnet_ksm_zc_req_cookie = -1; -static int hf_lnet_ksm_zc_ack_cookie = -1; +static int hf_lnet_ksm_type; +static int hf_lnet_ksm_csum; +static int hf_lnet_ksm_zc_req_cookie; +static int hf_lnet_ksm_zc_ack_cookie; -static int hf_lnet_ib_magic = -1; -static int hf_lnet_ib_version = -1; -static int hf_lnet_ib_type = -1; -static int hf_lnet_ib_credits = -1; -static int hf_lnet_ib_nob = -1; -static int hf_lnet_ib_csum = -1; -static int hf_lnet_ib_srcstamp = -1; -static int hf_lnet_ib_dststamp = -1; +static int hf_lnet_ib_magic; +static int hf_lnet_ib_version; +static int hf_lnet_ib_type; +static int hf_lnet_ib_credits; +static int hf_lnet_ib_nob; +static int hf_lnet_ib_csum; +static int hf_lnet_ib_srcstamp; +static int hf_lnet_ib_dststamp; -static int hf_lnet_src_nid = -1; -static int hf_lnet_dest_nid = -1; +static int hf_lnet_src_nid; +static int hf_lnet_dest_nid; -static int hf_lnet_nid_addr = -1; -static int hf_lnet_nid_lnet_type = -1; -static int hf_lnet_nid_interface = -1; +static int hf_lnet_nid_addr; +static int hf_lnet_nid_lnet_type; +static int hf_lnet_nid_interface; -static int hf_lnet_dest_pid = -1; -static int hf_lnet_src_pid = -1; +static int hf_lnet_dest_pid; +static int hf_lnet_src_pid; -static int hf_lnet_msg_type = -1; -static int hf_lnet_payload_length = -1; -static int hf_lnet_payload = -1; -static int hf_lnet_msg_filler = -1; +static int hf_lnet_msg_type; +static int hf_lnet_payload_length; +static int hf_lnet_payload; +static int hf_lnet_msg_filler; -static int hf_dst_wmd_interface = -1; -static int hf_dst_wmd_object = -1; +static int hf_dst_wmd_interface; +static int hf_dst_wmd_object; -static int hf_match_bits = -1; -static int hf_mlength = -1; +static int hf_match_bits; +static int hf_mlength; -static int hf_hdr_data = -1; -static int hf_ptl_index = -1; -static int hf_offset = -1; +static int hf_hdr_data; +static int hf_ptl_index; +static int hf_offset; -static int hf_src_offset = -1; -static int hf_sink_length = -1; +static int hf_src_offset; +static int hf_sink_length; -static int hf_hello_incarnation = -1; -static int hf_hello_type = -1; +static int hf_hello_incarnation; +static int hf_hello_type; -static int hf_lnet_o2ib_connparam = -1; -static int hf_lnet_o2ib_connparam_qdepth = -1; -static int hf_lnet_o2ib_connparam_max_frags = -1; -static int hf_lnet_o2ib_connparam_max_size = -1; -static int hf_lnet_o2ib_cookie = -1; -static int hf_lnet_o2ib_src_cookie = -1; -static int hf_lnet_o2ib_dest_cookie = -1; -static int hf_lnet_o2ib_status = -1; +static int hf_lnet_o2ib_connparam; +static int hf_lnet_o2ib_connparam_qdepth; +static int hf_lnet_o2ib_connparam_max_frags; +static int hf_lnet_o2ib_connparam_max_size; +static int hf_lnet_o2ib_cookie; +static int hf_lnet_o2ib_src_cookie; +static int hf_lnet_o2ib_dest_cookie; +static int hf_lnet_o2ib_status; -static int hf_lnet_rdma_desc = -1; -static int hf_lnet_rdma_desc_key = -1; -static int hf_lnet_rdma_desc_nfrags = -1; +static int hf_lnet_rdma_desc; +static int hf_lnet_rdma_desc_key; +static int hf_lnet_rdma_desc_nfrags; -static int hf_lnet_rdma_frag_size = -1; -static int hf_lnet_rdma_frag_addr = -1; +static int hf_lnet_rdma_frag_size; +static int hf_lnet_rdma_frag_addr; /* Initialize the subtree pointers */ -static gint ett_lnet = -1; -static gint ett_lnet_nid = -1; -static gint ett_lnet_o2ib_connparams = -1; -static gint ett_lnet_rdma_desc = -1; -static gint ett_lnet_rdma_frag = -1; +static gint ett_lnet; +static gint ett_lnet_nid; +static gint ett_lnet_o2ib_connparams; +static gint ett_lnet_rdma_desc; +static gint ett_lnet_rdma_frag; -static expert_field ei_lnet_buflen = EI_INIT; -static expert_field ei_lnet_type = EI_INIT; +static expert_field ei_lnet_buflen; +static expert_field ei_lnet_type; #define LNET_TCP_PORT 988 /* Not IANA registered */ @@ -250,11 +251,11 @@ get_lnet_conv(packet_info *pinfo, guint64 match_bits) { lnet_conv_info_t *conv_info; // Ignore ports because this is kernel level and there can only be one Lustre instance per server - conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst, conversation_pt_to_endpoint_type(pinfo->ptype), + conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst, conversation_pt_to_conversation_type(pinfo->ptype), 0, 0, 0); if (conversation == NULL) conversation = conversation_new(pinfo->num, &pinfo->src, - &pinfo->dst, conversation_pt_to_endpoint_type(pinfo->ptype), 0, 0, 0); + &pinfo->dst, conversation_pt_to_conversation_type(pinfo->ptype), 0, 0, 0); conv_info = (lnet_conv_info_t *)conversation_get_proto_data(conversation, proto_lnet); if (!conv_info) { @@ -359,7 +360,7 @@ lnet_dissect_struct_nid(tvbuff_t * tvb, proto_tree *parent_tree, int offset, int item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 8, ENC_NA); tree = proto_item_add_subtree(item, ett_lnet_nid); - ip = tvb_get_ntohl(tvb, offset); + ip = tvb_get_ipv4(tvb, offset); proto_tree_add_item(tree, hf_lnet_nid_addr, tvb, offset, 4, ENC_LITTLE_ENDIAN); offset+=4; proto_tree_add_item_ret_uint(tree, hf_lnet_nid_interface, tvb, offset, 2, ENC_LITTLE_ENDIAN, &interface); @@ -790,7 +791,7 @@ dissect_lnet_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * if (msg_filler_length > 72) goto out; */ - /* +24 : ksock_message take 24bytes, and allready in offset */ + /* +24 : ksock_message take 24bytes, and already in offset */ } if (msg_filler_length > 0) { @@ -1053,6 +1054,8 @@ proto_register_lnet(void) expert_lnet = expert_register_protocol(proto_lnet); expert_register_field_array(expert_lnet, ei, array_length(ei)); + lnet_handle = register_dissector("lnet", dissect_lnet, proto_lnet); + subdissector_table = register_dissector_table("lnet.ptl_index", "lnet portal index", proto_lnet, FT_UINT32 , BASE_DEC); @@ -1061,13 +1064,10 @@ proto_register_lnet(void) void proto_reg_handoff_lnet(void) { - dissector_handle_t lnet_handle; - heur_dissector_add("infiniband.payload", dissect_lnet_ib_heur, "LNet over IB", "lnet_ib", proto_lnet, HEURISTIC_ENABLE); heur_dissector_add("infiniband.mad.cm.private", dissect_lnet_ib_heur, "LNet over IB CM", "lnet_ib_cm_private", proto_lnet, HEURISTIC_ENABLE); - lnet_handle = create_dissector_handle(dissect_lnet, proto_lnet); dissector_add_for_decode_as("infiniband", lnet_handle); dissector_add_uint_with_preference("tcp.port", LNET_TCP_PORT, lnet_handle); } |