diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/docsis/packet-docsis.c | 4 | ||||
-rw-r--r-- | plugins/docsis/packet-macmgmt.c | 5 | ||||
-rw-r--r-- | plugins/ethercat/packet-ethercat-frame.c | 4 | ||||
-rw-r--r-- | plugins/irda/packet-ircomm.c | 19 | ||||
-rw-r--r-- | plugins/irda/packet-irda.c | 15 | ||||
-rw-r--r-- | plugins/irda/packet-sir.c | 4 | ||||
-rw-r--r-- | plugins/profinet/packet-pn-rt.c | 4 |
7 files changed, 18 insertions, 37 deletions
diff --git a/plugins/docsis/packet-docsis.c b/plugins/docsis/packet-docsis.c index 58b8a88cab..2f2057ac3b 100644 --- a/plugins/docsis/packet-docsis.c +++ b/plugins/docsis/packet-docsis.c @@ -114,7 +114,6 @@ static int hf_docsis_ehdr_bpup2_ver = -1; static int hf_docsis_ehdr_bpup2_sid = -1; static dissector_handle_t docsis_handle; static dissector_handle_t eth_withoutfcs_handle; -static dissector_handle_t data_handle; static dissector_handle_t docsis_mgmt_handle; #if 0 static dissector_table_t docsis_dissector_table; @@ -586,7 +585,7 @@ dissect_docsis (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* da if (pdulen > 0) { mgt_tvb = tvb_new_subset (tvb, hdrlen, captured_length, pdulen); - call_dissector (data_handle, mgt_tvb, pinfo, tree); + call_data_dissector(mgt_tvb, pinfo, tree); } if (concatlen > 0) { @@ -837,7 +836,6 @@ proto_reg_handoff_docsis (void) { docsis_handle = find_dissector ("docsis"); - data_handle = find_dissector ("data"); dissector_add_uint ("wtap_encap", WTAP_ENCAP_DOCSIS, docsis_handle); docsis_mgmt_handle = find_dissector ("docsis_mgmt"); diff --git a/plugins/docsis/packet-macmgmt.c b/plugins/docsis/packet-macmgmt.c index 90dc0b6e5d..b89a4c3304 100644 --- a/plugins/docsis/packet-macmgmt.c +++ b/plugins/docsis/packet-macmgmt.c @@ -87,7 +87,6 @@ static int hf_docsis_mgt_type = -1; static int hf_docsis_mgt_rsvd = -1; static dissector_table_t docsis_mgmt_dissector_table; -static dissector_handle_t data_handle; /* Initialize the subtree pointers */ static gint ett_docsis_mgmt = -1; @@ -193,7 +192,7 @@ dissect_macmgmt (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* d payload_tvb = tvb_new_subset_length (tvb, 20, msg_len - 6); if (!dissector_try_uint(docsis_mgmt_dissector_table, type, payload_tvb, pinfo, tree)) - call_dissector (data_handle, payload_tvb, pinfo, tree); + call_data_dissector(payload_tvb, pinfo, tree); return tvb_captured_length(tvb); } @@ -278,8 +277,6 @@ proto_reg_handoff_docsis_mgmt (void) docsis_mgmt_handle = find_dissector ("docsis_mgmt"); dissector_add_uint ("docsis", 0x03, docsis_mgmt_handle); #endif - - data_handle = find_dissector ("data"); } /* diff --git a/plugins/ethercat/packet-ethercat-frame.c b/plugins/ethercat/packet-ethercat-frame.c index dd71c17cf6..0d9eb5f677 100644 --- a/plugins/ethercat/packet-ethercat-frame.c +++ b/plugins/ethercat/packet-ethercat-frame.c @@ -38,7 +38,6 @@ void proto_reg_handoff_ethercat_frame(void); static int proto_ethercat_frame = -1; static dissector_table_t ethercat_frame_dissector_table; -static dissector_handle_t ethercat_frame_data_handle; /* Define the tree for the EtherCAT frame */ static int ett_ethercat_frame = -1; @@ -97,7 +96,7 @@ static int dissect_ethercat_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree col_add_fstr (pinfo->cinfo, COL_PROTOCOL, "0x%04x", hdr.v.protocol); /* No sub dissector wanted to handle this payload, decode it as general data instead. */ - call_dissector (ethercat_frame_data_handle, next_tvb, pinfo, tree); + call_data_dissector(next_tvb, pinfo, tree); } return tvb_captured_length(tvb); } @@ -151,7 +150,6 @@ void proto_reg_handoff_ethercat_frame(void) dissector_add_uint("ethertype", ETHERTYPE_ECATF, ethercat_frame_handle); dissector_add_uint("udp.port", ETHERTYPE_ECATF, ethercat_frame_handle); dissector_add_uint("tcp.port", ETHERTYPE_ECATF, ethercat_frame_handle); - ethercat_frame_data_handle = find_dissector("data"); } /* diff --git a/plugins/irda/packet-ircomm.c b/plugins/irda/packet-ircomm.c index 7458f19e25..e9d79c122c 100644 --- a/plugins/irda/packet-ircomm.c +++ b/plugins/irda/packet-ircomm.c @@ -123,7 +123,6 @@ static gint ett_ircomm_ctrl = -1; #define MAX_PARAMETERS 32 static gint ett_param[MAX_IAP_ENTRIES * MAX_PARAMETERS]; -static dissector_handle_t data_handle; static dissector_handle_t ircomm_raw_handle; static dissector_handle_t ircomm_cooked_handle; @@ -191,10 +190,10 @@ static int dissect_cooked_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* proto_tree_add_item(ctrl_tree, hf_control_len, tvb, offset, 1, ENC_BIG_ENDIAN); offset++; - call_dissector(data_handle, tvb_new_subset_length(tvb, offset, clen), pinfo, ctrl_tree); + call_data_dissector(tvb_new_subset_length(tvb, offset, clen), pinfo, ctrl_tree); offset += clen; - call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, ircomm_tree); + call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, ircomm_tree); return len; } @@ -206,6 +205,8 @@ static int dissect_cooked_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* static int dissect_raw_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_) { guint len = tvb_reported_length(tvb); + proto_item* ti; + proto_tree* ircomm_tree; if (len == 0) return 0; @@ -215,14 +216,11 @@ static int dissect_raw_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tre col_add_fstr(pinfo->cinfo, COL_INFO, "User Data: %d byte%s", len, (len > 1)? "s": ""); - if (tree) - { - /* create display subtree for the protocol */ - proto_item* ti = proto_tree_add_item(tree, proto_ircomm, tvb, 0, -1, ENC_NA); - proto_tree* ircomm_tree = proto_item_add_subtree(ti, ett_ircomm); + /* create display subtree for the protocol */ + ti = proto_tree_add_item(tree, proto_ircomm, tvb, 0, -1, ENC_NA); + ircomm_tree = proto_item_add_subtree(ti, ett_ircomm); - call_dissector(data_handle, tvb, pinfo, ircomm_tree); - } + call_data_dissector(tvb, pinfo, ircomm_tree); return len; } @@ -420,7 +418,6 @@ void proto_register_ircomm(void) void proto_reg_handoff_ircomm(void) { - data_handle = find_dissector("data"); ircomm_raw_handle = find_dissector("ircomm_raw"); ircomm_cooked_handle = find_dissector("ircomm_cooked"); } diff --git a/plugins/irda/packet-irda.c b/plugins/irda/packet-irda.c index 322b739ba0..f9c46d33da 100644 --- a/plugins/irda/packet-irda.c +++ b/plugins/irda/packet-irda.c @@ -139,8 +139,6 @@ void proto_reg_handoff_irda(void); void proto_register_irda(void); -static dissector_handle_t data_handle; - /* Initialize the protocol and registered fields */ static int proto_irlap = -1; static int hf_lap_a = -1; @@ -645,7 +643,7 @@ static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* r /* If any bytes remain, send it to the generic data dissector */ tvb = tvb_new_subset_remaining(tvb, offset); - call_dissector(data_handle, tvb, pinfo, root); + call_data_dissector(tvb, pinfo, root); } @@ -895,7 +893,7 @@ static void dissect_iap_result(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro /* If any bytes remain, send it to the generic data dissector */ tvb = tvb_new_subset_remaining(tvb, offset); - call_dissector(data_handle, tvb, pinfo, root); + call_data_dissector(tvb, pinfo, root); } @@ -1007,7 +1005,7 @@ static void dissect_appl_proto(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro call_dissector_with_data(lmp_conv->dissector, tvb, pinfo, root, GUINT_TO_POINTER(pdu_type)); } else - call_dissector(data_handle, tvb, pinfo, root); + call_data_dissector(tvb, pinfo, root); } @@ -1159,7 +1157,7 @@ static void dissect_irlmp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, g else { if ((dlsap == LSAP_IAS) || (slsap == LSAP_IAS)) - call_dissector(data_handle, tvb, pinfo, root); + call_data_dissector(tvb, pinfo, root); else switch (opcode) { @@ -1173,7 +1171,7 @@ static void dissect_irlmp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, g break; default: - call_dissector(data_handle, tvb, pinfo, root); + call_data_dissector(tvb, pinfo, root); } } } @@ -1828,7 +1826,7 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) if (tvb_reported_length_remaining(tvb, offset) > 0) { tvb = tvb_new_subset_remaining(tvb, offset); - call_dissector(data_handle, tvb, pinfo, root); + call_data_dissector(tvb, pinfo, root); } } @@ -2248,7 +2246,6 @@ void proto_reg_handoff_irda(void) irda_handle = find_dissector("irda"); dissector_add_uint("wtap_encap", WTAP_ENCAP_IRDA, irda_handle); dissector_add_uint("sll.ltype", LINUX_SLL_P_IRDA_LAP, irda_handle); - data_handle = find_dissector("data"); } /* diff --git a/plugins/irda/packet-sir.c b/plugins/irda/packet-sir.c index 526db940c7..98ee323390 100644 --- a/plugins/irda/packet-sir.c +++ b/plugins/irda/packet-sir.c @@ -47,7 +47,6 @@ void proto_reg_handoff_irsir(void); void proto_register_irsir(void); /** Protocol handles. */ -static dissector_handle_t data_handle; static dissector_handle_t irda_handle; /** Protocol fields. */ @@ -181,10 +180,7 @@ proto_reg_handoff_irsir(void) { dissector_add_uint("tcp.port", TCP_PORT_SIR, find_dissector("sir")); - data_handle = find_dissector("data"); irda_handle = find_dissector("irda"); - if (irda_handle == NULL) - irda_handle = data_handle; } diff --git a/plugins/profinet/packet-pn-rt.c b/plugins/profinet/packet-pn-rt.c index ac0acb9e10..8757a1a9ff 100644 --- a/plugins/profinet/packet-pn-rt.c +++ b/plugins/profinet/packet-pn-rt.c @@ -330,7 +330,6 @@ dissect_CSF_SDU_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * static reassembly_table pdu_reassembly_table; static GHashTable *reasembled_frag_table = NULL; -static dissector_handle_t data_handle; static dissector_table_t ethertype_subdissector_table; static guint32 start_frag_OR_ID[16]; @@ -447,7 +446,7 @@ dissect_FRAG_PDU_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void type = tvb_get_ntohs(pdu_tvb, 0); pdu_tvb = tvb_new_subset_remaining(pdu_tvb, 2); if (!dissector_try_uint(ethertype_subdissector_table, type, pdu_tvb, pinfo, tree)) - call_dissector(data_handle, pdu_tvb, pinfo, tree); + call_data_dissector(pdu_tvb, pinfo, tree); } } return TRUE; @@ -1001,7 +1000,6 @@ proto_reg_handoff_pn_rt(void) heur_dissector_add("pn_rt", dissect_CSF_SDU_heur, "PROFINET CSF_SDU IO", "pn_csf_sdu_pn_rt", proto_pn_rt, HEURISTIC_ENABLE); heur_dissector_add("pn_rt", dissect_FRAG_PDU_heur, "PROFINET Frag PDU IO", "pn_frag_pn_rt", proto_pn_rt, HEURISTIC_ENABLE); - data_handle = find_dissector("data"); ethertype_subdissector_table = find_dissector_table("ethertype"); } |