diff options
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-aoe.c | 18 | ||||
-rw-r--r-- | epan/dissectors/packet-batadv.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-hyperscsi.c | 7 | ||||
-rw-r--r-- | epan/dissectors/packet-sercosiii.c | 12 | ||||
-rw-r--r-- | epan/dissectors/packet-wai.c | 9 |
5 files changed, 30 insertions, 24 deletions
diff --git a/epan/dissectors/packet-aoe.c b/epan/dissectors/packet-aoe.c index 5369bfc50f..7f5a8379ae 100644 --- a/epan/dissectors/packet-aoe.c +++ b/epan/dissectors/packet-aoe.c @@ -365,20 +365,18 @@ dissect_aoe_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } -static void -dissect_aoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) +static int +dissect_aoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_) { - proto_item *item=NULL; - proto_tree *tree=NULL; + proto_item *item; + proto_tree *tree; guint8 version; col_set_str(pinfo->cinfo, COL_PROTOCOL, "AoE"); col_clear(pinfo->cinfo, COL_INFO); - if (parent_tree) { - item = proto_tree_add_item(parent_tree, proto_aoe, tvb, 0, -1, ENC_NA); - tree = proto_item_add_subtree(item, ett_aoe); - } + item = proto_tree_add_item(parent_tree, proto_aoe, tvb, 0, -1, ENC_NA); + tree = proto_item_add_subtree(item, ett_aoe); version=tvb_get_guint8(tvb, 0)>>4; proto_tree_add_uint(tree, hf_aoe_version, tvb, 0, 1, version); @@ -387,6 +385,8 @@ dissect_aoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) dissect_aoe_v1(tvb, pinfo, tree); break; } + + return tvb_captured_length(tvb); } static void @@ -469,7 +469,7 @@ proto_register_aoe(void) proto_register_field_array(proto_aoe, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - aoe_handle = register_dissector("aoe", dissect_aoe, proto_aoe); + aoe_handle = new_register_dissector("aoe", dissect_aoe, proto_aoe); register_init_routine(ata_init); register_cleanup_routine(ata_cleanup); diff --git a/epan/dissectors/packet-batadv.c b/epan/dissectors/packet-batadv.c index 3122c8a406..eb7161035b 100644 --- a/epan/dissectors/packet-batadv.c +++ b/epan/dissectors/packet-batadv.c @@ -843,7 +843,7 @@ static reassembly_table msg_reassembly_table; static unsigned int batadv_ethertype = ETH_P_BATMAN; -static void dissect_batadv_plugin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int dissect_batadv_plugin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint8 version; @@ -854,6 +854,8 @@ static void dissect_batadv_plugin(tvbuff_t *tvb, packet_info *pinfo, proto_tree dissect_batadv_v5(tvb, pinfo, tree); else dissect_batadv_v15(tvb, pinfo, tree); + + return tvb_captured_length(tvb); } static void dissect_batadv_v5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) @@ -5019,7 +5021,7 @@ void proto_register_batadv(void) "batadv" /* abbrev */ ); - register_dissector("batadv",dissect_batadv_plugin,proto_batadv_plugin); + new_register_dissector("batadv",dissect_batadv_plugin,proto_batadv_plugin); batadv_module = prefs_register_protocol(proto_batadv_plugin, proto_reg_handoff_batadv); @@ -5045,7 +5047,7 @@ void proto_reg_handoff_batadv(void) static unsigned int old_batadv_ethertype; if (!inited) { - batman_handle = create_dissector_handle(dissect_batadv_plugin, proto_batadv_plugin); + batman_handle = new_create_dissector_handle(dissect_batadv_plugin, proto_batadv_plugin); data_handle = find_dissector("data"); eth_handle = find_dissector("eth"); diff --git a/epan/dissectors/packet-hyperscsi.c b/epan/dissectors/packet-hyperscsi.c index 592ebcead8..8febc16b44 100644 --- a/epan/dissectors/packet-hyperscsi.c +++ b/epan/dissectors/packet-hyperscsi.c @@ -75,8 +75,8 @@ static const value_string hscsi_opcodes[] = { #define OPCODE_MASK 0x7F -static void -dissect_hyperscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_hyperscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { guint hs_hdr1, hs_hdr2, hs_hdr3; guint8 hs_res; @@ -144,6 +144,7 @@ dissect_hyperscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint(hs_pdu_tree, hf_hs_cmd, tvb, 4, 1, hs_cmd); } + return tvb_captured_length(tvb); } void @@ -185,7 +186,7 @@ proto_register_hyperscsi(void) proto_register_field_array(proto_hyperscsi, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_dissector("hyperscsi", dissect_hyperscsi, proto_hyperscsi); + new_register_dissector("hyperscsi", dissect_hyperscsi, proto_hyperscsi); } /* XXX <epan/etypes.h> */ diff --git a/epan/dissectors/packet-sercosiii.c b/epan/dissectors/packet-sercosiii.c index 517f45a519..f12a10908e 100644 --- a/epan/dissectors/packet-sercosiii.c +++ b/epan/dissectors/packet-sercosiii.c @@ -1161,8 +1161,8 @@ static void dissect_siii_at(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } /* Main dissector entry */ -static void -dissect_siii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_siii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { proto_item *ti; proto_tree *siii_tree; @@ -1182,7 +1182,7 @@ dissect_siii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * to dissect it as a normal SercosIII packet. */ if (dissector_try_heuristic(heur_subdissector_list, tvb, pinfo, tree, &hdtbl_entry, NULL)) - return; + return tvb_captured_length(tvb); /* check what we got on our hand */ type = tvb_get_guint8(tvb, 0); @@ -1209,6 +1209,8 @@ dissect_siii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) dissect_siii_at(tvb, pinfo, siii_tree); else dissect_siii_mdt(tvb, pinfo, siii_tree); + + return tvb_captured_length(tvb); } static void @@ -1617,7 +1619,7 @@ proto_register_sercosiii(void) proto_siii = proto_register_protocol("SERCOS III V1.1", "SERCOS III V1.1", "siii"); - register_dissector("sercosiii", dissect_siii, proto_siii); + new_register_dissector("sercosiii", dissect_siii, proto_siii); /* subdissector code */ heur_subdissector_list = register_heur_dissector_list("sercosiii"); @@ -1634,7 +1636,7 @@ proto_reg_handoff_sercosiii(void) { dissector_handle_t siii_handle; - siii_handle = create_dissector_handle(dissect_siii, proto_siii); + siii_handle = new_create_dissector_handle(dissect_siii, proto_siii); dissector_add_uint("ethertype", ETHERTYPE_SERCOS, siii_handle); } diff --git a/epan/dissectors/packet-wai.c b/epan/dissectors/packet-wai.c index 8d68d55077..efcbef7e48 100644 --- a/epan/dissectors/packet-wai.c +++ b/epan/dissectors/packet-wai.c @@ -854,8 +854,8 @@ dissect_wai_data(tvbuff_t *tvb, proto_tree *tree, guint8 subtype, guint16 lenx) } } -static void -dissect_wai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static int +dissect_wai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { /* Format of WAPI protocol packet in WAI authentication system @@ -886,7 +886,7 @@ Figure 18 from [ref:1] /* quick sanity check */ if ((length != tvb_reported_length (tvb)-WAI_MESSAGE_LENGTH) || (subtype > WAI_SUB_MULTICAST_ANNOUNCE_RESP)) { - return; + return 0; } col_set_str(pinfo->cinfo, COL_PROTOCOL, "WAI"); @@ -965,6 +965,7 @@ Figure 18 from [ref:1] } } + return tvb_captured_length(tvb); } static void wai_reassemble_init (void) @@ -1373,7 +1374,7 @@ proto_register_wai(void) proto_register_field_array(proto_wai, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - wai_handle = register_dissector("wai", dissect_wai, proto_wai); + wai_handle = new_register_dissector("wai", dissect_wai, proto_wai); } void |