aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-fcswils.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-fcswils.c')
-rw-r--r--epan/dissectors/packet-fcswils.c443
1 files changed, 222 insertions, 221 deletions
diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c
index f6e8c82f3c..98585b84e6 100644
--- a/epan/dissectors/packet-fcswils.c
+++ b/epan/dissectors/packet-fcswils.c
@@ -21,6 +21,8 @@
void proto_register_fcswils(void);
void proto_reg_handoff_fcswils(void);
+static dissector_handle_t swils_handle;
+
/*
* See the FC-SW specifications.
*/
@@ -36,198 +38,198 @@ void proto_reg_handoff_fcswils(void);
#define ZONENAME_LEN(x, y) (tvb_get_guint8(x, y)+4)
/* Initialize the protocol and registered fields */
-static int proto_fcswils = -1;
-static int hf_swils_opcode = -1;
-static int hf_swils_elp_rev = -1;
-static int hf_swils_elp_flags = -1;
-static int hf_swils_elp_r_a_tov = -1;
-static int hf_swils_elp_e_d_tov = -1;
-static int hf_swils_elp_req_epn = -1;
-static int hf_swils_elp_req_esn = -1;
-static int hf_swils_elp_clsf_svcp = -1;
-static int hf_swils_elp_clsf_rcvsz = -1;
-static int hf_swils_elp_clsf_conseq = -1;
-static int hf_swils_elp_clsf_e2e = -1;
-static int hf_swils_elp_clsf_openseq = -1;
-static int hf_swils_elp_cls1_svcp = -1;
-static int hf_swils_elp_cls1_rcvsz = -1;
-static int hf_swils_elp_cls2_svcp = -1;
-static int hf_swils_elp_cls2_rcvsz = -1;
-static int hf_swils_elp_cls3_svcp = -1;
-static int hf_swils_elp_cls3_rcvsz = -1;
-static int hf_swils_elp_isl_fc_mode = -1;
-static int hf_swils_elp_fcplen = -1;
-static int hf_swils_elp_b2bcredit = -1;
-static int hf_swils_elp_compat1 = -1;
-static int hf_swils_elp_compat2 = -1;
-static int hf_swils_elp_compat3 = -1;
-static int hf_swils_elp_compat4 = -1;
-static int hf_swils_efp_rec_type = -1;
-static int hf_swils_efp_dom_id = -1;
-static int hf_swils_efp_switch_name = -1;
-static int hf_swils_efp_mcast_grpno = -1;
-/* static int hf_swils_efp_alias_token = -1; */
-static int hf_swils_efp_record_len = -1;
-static int hf_swils_efp_payload_len = -1;
-static int hf_swils_efp_pswitch_pri = -1;
-static int hf_swils_efp_pswitch_name = -1;
-static int hf_swils_dia_switch_name = -1;
-static int hf_swils_rdi_payload_len = -1;
-static int hf_swils_rdi_req_sname = -1;
-/* static int hf_swils_fspfh_cmd = -1; */
-static int hf_swils_fspfh_rev = -1;
-static int hf_swils_fspfh_ar_num = -1;
-static int hf_swils_fspfh_auth_type = -1;
-static int hf_swils_fspfh_dom_id = -1;
-static int hf_swils_fspfh_auth = -1;
-static int hf_swils_hlo_options = -1;
-static int hf_swils_hlo_hloint = -1;
-static int hf_swils_hlo_deadint = -1;
-static int hf_swils_hlo_rcv_domid = -1;
-static int hf_swils_hlo_orig_pidx = -1;
-static int hf_swils_ldrec_linkid = -1;
-static int hf_swils_ldrec_out_pidx = -1;
-static int hf_swils_ldrec_nbr_pidx = -1;
-static int hf_swils_ldrec_link_type = -1;
-static int hf_swils_ldrec_link_cost = -1;
-static int hf_swils_lsrh_lsr_type = -1;
-static int hf_swils_lsrh_lsid = -1;
-static int hf_swils_lsrh_adv_domid = -1;
-static int hf_swils_lsrh_ls_incid = -1;
-static int hf_swils_esc_pdesc_vendorid = -1;
-static int hf_swils_esc_swvendorid = -1;
-static int hf_swils_esc_protocolid = -1;
-static int hf_swils_rscn_evtype = -1;
-static int hf_swils_rscn_addrfmt = -1;
-static int hf_swils_rscn_detectfn = -1;
-static int hf_swils_rscn_affectedport = -1;
-static int hf_swils_rscn_portstate = -1;
-static int hf_swils_rscn_portid = -1;
-static int hf_swils_rscn_pwwn = -1;
-static int hf_swils_rscn_nwwn = -1;
-static int hf_swils_zone_activezonenm = -1;
-static int hf_swils_zone_objname = -1;
-static int hf_swils_zone_objtype = -1;
-static int hf_swils_zone_mbrtype = -1;
-static int hf_swils_zone_protocol = -1;
-static int hf_swils_zone_mbrid = -1;
-static int hf_swils_zone_mbrid_fcwwn = -1;
-static int hf_swils_zone_mbrid_fc = -1;
-static int hf_swils_zone_mbrid_uint = -1;
-static int hf_swils_zone_status = -1;
-static int hf_swils_zone_reason = -1;
-static int hf_swils_aca_domainid = -1;
-static int hf_swils_sfc_opcode = -1;
-static int hf_swils_sfc_zonenm = -1;
-static int hf_swils_rjt = -1;
-static int hf_swils_rjtdet = -1;
-static int hf_swils_rjtvendor = -1;
-static int hf_swils_zone_mbrid_lun = -1;
-static int hf_swils_ess_rev = -1;
-static int hf_swils_ess_len = -1;
-static int hf_swils_ess_numobj = -1;
-static int hf_swils_interconnect_list_len = -1;
-static int hf_swils_ess_vendorname = -1;
-static int hf_swils_ess_modelname = -1;
-static int hf_swils_ess_relcode = -1;
-static int hf_swils_ess_vendorspecific = -1;
-static int hf_swils_ess_cap_type = -1;
-static int hf_swils_ess_cap_subtype = -1;
-static int hf_swils_ess_cap_numentries = -1;
-static int hf_swils_ess_cap_svc = -1;
-static int hf_swils_ess_dns_obj0h = -1;
-static int hf_swils_ess_dns_obj1h = -1;
-static int hf_swils_ess_dns_obj2h = -1;
-static int hf_swils_ess_dns_obj3h = -1;
-static int hf_swils_ess_dns_zlacc = -1;
-static int hf_swils_ess_dns_vendor = -1;
-static int hf_swils_ess_fctlr_rscn = -1;
-static int hf_swils_ess_fctlr_vendor = -1;
-static int hf_swils_ess_fcs_basic = -1;
-static int hf_swils_ess_fcs_platform = -1;
-static int hf_swils_ess_fcs_topology = -1;
-static int hf_swils_ess_fcs_enhanced = -1;
-static int hf_swils_ess_fzs_enh_supp = -1;
-static int hf_swils_ess_fzs_enh_ena = -1;
-static int hf_swils_ess_fzs_mr = -1;
-static int hf_swils_ess_fzs_zsdb_supp = -1;
-static int hf_swils_ess_fzs_zsdb_ena = -1;
-static int hf_swils_ess_fzs_adc_supp = -1;
-static int hf_swils_ess_fzs_hardzone = -1;
-static int hf_swils_mrra_rev = -1;
-static int hf_swils_mrra_size = -1;
-static int hf_swils_mrra_vendorid = -1;
-static int hf_swils_mrra_reply = -1;
-static int hf_swils_mrra_reply_size = -1;
-static int hf_swils_mrra_waittime = -1;
-static int hf_swils_ess_cap_t10 = -1;
-static int hf_swils_ess_cap_vendorobj = -1;
-static int hf_swils_ess_fzs_defzone = -1;
-static int hf_swils_ess_cap_len = -1;
-static int hf_swils_mrra_vendorinfo = -1;
+static int proto_fcswils;
+static int hf_swils_opcode;
+static int hf_swils_elp_rev;
+static int hf_swils_elp_flags;
+static int hf_swils_elp_r_a_tov;
+static int hf_swils_elp_e_d_tov;
+static int hf_swils_elp_req_epn;
+static int hf_swils_elp_req_esn;
+static int hf_swils_elp_clsf_svcp;
+static int hf_swils_elp_clsf_rcvsz;
+static int hf_swils_elp_clsf_conseq;
+static int hf_swils_elp_clsf_e2e;
+static int hf_swils_elp_clsf_openseq;
+static int hf_swils_elp_cls1_svcp;
+static int hf_swils_elp_cls1_rcvsz;
+static int hf_swils_elp_cls2_svcp;
+static int hf_swils_elp_cls2_rcvsz;
+static int hf_swils_elp_cls3_svcp;
+static int hf_swils_elp_cls3_rcvsz;
+static int hf_swils_elp_isl_fc_mode;
+static int hf_swils_elp_fcplen;
+static int hf_swils_elp_b2bcredit;
+static int hf_swils_elp_compat1;
+static int hf_swils_elp_compat2;
+static int hf_swils_elp_compat3;
+static int hf_swils_elp_compat4;
+static int hf_swils_efp_rec_type;
+static int hf_swils_efp_dom_id;
+static int hf_swils_efp_switch_name;
+static int hf_swils_efp_mcast_grpno;
+/* static int hf_swils_efp_alias_token; */
+static int hf_swils_efp_record_len;
+static int hf_swils_efp_payload_len;
+static int hf_swils_efp_pswitch_pri;
+static int hf_swils_efp_pswitch_name;
+static int hf_swils_dia_switch_name;
+static int hf_swils_rdi_payload_len;
+static int hf_swils_rdi_req_sname;
+/* static int hf_swils_fspfh_cmd; */
+static int hf_swils_fspfh_rev;
+static int hf_swils_fspfh_ar_num;
+static int hf_swils_fspfh_auth_type;
+static int hf_swils_fspfh_dom_id;
+static int hf_swils_fspfh_auth;
+static int hf_swils_hlo_options;
+static int hf_swils_hlo_hloint;
+static int hf_swils_hlo_deadint;
+static int hf_swils_hlo_rcv_domid;
+static int hf_swils_hlo_orig_pidx;
+static int hf_swils_ldrec_linkid;
+static int hf_swils_ldrec_out_pidx;
+static int hf_swils_ldrec_nbr_pidx;
+static int hf_swils_ldrec_link_type;
+static int hf_swils_ldrec_link_cost;
+static int hf_swils_lsrh_lsr_type;
+static int hf_swils_lsrh_lsid;
+static int hf_swils_lsrh_adv_domid;
+static int hf_swils_lsrh_ls_incid;
+static int hf_swils_esc_pdesc_vendorid;
+static int hf_swils_esc_swvendorid;
+static int hf_swils_esc_protocolid;
+static int hf_swils_rscn_evtype;
+static int hf_swils_rscn_addrfmt;
+static int hf_swils_rscn_detectfn;
+static int hf_swils_rscn_affectedport;
+static int hf_swils_rscn_portstate;
+static int hf_swils_rscn_portid;
+static int hf_swils_rscn_pwwn;
+static int hf_swils_rscn_nwwn;
+static int hf_swils_zone_activezonenm;
+static int hf_swils_zone_objname;
+static int hf_swils_zone_objtype;
+static int hf_swils_zone_mbrtype;
+static int hf_swils_zone_protocol;
+static int hf_swils_zone_mbrid;
+static int hf_swils_zone_mbrid_fcwwn;
+static int hf_swils_zone_mbrid_fc;
+static int hf_swils_zone_mbrid_uint;
+static int hf_swils_zone_status;
+static int hf_swils_zone_reason;
+static int hf_swils_aca_domainid;
+static int hf_swils_sfc_opcode;
+static int hf_swils_sfc_zonenm;
+static int hf_swils_rjt;
+static int hf_swils_rjtdet;
+static int hf_swils_rjtvendor;
+static int hf_swils_zone_mbrid_lun;
+static int hf_swils_ess_rev;
+static int hf_swils_ess_len;
+static int hf_swils_ess_numobj;
+static int hf_swils_interconnect_list_len;
+static int hf_swils_ess_vendorname;
+static int hf_swils_ess_modelname;
+static int hf_swils_ess_relcode;
+static int hf_swils_ess_vendorspecific;
+static int hf_swils_ess_cap_type;
+static int hf_swils_ess_cap_subtype;
+static int hf_swils_ess_cap_numentries;
+static int hf_swils_ess_cap_svc;
+static int hf_swils_ess_dns_obj0h;
+static int hf_swils_ess_dns_obj1h;
+static int hf_swils_ess_dns_obj2h;
+static int hf_swils_ess_dns_obj3h;
+static int hf_swils_ess_dns_zlacc;
+static int hf_swils_ess_dns_vendor;
+static int hf_swils_ess_fctlr_rscn;
+static int hf_swils_ess_fctlr_vendor;
+static int hf_swils_ess_fcs_basic;
+static int hf_swils_ess_fcs_platform;
+static int hf_swils_ess_fcs_topology;
+static int hf_swils_ess_fcs_enhanced;
+static int hf_swils_ess_fzs_enh_supp;
+static int hf_swils_ess_fzs_enh_ena;
+static int hf_swils_ess_fzs_mr;
+static int hf_swils_ess_fzs_zsdb_supp;
+static int hf_swils_ess_fzs_zsdb_ena;
+static int hf_swils_ess_fzs_adc_supp;
+static int hf_swils_ess_fzs_hardzone;
+static int hf_swils_mrra_rev;
+static int hf_swils_mrra_size;
+static int hf_swils_mrra_vendorid;
+static int hf_swils_mrra_reply;
+static int hf_swils_mrra_reply_size;
+static int hf_swils_mrra_waittime;
+static int hf_swils_ess_cap_t10;
+static int hf_swils_ess_cap_vendorobj;
+static int hf_swils_ess_fzs_defzone;
+static int hf_swils_ess_cap_len;
+static int hf_swils_mrra_vendorinfo;
/* Generated from convert_proto_tree_add_text.pl */
-static int hf_swils_lsrh_lsr_age = -1;
-static int hf_swils_zone_full_zone_set_length = -1;
-static int hf_swils_zone_num_zoning_objects = -1;
-static int hf_swils_lsrec_number_of_links = -1;
-static int hf_swils_sfc_zoneset_length = -1;
-static int hf_swils_zone_vendor_unique = -1;
-static int hf_swils_zone_num_members = -1;
-static int hf_swils_zone_active_zoneset_length = -1;
-static int hf_swils_lsack_num_of_lsr_headers = -1;
-static int hf_swils_lsrh_lsr_length = -1;
-static int hf_swils_esc_payload_length = -1;
-static int hf_swils_lsupdate_num_of_lsrs = -1;
-static int hf_swils_zone_mbr_identifier_length = -1;
-static int hf_swils_zone_mbrflags = -1;
-static int hf_swils_lsrh_options = -1;
-static int hf_swils_domain_id_list_length = -1;
-static int hf_swils_lsack_flags = -1;
-static int hf_swils_rscn_num_entries = -1;
-static int hf_swils_requested_domain_id = -1;
-static int hf_swils_lsrh_checksum = -1;
-static int hf_swils_granted_domain_id = -1;
-static int hf_swils_lsupdate_flags = -1;
-
-
-static expert_field ei_swils_efp_record_len = EI_INIT;
-static expert_field ei_swils_no_exchange = EI_INIT;
-static expert_field ei_swils_zone_mbrid = EI_INIT;
+static int hf_swils_lsrh_lsr_age;
+static int hf_swils_zone_full_zone_set_length;
+static int hf_swils_zone_num_zoning_objects;
+static int hf_swils_lsrec_number_of_links;
+static int hf_swils_sfc_zoneset_length;
+static int hf_swils_zone_vendor_unique;
+static int hf_swils_zone_num_members;
+static int hf_swils_zone_active_zoneset_length;
+static int hf_swils_lsack_num_of_lsr_headers;
+static int hf_swils_lsrh_lsr_length;
+static int hf_swils_esc_payload_length;
+static int hf_swils_lsupdate_num_of_lsrs;
+static int hf_swils_zone_mbr_identifier_length;
+static int hf_swils_zone_mbrflags;
+static int hf_swils_lsrh_options;
+static int hf_swils_domain_id_list_length;
+static int hf_swils_lsack_flags;
+static int hf_swils_rscn_num_entries;
+static int hf_swils_requested_domain_id;
+static int hf_swils_lsrh_checksum;
+static int hf_swils_granted_domain_id;
+static int hf_swils_lsupdate_flags;
+
+
+static expert_field ei_swils_efp_record_len;
+static expert_field ei_swils_no_exchange;
+static expert_field ei_swils_zone_mbrid;
/* Initialize the subtree pointers */
-static gint ett_fcswils = -1;
-static gint ett_fcswils_swacc = -1;
-static gint ett_fcswils_swrjt = -1;
-static gint ett_fcswils_elp = -1;
-static gint ett_fcswils_efp = -1;
-static gint ett_fcswils_efplist = -1;
-static gint ett_fcswils_dia = -1;
-static gint ett_fcswils_rdi = -1;
-static gint ett_fcswils_fspfhdr = -1;
-static gint ett_fcswils_hlo = -1;
-static gint ett_fcswils_lsrec = -1;
-static gint ett_fcswils_lsrechdr = -1;
-static gint ett_fcswils_ldrec = -1;
-static gint ett_fcswils_lsu = -1;
-static gint ett_fcswils_lsa = -1;
-static gint ett_fcswils_bf = -1;
-static gint ett_fcswils_rcf = -1;
-static gint ett_fcswils_rscn = -1;
-static gint ett_fcswils_rscn_dev = -1;
-static gint ett_fcswils_drlir = -1;
-static gint ett_fcswils_mr = -1;
-static gint ett_fcswils_zoneobjlist = -1;
-static gint ett_fcswils_zoneobj = -1;
-static gint ett_fcswils_zonembr = -1;
-static gint ett_fcswils_aca = -1;
-static gint ett_fcswils_rca = -1;
-static gint ett_fcswils_sfc = -1;
-static gint ett_fcswils_ufc = -1;
-static gint ett_fcswils_esc = -1;
-static gint ett_fcswils_esc_pdesc = -1;
-static gint ett_fcswils_ieinfo = -1;
-static gint ett_fcswils_capinfo = -1;
+static gint ett_fcswils;
+static gint ett_fcswils_swacc;
+static gint ett_fcswils_swrjt;
+static gint ett_fcswils_elp;
+static gint ett_fcswils_efp;
+static gint ett_fcswils_efplist;
+static gint ett_fcswils_dia;
+static gint ett_fcswils_rdi;
+static gint ett_fcswils_fspfhdr;
+static gint ett_fcswils_hlo;
+static gint ett_fcswils_lsrec;
+static gint ett_fcswils_lsrechdr;
+static gint ett_fcswils_ldrec;
+static gint ett_fcswils_lsu;
+static gint ett_fcswils_lsa;
+static gint ett_fcswils_bf;
+static gint ett_fcswils_rcf;
+static gint ett_fcswils_rscn;
+static gint ett_fcswils_rscn_dev;
+static gint ett_fcswils_drlir;
+static gint ett_fcswils_mr;
+static gint ett_fcswils_zoneobjlist;
+static gint ett_fcswils_zoneobj;
+static gint ett_fcswils_zonembr;
+static gint ett_fcswils_aca;
+static gint ett_fcswils_rca;
+static gint ett_fcswils_sfc;
+static gint ett_fcswils_ufc;
+static gint ett_fcswils_esc;
+static gint ett_fcswils_esc_pdesc;
+static gint ett_fcswils_ieinfo;
+static gint ett_fcswils_capinfo;
static const value_string fc_swils_opcode_key_val[] = {
{FC_SWILS_SWRJT , "SW_RJT"},
@@ -469,10 +471,10 @@ fcswils_hash(gconstpointer v)
}
static guint8 *
-zonenm_to_str(tvbuff_t *tvb, gint offset)
+zonenm_to_str(wmem_allocator_t *scope, tvbuff_t *tvb, gint offset)
{
int len = tvb_get_guint8(tvb, offset);
- return tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, len, ENC_ASCII);
+ return tvb_get_string_enc(scope, tvb, offset+4, len, ENC_ASCII);
}
/* Offset points to the start of the zone object */
@@ -493,13 +495,13 @@ get_zoneobj_len(tvbuff_t *tvb, gint offset)
* id (id_len bytes)
*/
objtype = tvb_get_guint8(tvb, offset);
- len = 4 + ZONENAME_LEN(tvb, offset+4); /* length upto num_of_mbrs field */
+ len = 4 + ZONENAME_LEN(tvb, offset+4); /* length up to num_of_mbrs field */
numrec = tvb_get_ntohl(tvb, offset+len); /* gets us num of zone mbrs */
len += 4; /* + num_mbrs */
for (i = 0; i < numrec; i++) {
if (objtype == FC_SWILS_ZONEOBJ_ZONESET) {
- len += 4 + ZONENAME_LEN(tvb, offset+4+len); /* length upto num_of_mbrs field */
+ len += 4 + ZONENAME_LEN(tvb, offset+4+len); /* length up to num_of_mbrs field */
numrec1 = tvb_get_ntohl(tvb, offset+len);
len += 4;
@@ -525,15 +527,15 @@ dissect_swils_interconnect_element_info(tvbuff_t *tvb, proto_tree *tree, int off
if (tree) {
proto_tree_add_item(tree, hf_swils_interconnect_list_len, tvb, offset+3, 1, ENC_BIG_ENDIAN);
len = tvb_strsize(tvb, offset+4);
- proto_tree_add_item(tree, hf_swils_ess_vendorname, tvb, offset+4, len, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(tree, hf_swils_ess_vendorname, tvb, offset+4, len, ENC_ASCII);
offset += (4 + len);
max_len -= len;
len = tvb_strsize(tvb, offset);
- proto_tree_add_item(tree, hf_swils_ess_modelname, tvb, offset, len, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(tree, hf_swils_ess_modelname, tvb, offset, len, ENC_ASCII);
offset += len;
max_len -= len;
len = tvb_strsize(tvb, offset);
- proto_tree_add_item(tree, hf_swils_ess_relcode, tvb, offset, len, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(tree, hf_swils_ess_relcode, tvb, offset, len, ENC_ASCII);
offset += len;
max_len -= len;
while (max_len > 0) {
@@ -541,7 +543,7 @@ dissect_swils_interconnect_element_info(tvbuff_t *tvb, proto_tree *tree, int off
* strings
*/
len = tvb_strsize(tvb, offset);
- proto_tree_add_item(tree, hf_swils_ess_vendorspecific, tvb, offset, len, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(tree, hf_swils_ess_vendorspecific, tvb, offset, len, ENC_ASCII);
offset += len;
max_len -= len;
}
@@ -669,7 +671,7 @@ dissect_swils_ess_capability_obj(tvbuff_t *tvb, proto_tree *tree, int offset)
proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_len, tvb, offset+3,
1, ENC_BIG_ENDIAN);
proto_tree_add_item(capinfo_tree, hf_swils_ess_cap_t10, tvb, offset+4,
- 8, ENC_ASCII|ENC_NA);
+ 8, ENC_ASCII);
i -= 8; /* reduce length by t10 object size */
offset += 12;
len += 12;
@@ -695,7 +697,7 @@ dissect_swils_nullpayload(tvbuff_t *tvb _U_, packet_info* pinfo _U_, proto_tree
}
static void
-dissect_swils_elp(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *elp_tree, guint8 isreq _U_)
+dissect_swils_elp(tvbuff_t *tvb, packet_info* pinfo, proto_tree *elp_tree, guint8 isreq _U_)
{
/* Set up structures needed to add the protocol subtree and manage it */
@@ -749,22 +751,22 @@ dissect_swils_elp(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *elp_tree, g
char *flagsbuf;
gint stroff, returned_length;
- flagsbuf=(char *)wmem_alloc(wmem_packet_scope(), MAX_FLAGS_LEN);
+ flagsbuf=(char *)wmem_alloc(pinfo->pool, MAX_FLAGS_LEN);
stroff = 0;
- returned_length = g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff,
+ returned_length = snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff,
"Class 1 Valid");
stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
if (cls1_svcparm[0] & 0x40) {
- returned_length = g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IMX");
+ returned_length = snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IMX");
stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
}
if (cls1_svcparm[0] & 0x20) {
- returned_length = g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IPS");
+ returned_length = snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | IPS");
stroff += MIN(returned_length, MAX_FLAGS_LEN-stroff);
}
if (cls1_svcparm[0] & 0x10) {
- /*returned_length =*/ g_snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | LKS");
+ /*returned_length =*/ snprintf(flagsbuf+stroff, MAX_FLAGS_LEN-stroff, " | LKS");
}
flags=flagsbuf;
}
@@ -1178,7 +1180,7 @@ dissect_swils_zone_mbr(tvbuff_t *tvb, packet_info* pinfo, proto_tree *zmbr_tree,
break;
case FC_SWILS_ZONEMBR_ALIAS:
proto_tree_add_string(zmbr_tree, hf_swils_zone_mbrid, tvb,
- offset+4, idlen, zonenm_to_str(tvb, offset+4));
+ offset+4, idlen, zonenm_to_str(pinfo->pool, tvb, offset+4));
break;
case FC_SWILS_ZONEMBR_WWN_LUN:
proto_tree_add_item(zmbr_tree, hf_swils_zone_mbrid_fcwwn, tvb,
@@ -1217,7 +1219,7 @@ dissect_swils_zone_obj(tvbuff_t *tvb, packet_info* pinfo, proto_tree *zobj_tree,
1, ENC_BIG_ENDIAN);
proto_tree_add_item(zobj_tree, hf_swils_zone_protocol, tvb,
offset+1, 1, ENC_BIG_ENDIAN);
- str = zonenm_to_str(tvb, offset+4);
+ str = zonenm_to_str(pinfo->pool, tvb, offset+4);
proto_tree_add_string(zobj_tree, hf_swils_zone_objname, tvb,
offset+4, ZONENAME_LEN(tvb, offset+4), str);
@@ -1255,7 +1257,7 @@ dissect_swils_mergereq(tvbuff_t *tvb, packet_info* pinfo, proto_tree *mr_tree, g
proto_tree_add_item(mr_tree, hf_swils_zone_active_zoneset_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
if (zonesetlen) {
- str = zonenm_to_str(tvb, offset+4);
+ str = zonenm_to_str(pinfo->pool, tvb, offset+4);
proto_tree_add_string(mr_tree, hf_swils_zone_activezonenm, tvb,
offset+4, ZONENAME_LEN(tvb, offset+4),
str);
@@ -1382,7 +1384,7 @@ dissect_swils_sfc(tvbuff_t *tvb, packet_info* pinfo, proto_tree *sfc_tree, guint
proto_tree_add_item(sfc_tree, hf_swils_sfc_zoneset_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
if (zonesetlen) {
- str = zonenm_to_str(tvb, offset+4);
+ str = zonenm_to_str(pinfo->pool, tvb, offset+4);
proto_tree_add_string(sfc_tree, hf_swils_sfc_zonenm, tvb,
offset+4, ZONENAME_LEN(tvb, offset+4),
str);
@@ -1473,7 +1475,7 @@ dissect_swils_esc(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *esc_tree, g
plen = tvb_get_ntohs(tvb, offset+2);
proto_tree_add_item(esc_tree, hf_swils_esc_payload_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(esc_tree, hf_swils_esc_swvendorid, tvb,
- offset+4, 8, ENC_ASCII|ENC_NA);
+ offset+4, 8, ENC_ASCII);
numrec = (plen - 12)/12;
offset = 12;
@@ -1481,7 +1483,7 @@ dissect_swils_esc(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *esc_tree, g
pdesc_tree = proto_tree_add_subtree_format(esc_tree, tvb, offset, 12,
ett_fcswils_esc_pdesc, NULL, "Protocol Descriptor %d", i);
proto_tree_add_item(pdesc_tree, hf_swils_esc_pdesc_vendorid, tvb,
- offset, 8, ENC_ASCII|ENC_NA);
+ offset, 8, ENC_ASCII);
proto_tree_add_item(pdesc_tree, hf_swils_esc_protocolid,
tvb, offset+10, 2, ENC_BIG_ENDIAN);
offset += 12;
@@ -1489,12 +1491,12 @@ dissect_swils_esc(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *esc_tree, g
}
else {
proto_tree_add_item(esc_tree, hf_swils_esc_swvendorid, tvb,
- offset+4, 8, ENC_ASCII|ENC_NA);
+ offset+4, 8, ENC_ASCII);
pdesc_tree = proto_tree_add_subtree(esc_tree, tvb, offset+12, 12,
ett_fcswils_esc_pdesc, NULL, "Accepted Protocol Descriptor");
proto_tree_add_item(pdesc_tree, hf_swils_esc_pdesc_vendorid, tvb,
- offset+12, 8, ENC_ASCII|ENC_NA);
+ offset+12, 8, ENC_ASCII);
proto_tree_add_item(pdesc_tree, hf_swils_esc_protocolid,
tvb, offset+22, 2, ENC_BIG_ENDIAN);
}
@@ -1574,12 +1576,12 @@ dissect_swils_mrra(tvbuff_t *tvb, packet_info* pinfo _U_, proto_tree *tree, guin
if (isreq) {
proto_tree_add_item(tree, hf_swils_mrra_rev, tvb, offset+4, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_swils_mrra_size, tvb, offset+8, 4, ENC_BIG_ENDIAN);
- proto_tree_add_item(tree, hf_swils_mrra_vendorid, tvb, offset+12, 8, ENC_ASCII|ENC_NA);
+ proto_tree_add_item(tree, hf_swils_mrra_vendorid, tvb, offset+12, 8, ENC_ASCII);
proto_tree_add_item(tree, hf_swils_mrra_vendorinfo, tvb, offset+20,
8, ENC_NA);
} else {
proto_tree_add_item(tree, hf_swils_mrra_vendorid, tvb, offset+4,
- 8, ENC_ASCII|ENC_NA);
+ 8, ENC_ASCII);
proto_tree_add_item(tree, hf_swils_mrra_reply, tvb, offset+12,
4, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_swils_mrra_reply_size, tvb, offset+16,
@@ -1680,11 +1682,11 @@ dissect_fcswils(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
/* Register conversation if this is not a response */
if ((opcode != FC_SWILS_SWACC) && (opcode != FC_SWILS_SWRJT)) {
conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
- conversation_pt_to_endpoint_type(pinfo->ptype), fchdr->oxid,
- fchdr->rxid, NO_PORT2);
+ conversation_pt_to_conversation_type(pinfo->ptype), fchdr->oxid,
+ fchdr->rxid, NO_PORT_B);
if (!conversation) {
conversation = conversation_new(pinfo->num, &pinfo->src, &pinfo->dst,
- conversation_pt_to_endpoint_type(pinfo->ptype), fchdr->oxid,
+ conversation_pt_to_conversation_type(pinfo->ptype), fchdr->oxid,
fchdr->rxid, NO_PORT2);
}
@@ -1712,8 +1714,8 @@ dissect_fcswils(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
else {
/* Opcode is ACC or RJT */
conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
- conversation_pt_to_endpoint_type(pinfo->ptype), fchdr->oxid,
- fchdr->rxid, NO_PORT2);
+ conversation_pt_to_conversation_type(pinfo->ptype), fchdr->oxid,
+ fchdr->rxid, NO_PORT_B);
isreq = FC_SWILS_RPLY;
if (!conversation) {
if (tree && (opcode == FC_SWILS_SWACC)) {
@@ -2500,14 +2502,13 @@ proto_register_fcswils(void)
expert_register_field_array(expert_fcswils, ei, array_length(ei));
fcswils_req_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), fcswils_hash, fcswils_equal);
+
+ swils_handle = register_dissector("swils", dissect_fcswils, proto_fcswils);
}
void
proto_reg_handoff_fcswils(void)
{
- dissector_handle_t swils_handle;
-
- swils_handle = create_dissector_handle(dissect_fcswils, proto_fcswils);
dissector_add_uint("fc.ftype", FC_FTYPE_SWILS, swils_handle);
fcsp_handle = find_dissector_add_dependency("fcsp", proto_fcswils);