diff options
Diffstat (limited to 'epan/dissectors/packet-sasp.c')
-rw-r--r-- | epan/dissectors/packet-sasp.c | 236 |
1 files changed, 118 insertions, 118 deletions
diff --git a/epan/dissectors/packet-sasp.c b/epan/dissectors/packet-sasp.c index 9ec028134e..7749d234e8 100644 --- a/epan/dissectors/packet-sasp.c +++ b/epan/dissectors/packet-sasp.c @@ -22,6 +22,8 @@ void proto_register_sasp(void); void proto_reg_handoff_sasp(void); +static dissector_handle_t sasp_handle; + static void dissect_reg_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset); static void dissect_dereg_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset); static void dissect_reg_rep(tvbuff_t *tvb, proto_tree *tree, guint32 offset); @@ -42,152 +44,152 @@ static guint32 dissect_weight_entry_data_comp(tvbuff_t *tvb, proto_tree *pay_loa static guint32 dissect_grp_wt_entry_datacomp(tvbuff_t *tvb, proto_tree *tree, guint32 offset); /* Initialize the protocol and registered fields */ -static int proto_sasp = -1; -static int hf_sasp_type = -1; -static int hf_sasp_length = -1; -static int hf_sasp_vrsn = -1; -static int hf_msg_len = -1; -static int hf_msg_id = -1; -static int hf_msg_type = -1; +static int proto_sasp; +static int hf_sasp_type; +static int hf_sasp_length; +static int hf_sasp_vrsn; +static int hf_msg_len; +static int hf_msg_id; +static int hf_msg_type; /*reg reply*/ -static int hf_sasp_reg_rep_rcode = -1; -static int hf_sasp_reg_rep_sz = -1; +static int hf_sasp_reg_rep_rcode; +static int hf_sasp_reg_rep_sz; /*reg req*/ -static int hf_sasp_reg_req_sz = -1; -static int hf_reg_req_lbflag = -1; -static int hf_sasp_gmd_cnt = -1; +static int hf_sasp_reg_req_sz; +static int hf_reg_req_lbflag; +static int hf_sasp_gmd_cnt; /*dereg req*/ -static int hf_sasp_dereg_req_sz = -1; -static int hf_dereg_req_lbflag = -1; -/* static int hf_dereg_req_reason = -1; */ -static int hf_dereg_req_reason_flag = -1; +static int hf_sasp_dereg_req_sz; +static int hf_dereg_req_lbflag; +/* static int hf_dereg_req_reason; */ +static int hf_dereg_req_reason_flag; /*dereg reply*/ -static int hf_sasp_dereg_rep_rcode = -1; -static int hf_sasp_dereg_rep_sz = -1; +static int hf_sasp_dereg_rep_rcode; +static int hf_sasp_dereg_rep_sz; /*send wt*/ -static int hf_sasp_sendwt_gwedcnt = -1; -static int hf_sasp_sendwt_sz = -1; +static int hf_sasp_sendwt_gwedcnt; +static int hf_sasp_sendwt_sz; /*setmemstate req*/ -static int hf_sasp_setmemstate_req_sz = -1; -static int hf_setmemstate_req_lbflag = -1; -/*static int hf_sasp_setmemstate_req_data = -1;*/ -static int hf_sasp_setmemstate_req_gmsd_cnt = -1; +static int hf_sasp_setmemstate_req_sz; +static int hf_setmemstate_req_lbflag; +/*static int hf_sasp_setmemstate_req_data;*/ +static int hf_sasp_setmemstate_req_gmsd_cnt; /*setmemstate reply*/ -/* static int hf_sasp_setmemstate_rep = -1; */ -static int hf_sasp_setmemstate_rep_rcode = -1; -static int hf_sasp_setmemstate_rep_sz = -1; +/* static int hf_sasp_setmemstate_rep; */ +static int hf_sasp_setmemstate_rep_rcode; +static int hf_sasp_setmemstate_rep_sz; /*mem data comp */ -static int hf_sasp_memdatacomp_type = -1; -static int hf_sasp_memdatacomp_sz = -1; -static int hf_sasp_memdatacomp_protocol = -1; -static int hf_sasp_memdatacomp_port = -1; -static int hf_sasp_memdatacomp_ip = -1; -static int hf_sasp_memdatacomp_lab_len = -1; -static int hf_sasp_memdatacomp_label = -1; +static int hf_sasp_memdatacomp_type; +static int hf_sasp_memdatacomp_sz; +static int hf_sasp_memdatacomp_protocol; +static int hf_sasp_memdatacomp_port; +static int hf_sasp_memdatacomp_ip; +static int hf_sasp_memdatacomp_lab_len; +static int hf_sasp_memdatacomp_label; /*grp data comp */ -static int hf_sasp_grpdatacomp = -1; -static int hf_sasp_grpdatacomp_sz = -1; -static int hf_sasp_grpdatacomp_LB_uid_len = -1; -static int hf_sasp_grpdatacomp_LB_uid = -1; -static int hf_sasp_grpdatacomp_grp_name_len = -1; -static int hf_sasp_grpdatacomp_grp_name = -1; +static int hf_sasp_grpdatacomp; +static int hf_sasp_grpdatacomp_sz; +static int hf_sasp_grpdatacomp_LB_uid_len; +static int hf_sasp_grpdatacomp_LB_uid; +static int hf_sasp_grpdatacomp_grp_name_len; +static int hf_sasp_grpdatacomp_grp_name; /*grp mem data comp */ -static int hf_sasp_grp_memdatacomp = -1; -static int hf_sasp_grp_memdatacomp_sz = -1; -static int hf_sasp_grp_memdatacomp_cnt = -1; +static int hf_sasp_grp_memdatacomp; +static int hf_sasp_grp_memdatacomp_sz; +static int hf_sasp_grp_memdatacomp_cnt; /*weight req*/ -static int hf_sasp_wt_req_sz = -1; -static int hf_sasp_wt_req_gd_cnt = -1; +static int hf_sasp_wt_req_sz; +static int hf_sasp_wt_req_gd_cnt; /*weight rep*/ -static int hf_sasp_wt_rep_sz = -1; -static int hf_sasp_wt_rep_rcode = -1; -static int hf_sasp_wt_rep_interval = -1; -static int hf_sasp_wt_rep_gwed_cnt = -1; +static int hf_sasp_wt_rep_sz; +static int hf_sasp_wt_rep_rcode; +static int hf_sasp_wt_rep_interval; +static int hf_sasp_wt_rep_gwed_cnt; /*setlbstate req*/ -static int hf_sasp_setlbstate_req_sz = -1; -static int hf_sasp_setlbstate_req_LB_uid_len = -1; -static int hf_sasp_setlbstate_req_LB_uid = -1; -static int hf_sasp_setlbstate_req_LB_health = -1; -/*static int hf_sasp_setlbstate_req_LB_flag = -1;*/ -/* static int hf_lbstate_flag = -1; */ -static int hf_sasp_pushflag = -1; -static int hf_sasp_trustflag = -1; -static int hf_sasp_nochangeflag = -1; +static int hf_sasp_setlbstate_req_sz; +static int hf_sasp_setlbstate_req_LB_uid_len; +static int hf_sasp_setlbstate_req_LB_uid; +static int hf_sasp_setlbstate_req_LB_health; +/*static int hf_sasp_setlbstate_req_LB_flag;*/ +/* static int hf_lbstate_flag; */ +static int hf_sasp_pushflag; +static int hf_sasp_trustflag; +static int hf_sasp_nochangeflag; /*setlbstate reply*/ -/* static int hf_sasp_setlbstate_rep = -1; */ -static int hf_sasp_setlbstate_rep_rcode = -1; -static int hf_sasp_setlbstate_rep_sz = -1; +/* static int hf_sasp_setlbstate_rep; */ +static int hf_sasp_setlbstate_rep_rcode; +static int hf_sasp_setlbstate_rep_sz; /*grp mem state data*/ -static int hf_sasp_grp_memstatedatacomp = -1; -static int hf_sasp_grp_memstatedatacomp_sz = -1; -static int hf_sasp_grp_memstatedatacomp_cnt = -1; +static int hf_sasp_grp_memstatedatacomp; +static int hf_sasp_grp_memstatedatacomp_sz; +static int hf_sasp_grp_memstatedatacomp_cnt; /*mem state data comp*/ -static int hf_sasp_memstatedatacomp_instance = -1; -static int hf_sasp_memstatedatacomp_sz = -1; -static int hf_sasp_memstatedatacomp_state = -1; -static int hf_sasp_memstatedatacomp_quiesce_flag = -1; +static int hf_sasp_memstatedatacomp_instance; +static int hf_sasp_memstatedatacomp_sz; +static int hf_sasp_memstatedatacomp_state; +static int hf_sasp_memstatedatacomp_quiesce_flag; /*wt entry dat comp*/ -static int hf_sasp_weight_entry_data_comp_type = -1; -static int hf_sasp_weight_entry_data_comp_sz = -1; -static int hf_sasp_weight_entry_data_comp_state = -1; -/* static int hf_wtstate_flag = -1; */ -static int hf_sasp_wed_contactsuccess_flag = -1; -static int hf_sasp_wed_quiesce_flag = -1; -static int hf_sasp_wed_registration_flag = -1; -static int hf_sasp_wed_confident_flag = -1; -static int hf_sasp_weight_entry_data_comp_weight = -1; +static int hf_sasp_weight_entry_data_comp_type; +static int hf_sasp_weight_entry_data_comp_sz; +static int hf_sasp_weight_entry_data_comp_state; +/* static int hf_wtstate_flag; */ +static int hf_sasp_wed_contactsuccess_flag; +static int hf_sasp_wed_quiesce_flag; +static int hf_sasp_wed_registration_flag; +static int hf_sasp_wed_confident_flag; +static int hf_sasp_weight_entry_data_comp_weight; /*grp wt entry data comp */ -static int hf_sasp_grp_wt_entry_datacomp_type = -1; -static int hf_sasp_grp_wt_entry_datacomp_sz = -1; -static int hf_sasp_grp_wt_entry_datacomp_cnt = -1; +static int hf_sasp_grp_wt_entry_datacomp_type; +static int hf_sasp_grp_wt_entry_datacomp_sz; +static int hf_sasp_grp_wt_entry_datacomp_cnt; /* Initialize the subtree pointers */ -static gint ett_sasp_data = -1; -static gint ett_sasp_header = -1; -static gint ett_sasp_msg = -1; -static gint ett_sasp_payload = -1; -static gint ett_sasp_reg_req = -1; -static gint ett_sasp_reg_rep = -1; -static gint ett_sasp_reg_req_sz = -1; -static gint ett_sasp_dereg_req_sz= -1; -static gint ett_sasp_dereg_rep = -1; -static gint ett_sasp_sendwt = -1; -static gint ett_sasp_setmemstate_rep = -1; -static gint ett_sasp_memdatacomp = -1; -static gint ett_sasp_grpdatacomp = -1; -static gint ett_sasp_grp_memdatacomp = -1; -static gint ett_sasp_setlbstate_req = -1; -static gint ett_sasp_setlbstate_rep = -1; -static gint ett_sasp_getwt= -1; -static gint ett_sasp_setmemstate_req = -1; -static gint ett_setlbstate_req_lbflag = -1; -static gint ett_sasp_grp_memstatedatacomp = -1; -static gint ett_sasp_memstatedatacomp = -1; -/*static gint ett_dereg_req_reason_flag = -1;*/ -static gint ett_sasp_grp_wt_entry_datacomp = -1; -static gint ett_sasp_weight_entry_data_comp = -1; -static gint ett_wt_entry_data_flag = -1; -static gint ett_sasp_wt_rep = -1; - -static expert_field ei_msg_type_invalid = EI_INIT; +static gint ett_sasp_data; +static gint ett_sasp_header; +static gint ett_sasp_msg; +static gint ett_sasp_payload; +static gint ett_sasp_reg_req; +static gint ett_sasp_reg_rep; +static gint ett_sasp_reg_req_sz; +static gint ett_sasp_dereg_req_sz; +static gint ett_sasp_dereg_rep; +static gint ett_sasp_sendwt; +static gint ett_sasp_setmemstate_rep; +static gint ett_sasp_memdatacomp; +static gint ett_sasp_grpdatacomp; +static gint ett_sasp_grp_memdatacomp; +static gint ett_sasp_setlbstate_req; +static gint ett_sasp_setlbstate_rep; +static gint ett_sasp_getwt; +static gint ett_sasp_setmemstate_req; +static gint ett_setlbstate_req_lbflag; +static gint ett_sasp_grp_memstatedatacomp; +static gint ett_sasp_memstatedatacomp; +/*static gint ett_dereg_req_reason_flag;*/ +static gint ett_sasp_grp_wt_entry_datacomp; +static gint ett_sasp_weight_entry_data_comp; +static gint ett_wt_entry_data_flag; +static gint ett_sasp_wt_rep; + +static expert_field ei_msg_type_invalid; /* desegmentation of SASP over TCP */ static gboolean sasp_desegment = TRUE; @@ -343,7 +345,7 @@ dissect_sasp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data { expert_add_info_format(pinfo, hti, &ei_msg_type_invalid, "Invalid SASP Header Type [0x%04x]", hdr_type); - /* XXX: The folowing should actually happen automatically ? */ + /* XXX: The following should actually happen automatically ? */ col_set_str(pinfo->cinfo, COL_INFO, "[Malformed: Invalid SASP Header Type]"); return tvb_reported_length(tvb); } @@ -512,7 +514,7 @@ static void dissect_dereg_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pay proto_tree *dereg_req_data; guint8 reason_flag; static gboolean first_flag = TRUE; - wmem_strbuf_t *reasonflags_strbuf = wmem_strbuf_new_label(pinfo->pool); + wmem_strbuf_t *reasonflags_strbuf = wmem_strbuf_create(pinfo->pool); static const gchar *fstr[] = {"No Reason", "Learned & Purposeful" }; dereg_req_data = proto_tree_add_subtree(pay_load, tvb, offset, -1, ett_sasp_dereg_req_sz, NULL, "DeReg Request"); @@ -676,7 +678,7 @@ static guint32 dissect_memdatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset += 1; /*Label*/ - proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_label, tvb, offset, lab_len, ENC_ASCII|ENC_NA); + proto_tree_add_item(memdatacomp_tree, hf_sasp_memdatacomp_label, tvb, offset, lab_len, ENC_ASCII); offset += lab_len; if (mdct_p != NULL) @@ -710,7 +712,7 @@ static guint32 dissect_grpdatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 offset += 1; proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_LB_uid, - tvb, offset, LB_uid_len, ENC_ASCII|ENC_NA); + tvb, offset, LB_uid_len, ENC_ASCII); offset += (guint8)LB_uid_len; grp_name_len = tvb_get_guint8(tvb, offset); @@ -722,7 +724,7 @@ static guint32 dissect_grpdatacomp(tvbuff_t *tvb, proto_tree *pay_load, guint32 /*Group Name*/ proto_tree_add_item(grpdatacomp_tree, hf_sasp_grpdatacomp_grp_name, - tvb, offset, grp_name_len, ENC_ASCII|ENC_NA); + tvb, offset, grp_name_len, ENC_ASCII); offset += grp_name_len; return offset; @@ -842,7 +844,7 @@ static void dissect_setlbstate_req(tvbuff_t *tvb, proto_tree *pay_load, guint32 /*LB UID*/ proto_tree_add_item(setlbstate_req_tree, hf_sasp_setlbstate_req_LB_uid, - tvb, offset, LB_uid_len, ENC_ASCII|ENC_NA); + tvb, offset, LB_uid_len, ENC_ASCII); offset += (guint8)LB_uid_len; /*LB Health*/ @@ -1404,7 +1406,7 @@ void proto_register_sasp(void) /*weight entry data comp*/ { &hf_sasp_weight_entry_data_comp_type, - { "Wt Entry Data Comp", "sasp.msg.type", + { "Wt Entry Data Comp", "sasp.wtentry.datacomp", FT_UINT16, BASE_HEX|BASE_EXT_STRING, &msg_table_ext, 0x0, "SASP Wt Entry Data Comp", HFILL } }, @@ -1508,6 +1510,7 @@ void proto_register_sasp(void) expert_module_t* expert_sasp; proto_sasp = proto_register_protocol("Server/Application State Protocol", "SASP", "sasp"); + sasp_handle = register_dissector("sasp", dissect_sasp, proto_sasp); proto_register_field_array(proto_sasp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); @@ -1530,9 +1533,6 @@ void proto_register_sasp(void) void proto_reg_handoff_sasp(void) { - dissector_handle_t sasp_handle; - - sasp_handle = create_dissector_handle(dissect_sasp, proto_sasp); dissector_add_uint_with_preference("tcp.port", SASP_GLOBAL_PORT, sasp_handle); } |