create_dissector_handle -> new_create_dissector_handle
authorMichael Mann <mmann78@netscape.net>
Sun, 15 Nov 2015 21:51:45 +0000 (16:51 -0500)
committerMichael Mann <mmann78@netscape.net>
Mon, 16 Nov 2015 22:00:30 +0000 (22:00 +0000)
Picking off "easy" dissectors that only have one or two exit points at most.

Change-Id: I96aa9cf53533cbb07105aa400d42922baf3016b3
Reviewed-on: https://code.wireshark.org/review/11860
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
103 files changed:
epan/dissectors/packet-h221_nonstd.c
epan/dissectors/packet-h223.c
epan/dissectors/packet-h261.c
epan/dissectors/packet-hcrt.c
epan/dissectors/packet-hip.c
epan/dissectors/packet-homeplug-av.c
epan/dissectors/packet-homeplug.c
epan/dissectors/packet-hp-erm.c
epan/dissectors/packet-hsr-prp-supervision.c
epan/dissectors/packet-hsr.c
epan/dissectors/packet-http.c
epan/dissectors/packet-i2c.c
epan/dissectors/packet-iapp.c
epan/dissectors/packet-icap.c
epan/dissectors/packet-icp.c
epan/dissectors/packet-idp.c
epan/dissectors/packet-iec104.c
epan/dissectors/packet-ieee1722.c
epan/dissectors/packet-ieee17221.c
epan/dissectors/packet-ieee1722a.c
epan/dissectors/packet-ieee80211-airopeek.c
epan/dissectors/packet-ieee80211-prism.c
epan/dissectors/packet-ieee80211.c
epan/dissectors/packet-ieee8021ah.c
epan/dissectors/packet-ieee802a.c
epan/dissectors/packet-igmp.c
epan/dissectors/packet-igrp.c
epan/dissectors/packet-infiniband.c
epan/dissectors/packet-ipfc.c
epan/dissectors/packet-ipnet.c
epan/dissectors/packet-ipoib.c
epan/dissectors/packet-ipp.c
epan/dissectors/packet-ipsec-udp.c
epan/dissectors/packet-ipsec.c
epan/dissectors/packet-ipsi-ctl.c
epan/dissectors/packet-ipvs-syncd.c
epan/dissectors/packet-ipxwan.c
epan/dissectors/packet-irc.c
epan/dissectors/packet-isdn.c
epan/dissectors/packet-isi.c
epan/dissectors/packet-ismacryp.c
epan/dissectors/packet-ismp.c
epan/dissectors/packet-jpeg.c
epan/dissectors/packet-juniper.c
epan/dissectors/packet-kdp.c
epan/dissectors/packet-kink.c
epan/dissectors/packet-kpasswd.c
epan/dissectors/packet-l2tp.c
epan/dissectors/packet-lacp.c
epan/dissectors/packet-lapbether.c
epan/dissectors/packet-lbmpdmtcp.c
epan/dissectors/packet-lge_monitor.c
epan/dissectors/packet-linx.c
epan/dissectors/packet-llt.c
epan/dissectors/packet-lmi.c
epan/dissectors/packet-loop.c
epan/dissectors/packet-lpd.c
epan/dissectors/packet-lwapp.c
epan/dissectors/packet-lwres.c
epan/dissectors/packet-m2tp.c
epan/dissectors/packet-m2ua.c
epan/dissectors/packet-maap.c
epan/dissectors/packet-maccontrol.c
epan/dissectors/packet-manolito.c
epan/dissectors/packet-marker.c
epan/dissectors/packet-mdshdr.c
epan/dissectors/packet-megaco.c
epan/dissectors/packet-mih.c
epan/dissectors/packet-mip6.c
epan/dissectors/packet-mmse.c
epan/dissectors/packet-mpeg-ca.c
epan/dissectors/packet-mpeg-pat.c
epan/dissectors/packet-mpeg1.c
epan/dissectors/packet-mpls-pm.c
epan/dissectors/packet-mpls-psc.c
epan/dissectors/packet-mplstp-oam.c
epan/dissectors/packet-mq.c
epan/dissectors/packet-mqtt-sn.c
epan/dissectors/packet-mrp-mmrp.c
epan/dissectors/packet-mrp-msrp.c
epan/dissectors/packet-mrp-mvrp.c
epan/dissectors/packet-msdp.c
epan/dissectors/packet-msn-messenger.c
epan/dissectors/packet-msnlb.c
epan/dissectors/packet-msproxy.c
epan/dissectors/packet-mtp2.c
epan/dissectors/packet-nasdaq-soup.c
epan/dissectors/packet-nbipx.c
epan/dissectors/packet-nbt.c
epan/dissectors/packet-ncp.c
epan/dissectors/packet-ncs.c
epan/dissectors/packet-netanalyzer.c
epan/dissectors/packet-netdump.c
epan/dissectors/packet-netrom.c
epan/dissectors/packet-nettl.c
epan/dissectors/packet-nfs.c
epan/dissectors/packet-nhrp.c
epan/dissectors/packet-nlsp.c
epan/dissectors/packet-nntp.c
epan/dissectors/packet-nsrp.c
epan/dissectors/packet-nstrace.c
epan/dissectors/packet-ntp.c
epan/dissectors/packet-null.c

index 759f2bddf0b2c5df649fe8df71337f8e79e43568..2725523b2ac7e80f7b3101380274b7e5134d9f4c 100644 (file)
@@ -51,8 +51,8 @@ const value_string ms_codec_vals[] = {
     {  0, NULL }
 };
 
-static void
-dissect_ms_nonstd(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
+static int
+dissect_ms_nonstd(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
 {
     proto_item *it;
     proto_tree *tr;
@@ -96,6 +96,7 @@ dissect_ms_nonstd(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
 
         }
     }
+    return tvb_captured_length(tvb);
 }
 
 /* Register all the bits needed with the filtering engine */
@@ -131,7 +132,7 @@ proto_reg_handoff_nonstd(void)
     static dissector_handle_t ms_nonstd_handle;
 
 
-    ms_nonstd_handle = create_dissector_handle(dissect_ms_nonstd, proto_nonstd);
+    ms_nonstd_handle = new_create_dissector_handle(dissect_ms_nonstd, proto_nonstd);
 
     dissector_add_uint("h245.nsp.h221",0xb500534c, ms_nonstd_handle);
     dissector_add_uint("h225.nsp.h221",0xb500534c, ms_nonstd_handle);
index 0587c815ff7e6522b967ab991e8db80e8fd2bffe..eea65ba644d88262d2090c0bc85e546a55f0c603 100644 (file)
@@ -1369,10 +1369,11 @@ dissect_h223_circuit_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
     return tvb_captured_length(tvb);
 }
 
-static void
-dissect_h223(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_h223(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     dissect_h223_common(tvb, pinfo, tree, CT_NONE, 0);
+    return tvb_captured_length(tvb);
 }
 
 /* H.223 specifies that the least-significant bit is transmitted first;
@@ -1663,7 +1664,7 @@ void proto_reg_handoff_h223(void)
     data_handle = find_dissector("data");
     srp_handle = find_dissector("srp");
 
-    dissector_add_for_decode_as("tcp.port", create_dissector_handle( dissect_h223, proto_h223));
+    dissector_add_for_decode_as("tcp.port", new_create_dissector_handle( dissect_h223, proto_h223));
     dissector_add_for_decode_as("tcp.port", h223_bitswapped);
     dissector_add_string("rtp_dyn_payload_type","CLEARMODE", h223_bitswapped);
     dissector_add_uint("iax2.dataformat", AST_DATAFORMAT_H223_H245, new_create_dissector_handle(dissect_h223_bitswapped_circuit_data, proto_h223_bitswapped));
index 810f3c64cd15e6f35cade137a926e4feabce1587..62cde4d80e005717f2b28ff0e4ab631279ac38b4 100644 (file)
@@ -56,8 +56,8 @@ static int hf_h261_data        = -1;
 /* H.261 fields defining a sub tree */
 static gint ett_h261           = -1;
 
-static void
-dissect_h261( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
+static int
+dissect_h261( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ )
 {
        proto_item *ti            = NULL;
        proto_tree *h261_tree     = NULL;
@@ -109,6 +109,7 @@ dissect_h261( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
                /* The rest of the packet is the H.261 stream */
                proto_tree_add_item( h261_tree, hf_h261_data, tvb, offset, -1, ENC_NA );
        }
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -255,7 +256,7 @@ proto_reg_handoff_h261(void)
 {
        dissector_handle_t h261_handle;
 
-       h261_handle = create_dissector_handle(dissect_h261, proto_h261);
+       h261_handle = new_create_dissector_handle(dissect_h261, proto_h261);
        dissector_add_uint("rtp.pt", PT_H261, h261_handle);
        dissector_add_uint("iax2.codec", AST_FORMAT_H261, h261_handle);
 }
index 8c51c05e94d3ec257523dbfd0a38e2ec51a4d611..d0bb94d03a1a3100c7fc5b1bed16098e08c6c397 100644 (file)
@@ -303,7 +303,7 @@ static gboolean dissect_hcrt_message(tvbuff_t* tvb, packet_info* pinfo, proto_tr
     return last;
 }
 
-static void dissect_hcrt(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree)
+static int dissect_hcrt(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data _U_)
 {
     guint8 type;
     proto_item* ti;
@@ -343,6 +343,7 @@ static void dissect_hcrt(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree)
     while (!dissect_hcrt_message(tvb, pinfo, hcrt_tree, &offset, b0_first, i)) {
         i++;
     }
+    return tvb_captured_length(tvb);
 }
 
 void proto_register_hcrt(void)
@@ -496,7 +497,7 @@ void proto_reg_handoff_hcrt(void)
     static gint hcrt_ethertype;
 
     if (!hcrt_prefs_initialized) {
-        hcrt_handle = create_dissector_handle(dissect_hcrt, proto_hcrt);
+        hcrt_handle = new_create_dissector_handle(dissect_hcrt, proto_hcrt);
         /* Also register as a dissector that can be selected by a TCP port number via
         "decode as" */
         dissector_add_for_decode_as("tcp.port", hcrt_handle);
index c6dcf43c05c4031173978faba020a021771f27a1..b52a8202b6920b2e2dd5f9ce0437aeddc1775c9e 100644 (file)
@@ -578,22 +578,30 @@ dissect_hip_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
     }
 }
 
-static void
-dissect_hip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_hip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     dissect_hip_common(tvb, pinfo, tree, FALSE);
+    return tvb_captured_length(tvb);
 }
 
-static void
-dissect_hip_in_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_hip_in_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
-        guint32 nullbytes;
-        nullbytes = tvb_get_ntohl(tvb, 0);
-        if (nullbytes == 0)
-        {
-                tvbuff_t *newtvb = tvb_new_subset_remaining(tvb, 4);
-                dissect_hip_common(newtvb, pinfo, tree, TRUE);
-        }
+    guint32 nullbytes;
+    tvbuff_t *newtvb;
+
+    if (tvb_captured_length(tvb) < 4)
+        return 0;
+
+    nullbytes = tvb_get_ntohl(tvb, 0);
+    if (nullbytes != 0)
+        return 0;
+
+    newtvb = tvb_new_subset_remaining(tvb, 4);
+    dissect_hip_common(newtvb, pinfo, tree, TRUE);
+
+    return tvb_captured_length(tvb);
 }
 
 
@@ -1602,10 +1610,10 @@ proto_reg_handoff_hip(void)
         dissector_handle_t hip_handle;
         dissector_handle_t hip_handle2;
 
-        hip_handle = create_dissector_handle(dissect_hip, proto_hip);
+        hip_handle = new_create_dissector_handle(dissect_hip, proto_hip);
         dissector_add_uint("ip.proto", IP_PROTO_HIP, hip_handle);
 
-        hip_handle2 = create_dissector_handle(dissect_hip_in_udp, proto_hip);
+        hip_handle2 = new_create_dissector_handle(dissect_hip_in_udp, proto_hip);
         dissector_add_uint("udp.port", 10500, hip_handle2);
 }
 /*
index aa3f138f4442f68a828684b7080d8265f076860c..7419c52093283f2a81e0933cbb7024269d677ddf 100644 (file)
@@ -3189,8 +3189,8 @@ dissect_homeplug_av_mme(ptvcursor_t *cursor, guint8 homeplug_av_mmver, guint16 h
    return;
 }
 
-static void
-dissect_homeplug_av(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_homeplug_av(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
    proto_item  *ti;
    proto_tree  *homeplug_av_tree;
@@ -3218,6 +3218,7 @@ dissect_homeplug_av(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
    }
 
    ptvcursor_free(cursor);
+   return tvb_captured_length(tvb);
 }
 
 void
@@ -4744,7 +4745,7 @@ proto_reg_handoff_homeplug_av(void)
 {
    dissector_handle_t homeplug_av_handle;
 
-   homeplug_av_handle = create_dissector_handle(dissect_homeplug_av, proto_homeplug_av);
+   homeplug_av_handle = new_create_dissector_handle(dissect_homeplug_av, proto_homeplug_av);
    dissector_add_uint("ethertype", ETHERTYPE_HOMEPLUG_AV, homeplug_av_handle);
 }
 
index 55cec5d2e47f729ef4eb335bc8d8585090a44f03..b0799263ae18f1d9e5bee702e558e062ccc5af9f 100644 (file)
@@ -1297,8 +1297,8 @@ static int check_tvb_length(ptvcursor_t *cursor, const gint length)
   return TVB_LEN_GREATEST;
 }
 
-static void
-dissect_homeplug(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
+static int
+dissect_homeplug(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
 {
   proto_item * it;
   proto_tree * homeplug_tree;
@@ -1343,6 +1343,7 @@ dissect_homeplug(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
   }
 
   ptvcursor_free(cursor);
+  return tvb_captured_length(tvb);
 }
 
 static void
@@ -1356,7 +1357,7 @@ proto_reg_handoff_homeplug(void)
 {
   dissector_handle_t homeplug_handle;
 
-  homeplug_handle = create_dissector_handle(dissect_homeplug, proto_homeplug);
+  homeplug_handle = new_create_dissector_handle(dissect_homeplug, proto_homeplug);
   dissector_add_uint("ethertype", ETHERTYPE_HOMEPLUG, homeplug_handle);
 }
 
index 6ff3df0a127606802ed6efdbdb58ac6fcfdfd8c2..0582c1cd551863cac801c0b5dc7dbe8be0f91a39 100644 (file)
@@ -85,8 +85,8 @@ static const value_string hp_erm_cfi_vals[] = {
 
 static dissector_handle_t eth_withoutfcs_handle;
 
-static void
-dissect_hp_erm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_hp_erm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_item *ti;
     proto_tree *hp_erm_tree;
@@ -112,6 +112,7 @@ dissect_hp_erm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     eth_tvb = tvb_new_subset_remaining(tvb, offset);
     call_dissector(eth_withoutfcs_handle, eth_tvb, pinfo, tree);
+    return tvb_captured_length(tvb);
 }
 
 void
@@ -172,7 +173,7 @@ proto_reg_handoff_hp_erm(void)
 
     if (!initialized) {
         eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
-        hp_erm_handle = create_dissector_handle(dissect_hp_erm, proto_hp_erm);
+        hp_erm_handle = new_create_dissector_handle(dissect_hp_erm, proto_hp_erm);
         initialized = TRUE;
     } else {
         if (hp_erm_udp_port != 0)
index c495cbcaa984c9eff33e42e413247c25699f5cf3..ddde483542e84517a4d96bb11e9a18036ecb6e05 100644 (file)
@@ -67,8 +67,8 @@ static int hf_hsr_prp_supervision_vdan_mac_address = -1;
 static gint ett_hsr_prp_supervision = -1;
 
 /* Code to actually dissect the packets */
-static void
-dissect_hsr_prp_supervision(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_hsr_prp_supervision(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_item *ti;
     proto_tree *hsr_prp_supervision_tree;
@@ -172,6 +172,7 @@ dissect_hsr_prp_supervision(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     /* Adjust the length of this tvbuff to include only the supervision data.
        This allows the rest to be marked as padding. */
     tvb_set_reported_length(tvb, offset);
+    return tvb_captured_length(tvb);
 }
 
 
@@ -252,7 +253,7 @@ void proto_register_hsr_prp_supervision(void)
 void proto_reg_handoff_hsr_prp_supervision(void)
 {
     dissector_handle_t hsr_prp_supervision_handle;
-    hsr_prp_supervision_handle = create_dissector_handle(dissect_hsr_prp_supervision, proto_hsr_prp_supervision);
+    hsr_prp_supervision_handle = new_create_dissector_handle(dissect_hsr_prp_supervision, proto_hsr_prp_supervision);
     dissector_add_uint("ethertype", ETHERTYPE_PRP, hsr_prp_supervision_handle);
 }
 
index 660e97d9249f156ec141d494b7885a76bb57db7c..8a063c1897e0c49fc3d7d5e60d9df5a23f39b821 100644 (file)
@@ -72,8 +72,8 @@ static gint ett_hsr_frame = -1;
 static dissector_handle_t data_handle;
 
 /* Code to actually dissect the packets */
-static  void
-dissect_hsr_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_hsr_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_item *ti;
     proto_tree *hsr_tree;
@@ -126,6 +126,7 @@ dissect_hsr_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     if (!dissector_try_uint(ethertype_subdissector_table, etype, next_tvb, pinfo, tree))
         call_dissector(data_handle, next_tvb, pinfo, hsr_tree);
 
+    return tvb_captured_length(tvb);
 }
 
 
@@ -188,7 +189,7 @@ void proto_register_hsr(void)
 void proto_reg_handoff_hsr(void)
 {
     dissector_handle_t hsr_frame_handle;
-    hsr_frame_handle = create_dissector_handle(dissect_hsr_frame, proto_hsr);
+    hsr_frame_handle = new_create_dissector_handle(dissect_hsr_frame, proto_hsr);
     dissector_add_uint("ethertype", ETHERTYPE_HSR, hsr_frame_handle);
 
     ethertype_subdissector_table = find_dissector_table("ethertype");
index 6e57020286a82003d2457988ba34661d7410c876..03c231bebf4b902d5ac8caa15bf893b34fdbc079 100644 (file)
@@ -2982,14 +2982,15 @@ dissect_http_heur_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
        return FALSE;
 }
 
-static void
-dissect_ssdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ssdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        conversation_t  *conversation;
        http_conv_t     *conv_data;
 
        conv_data = get_http_conversation_data(pinfo, &conversation);
        dissect_http_message(tvb, 0, pinfo, tree, conv_data, "SSDP", proto_ssdp);
+       return tvb_captured_length(tvb);
 }
 
 static void
@@ -3445,7 +3446,7 @@ proto_reg_handoff_http(void)
         * XXX - is there anything to dissect in the body of an SSDP
         * request or reply?  I.e., should there be an SSDP dissector?
         */
-       ssdp_handle = create_dissector_handle(dissect_ssdp, proto_ssdp);
+       ssdp_handle = new_create_dissector_handle(dissect_ssdp, proto_ssdp);
        dissector_add_uint("udp.port", UDP_PORT_SSDP, ssdp_handle);
 
        ntlmssp_handle = find_dissector("ntlmssp");
@@ -3465,8 +3466,8 @@ proto_reg_handoff_http(void)
 static gint proto_message_http = -1;
 static gint ett_message_http = -1;
 
-static void
-dissect_message_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_message_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        proto_tree      *subtree;
        proto_item      *ti;
@@ -3488,6 +3489,7 @@ dissect_message_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                        offset = next_offset;
                }
        }
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -3510,7 +3512,7 @@ proto_reg_handoff_message_http(void)
 {
        dissector_handle_t message_http_handle;
 
-       message_http_handle = create_dissector_handle(dissect_message_http,
+       message_http_handle = new_create_dissector_handle(dissect_message_http,
                        proto_message_http);
 
        dissector_add_string("media_type", "message/http", message_http_handle);
index 1754040ddd2accc9164ab686535a3f6cc5e420c8..5a8656dc7cd44bc2e108a4ffe0e0f68b1055fd43 100644 (file)
@@ -164,8 +164,8 @@ i2c_get_event_desc(guint32 event)
        return desc;
 }
 
-static void
-dissect_i2c(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_i2c(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        proto_item *ti;
        proto_tree *i2c_tree;
@@ -221,6 +221,7 @@ dissect_i2c(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                        call_dissector(data_handle, tvb, pinfo, tree);
                }
        }
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -262,7 +263,7 @@ proto_reg_handoff_i2c(void)
 
        data_handle = find_dissector("data");
 
-       i2c_handle = create_dissector_handle(dissect_i2c, proto_i2c);
+       i2c_handle = new_create_dissector_handle(dissect_i2c, proto_i2c);
        dissector_add_uint("wtap_encap", WTAP_ENCAP_I2C, i2c_handle);
 }
 
index 1cb6c8148e9cb0ff9b0d81a73cac19e38e04657e..8591408b3285e462a16bcd07b065f4f1e93c8c75 100644 (file)
@@ -349,8 +349,8 @@ dissect_pdus(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *pdutree,
 }
 
 /* code to dissect an IAPP packet */
-static void
-dissect_iapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_iapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_item *ti, *pduitem;
     proto_tree *iapp_tree, *pdutree;
@@ -368,22 +368,21 @@ dissect_iapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     codestrval = val_to_str_const(ia_type, iapp_vals, "Unknown Packet");
     col_add_fstr(pinfo->cinfo, COL_INFO, "%s(%d) (version=%d)", codestrval, ia_type, ia_version);
 
-    if (tree)
-    {
-        ti = proto_tree_add_item(tree, proto_iapp, tvb, 0, -1, ENC_NA);
-        iapp_tree = proto_item_add_subtree(ti, ett_iapp);
+    ti = proto_tree_add_item(tree, proto_iapp, tvb, 0, -1, ENC_NA);
+    iapp_tree = proto_item_add_subtree(ti, ett_iapp);
 
-        /* common header for all IAPP frames */
+    /* common header for all IAPP frames */
 
-        proto_tree_add_item(iapp_tree, hf_iapp_version, tvb, 0, 1, ENC_BIG_ENDIAN);
-        proto_tree_add_item(iapp_tree, hf_iapp_type, tvb, 1, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(iapp_tree, hf_iapp_version, tvb, 0, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(iapp_tree, hf_iapp_type, tvb, 1, 1, ENC_BIG_ENDIAN);
 
-        pdutree = proto_tree_add_subtree(iapp_tree, tvb, 2, -1,
-                ett_iapp_pdu, &pduitem, "Protocol data units");
+    pdutree = proto_tree_add_subtree(iapp_tree, tvb, 2, -1,
+            ett_iapp_pdu, &pduitem, "Protocol data units");
 
-        dissect_pdus(tvb, pinfo, 2, pdutree, pduitem,
-                tvb_captured_length_remaining(tvb, 2));
-    }
+    dissect_pdus(tvb, pinfo, 2, pdutree, pduitem,
+            tvb_captured_length_remaining(tvb, 2));
+
+    return tvb_captured_length(tvb);
 }
 
 
@@ -480,7 +479,7 @@ proto_reg_handoff_iapp(void)
 {
     dissector_handle_t iapp_handle;
 
-    iapp_handle = create_dissector_handle(dissect_iapp, proto_iapp);
+    iapp_handle = new_create_dissector_handle(dissect_iapp, proto_iapp);
     dissector_add_uint("udp.port", UDP_PORT_IAPP, iapp_handle);
 }
 /*
index 92d68202b04d8ce00ece30d9641b0aad93b9176c..8f0d5bb4f7f425e41f66e5c9f2bc53959cce44df 100644 (file)
@@ -54,8 +54,8 @@ static dissector_handle_t http_handle;
 
 #define TCP_PORT_ICAP           1344
 static int is_icap_message(const guchar *data, int linelen, icap_type_t *type);
-static void
-dissect_icap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_icap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_tree   *icap_tree = NULL;
     proto_item   *ti        = NULL;
@@ -245,6 +245,8 @@ is_icap_header:
             call_dissector(http_handle, new_tvb, pinfo, icap_tree);
         }
     }
+
+       return tvb_captured_length(tvb);
 }
 
 
@@ -322,7 +324,7 @@ proto_reg_handoff_icap(void)
     data_handle = find_dissector("data");
     http_handle = find_dissector("http");
 
-    icap_handle = create_dissector_handle(dissect_icap, proto_icap);
+    icap_handle = new_create_dissector_handle(dissect_icap, proto_icap);
     dissector_add_uint("tcp.port", TCP_PORT_ICAP, icap_handle);
 }
 
index 3d0cdf70631a85432f03d41c41bfa8d14a069222..6a573fcb1aa2da2fe43ae7a57b02c39dedc8b282 100644 (file)
@@ -144,7 +144,7 @@ static void dissect_icp_payload(tvbuff_t *tvb, packet_info *pinfo, int offset,
        }
 }
 
-static void dissect_icp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_icp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        proto_tree *icp_tree , *payload_tree;
        proto_item *ti;
@@ -164,12 +164,11 @@ static void dissect_icp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                     val_to_str_const(opcode, opcode_vals, "Unknown"), opcode,
                     request_number);
 
+       ti = proto_tree_add_item(tree,proto_icp, tvb, 0, message_length, ENC_NA);
+       icp_tree = proto_item_add_subtree(ti, ett_icp);
+
        if (tree)
        {
-
-               ti = proto_tree_add_item(tree,proto_icp, tvb, 0, message_length, ENC_NA);
-               icp_tree = proto_item_add_subtree(ti, ett_icp);
-
                proto_tree_add_uint(icp_tree,hf_icp_opcode, tvb, 0, 1, opcode);
 
                proto_tree_add_item(icp_tree,hf_icp_version, tvb, 1, 1, ENC_BIG_ENDIAN);
@@ -195,13 +194,16 @@ static void dissect_icp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                }
 
                proto_tree_add_item(icp_tree, hf_icp_sender_host_ip_address, tvb, 16, 4, ENC_BIG_ENDIAN);
+       }
 
-               payload_tree = proto_tree_add_subtree(icp_tree, tvb,
+       payload_tree = proto_tree_add_subtree(icp_tree, tvb,
                                                      20, message_length - 20,
                                                      ett_icp_payload, NULL, "Payload");
-               dissect_icp_payload(tvb, pinfo, 20, payload_tree, opcode);
-       }
+       dissect_icp_payload(tvb, pinfo, 20, payload_tree, opcode);
+
+       return tvb_captured_length(tvb);
 }
+
 void
 proto_register_icp(void)
 {
@@ -255,7 +257,7 @@ proto_reg_handoff_icp(void)
 {
        dissector_handle_t icp_handle;
 
-       icp_handle = create_dissector_handle(dissect_icp, proto_icp);
+       icp_handle = new_create_dissector_handle(dissect_icp, proto_icp);
        dissector_add_uint("udp.port", UDP_PORT_ICP, icp_handle);
 }
 
index 598a8c73a9e412e33182cd6078ab597ad5b3c2a3..01a520724c47654c31a109b0f2e563cd359dca63 100644 (file)
@@ -75,8 +75,8 @@ static const value_string idp_socket_vals[] = {
        { 0,                            NULL }
 };
 
-static void
-dissect_idp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_idp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        proto_tree      *idp_tree;
        proto_item      *ti;
@@ -122,11 +122,12 @@ dissect_idp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        /*
         * Hand off to the dissector for the packet type.
         */
-       if (dissector_try_uint(idp_type_dissector_table, type, next_tvb,
-           pinfo, tree))
-               return;
-
-       call_dissector(data_handle, next_tvb, pinfo, tree);
+       if (!dissector_try_uint(idp_type_dissector_table, type, next_tvb,
+               pinfo, tree))
+       {
+               call_dissector(data_handle, next_tvb, pinfo, tree);
+       }
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -205,7 +206,7 @@ proto_reg_handoff_idp(void)
 {
        dissector_handle_t idp_handle;
 
-       idp_handle = create_dissector_handle(dissect_idp, proto_idp);
+       idp_handle = new_create_dissector_handle(dissect_idp, proto_idp);
        dissector_add_uint("ethertype", ETHERTYPE_XNS_IDP, idp_handle);
        dissector_add_uint("chdlc.protocol", ETHERTYPE_XNS_IDP, idp_handle);
 
index abdbe98b61436f2bb4f5cc666c73736c3f444c79..ae1fc419d0792ab42204ac22a3d128926fb0ebcf 100644 (file)
@@ -1054,7 +1054,7 @@ static guint get_iec104apdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
 
 
 /* Is is called twice: For 'Packet List' and for 'Packet Details' */
-static void dissect_iec104asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_iec104asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        guint Len = tvb_reported_length(tvb);
        guint8 Bytex;
@@ -1196,7 +1196,7 @@ static void dissect_iec104asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
                                        /* check length */
                                        if(Len < (guint)(offset + 3)) {
                                                expert_add_info(pinfo, itSignal, &ei_iec104_short_asdu);
-                                               return;
+                                               return offset;
                                        }
                                        get_InfoObjectAddress(&asdu_info_obj_addr, tvb, &offset, trSignal);
                                } else {
@@ -1212,7 +1212,7 @@ static void dissect_iec104asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
                                                /* check length */
                                                if(Len < (guint)(offset + 3)) {
                                                        expert_add_info(pinfo, itSignal, &ei_iec104_short_asdu);
-                                                       return;
+                                                       return offset;
                                                }
                                                get_InfoObjectAddress(&asdu_info_obj_addr, tvb, &offset, trSignal);
                                        }
@@ -1223,7 +1223,7 @@ static void dissect_iec104asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
                                /* check length */
                                if(Len < (guint)(offset + asduh.DataLength)) {
                                        expert_add_info(pinfo, itSignal, &ei_iec104_short_asdu);
-                                       return;
+                                       return offset;
                                }
 
                                switch (asduh.TypeId) {
@@ -1371,6 +1371,7 @@ static void dissect_iec104asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
                        break;
        } /* end 'switch (asdu_typeid)' */
 
+       return tvb_captured_length(tvb);
 }
 
 
@@ -1855,7 +1856,7 @@ proto_reg_handoff_iec104(void)
        dissector_handle_t iec104apci_handle;
 
        iec104apci_handle = new_create_dissector_handle(dissect_iec104reas, proto_iec104apci);
-       iec104asdu_handle = create_dissector_handle(dissect_iec104asdu, proto_iec104asdu);
+       iec104asdu_handle = new_create_dissector_handle(dissect_iec104asdu, proto_iec104asdu);
 
        dissector_add_uint("tcp.port", IEC104_PORT, iec104apci_handle);
 }
index fe5996e17ac3d01f8c729384654c471f9f617f7f..2a51acffc9ba17e979c5ffa4ac4f6d3d8ce0ae55 100644 (file)
@@ -122,8 +122,8 @@ static expert_field ei_1722_incorrect_dbs = EI_INIT;
 
 static dissector_table_t avb_dissector_table;
 
-static void
-dissect_1722(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_1722(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_item *ti;
     proto_tree *ieee1722_tree = NULL;
@@ -139,11 +139,10 @@ dissect_1722(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     col_set_str(pinfo->cinfo, COL_INFO, "AVB Transportation Protocol");
 
-    if (tree) {
-        ti = proto_tree_add_item(tree, proto_1722, tvb, 0, -1, ENC_NA);
-
-        ieee1722_tree = proto_item_add_subtree(ti, ett_1722);
+     ti = proto_tree_add_item(tree, proto_1722, tvb, 0, -1, ENC_NA);
+     ieee1722_tree = proto_item_add_subtree(ti, ett_1722);
 
+    if (tree) {
         /* Add the CD and Subtype fields
          * CD field is 1 bit
          * Subtype field is 7 bits
@@ -161,7 +160,8 @@ dissect_1722(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     subtype &= 0x7F;
 
     /* call any registered subtype dissectors which use only the common AVTPDU (e.g. 1722.1 and MAAP) */
-    if (dissector_try_uint(avb_dissector_table, subtype, tvb, pinfo, tree)) return;
+    if (dissector_try_uint(avb_dissector_table, subtype, tvb, pinfo, tree))
+        return tvb_captured_length(tvb);
 
     if (tree) {
         proto_tree_add_item(ieee1722_tree, hf_1722_mrfield, tvb, IEEE_1722_VERSION_OFFSET, 1, ENC_BIG_ENDIAN);
@@ -221,27 +221,28 @@ dissect_1722(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
         proto_tree_add_item(ieee1722_tree, hf_1722_syt, tvb,
                             IEEE_1722_SYT_OFFSET, 2, ENC_BIG_ENDIAN);
+    }
 
-        /* Calculate the remaining size by subtracting the CIP header size
+    /* Calculate the remaining size by subtracting the CIP header size
            from the value in the packet data length field */
-        datalen = tvb_get_ntohs(tvb, IEEE_1722_PKT_DATA_LENGTH_OFFSET);
-        datalen -= IEEE_1722_CIP_HEADER_SIZE;
-
-        /* Make the Audio sample tree. */
-        ti = proto_tree_add_item(ieee1722_tree, hf_1722_data, tvb,
-                                 IEEE_1722_DATA_OFFSET, datalen, ENC_NA);
+    datalen = tvb_get_ntohs(tvb, IEEE_1722_PKT_DATA_LENGTH_OFFSET);
+    datalen -= IEEE_1722_CIP_HEADER_SIZE;
 
-        audio_tree = proto_item_add_subtree(ti, ett_1722_audio);
+    /* Make the Audio sample tree. */
+    ti = proto_tree_add_item(ieee1722_tree, hf_1722_data, tvb,
+                                IEEE_1722_DATA_OFFSET, datalen, ENC_NA);
 
-        /* Need to get the offset of where the audio data starts */
-        offset = IEEE_1722_DATA_OFFSET;
-        dbs = tvb_get_guint8(tvb, IEEE_1722_DBS_OFFSET);
+    audio_tree = proto_item_add_subtree(ti, ett_1722_audio);
 
-        /* If the DBS is ever 0 for whatever reason, then just add the rest of packet as unknown */
-        if(dbs == 0)
-            expert_add_info(pinfo, ti, &ei_1722_incorrect_dbs);
+    /* Need to get the offset of where the audio data starts */
+    offset = IEEE_1722_DATA_OFFSET;
+    dbs = tvb_get_guint8(tvb, IEEE_1722_DBS_OFFSET);
 
-        else {
+    /* If the DBS is ever 0 for whatever reason, then just add the rest of packet as unknown */
+    if(dbs == 0)
+        expert_add_info(pinfo, ti, &ei_1722_incorrect_dbs);
+    else {
+        if (audio_tree) {
             /* Loop through all samples and add them to the audio tree. */
             for (j = 0; j < (datalen / (dbs*4)); j++) {
                 sample_tree = proto_tree_add_subtree_format(audio_tree, tvb, offset, 1, ett_1722_sample, NULL, "Sample %d", j+1);
@@ -255,6 +256,7 @@ dissect_1722(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             }
         }
     }
+    return tvb_captured_length(tvb);
 }
 
 /* Register the protocol with Wireshark */
@@ -409,7 +411,7 @@ void proto_reg_handoff_1722(void)
 {
     dissector_handle_t avbtp_handle;
 
-    avbtp_handle = create_dissector_handle(dissect_1722, proto_1722);
+    avbtp_handle = new_create_dissector_handle(dissect_1722, proto_1722);
     dissector_add_uint("ethertype", ETHERTYPE_AVBTP, avbtp_handle);
 }
 
index 3b7f2970acfde5b3787dba601b881a06611a2319..4034ec94ea92236704902164dfed1d56b8d7758a 100644 (file)
@@ -4692,8 +4692,8 @@ dissect_17221_acmp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *acmp_tree)
    proto_tree_add_item(acmp_tree, hf_acmp_vlan_id, tvb, ACMP_VLAN_ID_OFFSET, 2, ENC_BIG_ENDIAN);
 }
 
-static void
-dissect_17221(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_17221(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
    guint8 subtype = 0;
    proto_item *ieee17221_item;
@@ -4734,10 +4734,11 @@ dissect_17221(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
          {
             /* Shouldn't get here */
             col_set_str(pinfo->cinfo, COL_INFO, "1722.1 Unknown");
-            return;
+            return 0;
          }
    }
 
+   return tvb_captured_length(tvb);
 }
 
 /* Register the protocol with Wireshark */
@@ -7019,7 +7020,7 @@ proto_reg_handoff_17221(void)
 
    /* avb17221_handle = find_dissector("ieee1722"); */
 
-   avb17221_handle = create_dissector_handle(dissect_17221, proto_17221);
+   avb17221_handle = new_create_dissector_handle(dissect_17221, proto_17221);
    dissector_add_uint("ieee1722.subtype", 0x7A, avb17221_handle);
    dissector_add_uint("ieee1722.subtype", 0x7B, avb17221_handle);
    dissector_add_uint("ieee1722.subtype", 0x7C, avb17221_handle);
index 7fe82ad11b2a9033c6f05a9d2a94679c7098235d..84c6ee3a01dd1bd7fee7250be813af6ec477cfdd 100644 (file)
@@ -228,7 +228,7 @@ static expert_field ei_format_info          = EI_INIT;
 static expert_field ei_clock_reference_type = EI_INIT;
 
 
-static void dissect_1722a (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_1722a (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_item *ti                 = NULL;
     proto_tree *ieee1722a_tree     = NULL;
@@ -382,6 +382,7 @@ static void dissect_1722a (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         DISSECTOR_ASSERT_NOT_REACHED();
         break;
     }
+    return tvb_captured_length(tvb);
 }
 
 /* Register the protocol with Wireshark */
@@ -512,7 +513,7 @@ void proto_reg_handoff_1722a(void)
 {
     dissector_handle_t avb1722a_handle;
 
-    avb1722a_handle = create_dissector_handle(dissect_1722a, proto_1722a);
+    avb1722a_handle = new_create_dissector_handle(dissect_1722a, proto_1722a);
     dissector_add_uint("ieee1722.subtype", IEEE_1722A_SUBTYPE_AVTP_AUDIO, avb1722a_handle);
     dissector_add_uint("ieee1722.subtype", IEEE_1722A_SUBTYPE_CRF,        avb1722a_handle);
 }
index 72e2561affa419272972682f477bf896a94354ad..82864ec812ebf0157a0634cdb46ed396a9323468 100644 (file)
@@ -39,8 +39,8 @@ static int hf_signal_strength = -1;
 
 static gint ett_airopeek = -1;
 
-static void
-dissect_airopeek(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_airopeek(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   proto_tree *airopeek_tree = NULL;
   proto_item *ti;
@@ -74,17 +74,15 @@ dissect_airopeek(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%u.%u",
                data_rate / 2,
                data_rate & 1 ? 5 : 0);
-  if (tree) {
-    proto_tree_add_uint64_format_value(airopeek_tree, hf_data_rate, tvb, 0, 1,
+
+  proto_tree_add_uint64_format_value(airopeek_tree, hf_data_rate, tvb, 0, 1,
                                  (guint64)data_rate * 500000,
                                  "%u.%u Mb/s",
                                  data_rate / 2,
                                  data_rate & 1 ? 5 : 0);
-  }
 
   phdr.channel = tvb_get_guint8(tvb, 1);
-  if (tree)
-    proto_tree_add_item(airopeek_tree, hf_channel, tvb, 1, 1, ENC_BIG_ENDIAN);
+  proto_tree_add_item(airopeek_tree, hf_channel, tvb, 1, 1, ENC_BIG_ENDIAN);
 
   signal_level = tvb_get_guint8(tvb, 2);
   /*
@@ -109,6 +107,7 @@ dissect_airopeek(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   pinfo->current_proto = "IEEE 802.11";
   next_tvb = tvb_new_subset_remaining(tvb, 4);
   call_dissector_with_data(ieee80211_radio_handle, next_tvb, pinfo, tree, &phdr);
+  return tvb_captured_length(tvb);
 }
 
 void proto_register_ieee80211_airopeek(void)
@@ -143,7 +142,7 @@ void proto_reg_handoff_ieee80211_airopeek(void)
   dissector_handle_t airopeek_handle;
 
   /* Register handoff to airopeek-header dissectors */
-  airopeek_handle = create_dissector_handle(dissect_airopeek, proto_airopeek);
+  airopeek_handle = new_create_dissector_handle(dissect_airopeek, proto_airopeek);
   dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11_AIROPEEK,
                      airopeek_handle);
   ieee80211_radio_handle = find_dissector("wlan_radio");
index 504e00c78f10da00ac8783120a33ca704014e90a..0a5c80df8091b019ef2ccf2226f4af3e65734e86 100644 (file)
@@ -283,10 +283,10 @@ tvb_get_enctohl(tvbuff_t *tvb, int offset, guint encoding)
         return tvb_get_letohl(tvb, offset);
 }
 
-static void
-dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
-    proto_tree *prism_tree = NULL, *prism_did_tree = NULL;
+    proto_tree *prism_tree, *prism_did_tree = NULL;
     proto_item *ti = NULL, *ti_did = NULL;
     tvbuff_t *next_tvb;
     int offset;
@@ -306,7 +306,7 @@ dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     if ((msgcode == WLANCAP_MAGIC_COOKIE_V1) ||
         (msgcode == WLANCAP_MAGIC_COOKIE_V2)) {
       call_dissector(wlancap_handle, tvb, pinfo, tree);
-      return;
+      return tvb_captured_length(tvb);
     }
 
     /*
@@ -328,7 +328,7 @@ dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     } else {
         /* neither matched - try it as just 802.11 with no Prism header */
         call_dissector(ieee80211_handle, tvb, pinfo, tree);
-        return;
+        return tvb_captured_length(tvb);
     }
 
     /* We don't have any 802.11 metadata yet. */
@@ -341,29 +341,21 @@ dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "Prism");
     col_clear(pinfo->cinfo, COL_INFO);
 
-    if(tree) {
-        ti = proto_tree_add_item(tree, proto_prism, tvb, 0, 144, ENC_NA);
-        prism_tree = proto_item_add_subtree(ti, ett_prism);
-    }
+    ti = proto_tree_add_item(tree, proto_prism, tvb, 0, 144, ENC_NA);
+    prism_tree = proto_item_add_subtree(ti, ett_prism);
 
     /* Message Code */
-    if(tree) {
-        proto_tree_add_item(prism_tree, hf_ieee80211_prism_msgcode, tvb, offset, 4, byte_order);
-    }
+    proto_tree_add_item(prism_tree, hf_ieee80211_prism_msgcode, tvb, offset, 4, byte_order);
     msgcode = tvb_get_enctohl(tvb, offset, byte_order);
     offset += 4;
 
     /* Message Length */
-    if(tree) {
-        proto_tree_add_item(prism_tree, hf_ieee80211_prism_msglen, tvb, offset, 4, byte_order);
-    }
+    proto_tree_add_item(prism_tree, hf_ieee80211_prism_msglen, tvb, offset, 4, byte_order);
     msglen = tvb_get_enctohl(tvb, offset, byte_order);
     offset += 4;
 
     /* Device Name */
-    if(tree) {
-       proto_tree_add_item(prism_tree, hf_ieee80211_prism_devname, tvb, offset, 16, ENC_ASCII|ENC_NA);
-    }
+    proto_tree_add_item(prism_tree, hf_ieee80211_prism_devname, tvb, offset, 16, ENC_ASCII|ENC_NA);
     devname_p = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 16, ENC_ASCII);
     offset += 16;
 
@@ -385,15 +377,11 @@ dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
         /* Status */
         status = tvb_get_enctohs(tvb, offset, byte_order);
-        if(tree) {
-            proto_tree_add_item(prism_did_tree, hf_ieee80211_prism_did_status, tvb, offset, 2, byte_order);
-        }
+        proto_tree_add_item(prism_did_tree, hf_ieee80211_prism_did_status, tvb, offset, 2, byte_order);
         offset += 2;
 
         /* Length */
-        if(tree) {
-            proto_tree_add_item(prism_did_tree, hf_ieee80211_prism_did_length, tvb, offset, 2, byte_order);
-        }
+        proto_tree_add_item(prism_did_tree, hf_ieee80211_prism_did_length, tvb, offset, 2, byte_order);
         offset += 2;
 
         /* Data, if present... */
@@ -489,9 +477,7 @@ dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
               break;
 
               default:
-                if(tree){
-                    proto_tree_add_item(prism_did_tree, hf_ieee80211_prism_did_unknown, tvb, offset, 4, byte_order);
-                }
+                proto_tree_add_item(prism_did_tree, hf_ieee80211_prism_did_unknown, tvb, offset, 4, byte_order);
               break;
             }
         }
@@ -501,6 +487,7 @@ dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     /* dissect the 802.11 header next */
     next_tvb = tvb_new_subset_remaining(tvb, offset);
     call_dissector_with_data(ieee80211_radio_handle, next_tvb, pinfo, tree, (void *)&phdr);
+    return tvb_captured_length(tvb);
 }
 
 static hf_register_info hf_prism[] = {
@@ -596,7 +583,7 @@ void proto_reg_handoff_ieee80211_prism(void)
 {
   dissector_handle_t prism_handle;
 
-  prism_handle = create_dissector_handle(dissect_prism, proto_prism);
+  prism_handle = new_create_dissector_handle(dissect_prism, proto_prism);
   dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11_PRISM, prism_handle);
   ieee80211_handle = find_dissector("wlan");
   ieee80211_radio_handle = find_dissector("wlan_radio");
index 917f227f5a9cac426539cd6b04d2d9942112a4e7..081f5e34c2286b9bea80ec1b1228e5328e7d0a9b 100644 (file)
@@ -18429,8 +18429,8 @@ dissect_ieee80211_withoutfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
  *      is already decrypted. I added a test in the code to accomodate this.
  *      For TKIP it seems to stay encrypted.
  */
-static void
-dissect_ieee80211_centrino(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ieee80211_centrino(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   struct ieee_802_11_phdr phdr;
 
@@ -18441,6 +18441,7 @@ dissect_ieee80211_centrino(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
   phdr.presence_flags = 0;
   dissect_ieee80211_common (tvb, pinfo, tree, FALSE, TRUE, &phdr);
+  return tvb_captured_length(tvb);
 }
 
 /*
@@ -18905,8 +18906,8 @@ wlan_retransmit_init(void)
 
 }
 
-static void
-dissect_data_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_data_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   int         offset = 0;
   guint8      type;
@@ -18935,6 +18936,7 @@ dissect_data_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     }
     break;
   }
+  return tvb_captured_length(tvb);
 }
 
 void
@@ -27268,7 +27270,7 @@ proto_reg_handoff_ieee80211(void)
   ieee80211_handle = find_dissector("wlan");
   dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_handle);
 
-  centrino_handle = create_dissector_handle( dissect_ieee80211_centrino, proto_centrino );
+  centrino_handle = new_create_dissector_handle( dissect_ieee80211_centrino, proto_centrino );
   dissector_add_uint("ethertype", ETHERTYPE_CENTRINO_PROMISC, centrino_handle);
 
   /* Register handoff to Aruba GRE */
@@ -27297,7 +27299,7 @@ proto_reg_handoff_ieee80211(void)
   dissector_add_uint("gre.proto", GRE_ARUBA_8360, ieee80211_handle);
   dissector_add_uint("gre.proto", GRE_ARUBA_8370, ieee80211_handle);
 
-  data_encap_handle = create_dissector_handle(dissect_data_encap, proto_wlan);
+  data_encap_handle = new_create_dissector_handle(dissect_data_encap, proto_wlan);
   dissector_add_uint("ethertype", ETHERTYPE_IEEE80211_DATA_ENCAP,
                 data_encap_handle);
 
index afadb086b3a576f86bde36f52dab45686e88ab5c..51c84f65d8f43ca891998900cc11e316e931f6fe 100644 (file)
@@ -101,9 +101,8 @@ capture_ieee8021ah(const guchar *pd, int offset, int len, packet_counts *ld)
 
 /* Dissector *************************************************************/
 static
-void
-dissect_ieee8021ad(tvbuff_t *tvb, packet_info *pinfo,
-                   proto_tree *tree)
+int dissect_ieee8021ad(tvbuff_t *tvb, packet_info *pinfo,
+                   proto_tree *tree, void* data _U_)
 {
     proto_tree       *ptree   = NULL;
     proto_tree       *tagtree = NULL;
@@ -130,12 +129,8 @@ dissect_ieee8021ad(tvbuff_t *tvb, packet_info *pinfo,
                  (tci >> 13), ((tci >> 12) & 1), (tci & 0xFFF));
 
     /* create the protocol tree */
-    ieee8021ad_tree = NULL;
-
-    if (tree) {
-        ptree = proto_tree_add_item(tree, proto_tree_index, tvb, 0, IEEE8021AD_LEN, ENC_NA);
-        ieee8021ad_tree = proto_item_add_subtree(ptree, ett_ieee8021ad);
-    }
+    ptree = proto_tree_add_item(tree, proto_tree_index, tvb, 0, IEEE8021AD_LEN, ENC_NA);
+    ieee8021ad_tree = proto_item_add_subtree(ptree, ett_ieee8021ad);
 
     encap_proto = tvb_get_ntohs(tvb, IEEE8021AD_LEN - 2);
     ethertype_data.fh_tree = ieee8021ad_tree;
@@ -172,7 +167,6 @@ dissect_ieee8021ad(tvbuff_t *tvb, packet_info *pinfo,
             dissect_ieee8021ah_common(next_tvb, pinfo, tree, NULL, proto_tree_index);
         }
 
-        return;
     } else if (encap_proto == ETHERTYPE_IEEE_802_1AD) {
         /* two VLAN tags (i.e. Q-in-Q) */
         ctci = tvb_get_ntohs(tvb, IEEE8021AD_LEN);
@@ -220,6 +214,7 @@ dissect_ieee8021ad(tvbuff_t *tvb, packet_info *pinfo,
            dissector based on ethertype */
         call_dissector_with_data(ethertype_handle, tvb, pinfo, tree, &ethertype_data);
     }
+    return tvb_captured_length(tvb);
 }
 
 void
@@ -295,9 +290,8 @@ dissect_ieee8021ah_common(tvbuff_t *tvb, packet_info *pinfo,
 }
 
 static
-void
-dissect_ieee8021ah(tvbuff_t *tvb, packet_info *pinfo,
-                   proto_tree *tree)
+int dissect_ieee8021ah(tvbuff_t *tvb, packet_info *pinfo,
+                   proto_tree *tree, void* data _U_)
 {
     proto_item *pi;
     guint32     tci;
@@ -326,6 +320,7 @@ dissect_ieee8021ah(tvbuff_t *tvb, packet_info *pinfo,
     } else {
         dissect_ieee8021ah_common(tvb, pinfo, tree, NULL, proto_tree_index);
     }
+    return tvb_captured_length(tvb);
 }
 
 /* Protocol Registration **************************************************/
@@ -428,9 +423,9 @@ proto_reg_handoff_ieee8021ah(void)
 
     if (!prefs_initialized){
         dissector_handle_t ieee8021ad_handle;
-        ieee8021ah_handle = create_dissector_handle(dissect_ieee8021ah,
+        ieee8021ah_handle = new_create_dissector_handle(dissect_ieee8021ah,
                                                     proto_ieee8021ah);
-        ieee8021ad_handle = create_dissector_handle(dissect_ieee8021ad,
+        ieee8021ad_handle = new_create_dissector_handle(dissect_ieee8021ad,
                                                     proto_ieee8021ad);
         dissector_add_uint("ethertype", ETHERTYPE_IEEE_802_1AD, ieee8021ad_handle);
         ethertype_handle = find_dissector("ethertype");
index 465a5c55abcc4c0c7e4395c0401602a78b519303..1ee75ac47673859e55b7ef78fb3980cc7ca76847 100644 (file)
@@ -76,8 +76,8 @@ ieee802a_add_oui(guint32 oui, const char *table_name, const char *table_ui_name,
        g_hash_table_insert(oui_info_table, GUINT_TO_POINTER(oui), new_info);
 }
 
-static void
-dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        proto_tree      *ieee802a_tree;
        proto_item      *ti;
@@ -128,16 +128,15 @@ dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                hf = hf_ieee802a_pid;
                subdissector_table = NULL;
        }
-       if (tree)
-               proto_tree_add_uint(ieee802a_tree, hf, tvb, 3, 2, pid);
+
+       proto_tree_add_uint(ieee802a_tree, hf, tvb, 3, 2, pid);
        next_tvb = tvb_new_subset_remaining(tvb, 5);
-       if (subdissector_table != NULL) {
+       if ((subdissector_table == NULL) ||
                /* do lookup with the subdissector table */
-               if (dissector_try_uint(subdissector_table, pid, next_tvb,
-                   pinfo, tree))
-                       return;
+               (!dissector_try_uint(subdissector_table, pid, next_tvb, pinfo, tree))) {
+                       call_dissector(data_handle, next_tvb, pinfo, tree);
        }
-       call_dissector(data_handle, next_tvb, pinfo, tree);
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -176,7 +175,7 @@ proto_reg_handoff_ieee802a(void)
 
        data_handle = find_dissector("data");
 
-       ieee802a_handle = create_dissector_handle(dissect_ieee802a,
+       ieee802a_handle = new_create_dissector_handle(dissect_ieee802a,
            proto_ieee802a);
        dissector_add_uint("ethertype", ETHERTYPE_IEEE802_OUI_EXTENDED,
            ieee802a_handle);
index aba1e51b3e4f14accfe08deb0f179a537ab4c34b..ecd6505295ec7e61414ce62547f241fae39d36da 100644 (file)
@@ -905,8 +905,8 @@ dissect_igmp_mtrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
        return offset;
 }
 
-static void
-dissect_igmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+static int
+dissect_igmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
 {
        int offset = 0;
        unsigned char type;
@@ -917,6 +917,7 @@ dissect_igmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
        {
                dissect_igmp_unknown(tvb, pinfo, parent_tree);
        }
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -1119,7 +1120,7 @@ proto_reg_handoff_igmp(void)
                                                igmp_mquery_handle, igmp_mtrace_handle, igmp_report_handle;
        range_t *igmpv0_range = NULL;
 
-       igmp_handle = create_dissector_handle(dissect_igmp, proto_igmp);
+       igmp_handle = new_create_dissector_handle(dissect_igmp, proto_igmp);
        dissector_add_uint("ip.proto", IP_PROTO_IGMP, igmp_handle);
 
        /* IGMP v0 */
index d880aedd87f0513e1835a8be7940534cc720299c..ad79b4c87d8130a5883142ba0859a2800cdb82e4 100644 (file)
@@ -65,7 +65,7 @@ static expert_field ei_igrp_version = EI_INIT;
 
 static void dissect_vektor_igrp (tvbuff_t *tvb, proto_tree *igrp_vektor_tree, guint8 network);
 
-static void dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   guint8 ver_and_opcode,version,opcode,network;
   gint offset=IGRP_HEADER_LENGTH;
@@ -80,7 +80,6 @@ static void dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
   ver_and_opcode = tvb_get_guint8(tvb,0);
 
-
   switch (ver_and_opcode) {
   case 0x11:
     col_set_str(pinfo->cinfo, COL_INFO, "Response" );
@@ -93,8 +92,6 @@ static void dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   }
 
 
-
-
   if (tree) {
     ti = proto_tree_add_protocol_format(tree, proto_igrp, tvb, 0, -1,
                                         "Cisco IGRP");
@@ -152,6 +149,7 @@ static void dissect_igrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     proto_tree_add_item(igrp_tree, hf_igrp_checksum, tvb, 10, 2, ENC_BIG_ENDIAN);
   }
+  return tvb_captured_length(tvb);
 }
 
 static void dissect_vektor_igrp (tvbuff_t *tvb, proto_tree *igrp_vektor_tree, guint8 network)
@@ -258,7 +256,7 @@ proto_reg_handoff_igrp(void)
 {
   dissector_handle_t igrp_handle;
 
-  igrp_handle = create_dissector_handle(dissect_igrp, proto_igrp);
+  igrp_handle = new_create_dissector_handle(dissect_igrp, proto_igrp);
   dissector_add_uint("ip.proto", IP_PROTO_IGRP, igrp_handle);
 }
 
index 8048ce2d51fce77b4cc4ec0c1801be875669b87c..10e8e0107e032f48398bb8f5cce5a0bf7836fa89 100644 (file)
@@ -134,8 +134,6 @@ typedef enum {
 
 /* Forward-declarations */
 
-static void dissect_roce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-static void dissect_rroce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
 static void dissect_infiniband_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ib_packet_start_header starts_with);
 static gint32 find_next_header_sequence(struct infinibandinfo* ibInfo);
 static gboolean contains(guint32 value, guint32* arr, int length);
@@ -1495,21 +1493,23 @@ static void table_destroy_notify(gpointer data) {
 /* Helper dissector for correctly dissecting RRoCE packets (encapsulated within an IP */
 /* frame). The only difference from regular IB packets is that RRoCE packets do not contain */
 /* a LRH, and always start with a BTH.                                                      */
-static void
-dissect_rroce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_rroce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     /* this is a RRoCE packet, so signal the IB dissector not to look for LRH/GRH */
     dissect_infiniband_common(tvb, pinfo, tree, IB_PACKET_STARTS_WITH_BTH);
+    return tvb_captured_length(tvb);
 }
 
 /* Helper dissector for correctly dissecting RoCE packets (encapsulated within an Ethernet */
 /* frame). The only difference from regular IB packets is that RoCE packets do not contain */
 /* a LRH, and always start with a GRH.                                                      */
-static void
-dissect_roce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_roce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     /* this is a RoCE packet, so signal the IB dissector not to look for LRH */
     dissect_infiniband_common(tvb, pinfo, tree, IB_PACKET_STARTS_WITH_GRH);
+    return tvb_captured_length(tvb);
 }
 
 static int
@@ -7466,11 +7466,11 @@ void proto_reg_handoff_infiniband(void)
     dissector_add_uint("erf.types.type", ERF_TYPE_INFINIBAND_LINK, ib_link_handle);
 
     /* create and announce an anonymous RoCE dissector */
-    roce_handle = create_dissector_handle(dissect_roce, proto_infiniband);
+    roce_handle = new_create_dissector_handle(dissect_roce, proto_infiniband);
     dissector_add_uint("ethertype", ETHERTYPE_ROCE, roce_handle);
 
     /* create and announce an anonymous RRoCE dissector */
-    rroce_handle = create_dissector_handle(dissect_rroce, proto_infiniband);
+    rroce_handle = new_create_dissector_handle(dissect_rroce, proto_infiniband);
     if (!initialized)
     {
         initialized = TRUE;
index 91086712397639794d95279831d11ee303c49822..b1bbee44bb32741cf320fe16cf462acc3135b93a 100644 (file)
@@ -56,8 +56,8 @@ capture_ipfc (const guchar *pd, int len, packet_counts *ld)
   capture_llc(pd, 16, len, ld);
 }
 
-static void
-dissect_ipfc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ipfc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
 
 /* Set up structures needed to add the protocol subtree and manage it */
@@ -80,6 +80,7 @@ dissect_ipfc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     next_tvb = tvb_new_subset_remaining (tvb, 16);
     call_dissector(llc_handle, next_tvb, pinfo, tree);
+    return tvb_captured_length(tvb);
 }
 
 /* Register the protocol with Wireshark */
@@ -124,7 +125,7 @@ proto_reg_handoff_ipfc (void)
 {
     dissector_handle_t ipfc_handle;
 
-    ipfc_handle = create_dissector_handle (dissect_ipfc, proto_ipfc);
+    ipfc_handle = new_create_dissector_handle (dissect_ipfc, proto_ipfc);
     dissector_add_uint("wtap_encap", WTAP_ENCAP_IP_OVER_FC, ipfc_handle);
 
     llc_handle = find_dissector ("llc");
index 88769310ce42f1958bd242507c12e109c0134acb..34a48847a7f7846aa56618a25344e94ee439d925 100644 (file)
@@ -57,8 +57,8 @@ static const value_string htype_vals[] = {
   { 0, NULL }
 };
 
-static void
-dissect_ipnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ipnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   proto_tree *fh_tree;
   proto_item *ti;
@@ -100,6 +100,7 @@ dissect_ipnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   default:
     break;
   }
+  return tvb_captured_length(tvb);
 }
 
 void
@@ -150,7 +151,7 @@ proto_reg_handoff_ipnet(void)
   ip_handle = find_dissector("ip");
   ipv6_handle = find_dissector("ipv6");
 
-  ipnet_handle = create_dissector_handle(dissect_ipnet, proto_ipnet);
+  ipnet_handle = new_create_dissector_handle(dissect_ipnet, proto_ipnet);
   dissector_add_uint("wtap_encap", WTAP_ENCAP_IPNET, ipnet_handle);
 }
 
index 8604a357cb9af1ab45049c64e65c1686b3bf161a..6731556560f754875eb55686cd4bc2e45319e981 100644 (file)
@@ -40,8 +40,8 @@ static dissector_handle_t arp_handle;
 static dissector_handle_t ip_handle;
 static dissector_handle_t ipv6_handle;
 
-static void
-dissect_ipoib(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ipoib(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   proto_tree *fh_tree;
   proto_item *ti;
@@ -79,6 +79,7 @@ dissect_ipoib(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   default:
     break;
   }
+  return tvb_captured_length(tvb);
 }
 
 void
@@ -116,7 +117,7 @@ proto_reg_handoff_ipoib(void)
   ip_handle   = find_dissector("ip");
   ipv6_handle = find_dissector("ipv6");
 
-  ipoib_handle = create_dissector_handle(dissect_ipoib, proto_ipoib);
+  ipoib_handle = new_create_dissector_handle(dissect_ipoib, proto_ipoib);
   dissector_add_uint("wtap_encap", WTAP_ENCAP_IP_OVER_IB, ipoib_handle);
 }
 
index 9c13c7b1dd849c33c21fb7711425f129bd64b49a..d8a074c206b3aaabd922c19f0b4b4463aaef8876 100644 (file)
@@ -190,8 +190,8 @@ static void add_charstring_value(const gchar *tag_desc, proto_tree *tree,
 static int add_value_head(const gchar *tag_desc, proto_tree *tree,
                                         tvbuff_t *tvb, int offset, int name_length, int value_length, char **name_val);
 
-static void
-dissect_ipp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ipp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_tree  *ipp_tree;
     proto_item  *ti;
@@ -207,59 +207,58 @@ dissect_ipp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     else
         col_set_str(pinfo->cinfo, COL_INFO, "IPP response");
 
-    if (tree) {
-        ti = proto_tree_add_item(tree, proto_ipp, tvb, offset, -1, ENC_NA);
-        ipp_tree = proto_item_add_subtree(ti, ett_ipp);
+    ti = proto_tree_add_item(tree, proto_ipp, tvb, offset, -1, ENC_NA);
+    ipp_tree = proto_item_add_subtree(ti, ett_ipp);
 
-        proto_tree_add_item(ipp_tree, hf_ipp_version, tvb, offset, 2, ENC_BIG_ENDIAN);
-        offset += 2;
+    proto_tree_add_item(ipp_tree, hf_ipp_version, tvb, offset, 2, ENC_BIG_ENDIAN);
+    offset += 2;
 
-        if (is_request) {
-            proto_tree_add_item(ipp_tree, hf_ipp_operation_id, tvb, offset, 2, ENC_BIG_ENDIAN);
-        } else {
-            status_code = tvb_get_ntohs(tvb, offset);
-            switch (status_code & STATUS_TYPE_MASK) {
+    if (is_request) {
+        proto_tree_add_item(ipp_tree, hf_ipp_operation_id, tvb, offset, 2, ENC_BIG_ENDIAN);
+    } else {
+        status_code = tvb_get_ntohs(tvb, offset);
+        switch (status_code & STATUS_TYPE_MASK) {
 
-            case STATUS_SUCCESSFUL:
-                status_type = "Successful";
-                break;
+        case STATUS_SUCCESSFUL:
+            status_type = "Successful";
+            break;
 
-            case STATUS_INFORMATIONAL:
-                status_type = "Informational";
-                break;
+        case STATUS_INFORMATIONAL:
+            status_type = "Informational";
+            break;
 
-            case STATUS_REDIRECTION:
-                status_type = "Redirection";
-                break;
+        case STATUS_REDIRECTION:
+            status_type = "Redirection";
+            break;
 
-            case STATUS_CLIENT_ERROR:
-                status_type = "Client error";
-                break;
+        case STATUS_CLIENT_ERROR:
+            status_type = "Client error";
+            break;
 
-            case STATUS_SERVER_ERROR:
-                status_type = "Server error";
-                break;
+        case STATUS_SERVER_ERROR:
+            status_type = "Server error";
+            break;
 
-            default:
-                status_type = "Unknown";
-                break;
-            }
-            proto_tree_add_uint_format_value(ipp_tree, hf_ipp_status_code, tvb, offset, 2, status_code,
-                                "%s (%s)", status_type, val_to_str(status_code, status_vals, "0x804x"));
+        default:
+            status_type = "Unknown";
+            break;
         }
-        offset += 2;
+        proto_tree_add_uint_format_value(ipp_tree, hf_ipp_status_code, tvb, offset, 2, status_code,
+                            "%s (%s)", status_type, val_to_str(status_code, status_vals, "0x804x"));
+    }
+    offset += 2;
 
-        proto_tree_add_item(ipp_tree, hf_ipp_request_id, tvb, offset, 4, ENC_BIG_ENDIAN);
-        offset += 4;
+    proto_tree_add_item(ipp_tree, hf_ipp_request_id, tvb, offset, 4, ENC_BIG_ENDIAN);
+    offset += 4;
 
-        offset = parse_attributes(tvb, offset, ipp_tree);
+    offset = parse_attributes(tvb, offset, ipp_tree);
 
-        if (tvb_offset_exists(tvb, offset)) {
-            call_dissector(data_handle,
-                           tvb_new_subset_remaining(tvb, offset), pinfo,
-                           ipp_tree);
-        }
+    if (tvb_offset_exists(tvb, offset)) {
+        call_dissector(data_handle,
+                        tvb_new_subset_remaining(tvb, offset), pinfo,
+                        ipp_tree);
     }
+    return tvb_captured_length(tvb);
 }
 
 #define TAG_TYPE(x)       ((x) & 0xF0)
@@ -718,7 +717,7 @@ proto_reg_handoff_ipp(void)
     /*
      * Register ourselves as running atop HTTP and using port 631.
      */
-    ipp_handle = create_dissector_handle(dissect_ipp, proto_ipp);
+    ipp_handle = new_create_dissector_handle(dissect_ipp, proto_ipp);
     http_dissector_add(631, ipp_handle);
     dissector_add_string("media_type", "application/ipp", ipp_handle);
     data_handle = find_dissector("data");
index 6239b099f0e8763819ee95c946ca68d342b5cb39..01c17d79d2ca2cc4d4075b414aa9e5273ea9fe8f 100644 (file)
@@ -43,8 +43,8 @@ static dissector_handle_t isakmp_handle;
  * UDP Encapsulation of IPsec Packets
  * draft-ietf-ipsec-udp-encaps-06.txt
  */
-static void
-dissect_udpencap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_udpencap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   tvbuff_t   *next_tvb;
   proto_tree *udpencap_tree;
@@ -76,6 +76,7 @@ dissect_udpencap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
       call_dissector(esp_handle, tvb, pinfo, tree);
     }
   }
+  return tvb_captured_length(tvb);
 }
 
 void
@@ -106,7 +107,7 @@ proto_reg_handoff_udpencap(void)
   esp_handle = find_dissector("esp");
   isakmp_handle = find_dissector("isakmp");
 
-  udpencap_handle = create_dissector_handle(dissect_udpencap, proto_udpencap);
+  udpencap_handle = new_create_dissector_handle(dissect_udpencap, proto_udpencap);
   dissector_add_uint("udp.port", 4500, udpencap_handle);
 }
 
index ff0063f355423c47d8f21af3ad35ca502ea248d3..4e52241fe61a6297f82e14a218fad66af331dce6 100644 (file)
@@ -2233,8 +2233,8 @@ dissect_esp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 }
 
 
-static void
-dissect_ipcomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ipcomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dissector_data _U_)
 {
   proto_tree *ipcomp_tree;
   proto_item *ti;
@@ -2242,6 +2242,7 @@ dissect_ipcomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   const char *p;
   dissector_handle_t dissector_handle;
   guint32 saved_match_uint;
+  tvbuff_t *data, *decomp;
 
   /*
    * load the top pane info. This should be overwritten by
@@ -2263,9 +2264,6 @@ dissect_ipcomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
    * populate a tree in the second pane with the status of the link layer
    * (ie none)
    */
-  if (tree) {
-    tvbuff_t *data, *decomp;
-
     ti = proto_tree_add_item(tree, proto_ipcomp, tvb, 0, -1, ENC_NA);
     ipcomp_tree = proto_item_add_subtree(ti, ett_ipcomp);
 
@@ -2303,7 +2301,8 @@ dissect_ipcomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         call_dissector(dissector_handle, decomp, pinfo, tree);
         pinfo->match_uint = saved_match_uint;
     }
-  }
+
+       return tvb_captured_length(tvb);
 }
 
 static void ipsec_init_protocol(void)
@@ -2554,7 +2553,7 @@ proto_reg_handoff_ipsec(void)
   dissector_add_uint("ip.proto", IP_PROTO_AH, ah_handle);
   esp_handle = find_dissector("esp");
   dissector_add_uint("ip.proto", IP_PROTO_ESP, esp_handle);
-  ipcomp_handle = create_dissector_handle(dissect_ipcomp, proto_ipcomp);
+  ipcomp_handle = new_create_dissector_handle(dissect_ipcomp, proto_ipcomp);
   dissector_add_uint("ip.proto", IP_PROTO_IPCOMP, ipcomp_handle);
   ipv6_ah_handle = new_create_dissector_handle(dissect_ah_header, proto_ah );
   dissector_add_uint("ipv6.nxt", IP_PROTO_AH, ipv6_ah_handle);
index 3608106a29d26a28d2e75d48af7ef45e6bf6067d..3bbf9c19101967161e32daec8ea60452c240f1ce 100644 (file)
@@ -47,7 +47,7 @@ static int hf_ipsictl_data = -1;
 static gint ett_ipsictl = -1;
 static gint ett_ipsictl_pdu = -1;
 
-static void dissect_ipsictl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_ipsictl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
 
   proto_tree   *ipsictl_tree;
@@ -162,9 +162,7 @@ static void dissect_ipsictl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
   if (!haspdus)
   {
-    if (tree) {
-      proto_tree_add_item(ipsictl_tree, hf_ipsictl_data, tvb, offset, -1, ENC_NA);
-    }
+    proto_tree_add_item(ipsictl_tree, hf_ipsictl_data, tvb, offset, -1, ENC_NA);
   }
 
   col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPSICTL");
@@ -183,6 +181,7 @@ static void dissect_ipsictl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     col_set_str(pinfo->cinfo, COL_INFO, "Initialization");
   }
 
+  return tvb_captured_length(tvb);
 
 } /* dissect_ipsictl */
 
@@ -236,7 +235,7 @@ void proto_reg_handoff_ipsictl(void)
 
   dissector_handle_t ipsictl_handle = NULL;
 
-  ipsictl_handle = create_dissector_handle(dissect_ipsictl, proto_ipsictl);
+  ipsictl_handle = new_create_dissector_handle(dissect_ipsictl, proto_ipsictl);
 
   dissector_add_uint("tcp.port", IPSICTL_PORT, ipsictl_handle);
 
index 56fe16326881c49159975a0e79ad2a894c28449c..036e2710e94bfc94ddc987bc7beaf83e45e232d8 100644 (file)
@@ -102,8 +102,8 @@ static const value_string connection_type_strings[] = {
 };
 
 
-static void
-dissect_ipvs_syncd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
+static int
+dissect_ipvs_syncd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_)
 {
        proto_tree *tree;
        proto_item *item;
@@ -200,6 +200,8 @@ dissect_ipvs_syncd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
                }
 
        }
+
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -331,7 +333,7 @@ proto_reg_handoff_ipvs_syncd(void)
 {
        dissector_handle_t ipvs_syncd_handle;
 
-       ipvs_syncd_handle = create_dissector_handle(dissect_ipvs_syncd, proto_ipvs_syncd);
+       ipvs_syncd_handle = new_create_dissector_handle(dissect_ipvs_syncd, proto_ipvs_syncd);
        dissector_add_uint("udp.port", IPVS_SYNCD_PORT, ipvs_syncd_handle);
 }
 
index 0af70c0f634d21be99dd07d02aa8dc956b6e87d1..113c55ef9f8e9839dda11b48fbc446b02383f7f9 100644 (file)
@@ -122,8 +122,8 @@ static const value_string ipxwan_compression_type_vals[] = {
        { 0,                 NULL }
 };
 
-static void
-dissect_ipxwan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ipxwan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        proto_item *ti;
        proto_tree *ipxwan_tree = NULL;
@@ -142,194 +142,190 @@ dissect_ipxwan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "IPX WAN");
        col_clear(pinfo->cinfo, COL_INFO);
 
-       if (tree) {
-               ti = proto_tree_add_item(tree, proto_ipxwan, tvb, 0, -1,
-                   ENC_NA);
-               ipxwan_tree = proto_item_add_subtree(ti, ett_ipxwan);
-       }
+       ti = proto_tree_add_item(tree, proto_ipxwan, tvb, 0, -1,
+               ENC_NA);
+       ipxwan_tree = proto_item_add_subtree(ti, ett_ipxwan);
 
-       if (tree) {
-               proto_tree_add_item(ipxwan_tree, hf_ipxwan_identifier, tvb,
+       proto_tree_add_item(ipxwan_tree, hf_ipxwan_identifier, tvb,
                    offset, 4, ENC_ASCII|ENC_NA);
-       }
+
        offset += 4;
        packet_type = tvb_get_guint8(tvb, offset);
        col_add_str(pinfo->cinfo, COL_INFO,
                    val_to_str(packet_type, ipxwan_packet_type_vals,
                        "Unknown packet type %u"));
 
-       if (tree) {
-               proto_tree_add_uint(ipxwan_tree, hf_ipxwan_packet_type, tvb,
-                       offset, 1, packet_type);
-               offset += 1;
-               proto_tree_add_item(ipxwan_tree, hf_ipxwan_node_id, tvb,
-                       offset, 4, ENC_BIG_ENDIAN);
-               offset += 4;
-               proto_tree_add_item(ipxwan_tree, hf_ipxwan_sequence_number, tvb,
-                       offset, 1, ENC_BIG_ENDIAN);
+       proto_tree_add_uint(ipxwan_tree, hf_ipxwan_packet_type, tvb,
+               offset, 1, packet_type);
+       offset += 1;
+       proto_tree_add_item(ipxwan_tree, hf_ipxwan_node_id, tvb,
+               offset, 4, ENC_BIG_ENDIAN);
+       offset += 4;
+       proto_tree_add_item(ipxwan_tree, hf_ipxwan_sequence_number, tvb,
+               offset, 1, ENC_BIG_ENDIAN);
+       offset += 1;
+       num_options = tvb_get_guint8(tvb, offset);
+       proto_tree_add_uint(ipxwan_tree, hf_ipxwan_num_options, tvb,
+               offset, 1, num_options);
+       offset += 1;
+
+       while (num_options != 0) {
+               option_number = tvb_get_guint8(tvb, offset);
+               option_tree = proto_tree_add_subtree_format(ipxwan_tree, tvb, offset, -1,
+                       ett_ipxwan_option, &ti, "Option: %s",
+                       val_to_str(option_number, ipxwan_option_num_vals,
+                           "Unknown (%u)"));
+
+               proto_tree_add_uint(option_tree, hf_ipxwan_option_num,
+                       tvb, offset, 1, option_number);
                offset += 1;
-               num_options = tvb_get_guint8(tvb, offset);
-               proto_tree_add_uint(ipxwan_tree, hf_ipxwan_num_options, tvb,
-                       offset, 1, num_options);
+               proto_tree_add_item(option_tree, hf_ipxwan_accept_option,
+                       tvb, offset, 1, ENC_BIG_ENDIAN);
                offset += 1;
-
-               while (num_options != 0) {
-                       option_number = tvb_get_guint8(tvb, offset);
-                       option_tree = proto_tree_add_subtree_format(ipxwan_tree, tvb, offset, -1,
-                           ett_ipxwan_option, &ti, "Option: %s",
-                           val_to_str(option_number, ipxwan_option_num_vals,
-                               "Unknown (%u)"));
-
-                       proto_tree_add_uint(option_tree, hf_ipxwan_option_num,
-                           tvb, offset, 1, option_number);
-                       offset += 1;
-                       proto_tree_add_item(option_tree, hf_ipxwan_accept_option,
-                           tvb, offset, 1, ENC_BIG_ENDIAN);
-                       offset += 1;
-                       option_data_len = tvb_get_ntohs(tvb, offset);
-                       proto_tree_add_uint(option_tree, hf_ipxwan_option_data_len,
-                           tvb, offset, 2, option_data_len);
-                       offset += 2;
-                       proto_item_set_len(ti, option_data_len+4);
-                       switch (option_number) {
-
-                       case OPT_ROUTING_TYPE:
-                               if (option_data_len != 1) {
-                                       expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
-                                               "Bogus length: %u, should be 1", option_data_len);
-                               } else {
-                                       proto_tree_add_item(option_tree,
-                                           hf_ipxwan_routing_type, tvb,
-                                           offset, 1, ENC_BIG_ENDIAN);
-                               }
-                               break;
-
-                       case OPT_RIP_SAP_INFO_EXCHANGE:
-                               if (option_data_len != 54) {
-                                       expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
-                                               "Bogus length: %u, should be 54", option_data_len);
-                               } else {
-                                       wan_link_delay = tvb_get_ntohs(tvb,
-                                           offset);
-                                       proto_tree_add_uint_format_value(option_tree,
-                                           hf_ipxwan_wan_link_delay, tvb,
-                                           offset, 2, wan_link_delay,
-                                           "%ums",
-                                           wan_link_delay);
-                                       proto_tree_add_item(option_tree,
-                                           hf_ipxwan_common_network_number,
-                                           tvb, offset+2, 4, ENC_NA);
-                                       proto_tree_add_item(option_tree,
-                                           hf_ipxwan_router_name, tvb,
-                                           offset+6, 48, ENC_ASCII|ENC_NA);
-                               }
-                               break;
-
-                       case OPT_NLSP_INFORMATION:
-                               if (option_data_len != 8) {
-                                       expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
-                                               "Bogus length: %u, should be 8", option_data_len);
-                               } else {
-                                       delay = tvb_get_ntohl(tvb, offset);
-                                       proto_tree_add_uint_format_value(option_tree,
-                                           hf_ipxwan_delay, tvb,
-                                           offset, 4, delay,
-                                           "%uus", delay);
-                                       throughput = tvb_get_ntohl(tvb, offset);
-                                       proto_tree_add_uint_format_value(option_tree,
-                                           hf_ipxwan_throughput, tvb,
-                                           offset, 4, throughput,
-                                           "%uus",
-                                           throughput);
-                               }
-                               break;
-
-                       case OPT_NLSP_RAW_THROUGHPUT_DATA:
-                               if (option_data_len != 8) {
-                                       expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
-                                               "Bogus length: %u, should be 8", option_data_len);
-                               } else {
-                                       proto_tree_add_item(option_tree,
-                                           hf_ipxwan_request_size, tvb,
-                                           offset, 4, ENC_BIG_ENDIAN);
-                                       delta_time = tvb_get_ntohl(tvb, offset);
-                                       proto_tree_add_uint_format_value(option_tree,
-                                           hf_ipxwan_delta_time, tvb,
-                                           offset, 4, delta_time,
-                                           "%uus",
-                                           delta_time);
-                               }
-                               break;
-
-                       case OPT_EXTENDED_NODE_ID:
-                               if (option_data_len != 4) {
-                                       expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
-                                               "Bogus length: %u, should be 4", option_data_len);
-                               } else {
-                                       proto_tree_add_item(option_tree,
-                                           hf_ipxwan_extended_node_id, tvb,
-                                           offset, 4, ENC_NA);
-                               }
-                               break;
-
-                       case OPT_NODE_NUMBER:
-                               if (option_data_len != 6) {
-                                       expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
-                                               "Bogus length: %u, should be 6", option_data_len);
-                               } else {
-                                       proto_tree_add_item(option_tree,
-                                           hf_ipxwan_node_number, tvb,
-                                           offset, 6, ENC_NA);
-                               }
-                               break;
-
-                       case OPT_COMPRESSION:
-                               if (option_data_len < 1) {
-                                       expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
-                                               "Bogus length: %u, should be >= 1", option_data_len);
-                               } else {
-                                       compression_type = tvb_get_guint8(tvb,
-                                           offset);
-                                       ti = proto_tree_add_uint(option_tree,
-                                           hf_ipxwan_compression_type, tvb,
-                                           offset, 1, compression_type);
-                                       switch (compression_type) {
-
-                                       case COMP_TYPE_TELEBIT:
-                                               if (option_data_len < 3) {
-                                                       expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
-                                                               "Bogus length: %u, should be >= 3", option_data_len);
-                                               } else {
-                                                       proto_tree_add_item(option_tree, hf_ipxwan_compression_options,
-                                                               tvb, offset+1, 1, ENC_BIG_ENDIAN);
-                                                       proto_tree_add_item(option_tree, hf_ipxwan_compression_slots,
-                                                               tvb, offset+2, 1, ENC_BIG_ENDIAN);
-                                               }
-                                               break;
-
-                                       default:
-                                               proto_tree_add_item(option_tree, hf_ipxwan_compression_parameters,
-                                                       tvb, offset+1, option_data_len-1, ENC_NA);
-                                               break;
+               option_data_len = tvb_get_ntohs(tvb, offset);
+               proto_tree_add_uint(option_tree, hf_ipxwan_option_data_len,
+                       tvb, offset, 2, option_data_len);
+               offset += 2;
+               proto_item_set_len(ti, option_data_len+4);
+               switch (option_number) {
+
+               case OPT_ROUTING_TYPE:
+                       if (option_data_len != 1) {
+                               expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
+                                       "Bogus length: %u, should be 1", option_data_len);
+                       } else {
+                               proto_tree_add_item(option_tree,
+                                       hf_ipxwan_routing_type, tvb,
+                                       offset, 1, ENC_BIG_ENDIAN);
+                       }
+                       break;
+
+               case OPT_RIP_SAP_INFO_EXCHANGE:
+                       if (option_data_len != 54) {
+                               expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
+                                       "Bogus length: %u, should be 54", option_data_len);
+                       } else {
+                               wan_link_delay = tvb_get_ntohs(tvb,
+                                       offset);
+                               proto_tree_add_uint_format_value(option_tree,
+                                       hf_ipxwan_wan_link_delay, tvb,
+                                       offset, 2, wan_link_delay,
+                                       "%ums",
+                                       wan_link_delay);
+                               proto_tree_add_item(option_tree,
+                                       hf_ipxwan_common_network_number,
+                                       tvb, offset+2, 4, ENC_NA);
+                               proto_tree_add_item(option_tree,
+                                       hf_ipxwan_router_name, tvb,
+                                       offset+6, 48, ENC_ASCII|ENC_NA);
+                       }
+                       break;
+
+               case OPT_NLSP_INFORMATION:
+                       if (option_data_len != 8) {
+                               expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
+                                       "Bogus length: %u, should be 8", option_data_len);
+                       } else {
+                               delay = tvb_get_ntohl(tvb, offset);
+                               proto_tree_add_uint_format_value(option_tree,
+                                       hf_ipxwan_delay, tvb,
+                                       offset, 4, delay,
+                                       "%uus", delay);
+                               throughput = tvb_get_ntohl(tvb, offset);
+                               proto_tree_add_uint_format_value(option_tree,
+                                       hf_ipxwan_throughput, tvb,
+                                       offset, 4, throughput,
+                                       "%uus",
+                                       throughput);
+                       }
+                       break;
+
+               case OPT_NLSP_RAW_THROUGHPUT_DATA:
+                       if (option_data_len != 8) {
+                               expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
+                                       "Bogus length: %u, should be 8", option_data_len);
+                       } else {
+                               proto_tree_add_item(option_tree,
+                                       hf_ipxwan_request_size, tvb,
+                                       offset, 4, ENC_BIG_ENDIAN);
+                               delta_time = tvb_get_ntohl(tvb, offset);
+                               proto_tree_add_uint_format_value(option_tree,
+                                       hf_ipxwan_delta_time, tvb,
+                                       offset, 4, delta_time,
+                                       "%uus",
+                                       delta_time);
+                       }
+                       break;
+
+               case OPT_EXTENDED_NODE_ID:
+                       if (option_data_len != 4) {
+                               expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
+                                       "Bogus length: %u, should be 4", option_data_len);
+                       } else {
+                               proto_tree_add_item(option_tree,
+                                       hf_ipxwan_extended_node_id, tvb,
+                                       offset, 4, ENC_NA);
+                       }
+                       break;
+
+               case OPT_NODE_NUMBER:
+                       if (option_data_len != 6) {
+                               expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
+                                       "Bogus length: %u, should be 6", option_data_len);
+                       } else {
+                               proto_tree_add_item(option_tree,
+                                       hf_ipxwan_node_number, tvb,
+                                       offset, 6, ENC_NA);
+                       }
+                       break;
+
+               case OPT_COMPRESSION:
+                       if (option_data_len < 1) {
+                               expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
+                                       "Bogus length: %u, should be >= 1", option_data_len);
+                       } else {
+                               compression_type = tvb_get_guint8(tvb,
+                                       offset);
+                               ti = proto_tree_add_uint(option_tree,
+                                       hf_ipxwan_compression_type, tvb,
+                                       offset, 1, compression_type);
+                               switch (compression_type) {
+
+                               case COMP_TYPE_TELEBIT:
+                                       if (option_data_len < 3) {
+                                               expert_add_info_format(pinfo, ti, &ei_ipxwan_option_data_len,
+                                                       "Bogus length: %u, should be >= 3", option_data_len);
+                                       } else {
+                                               proto_tree_add_item(option_tree, hf_ipxwan_compression_options,
+                                                       tvb, offset+1, 1, ENC_BIG_ENDIAN);
+                                               proto_tree_add_item(option_tree, hf_ipxwan_compression_slots,
+                                                       tvb, offset+2, 1, ENC_BIG_ENDIAN);
                                        }
-                               }
-                               break;
-
-                       case OPT_PAD:
-                               proto_tree_add_item(option_tree, hf_ipxwan_padding,
-                                       tvb, offset, option_data_len, ENC_NA);
-                               break;
+                                       break;
 
-                       default:
-                               proto_tree_add_item(option_tree, hf_ipxwan_option_value,
-                                       tvb, offset, option_data_len, ENC_NA);
-                               break;
+                               default:
+                                       proto_tree_add_item(option_tree, hf_ipxwan_compression_parameters,
+                                               tvb, offset+1, option_data_len-1, ENC_NA);
+                                       break;
+                               }
                        }
+                       break;
 
-                       offset += option_data_len;
-                       num_options--;
+               case OPT_PAD:
+                       proto_tree_add_item(option_tree, hf_ipxwan_padding,
+                               tvb, offset, option_data_len, ENC_NA);
+                       break;
+
+               default:
+                       proto_tree_add_item(option_tree, hf_ipxwan_option_value,
+                               tvb, offset, option_data_len, ENC_NA);
+                       break;
                }
+
+               offset += option_data_len;
+               num_options--;
        }
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -458,7 +454,7 @@ proto_reg_handoff_ipxwan(void)
 {
        dissector_handle_t ipxwan_handle;
 
-       ipxwan_handle = create_dissector_handle(dissect_ipxwan,
+       ipxwan_handle = new_create_dissector_handle(dissect_ipxwan,
            proto_ipxwan);
        dissector_add_uint("ipx.socket", IPX_SOCKET_IPXWAN, ipxwan_handle);
 }
index d9eee7867f207e364e284fbc1cf8efb3c42d029b..a1ba34a19097cd87affae2ae30cc2935afcda97e 100644 (file)
@@ -444,8 +444,8 @@ dissect_irc_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int of
     }
 }
 
-static void
-dissect_irc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_irc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_tree *irc_tree, *ti;
     gint        offset = 0;
@@ -494,6 +494,7 @@ dissect_irc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         }
         offset = next_offset;
     }
+    return tvb_captured_length(tvb);
 }
 
 void
@@ -571,7 +572,7 @@ proto_reg_handoff_irc(void)
 {
     dissector_handle_t irc_handle;
 
-    irc_handle = create_dissector_handle(dissect_irc, proto_irc);
+    irc_handle = new_create_dissector_handle(dissect_irc, proto_irc);
     dissector_add_uint("tcp.port", TCP_PORT_IRC, irc_handle);
     dissector_add_uint("tcp.port", TCP_PORT_DIRCPROXY, irc_handle);
 }
index fc27c8978eaf894fd256a294ada2793f4cae1d67..80e7d87120182918e2981da21777ce12797e8f66 100644 (file)
@@ -90,8 +90,8 @@ static const value_string channel_vals[] = {
        { 0,    NULL }
 };
 
-static void
-dissect_isdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_isdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        proto_tree *isdn_tree;
        proto_item *ti;
@@ -200,6 +200,8 @@ dissect_isdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        if (!try_circuit_dissector(CT_ISDN, pinfo->pseudo_header->isdn.channel,
                pinfo->fd->num, tvb, pinfo, tree, NULL))
                call_dissector(data_handle, tvb, pinfo, tree);
+
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -242,7 +244,7 @@ proto_reg_handoff_isdn(void)
        v120_handle = find_dissector("v120");
        data_handle = find_dissector("data");
 
-       isdn_handle = create_dissector_handle(dissect_isdn, proto_isdn);
+       isdn_handle = new_create_dissector_handle(dissect_isdn, proto_isdn);
 
        dissector_add_uint("wtap_encap", WTAP_ENCAP_ISDN, isdn_handle);
 }
index c082b207fd5e5e37ee2b265272ba2af9cf1333cc..ad4b9de79dada72be52fab611b512a5781c4009d 100644 (file)
@@ -678,7 +678,7 @@ static int ett_isi_network_gsm_band_info = -1;
 static expert_field ei_isi_len = EI_INIT;
 static expert_field ei_isi_unsupported_packet = EI_INIT;
 
-static void dissect_isi_sim_auth(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree) {
+static int dissect_isi_sim_auth(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_) {
        proto_item *item;
        proto_tree *tree;
        guint8 cmd, code;
@@ -821,9 +821,10 @@ static void dissect_isi_sim_auth(tvbuff_t *tvb, packet_info *pinfo, proto_item *
                        col_set_str(pinfo->cinfo, COL_INFO, "unknown SIM Authentication packet");
                        break;
        }
+       return tvb_captured_length(tvb);
 }
 
-static void dissect_isi_sim(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree) {
+static int dissect_isi_sim(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_) {
        proto_item *item;
        proto_tree *tree;
        guint8 cmd, code;
@@ -1080,9 +1081,10 @@ static void dissect_isi_sim(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitr
                        col_set_str(pinfo->cinfo, COL_INFO, "Unknown type");
                        break;
        }
+       return tvb_captured_length(tvb);
 }
 
-static void dissect_isi_gss(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree) {
+static int dissect_isi_gss(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_) {
        proto_item *item;
        proto_tree *tree;
        guint8 cmd, code;
@@ -1168,6 +1170,7 @@ static void dissect_isi_gss(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitr
                        col_set_str(pinfo->cinfo, COL_INFO, "Unknown type");
                        break;
        }
+       return tvb_captured_length(tvb);
 }
 
 static void dissect_isi_gps_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_item *item _U_, proto_tree *tree)
@@ -1283,7 +1286,7 @@ static void dissect_isi_gps_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_it
 
 }
 
-static void dissect_isi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree)
+static int dissect_isi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_)
 {
        proto_item *item;
        proto_tree *tree;
@@ -1324,9 +1327,10 @@ static void dissect_isi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitr
                        col_add_fstr(pinfo->cinfo, COL_INFO, "unknown GPS packet (0x%02x)", cmd);
                        break;
        }
+       return tvb_captured_length(tvb);
 }
 
-static void dissect_isi_ss(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree)
+static int dissect_isi_ss(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_)
 {
        proto_item *item;
        proto_tree *tree;
@@ -1497,6 +1501,7 @@ static void dissect_isi_ss(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitre
                        col_set_str(pinfo->cinfo, COL_INFO, "Unknown type");
                        break;
        }
+       return tvb_captured_length(tvb);
 }
 
 static void dissect_isi_network_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_item *item _U_, proto_tree *tree)
@@ -1595,7 +1600,7 @@ static void dissect_isi_network_cell_info_ind(tvbuff_t *tvb, packet_info *pinfo,
        }
 }
 
-static void dissect_isi_network(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree) {
+static int dissect_isi_network(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_) {
        proto_item *item;
        proto_tree *tree;
        guint8 cmd;
@@ -1628,9 +1633,10 @@ static void dissect_isi_network(tvbuff_t *tvb, packet_info *pinfo, proto_item *i
                        expert_add_info(pinfo, item, &ei_isi_unsupported_packet);
                        break;
        }
+       return tvb_captured_length(tvb);
 }
 
-static void dissect_isi_sms(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree) {
+static int dissect_isi_sms(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitree, void* data _U_) {
        proto_item *item = NULL;
        proto_tree *tree = NULL;
        guint8 cmd, code;
@@ -1775,9 +1781,10 @@ static void dissect_isi_sms(tvbuff_t *tvb, packet_info *pinfo, proto_item *isitr
                        col_set_str(pinfo->cinfo, COL_INFO, "Unknown type");
                        break;
        }
+       return tvb_captured_length(tvb);
 }
 
-static void dissect_isi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+static int dissect_isi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
        proto_tree *isi_tree;
        proto_item *item, *item_len;
        tvbuff_t *content_tvb;
@@ -1821,6 +1828,8 @@ static void dissect_isi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
        /* Call subdissector depending on the resource ID */
        if (!dissector_try_uint(isi_resource_dissector_table, resource, content_tvb, pinfo, isi_tree))
                call_dissector(data_handle, content_tvb, pinfo, isi_tree);
+
+       return tvb_captured_length(tvb);
 }
 
 /* Experimental approach based upon the one used for PPP*/
@@ -1832,7 +1841,7 @@ static gboolean dissect_usb_isi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
                return FALSE;
 
        next_tvb = tvb_new_subset_remaining(tvb, 1);
-       dissect_isi(next_tvb, pinfo, tree);
+       dissect_isi(next_tvb, pinfo, tree, data);
 
        return TRUE;
 }
@@ -2131,17 +2140,17 @@ proto_reg_handoff_isi(void)
 
        if(!initialized) {
                data_handle = find_dissector("data");
-               dissector_add_uint("sll.ltype", LINUX_SLL_P_ISI, create_dissector_handle(dissect_isi, proto_isi));
+               dissector_add_uint("sll.ltype", LINUX_SLL_P_ISI, new_create_dissector_handle(dissect_isi, proto_isi));
 
                heur_dissector_add("usb.bulk", dissect_usb_isi, "ISI bulk endpoint", "usb_bulk_isi", proto_isi, HEURISTIC_DISABLE);
 
-               dissector_add_uint("isi.resource", 0x02, create_dissector_handle(dissect_isi_sms, proto_isi));
-               dissector_add_uint("isi.resource", 0x06, create_dissector_handle(dissect_isi_ss, proto_isi));
-               dissector_add_uint("isi.resource", 0x08, create_dissector_handle(dissect_isi_sim_auth, proto_isi));
-               dissector_add_uint("isi.resource", 0x09, create_dissector_handle(dissect_isi_sim, proto_isi));
-               dissector_add_uint("isi.resource", 0x0a, create_dissector_handle(dissect_isi_network, proto_isi));
-               dissector_add_uint("isi.resource", 0x32, create_dissector_handle(dissect_isi_gss, proto_isi));
-               dissector_add_uint("isi.resource", 0x54, create_dissector_handle(dissect_isi_gps, proto_isi));
+               dissector_add_uint("isi.resource", 0x02, new_create_dissector_handle(dissect_isi_sms, proto_isi));
+               dissector_add_uint("isi.resource", 0x06, new_create_dissector_handle(dissect_isi_ss, proto_isi));
+               dissector_add_uint("isi.resource", 0x08, new_create_dissector_handle(dissect_isi_sim_auth, proto_isi));
+               dissector_add_uint("isi.resource", 0x09, new_create_dissector_handle(dissect_isi_sim, proto_isi));
+               dissector_add_uint("isi.resource", 0x0a, new_create_dissector_handle(dissect_isi_network, proto_isi));
+               dissector_add_uint("isi.resource", 0x32, new_create_dissector_handle(dissect_isi_gss, proto_isi));
+               dissector_add_uint("isi.resource", 0x54, new_create_dissector_handle(dissect_isi_gps, proto_isi));
        }
 }
 
index aa9dd41c90662300d622dfaaf9b9b8837bb79bcb..9f27142577446cd31d1773046b68dc90a0ca8b2d 100644 (file)
@@ -210,7 +210,7 @@ static gint ett_ismacryp_message = -1;
 */
 
 /* dissect_ismacryp_v11 gets called if rtp_dyn_payload_type = "enc-mpeg4-generic" i.e. is set via SDP */
-static void dissect_ismacryp_v11(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_ismacryp_v11(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        /* display ISMACryp version */
        col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_ISMACRYP_11);
@@ -219,10 +219,11 @@ static void dissect_ismacryp_v11(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
        col_set_str(pinfo->cinfo, COL_INFO, "(PT=enc-mpeg4-generic)");
 
        dissect_ismacryp_common( tvb, pinfo, tree, V11);
+       return tvb_captured_length(tvb);
 }
 
 /* dissect_ismacryp_v20 gets called if rtp_dyn_payload_type = "enc-isoff-generic" i.e. is set via SDP */
-static void dissect_ismacryp_v20(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_ismacryp_v20(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        /* display ISMACryp version */
        col_set_str(pinfo->cinfo, COL_PROTOCOL, PROTO_TAG_ISMACRYP_20);
@@ -231,12 +232,14 @@ static void dissect_ismacryp_v20(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
        col_set_str(pinfo->cinfo, COL_INFO, "(PT=enc-isoff-generic)");
 
        dissect_ismacryp_common( tvb, pinfo, tree, V20);
+       return tvb_captured_length(tvb);
 }
 
-static void dissect_ismacryp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_ismacryp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        col_set_str(pinfo->cinfo, COL_INFO, "Manual version");
        dissect_ismacryp_common( tvb, pinfo, tree, version_type);   /* Unknown version type: Use preference */
+       return tvb_captured_length(tvb);
 }
 
 static void dissect_ismacryp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint ismacryp_version)
@@ -1004,9 +1007,9 @@ void proto_reg_handoff_ismacryp(void)
        if (!ismacryp_prefs_initialized) {
                dissector_handle_t ismacryp_v11_handle;
                dissector_handle_t ismacryp_v20_handle;
-               ismacryp_handle = create_dissector_handle(dissect_ismacryp, proto_ismacryp);
-               ismacryp_v11_handle = create_dissector_handle(dissect_ismacryp_v11, proto_ismacryp);
-               ismacryp_v20_handle = create_dissector_handle(dissect_ismacryp_v20, proto_ismacryp);
+               ismacryp_handle = new_create_dissector_handle(dissect_ismacryp, proto_ismacryp);
+               ismacryp_v11_handle = new_create_dissector_handle(dissect_ismacryp_v11, proto_ismacryp);
+               ismacryp_v20_handle = new_create_dissector_handle(dissect_ismacryp_v20, proto_ismacryp);
                ismacryp_prefs_initialized = TRUE;
                dissector_add_string("rtp_dyn_payload_type", "ISMACRYP", ismacryp_handle);
                dissector_add_string("rtp_dyn_payload_type", "enc-mpeg4-generic", ismacryp_v11_handle);
index 69b5f66caf17feb4c3449c1ab5867c8a14b77e18..fe68fca7b639fffd06fb9d34849114bfa87b26ab 100644 (file)
@@ -487,8 +487,8 @@ dissect_ismp_edp(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *ismp
 
 
 /* Code to actually dissect the packets */
-static void
-dissect_ismp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ismp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        int offset = 0;
        guint16 message_type = 0;
@@ -534,6 +534,8 @@ dissect_ismp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        /* if Enterasys Discover Protocol, dissect it */
        if(message_type == ISMPTYPE_EDP)
                dissect_ismp_edp(tvb, pinfo, offset, tree);
+
+       return tvb_captured_length(tvb);
 }
 
 
@@ -880,7 +882,7 @@ proto_reg_handoff_ismp(void)
 {
        dissector_handle_t ismp_handle;
 
-       ismp_handle = create_dissector_handle(dissect_ismp,
+       ismp_handle = new_create_dissector_handle(dissect_ismp,
            proto_ismp);
        dissector_add_uint("ethertype", ETHERTYPE_ISMP, ismp_handle);
 }
index a3752e4c2c07420bee48b1cb1e6e1d7d18bfb5f1..315a9cdf1c1dac40fa8bccd76486436653d9052e 100644 (file)
@@ -177,8 +177,8 @@ static header_field_info hfi_rtp_jpeg_payload JPEG_HFI_INIT = {
 /* JPEG fields defining a sub tree */
 static gint ett_jpeg = -1;
 
-static void
-dissect_jpeg( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
+static int
+dissect_jpeg( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ )
 {
        proto_item *ti = NULL;
        proto_tree *jpeg_tree = NULL;
@@ -254,6 +254,7 @@ dissect_jpeg( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
                /* The rest of the packet is the JPEG data */
                proto_tree_add_item( jpeg_tree, &hfi_rtp_jpeg_payload, tvb, offset, -1, ENC_NA );
        }
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -296,7 +297,7 @@ proto_register_jpeg(void)
        proto_register_fields(proto_jpeg, hfi, array_length(hfi));
        proto_register_subtree_array(ett, array_length(ett));
 
-       jpeg_handle = create_dissector_handle(dissect_jpeg, proto_jpeg);
+       jpeg_handle = new_create_dissector_handle(dissect_jpeg, proto_jpeg);
 
        /* RFC 2798 */
        register_ber_oid_dissector_handle("0.9.2342.19200300.100.1.60", jpeg_handle, proto_jpeg, "jpegPhoto");
index 297838146c211cbd214ded91c8910929c6be9ccc..61ff761fda06b0befa0fdb5785b5ad7fedb74ec8 100644 (file)
@@ -926,17 +926,19 @@ dissect_juniper_chdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
 
 /* wrapper for passing the PIC type to the generic ATM dissector */
-static void
-dissect_juniper_atm1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_juniper_atm1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   dissect_juniper_atm(tvb,pinfo,tree, JUNIPER_PIC_ATM1);
+  return tvb_captured_length(tvb);
 }
 
 /* wrapper for passing the PIC type to the generic ATM dissector */
-static void
-dissect_juniper_atm2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_juniper_atm2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   dissect_juniper_atm(tvb,pinfo,tree, JUNIPER_PIC_ATM2);
+  return tvb_captured_length(tvb);
 }
 
 /* generic ATM dissector */
@@ -1427,8 +1429,8 @@ proto_reg_handoff_juniper(void)
   ipv4_handle   = find_dissector("ip");
   data_handle   = find_dissector("data");
 
-  juniper_atm2_handle   = create_dissector_handle(dissect_juniper_atm2,   proto_juniper);
-  juniper_atm1_handle   = create_dissector_handle(dissect_juniper_atm1,   proto_juniper);
+  juniper_atm2_handle   = new_create_dissector_handle(dissect_juniper_atm2,   proto_juniper);
+  juniper_atm1_handle   = new_create_dissector_handle(dissect_juniper_atm1,   proto_juniper);
   juniper_pppoe_handle  = create_dissector_handle(dissect_juniper_pppoe,  proto_juniper);
   juniper_mlppp_handle  = create_dissector_handle(dissect_juniper_mlppp,  proto_juniper);
   juniper_mlfr_handle   = create_dissector_handle(dissect_juniper_mlfr,   proto_juniper);
index 394950d005186d33d066eda312cb801737fd34e9..7b655d885807744e26abe66636f73cb5ed81c2bc 100644 (file)
@@ -75,9 +75,9 @@ static int hf_kdp_rst_flag = -1;
 static int hf_kdp_bcst_flag = -1;
 static int hf_kdp_dup_flag = -1;
 
-static void dissect_kdp(tvbuff_t *tvb,
+static int dissect_kdp(tvbuff_t *tvb,
                         packet_info *pinfo,
-                        proto_tree *tree) {
+                        proto_tree *tree, void* data _U_) {
   proto_item *ti;
   proto_tree *kdp_tree;
   guint body_len;
@@ -257,6 +257,8 @@ static void dissect_kdp(tvbuff_t *tvb,
                    src_flowid_string,
                    packet_errors);
   }
+
+  return tvb_captured_length(tvb);
 }
 
 void proto_register_kdp(void) {
@@ -403,7 +405,7 @@ void proto_register_kdp(void) {
 void
 proto_reg_handoff_kdp(void) {
   dissector_handle_t kdp_handle;
-  kdp_handle = create_dissector_handle(dissect_kdp, proto_kdp);
+  kdp_handle = new_create_dissector_handle(dissect_kdp, proto_kdp);
   dissector_add_uint("udp.port", KDP_PORT, kdp_handle);
 }
 
index 8b6f8a89b9933aa61b7641fe20ebb7d123e3fd3e..a2e052752031cdb543512f1ff93fbe8e2ce20ae7 100644 (file)
@@ -198,8 +198,8 @@ static void dissect_decrypt_kink_encrypt(packet_info *pinfo, tvbuff_t *tvb, prot
 #endif
 
 /* This function is dissecting the kink header. */
-static void
-dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
+static int
+dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_){
   proto_item *ti = NULL;
   proto_tree *kink_tree = NULL;
   guint8 type;
@@ -278,6 +278,7 @@ dissect_kink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree){
 
   control_payload(pinfo, tvb, offset, next_payload, kink_tree);
 
+  return tvb_captured_length(tvb);
 }
 
 /* This part call the dissect payload function by next_payload value.
@@ -992,7 +993,7 @@ void proto_reg_handoff_kink(void) {
 
   dissector_handle_t kink_handle = NULL;
 
-  kink_handle = create_dissector_handle(dissect_kink, proto_kink);
+  kink_handle = new_create_dissector_handle(dissect_kink, proto_kink);
 
   dissector_add_uint("udp.port", KINK_PORT, kink_handle);
 
index 151a3d75859e66d17533b96cfbd2a3f50720d895..7d31c9c3b27e4a74e79a0c0cd8cd3cadd4622d14 100644 (file)
@@ -235,10 +235,11 @@ dissect_kpasswd_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboo
 
 }
 
-static void
-dissect_kpasswd_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_kpasswd_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     dissect_kpasswd_common(tvb, pinfo, tree, FALSE);
+    return tvb_captured_length(tvb);
 }
 
 static int
@@ -325,7 +326,7 @@ proto_reg_handoff_kpasswd(void)
     dissector_handle_t kpasswd_handle_udp;
     dissector_handle_t kpasswd_handle_tcp;
 
-    kpasswd_handle_udp = create_dissector_handle(dissect_kpasswd_udp, proto_kpasswd);
+    kpasswd_handle_udp = new_create_dissector_handle(dissect_kpasswd_udp, proto_kpasswd);
     kpasswd_handle_tcp = new_create_dissector_handle(dissect_kpasswd_tcp, proto_kpasswd);
     dissector_add_uint("udp.port", UDP_PORT_KPASSWD, kpasswd_handle_udp);
     dissector_add_uint("tcp.port", TCP_PORT_KPASSWD, kpasswd_handle_tcp);
index 1661ef2006604780f982dbaed3cd4c4e8278527d..0a859fea1515cd6f146120bc55d08fef1ea75891 100644 (file)
@@ -2609,8 +2609,8 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
  * or process_l2tpv3_data_ip for Data Messages over IP, based on the
  * Session ID
  */
-static void
-dissect_l2tp_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_l2tp_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     int     idx = 0;
     guint32 sid;                /* Session ID */
@@ -2643,7 +2643,7 @@ dissect_l2tp_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         process_l2tpv3_data_ip(tvb, pinfo, tree, l2tp_conv);
     }
 
-    return;
+    return tvb_captured_length(tvb);
 }
 
 static int dissect_atm_oam_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
@@ -3041,7 +3041,7 @@ proto_reg_handoff_l2tp(void)
     l2tp_udp_handle = new_create_dissector_handle(dissect_l2tp_udp, proto_l2tp);
     dissector_add_uint("udp.port", UDP_PORT_L2TP, l2tp_udp_handle);
 
-    l2tp_ip_handle = create_dissector_handle(dissect_l2tp_ip, proto_l2tp);
+    l2tp_ip_handle = new_create_dissector_handle(dissect_l2tp_ip, proto_l2tp);
     dissector_add_uint("ip.proto", IP_PROTO_L2TP, l2tp_ip_handle);
 
     /*
index eb917741598680750c58d089f8545420a64ce3a8..977b6d52f8590b46129a7ace2499de5005840a96 100644 (file)
@@ -113,8 +113,8 @@ static gint ett_lacp_p_flags = -1;
  *
  * Notes:
  */
-static void
-dissect_lacp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lacp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     int     offset = 0;
     guint16 raw_word;
@@ -314,6 +314,7 @@ dissect_lacp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         proto_tree_add_item(lacpdu_tree, hf_lacp_term_reserved, tvb,
                 offset, 50, ENC_NA);
     }
+    return tvb_captured_length(tvb);
 }
 
 /* Register the protocol with Wireshark */
@@ -557,7 +558,7 @@ proto_reg_handoff_lacp(void)
 {
     dissector_handle_t lacp_handle;
 
-    lacp_handle = create_dissector_handle(dissect_lacp, proto_lacp);
+    lacp_handle = new_create_dissector_handle(dissect_lacp, proto_lacp);
     dissector_add_uint("slow.subtype", LACP_SUBTYPE, lacp_handle);
 }
 
index 1388481001b15a387b6610e8b41ac619fa66b3a1..7b9d8b1e1d4f79ae9125245e6c6b66810c176c38 100644 (file)
@@ -38,8 +38,8 @@ static gint ett_lapbether = -1;
 
 static dissector_handle_t lapb_handle;
 
-static void
-dissect_lapbether(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lapbether(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_tree *lapbether_tree, *ti;
     int         len;
@@ -64,6 +64,7 @@ dissect_lapbether(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     next_tvb = tvb_new_subset_length(tvb, 2, len);
     call_dissector(lapb_handle, next_tvb, pinfo, tree);
 
+    return tvb_captured_length(tvb);
 }
 
 void
@@ -96,7 +97,7 @@ proto_reg_handoff_lapbether(void)
    */
   lapb_handle = find_dissector("lapb");
 
-  lapbether_handle = create_dissector_handle(dissect_lapbether,
+  lapbether_handle = new_create_dissector_handle(dissect_lapbether,
                                              proto_lapbether);
   dissector_add_uint("ethertype", ETHERTYPE_DEC, lapbether_handle);
 
index d9db12d4b288dab5014aa69e7328686192af2c38..d130006ce2d874dfd9879f8cbf1910e2da691ed6 100644 (file)
@@ -307,7 +307,7 @@ static int dissect_lbmpdm_tcp_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tre
 /*
  * dissect_lbmpdm_tcp - The dissector for LBMPDM over TCP
  */
-static void dissect_lbmpdm_tcp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
+static int dissect_lbmpdm_tcp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
 {
     char * tag_name = NULL;
 
@@ -324,6 +324,7 @@ static void dissect_lbmpdm_tcp(tvbuff_t * tvb, packet_info * pinfo, proto_tree *
     col_set_fence(pinfo->cinfo, COL_INFO);
     tcp_dissect_pdus(tvb, pinfo, tree, TRUE, lbmpdm_get_minimum_length(), /* Need at least the msglen */
         get_lbmpdm_tcp_pdu_length, dissect_lbmpdm_tcp_pdu, NULL);
+    return tvb_captured_length(tvb);
 }
 
 static gboolean test_lbmpdm_tcp_packet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * user_data _U_)
@@ -349,7 +350,7 @@ static gboolean test_lbmpdm_tcp_packet(tvbuff_t * tvb, packet_info * pinfo, prot
     {
         if (lbmpdm_tcp_tag_find(pinfo) != NULL)
         {
-            dissect_lbmpdm_tcp(tvb, pinfo, tree);
+            dissect_lbmpdm_tcp(tvb, pinfo, tree, user_data);
             return (TRUE);
         }
         else
@@ -365,7 +366,7 @@ static gboolean test_lbmpdm_tcp_packet(tvbuff_t * tvb, packet_info * pinfo, prot
         return (FALSE);
     }
     /* One of ours. Probably. */
-    dissect_lbmpdm_tcp(tvb, pinfo, tree);
+    dissect_lbmpdm_tcp(tvb, pinfo, tree, user_data);
     return (TRUE);
 }
 
@@ -438,7 +439,7 @@ void proto_reg_handoff_lbmpdm_tcp(void)
 
     if (!already_registered)
     {
-        lbmpdm_tcp_dissector_handle = create_dissector_handle(dissect_lbmpdm_tcp, lbmpdm_tcp_protocol_handle);
+        lbmpdm_tcp_dissector_handle = new_create_dissector_handle(dissect_lbmpdm_tcp, lbmpdm_tcp_protocol_handle);
         dissector_add_for_decode_as("tcp.port", lbmpdm_tcp_dissector_handle);
         heur_dissector_add("tcp", test_lbmpdm_tcp_packet, "LBMPDM over TCP", "lbmpdm_tcp", lbmpdm_tcp_protocol_handle, HEURISTIC_ENABLE);
     }
index 817131d404140712d74f22b5b79bb6b8bc82e11d..d24d34029ac9e97ae4b78e1d315830f6e572c029 100644 (file)
@@ -63,8 +63,8 @@ static const value_string lge_monitor_prot_vals[] = {
 #define LGEMON_PROTO_HEADER_LENGTH 12
 
 /* Code to actually dissect the packets */
-static void
-dissect_lge_monitor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lge_monitor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        int offset = 0;
        guint32 lge_monitor_proto_id;
@@ -101,15 +101,15 @@ dissect_lge_monitor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                break;
        case 2: /* SCTP */
                call_dissector(sctp_handle, next_tvb, pinfo, tree);
-               return;
+               break;
        case 3: /* M3UA */
                call_dissector(m3ua_handle, next_tvb, pinfo, tree);
-               return;
+               break;
        default:
                proto_tree_add_item(lge_monitor_tree, hf_lge_monitor_data, tvb, offset, -1, ENC_NA);
                break;
        }
-       return;
+       return tvb_captured_length(tvb);
 }
 
 
@@ -121,7 +121,7 @@ proto_reg_handoff_lge_monitor(void)
        static gboolean lge_monitor_prefs_initialized = FALSE;
 
        if (!lge_monitor_prefs_initialized) {
-               lge_monitor_handle = create_dissector_handle(dissect_lge_monitor, proto_lge_monitor);
+               lge_monitor_handle = new_create_dissector_handle(dissect_lge_monitor, proto_lge_monitor);
                dissector_add_for_decode_as("udp.port", lge_monitor_handle);
                mtp3_handle  = find_dissector("mtp3");
                m3ua_handle  = find_dissector("m3ua");
index 0b362e2a7602587bcacf6929bf1dd19ec52b353f..b624522f6f9ccfc55a8ff4036ac529cbb0beeec4 100644 (file)
@@ -283,8 +283,8 @@ static const value_string linx_conn_cmd[] = {
        { 0,    NULL}
 };
 
-static void
-dissect_linx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_linx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        guint32 dword;
        int     offset = 0;
@@ -639,6 +639,7 @@ dissect_linx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                }
 
        }
+       return tvb_captured_length(tvb);
 }
 
 
@@ -838,7 +839,7 @@ proto_reg_handoff_linx(void)
 {
        dissector_handle_t linx_handle;
 
-       linx_handle = create_dissector_handle(dissect_linx, proto_linx);
+       linx_handle = new_create_dissector_handle(dissect_linx, proto_linx);
        dissector_add_uint("ethertype", ETHERTYPE_LINX, linx_handle);
 }
 
@@ -849,8 +850,8 @@ proto_reg_handoff_linx(void)
 /* Default the port to zero */
 static guint linx_tcp_port = 0;
 
-static void
-dissect_linx_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_linx_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        guint32 dword;
        int offset = 0;
@@ -981,6 +982,7 @@ dissect_linx_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                        }
                }
        }
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -1087,7 +1089,7 @@ proto_reg_handoff_linx_tcp(void)
 
 
        if (!linx_tcp_prefs_initialized) {
-               linx_tcp_handle = create_dissector_handle(dissect_linx_tcp, proto_linx_tcp);
+               linx_tcp_handle = new_create_dissector_handle(dissect_linx_tcp, proto_linx_tcp);
                dissector_add_uint("tcp.port", linx_tcp_port, linx_tcp_handle);
                linx_tcp_prefs_initialized = TRUE;
        }
index 295519f7b0b683aa383139dbc1a18381696938e6..1783d619380e9959926102684eb8c309112c8618 100644 (file)
@@ -51,8 +51,8 @@ static int hf_llt_message_time = -1;
 static gint ett_llt = -1;
 
 /* Code to actually dissect the packets */
-static void
-dissect_llt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_llt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        /* Set up structures needed to add the protocol subtree and manage it */
        proto_item *ti;
@@ -75,6 +75,7 @@ dissect_llt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        proto_tree_add_item(llt_tree, hf_llt_sequence_num, tvb, 24, 4, ENC_BIG_ENDIAN);
        proto_tree_add_item(llt_tree, hf_llt_message_time, tvb, 40, 4, ENC_BIG_ENDIAN);
 
+       return tvb_captured_length(tvb);
 }
 
 /* Register the protocol with Wireshark */
@@ -137,7 +138,7 @@ proto_reg_handoff_llt(void)
        static guint preference_alternate_ethertype_last;
 
        if (!initialized) {
-               llt_handle = create_dissector_handle(dissect_llt, proto_llt);
+               llt_handle = new_create_dissector_handle(dissect_llt, proto_llt);
                dissector_add_uint("ethertype", ETHERTYPE_LLT, llt_handle);
                initialized = TRUE;
        } else {
index d57a46d1f3787990d126c446ddf6615a8a6d0101..2737e1e9fd6708c1a4d1edbe5e48d71d738775aa 100644 (file)
@@ -132,8 +132,8 @@ dissect_lmi_pvc_status(tvbuff_t *tvb, int offset, proto_tree *tree)
     proto_tree_add_uint(tree, hf_lmi_act, tvb, offset, 1, tvb_get_guint8( tvb, offset));
 }
 
-static void
-dissect_lmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_tree    *lmi_tree, *lmi_subtree;
     proto_item    *ti;
@@ -177,6 +177,7 @@ dissect_lmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             dissect_lmi_pvc_status( tvb, offset, lmi_subtree);
         offset += len;
     }
+    return tvb_captured_length(tvb);
 }
 
 
@@ -236,7 +237,7 @@ proto_reg_handoff_lmi(void)
 {
     dissector_handle_t lmi_handle;
 
-    lmi_handle = create_dissector_handle(dissect_lmi, proto_lmi);
+    lmi_handle = new_create_dissector_handle(dissect_lmi, proto_lmi);
     dissector_add_uint("fr.nlpid", NLPID_LMI, lmi_handle);
 }
 
index e19c9f90f8a3a94ac34dce85bc5f98229a0c166f..9aad70a671112336046efffbcc7ca20378f99efc 100644 (file)
@@ -52,8 +52,8 @@ static const value_string function_vals[] = {
   { 0, NULL }
 };
 
-static void
-dissect_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   proto_tree  *loop_tree = NULL;
   proto_item  *ti;
@@ -118,6 +118,7 @@ dissect_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     next_tvb = tvb_new_subset_remaining(tvb, offset);
     call_dissector(data_handle, next_tvb, pinfo, tree);
   }
+  return tvb_captured_length(tvb);
 }
 
 void
@@ -164,7 +165,7 @@ proto_reg_handoff_loop(void)
 {
   dissector_handle_t loop_handle;
 
-  loop_handle = create_dissector_handle(dissect_loop, proto_loop);
+  loop_handle = new_create_dissector_handle(dissect_loop, proto_loop);
 
   dissector_add_uint("ethertype", ETHERTYPE_LOOP, loop_handle);
 
index 13ffec1019799f75f70a682b1729e02618d98a68..41db5ce3a51a012355794c978394ac0c3d5faeae 100644 (file)
@@ -67,8 +67,8 @@ static const value_string lpd_server_code[] = {
        { 0, NULL }
 };
 
-static void
-dissect_lpd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lpd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        proto_tree      *lpd_tree;
        proto_item      *ti, *hidden_item;
@@ -136,6 +136,8 @@ dissect_lpd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                else {
                        call_dissector(data_handle,tvb, pinfo, lpd_tree);
                }
+
+       return tvb_captured_length(tvb);
 }
 
 
@@ -197,7 +199,7 @@ proto_reg_handoff_lpd(void)
 {
        dissector_handle_t lpd_handle;
 
-       lpd_handle = create_dissector_handle(dissect_lpd, proto_lpd);
+       lpd_handle = new_create_dissector_handle(dissect_lpd, proto_lpd);
        dissector_add_uint("tcp.port", TCP_PORT_PRINTER, lpd_handle);
        data_handle = find_dissector("data");
 }
index de2b8d1bfe8140cfd4f4bf67cdce54add51ea05f..d9409d9ea430d73239e5343ea87735e17bb6e5ad 100644 (file)
@@ -311,9 +311,9 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo,
  * the start of the packet, so it simply re-calls the ethernet
  * dissector on the packet.
  */
-static void
+static int
 dissect_lwapp_l3(tvbuff_t *tvb, packet_info *pinfo,
-                            proto_tree *tree)
+                            proto_tree *tree, void* data _U_)
 {
     /* Set up structures needed to add the protocol subtree and manage it */
     proto_item *ti;
@@ -325,18 +325,16 @@ dissect_lwapp_l3(tvbuff_t *tvb, packet_info *pinfo,
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "LWAPP-L3");
     col_set_str(pinfo->cinfo, COL_INFO, "802.3 Packets over Layer 3");
 
-    if (tree) {
-        /* create display subtree for the protocol */
-        ti = proto_tree_add_item(tree, proto_lwapp_l3, tvb, offset,
-                                 -1, ENC_NA);
-        lwapp_tree = proto_item_add_subtree(ti, ett_lwapp_l3);
-    } else {
-        lwapp_tree = NULL;
-    }
+    /* create display subtree for the protocol */
+    ti = proto_tree_add_item(tree, proto_lwapp_l3, tvb, offset,
+                                -1, ENC_NA);
+    lwapp_tree = proto_item_add_subtree(ti, ett_lwapp_l3);
+
     /* Dissect as Ethernet */
     next_client = tvb_new_subset_remaining(tvb, 0);
     call_dissector(eth_withoutfcs_handle, next_client, pinfo, lwapp_tree);
-    return;
+
+    return tvb_captured_length(tvb);
 
 } /* dissect_lwapp_l3*/
 
@@ -346,9 +344,9 @@ dissect_lwapp_l3(tvbuff_t *tvb, packet_info *pinfo,
  * lwapp payload in the data, and doesn't care whether the data was
  * from a UDP packet, or a Layer 2 one.
  */
-static void
+static int
 dissect_lwapp(tvbuff_t *tvb, packet_info *pinfo,
-                        proto_tree *tree)
+                        proto_tree *tree, void* data _U_)
 {
     LWAPP_Header header;
     guint8       slotId;
@@ -450,7 +448,7 @@ dissect_lwapp(tvbuff_t *tvb, packet_info *pinfo,
     } else {
         dissect_control(next_client, pinfo, tree);
     }
-    return;
+    return tvb_captured_length(tvb);
 
 } /* dissect_lwapp*/
 
@@ -551,10 +549,10 @@ proto_reg_handoff_lwapp(void)
     data_handle = find_dissector("data");
 
     /* This dissector assumes lwapp packets in an 802.3 frame */
-    lwapp_l3_handle = create_dissector_handle(dissect_lwapp_l3, proto_lwapp_l3);
+    lwapp_l3_handle = new_create_dissector_handle(dissect_lwapp_l3, proto_lwapp_l3);
 
     /* This dissector assumes a lwapp packet */
-    lwapp_handle = create_dissector_handle(dissect_lwapp, proto_lwapp);
+    lwapp_handle = new_create_dissector_handle(dissect_lwapp, proto_lwapp);
 
     /*
      * Ok, the following deserves some comments.  We have four
index c07781b00e0a1e20a6cfce2132506e733a4ab02e..c43c7ec672614018eb28ec93c1271a3c6b9c9261 100644 (file)
@@ -815,8 +815,8 @@ static void dissect_getrdatabyname(tvbuff_t* tvb, proto_tree* lwres_tree, int ty
         dissect_rdata_response(tvb, lwres_tree);
 }
 
-static void
-dissect_lwres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_lwres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     guint16 version, flags, authtype, authlength ;
     guint32 length, opcode, result, recvlength, serial;
@@ -857,7 +857,7 @@ dissect_lwres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     }
 
     if(tree == NULL)
-        return;
+        return tvb_captured_length(tvb);
 
     lwres_item = proto_tree_add_item(tree,proto_lwres, tvb,0, -1, ENC_NA);
     lwres_tree = proto_item_add_subtree(lwres_item, ett_lwres);
@@ -950,6 +950,7 @@ dissect_lwres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             break;
         }
     }
+    return tvb_captured_length(tvb);
 }
 
 
@@ -1156,7 +1157,7 @@ proto_reg_handoff_lwres(void)
     static guint lwres_port;
 
     if(!lwres_prefs_initialized) {
-        lwres_handle = create_dissector_handle(dissect_lwres, proto_lwres);
+        lwres_handle = new_create_dissector_handle(dissect_lwres, proto_lwres);
         lwres_prefs_initialized = TRUE;
     }
     else {
index 0470349b5d8e967922733a8926c2fc4b09eb16f0..ffec3e67032d2c05fcccc874b86f30a18b588791 100644 (file)
@@ -525,8 +525,8 @@ dissect_m2tp_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_item *m2tp
 }
 
 /* M2tp */
-static void
-dissect_m2tp(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_m2tp(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   proto_item *m2tp_item;
   proto_tree *m2tp_tree;
@@ -540,6 +540,7 @@ dissect_m2tp(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
 
   /* dissect the message */
   dissect_m2tp_message(message_tvb, pinfo, m2tp_item, m2tp_tree, tree);
+  return tvb_captured_length(message_tvb);
 }
 
 /* Register the protocol with Wireshark */
@@ -655,7 +656,7 @@ proto_reg_handoff_m2tp(void)
 {
   dissector_handle_t m2tp_handle;
   mtp2_handle   = find_dissector("mtp2");
-  m2tp_handle   = create_dissector_handle(dissect_m2tp, proto_m2tp);
+  m2tp_handle   = new_create_dissector_handle(dissect_m2tp, proto_m2tp);
   dissector_add_uint("sctp.ppi",  M2TP_PAYLOAD_PROTOCOL_ID, m2tp_handle);
   dissector_add_uint("sctp.port", SCTP_PORT_M2TP, m2tp_handle);
 }
index 764d65e3676be0bf65b6a3018cf6a4014c4feacf..bcc900f475b7a23290af5f0fec7e35f864149768 100644 (file)
@@ -1041,8 +1041,8 @@ dissect_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, pro
   dissect_parameters(parameters_tvb, pinfo, tree, m2ua_tree);
 }
 
-static void
-dissect_m2ua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_m2ua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   proto_item *m2ua_item;
   proto_tree *m2ua_tree;
@@ -1056,6 +1056,7 @@ dissect_m2ua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
 
   /* dissect the message */
   dissect_message(message_tvb, pinfo, tree, m2ua_tree);
+  return tvb_captured_length(message_tvb);
 }
 
 /* Register the protocol with Wireshark */
@@ -1142,7 +1143,7 @@ proto_reg_handoff_m2ua(void)
   dissector_handle_t m2ua_handle;
 
   mtp3_handle = find_dissector("mtp3");
-  m2ua_handle = create_dissector_handle(dissect_m2ua, proto_m2ua);
+  m2ua_handle = new_create_dissector_handle(dissect_m2ua, proto_m2ua);
   dissector_add_uint("sctp.ppi",  M2UA_PAYLOAD_PROTOCOL_ID, m2ua_handle);
   dissector_add_uint("sctp.port", SCTP_PORT_M2UA, m2ua_handle);
 }
index 1f373507e494250bc05c8af9dfe97e9c9c1f30c1..dfa95d8e9f079b6976386a3a8ecbc78496a3f7c7 100644 (file)
@@ -81,8 +81,8 @@ static int hf_maap_conflict_count = -1;
 /* Initialize the subtree pointers */
 static int ett_maap = -1;
 
-static void
-dissect_maap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_maap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     guint8      maap_msg_type;
     proto_item *maap_item     = NULL;
@@ -134,6 +134,8 @@ dissect_maap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         proto_tree_add_item(maap_tree, hf_maap_conflict_start_addr, tvb, MAAP_CONFLICT_START_ADDR_OFFSET, 6, ENC_NA);
         proto_tree_add_item(maap_tree, hf_maap_conflict_count,      tvb, MAAP_CONFLICT_COUNT_OFFSET,      2, ENC_BIG_ENDIAN);
     }
+
+    return tvb_captured_length(tvb);
 } /* end dissect_maap() */
 
 /* Register the protocol with Wireshark */
@@ -211,7 +213,7 @@ proto_reg_handoff_maap(void)
 {
     dissector_handle_t maap_handle;
 
-    maap_handle = create_dissector_handle(dissect_maap, proto_maap);
+    maap_handle = new_create_dissector_handle(dissect_maap, proto_maap);
     dissector_add_uint("ieee1722.subtype", 0x7E, maap_handle);
 }
 
index 8aff7f7102b315b7b1ccc00108b3fcef5d3369f6..d727009b5d53ea099aab8ff6a0ac17c9de0606d9 100644 (file)
@@ -129,8 +129,8 @@ static const value_string reg_flags_vals[] = {
 static const guint8 dst_addr[] = {0x01, 0x80, 0xC2, 0x00, 0x00, 0x01};
 static const address macctrl_dst_address = { AT_ETHER, 6, dst_addr};
 
-static void
-dissect_macctrl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_macctrl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   proto_item *ti, *opcode_item;
   proto_tree *macctrl_tree = NULL;
@@ -250,6 +250,7 @@ dissect_macctrl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
       expert_add_info(pinfo, opcode_item, &ei_macctrl_opcode);
      break;
   }
+  return tvb_captured_length(tvb);
 }
 
 void
@@ -391,7 +392,7 @@ proto_reg_handoff_macctrl(void)
 {
   dissector_handle_t macctrl_handle;
 
-  macctrl_handle = create_dissector_handle(dissect_macctrl, proto_macctrl);
+  macctrl_handle = new_create_dissector_handle(dissect_macctrl, proto_macctrl);
   dissector_add_uint("ethertype", ETHERTYPE_MAC_CONTROL, macctrl_handle);
 }
 
index a8827db6917dc611fdd023db1c6d4c7c4ef69af9..a4d7665de240521325ea7fe70c5c1fa06aeb1e3b 100644 (file)
@@ -48,8 +48,8 @@ static gint ett_manolito = -1;
 static expert_field ei_manolito_type = EI_INIT;
 
 /* Code to actually dissect the packets */
-static void
-dissect_manolito(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_manolito(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dissector_data _U_)
 {
        unsigned int offset;
 
@@ -214,6 +214,7 @@ dissect_manolito(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        {
                col_set_str(pinfo->cinfo, COL_INFO, packet_type);
        }
+       return tvb_captured_length(tvb);
 }
 
 
@@ -295,7 +296,7 @@ proto_reg_handoff_manolito(void)
 {
        dissector_handle_t manolito_handle;
 
-       manolito_handle = create_dissector_handle(dissect_manolito,
+       manolito_handle = new_create_dissector_handle(dissect_manolito,
            proto_manolito);
        dissector_add_uint("udp.port", 41170, manolito_handle);
 }
index bd8e828c29b0a623f0064fa4a4d92194b22ee468..2e0218c28e9539e726657a422c410ab159609861 100644 (file)
@@ -78,8 +78,8 @@ static gint ett_marker = -1;
  *    Dominique Bastien (dbastien@accedian.com)
  *      + add support for MARKER and MARKER Response PDUs.
  */
-static void
-dissect_marker(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_marker(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     int     offset = 0;
     guint8  raw_octet;
@@ -138,6 +138,7 @@ dissect_marker(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             offset += 2;
         }
     }
+    return tvb_captured_length(tvb);
 }
 
 /* Register the protocol with Wireshark */
@@ -199,7 +200,7 @@ proto_reg_handoff_marker(void)
 {
     dissector_handle_t marker_handle;
 
-    marker_handle = create_dissector_handle(dissect_marker, proto_marker);
+    marker_handle = new_create_dissector_handle(dissect_marker, proto_marker);
     dissector_add_uint("slow.subtype", MARKER_SUBTYPE, marker_handle);
 }
 
index 34a427296d816d6a07dca5d612a45942af5794d2..87387a3cd5be4373782f459d1deb4325df8f1ec5 100644 (file)
@@ -129,8 +129,8 @@ static const value_string eof_vals[] = {
     {0,                          NULL},
 };
 
-static void
-dissect_mdshdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mdshdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
 
 /* Set up structures needed to add the protocol subtree and manage it */
@@ -244,6 +244,7 @@ dissect_mdshdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     else {
         call_dissector(data_handle, next_tvb, pinfo, tree);
     }
+    return tvb_captured_length(tvb);
 }
 
 
@@ -319,7 +320,7 @@ proto_reg_handoff_mdshdr(void)
          * ethertype ETHERTYPE_FCFT, and fetch the data and Fibre
          * Channel handles.
          */
-        mdshdr_handle = create_dissector_handle(dissect_mdshdr, proto_mdshdr);
+        mdshdr_handle = new_create_dissector_handle(dissect_mdshdr, proto_mdshdr);
         dissector_add_uint("ethertype", ETHERTYPE_FCFT, mdshdr_handle);
         data_handle   = find_dissector("data");
         fc_dissector_handle = find_dissector("fc");
index 955bf573bbcba34ae09094d36f10b87dcc6246d4..6ec4d403fae10f471153651513cbd29eb65d8e7b 100644 (file)
@@ -452,7 +452,7 @@ static gboolean keep_persistent_data = FALSE;
  * dissect_megaco_text over TCP, there will be a TPKT header there
  *
  */
-static void dissect_megaco_text_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_megaco_text_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     int lv_tpkt_len;
 
@@ -473,6 +473,8 @@ static void dissect_megaco_text_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tre
     }
     dissect_tpkt_encap(tvb, pinfo, tree, TRUE,
         megaco_text_handle);
+
+    return tvb_captured_length(tvb);
 }
 
 #define ERRORTOKEN          1
@@ -3819,7 +3821,7 @@ proto_reg_handoff_megaco(void)
         data_handle = find_dissector("data");
 
         megaco_text_handle = find_dissector("megaco");
-        megaco_text_tcp_handle = create_dissector_handle(dissect_megaco_text_tcp, proto_megaco);
+        megaco_text_tcp_handle = new_create_dissector_handle(dissect_megaco_text_tcp, proto_megaco);
 
         dissector_add_uint("sctp.ppi", H248_PAYLOAD_PROTOCOL_ID,   megaco_text_handle);
 
index 034c2932147c1fe04805afecd125fe8191090b8d..e1b237664e2ce9351bf932cc3facb87f116c2096 100644 (file)
@@ -1986,7 +1986,7 @@ static void dissect_mih_tlv(tvbuff_t *tvb,int offset, proto_tree *tlv_tree, guin
         return;
 }
 
-static void dissect_mih(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mih(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
         proto_item *ti = NULL;
         int offset = 0;
@@ -2065,23 +2065,19 @@ static void dissect_mih(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         switch (service)
         {
         case 1 :/*for Service Management..*/
-                if(mid_tree)
-                        proto_tree_add_item(mid_tree, hf_mih_serv_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
+                proto_tree_add_item(mid_tree, hf_mih_serv_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
                 col_append_fstr(pinfo->cinfo, COL_INFO, "\"%s\"", val_to_str(action, serv_act_id_values, "Unknown"));
                 break;
         case 2 :/*for event services..*/
-                if(mid_tree)
-                        proto_tree_add_item(mid_tree, hf_mih_event_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
+                proto_tree_add_item(mid_tree, hf_mih_event_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
                 col_append_fstr(pinfo->cinfo, COL_INFO, "\"%s\"", val_to_str(action, event_act_id_values, "Unknown"));
                 break;
         case 3 :/*for Command Services..*/
-                if(mid_tree)
-                        proto_tree_add_item(mid_tree, hf_mih_command_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
+                proto_tree_add_item(mid_tree, hf_mih_command_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
                 col_append_fstr(pinfo->cinfo, COL_INFO, "\"%s\"", val_to_str(action, command_act_id_values, "Unknown"));
                 break;
         case 4 :/*for Information Services..*/
-                if(mid_tree)
-                        proto_tree_add_item(mid_tree, hf_mih_info_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
+                proto_tree_add_item(mid_tree, hf_mih_info_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
                 col_append_fstr(pinfo->cinfo, COL_INFO, "\"%s\"", val_to_str(action, info_act_id_values, "Unknown"));
                 break;
         }
@@ -2191,7 +2187,7 @@ static void dissect_mih(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                 offset += (guint32)len;
                                 payload_length -= (1 + len_of_len + (guint32)len);
                         }else{
-                            return;
+                            return offset;
                         }
                 }
                 else
@@ -2202,6 +2198,8 @@ static void dissect_mih(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         }
         if(fragment!=0)
                 proto_tree_add_item(mih_tree, hf_fragmented_tlv, tvb, offset, -1, ENC_NA);
+
+        return tvb_captured_length(tvb);
 }
 
 /*dissector initialistaion*/
@@ -4871,7 +4869,7 @@ void proto_reg_handoff_mih(void)
 {
         dissector_handle_t mih_handle;
 
-        mih_handle = create_dissector_handle(dissect_mih, proto_mih);
+        mih_handle = new_create_dissector_handle(dissect_mih, proto_mih);
         /*Layer 3 handle*/
         dissector_add_uint("udp.port", MIH_PORT, mih_handle);
         dissector_add_uint("tcp.port", MIH_PORT, mih_handle);
index 9c339ed200f9eeed795dc14bf0048ce004843cb5..9331b9ced839b3bedcf804b6b6ac4989f38302ae 100644 (file)
@@ -4004,8 +4004,8 @@ dissect_mip6_options(tvbuff_t *tvb, proto_tree *mip6_tree, int offset, int len,
 }
 
 /* Function that dissects the whole MIPv6 packet */
-static void
-dissect_mip6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mip6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_tree *mip6_tree   = NULL;
     guint8      type, pproto;
@@ -4144,7 +4144,7 @@ dissect_mip6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     if (offset < len) {
         if (len < (offset - start_offset)) {
             expert_add_info(pinfo, header_item, &ei_mip6_bogus_header_length);
-            return;
+            return offset;
         }
         len -= (offset - start_offset);
         dissect_mip6_options(tvb, mip6_tree, offset, len, pinfo);
@@ -4171,6 +4171,7 @@ dissect_mip6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
         col_set_str(pinfo->cinfo, COL_INFO, "Fast Binding Acknowledgment");
     }
+    return tvb_captured_length(tvb);
 }
 
 /* Register the protocol with Wireshark */
@@ -5364,7 +5365,7 @@ proto_reg_handoff_mip6(void)
     dissector_handle_t mip6_handle;
 
     /* mip6_handle = find_dissector("mipv6"); */
-    mip6_handle = create_dissector_handle(dissect_mip6, proto_mip6);
+    mip6_handle = new_create_dissector_handle(dissect_mip6, proto_mip6);
     dissector_add_uint("ip.proto", IP_PROTO_MIPV6_OLD, mip6_handle);
     dissector_add_uint("ip.proto", IP_PROTO_MIPV6, mip6_handle);
     /* Add support for PMIPv6 control messages over IPV4 */
index adc933fa3a7bae5356b2f26e5f0c3549aa5dc44b..1476741f9ef1e8ed6b7924a4ff0961aedb6e96e2 100644 (file)
@@ -64,7 +64,7 @@ void proto_reg_handoff_mmse(void);
 /*
  * Forward declarations
  */
-static void dissect_mmse_standalone(tvbuff_t *, packet_info *, proto_tree *);
+static int dissect_mmse_standalone(tvbuff_t *, packet_info *, proto_tree *, void*);
 static void dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
         guint8 pdut, const char *message_type);
 
@@ -648,12 +648,12 @@ dissect_mmse_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
     if ((tvb_get_guint8(tvb, 2) != MM_TID_HDR) &&
         (tvb_get_guint8(tvb, 2) != MM_VERSION_HDR))
         return FALSE;
-    dissect_mmse_standalone(tvb, pinfo, tree);
+    dissect_mmse_standalone(tvb, pinfo, tree, data);
     return TRUE;
 }
 
-static void
-dissect_mmse_standalone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mmse_standalone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     guint8       pdut;
     const char   *message_type;
@@ -670,10 +670,11 @@ dissect_mmse_standalone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         col_add_fstr(pinfo->cinfo, COL_INFO, "MMS %s", message_type);
 
     dissect_mmse(tvb, pinfo, tree, pdut, message_type);
+    return tvb_captured_length(tvb);
 }
 
-static void
-dissect_mmse_encapsulated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mmse_encapsulated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     guint8       pdut;
     const char   *message_type;
@@ -689,6 +690,7 @@ dissect_mmse_encapsulated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                 message_type);
 
     dissect_mmse(tvb, pinfo, tree, pdut, message_type);
+    return tvb_captured_length(tvb);
 }
 
 static void
@@ -1665,9 +1667,9 @@ proto_reg_handoff_mmse(void)
     dissector_handle_t mmse_encapsulated_handle;
 
     heur_dissector_add("wsp", dissect_mmse_heur, "MMS Message Encapsulation over WSP", "mmse_wsp", proto_mmse, HEURISTIC_ENABLE);
-    mmse_standalone_handle = create_dissector_handle(
+    mmse_standalone_handle = new_create_dissector_handle(
             dissect_mmse_standalone, proto_mmse);
-    mmse_encapsulated_handle = create_dissector_handle(
+    mmse_encapsulated_handle = new_create_dissector_handle(
             dissect_mmse_encapsulated, proto_mmse);
         /* As the media types for WSP and HTTP are the same, the WSP dissector
          * uses the same string dissector table as the HTTP protocol. */
index 850e2dcd5034e666f8373c7a65a37a0fc5a72511..26f1f48198f8a7c14dbe0d9c9aeb3927e87e4a0c 100644 (file)
@@ -51,10 +51,9 @@ static const value_string mpeg_ca_cur_next_vals[] = {
 
 };
 
-static void
-dissect_mpeg_ca(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mpeg_ca(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
-
     guint offset = 0, length = 0;
 
     proto_item *ti;
@@ -88,6 +87,7 @@ dissect_mpeg_ca(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     offset += packet_mpeg_sect_crc(tvb, pinfo, mpeg_ca_tree, 0, offset);
 
     proto_item_set_len(ti, offset);
+    return tvb_captured_length(tvb);
 }
 
 
@@ -145,7 +145,7 @@ void proto_reg_handoff_mpeg_ca(void)
 {
     dissector_handle_t mpeg_ca_handle;
 
-    mpeg_ca_handle = create_dissector_handle(dissect_mpeg_ca, proto_mpeg_ca);
+    mpeg_ca_handle = new_create_dissector_handle(dissect_mpeg_ca, proto_mpeg_ca);
     dissector_add_uint("mpeg_sect.tid", MPEG_CA_TID, mpeg_ca_handle);
 }
 
index a931ee1c1e13282f7f63596f1d61dc4a70985030..8e6ef0291a128d68319c4bcd11f02e6a187e577a 100644 (file)
@@ -58,10 +58,9 @@ static const true_false_string mpeg_pat_cur_next_vals = {
 
 };
 
-static void
-dissect_mpeg_pat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mpeg_pat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
-
     guint offset = 0, length = 0;
     guint16 prog_num, prog_pid;
 
@@ -94,7 +93,7 @@ dissect_mpeg_pat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     offset += 1;
 
     if (offset >= length)
-        return;
+        return offset;
 
 
     /* Parse all the programs */
@@ -117,6 +116,7 @@ dissect_mpeg_pat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     offset += packet_mpeg_sect_crc(tvb, pinfo, mpeg_pat_tree, 0, offset);
     proto_item_set_len(ti, offset);
+    return tvb_captured_length(tvb);
 }
 
 
@@ -190,7 +190,7 @@ void proto_reg_handoff_mpeg_pat(void)
 {
     dissector_handle_t mpeg_pat_handle;
 
-    mpeg_pat_handle = create_dissector_handle(dissect_mpeg_pat, proto_mpeg_pat);
+    mpeg_pat_handle = new_create_dissector_handle(dissect_mpeg_pat, proto_mpeg_pat);
     dissector_add_uint("mpeg_sect.tid", MPEG_PAT_TID, mpeg_pat_handle);
 }
 
index 4044a463fb2406852fac0dc1f2dfdbb146c4f0bb..88c53c4fc267341a39ec57c1989bdeed50fe5baf 100644 (file)
@@ -76,8 +76,8 @@ static const value_string rtp_mpg_picture_types_vals[] =
        { 0, NULL },
 };
 
-static void
-dissect_mpeg1( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
+static int
+dissect_mpeg1( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ )
 {
        proto_item *ti;
        proto_tree *mpg_tree;
@@ -125,6 +125,7 @@ dissect_mpeg1( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
 
        /* The rest of the packet is the MPEG-1 stream */
        proto_tree_add_item( mpg_tree, hf_rtp_mpg_data, tvb, offset, -1, ENC_NA );
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -327,7 +328,7 @@ proto_reg_handoff_mpeg1(void)
 {
        dissector_handle_t mpeg1_handle;
 
-       mpeg1_handle = create_dissector_handle(dissect_mpeg1, proto_mpg);
+       mpeg1_handle = new_create_dissector_handle(dissect_mpeg1, proto_mpg);
        dissector_add_uint("rtp.pt", PT_MPV, mpeg1_handle);
 }
 
index b03ae8654cf0f49d038bbbed339fca81db7fb076..4052ecb8c510708572befc35cccd14ce36acddb8 100644 (file)
@@ -660,22 +660,24 @@ dissect_mpls_pm_loss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
     }
 }
 
-static void
-dissect_mpls_pm_dlm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mpls_pm_dlm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     /* the message formats for direct and inferred LM are identical */
     dissect_mpls_pm_loss(tvb, pinfo, tree, DLM);
+    return tvb_captured_length(tvb);
 }
 
-static void
-dissect_mpls_pm_ilm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mpls_pm_ilm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     /* the message formats for direct and inferred LM are identical */
     dissect_mpls_pm_loss(tvb, pinfo, tree, ILM);
+    return tvb_captured_length(tvb);
 }
 
-static void
-dissect_mpls_pm_delay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mpls_pm_delay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_item *ti;
     proto_tree *pm_tree;
@@ -694,10 +696,6 @@ dissect_mpls_pm_delay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                         "DM",
                         &query, &response, &class_specific, &sid, &code);
 
-    if (!tree) {
-        return;
-    }
-
     /* create display subtree for the protocol */
     ti = proto_tree_add_item(tree, proto_mpls_pm_dm, tvb, 0, -1, ENC_NA);
     pm_tree = proto_item_add_subtree(ti, ett_mpls_pm);
@@ -758,6 +756,7 @@ dissect_mpls_pm_delay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         mpls_pm_dissect_timestamp(tvb, pm_tree, offset, qtf, rtf, query, i);
         offset += 8;
     }
+    return tvb_captured_length(tvb);
 }
 
 static void
@@ -878,18 +877,20 @@ dissect_mpls_pm_combined(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
     }
 }
 
-static void
-dissect_mpls_pm_dlm_dm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mpls_pm_dlm_dm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     /* the formats of the DLM+DM and ILM+DM messages are also identical */
     dissect_mpls_pm_combined(tvb, pinfo, tree, DLMDM);
+    return tvb_captured_length(tvb);
 }
 
-static void
-dissect_mpls_pm_ilm_dm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mpls_pm_ilm_dm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     /* the formats of the DLM+DM and ILM+DM messages are also identical */
     dissect_mpls_pm_combined(tvb, pinfo, tree, ILMDM);
+    return tvb_captured_length(tvb);
 }
 
 void
@@ -1525,15 +1526,15 @@ proto_reg_handoff_mpls_pm(void)
     dissector_handle_t mpls_pm_dlm_handle, mpls_pm_ilm_handle, mpls_pm_dm_handle,
                        mpls_pm_dlm_dm_handle, mpls_pm_ilm_dm_handle;
 
-    mpls_pm_dlm_handle    = create_dissector_handle( dissect_mpls_pm_dlm, proto_mpls_pm_dlm );
+    mpls_pm_dlm_handle    = new_create_dissector_handle( dissect_mpls_pm_dlm, proto_mpls_pm_dlm );
     dissector_add_uint("pwach.channel_type", 0x000A, mpls_pm_dlm_handle); /* FF: MPLS PM, RFC 6374, DLM */
-    mpls_pm_ilm_handle    = create_dissector_handle( dissect_mpls_pm_ilm, proto_mpls_pm_ilm );
+    mpls_pm_ilm_handle    = new_create_dissector_handle( dissect_mpls_pm_ilm, proto_mpls_pm_ilm );
     dissector_add_uint("pwach.channel_type", 0x000B, mpls_pm_ilm_handle); /* FF: MPLS PM, RFC 6374, ILM */
-    mpls_pm_dm_handle    = create_dissector_handle( dissect_mpls_pm_delay, proto_mpls_pm_dm );
+    mpls_pm_dm_handle    = new_create_dissector_handle( dissect_mpls_pm_delay, proto_mpls_pm_dm );
     dissector_add_uint("pwach.channel_type", 0x000C, mpls_pm_dm_handle); /* FF: MPLS PM, RFC 6374, DM */
-    mpls_pm_dlm_dm_handle    = create_dissector_handle( dissect_mpls_pm_dlm_dm, proto_mpls_pm_dlm_dm );
+    mpls_pm_dlm_dm_handle    = new_create_dissector_handle( dissect_mpls_pm_dlm_dm, proto_mpls_pm_dlm_dm );
     dissector_add_uint("pwach.channel_type", 0x000D, mpls_pm_dlm_dm_handle); /* FF: MPLS PM, RFC 6374, DLM+DM */
-    mpls_pm_ilm_dm_handle    = create_dissector_handle( dissect_mpls_pm_ilm_dm, proto_mpls_pm_ilm_dm );
+    mpls_pm_ilm_dm_handle    = new_create_dissector_handle( dissect_mpls_pm_ilm_dm, proto_mpls_pm_ilm_dm );
     dissector_add_uint("pwach.channel_type", 0x000E, mpls_pm_ilm_dm_handle); /* FF: MPLS PM, RFC 6374, ILM+DM */
 
 }
index e3400fa8d411a09aada5f663e350d40c0eb3a5af..a2d3d83ee4842663523718b7fa3cd2b626eb78a3 100644 (file)
@@ -108,8 +108,8 @@ const range_string mpls_psc_dpath_rvals[] = {
     { 0,   0, NULL                       }
 };
 
-static void
-dissect_mpls_psc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mpls_psc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_item *ti;
     proto_tree *psc_tree;
@@ -132,7 +132,7 @@ dissect_mpls_psc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                  fpath, path);
 
     if (!tree) {
-        return;
+        return tvb_captured_length(tvb);
     }
 
     /* create display subtree for the protocol */
@@ -157,6 +157,7 @@ dissect_mpls_psc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     offset += 1;
     /* tlv len */
     proto_tree_add_item(psc_tree, hf_mpls_psc_tlvlen, tvb, offset, 1, ENC_BIG_ENDIAN);
+    return tvb_captured_length(tvb);
 }
 
 void
@@ -239,7 +240,7 @@ proto_reg_handoff_mpls_psc(void)
 {
     dissector_handle_t mpls_psc_handle;
 
-    mpls_psc_handle    = create_dissector_handle( dissect_mpls_psc, proto_mpls_psc );
+    mpls_psc_handle    = new_create_dissector_handle( dissect_mpls_psc, proto_mpls_psc );
     dissector_add_uint("pwach.channel_type", 0x0024, mpls_psc_handle); /* FF: PSC, RFC 6378 */
 }
 
index 3d2426a92356d2789b302527eaa9193adec76223..ccecd8151fda44a0428dc3b6bae7d1a58746f5b2 100644 (file)
@@ -114,8 +114,8 @@ dissect_mplstp_fm_tlv (tvbuff_t *tvb, proto_tree *tree)
 }
 
 /* Dissector for MPLS-TP LI protocol: RFC 6435 */
-static void
-dissect_mplstp_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mplstp_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   proto_item *ti;
   proto_tree *lock_tree;
@@ -127,7 +127,7 @@ dissect_mplstp_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   col_clear(pinfo->cinfo, COL_INFO);
 
   if (!tree)
-    return;
+    return tvb_captured_length(tvb);
 
   ti = proto_tree_add_item(tree, proto_mplstp_lock, tvb, 0, -1, ENC_NA);
 
@@ -151,13 +151,13 @@ dissect_mplstp_lock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   next_tvb = tvb_new_subset_remaining (tvb, offset);
   dissect_bfd_mep (next_tvb, tree, proto_mplstp_lock);
 
-  return;
+  return tvb_captured_length(tvb);
 }
 
 
 /* Dissector for MPLS-TP FM protocol: RFC 6427 */
-static void
-dissect_mplstp_fm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mplstp_fm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
    proto_item *ti, *ti_flags;
    proto_tree *fm_tree, *fm_flags;
@@ -171,7 +171,7 @@ dissect_mplstp_fm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
    tlv_len = tvb_get_guint8 (tvb, (offset + 4));
 
    if (!tree)
-     return;
+     return tvb_captured_length(tvb);
 
    ti = proto_tree_add_item(tree, proto_mplstp_fm, tvb, 0, (tlv_len + 5), ENC_NA);
    fm_tree = proto_item_add_subtree (ti, ett_mplstp_fm);
@@ -215,7 +215,7 @@ dissect_mplstp_fm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        next_tvb = tvb_new_subset_remaining (tvb, offset);
        dissect_mplstp_fm_tlv (next_tvb, tree);
      }
-  return;
+   return tvb_captured_length(tvb);
 }
 
 void
@@ -254,7 +254,7 @@ proto_reg_handoff_mplstp_lock(void)
 {
   dissector_handle_t mplstp_lock_handle;
 
-  mplstp_lock_handle    = create_dissector_handle( dissect_mplstp_lock, proto_mplstp_lock );
+  mplstp_lock_handle    = new_create_dissector_handle( dissect_mplstp_lock, proto_mplstp_lock );
   dissector_add_uint("pwach.channel_type", 0x0026, mplstp_lock_handle); /* KM: MPLSTP LOCK, RFC 6435 */
 }
 
@@ -343,7 +343,7 @@ proto_reg_handoff_mplstp_fm(void)
 {
   dissector_handle_t mplstp_fm_handle;
 
-  mplstp_fm_handle = create_dissector_handle( dissect_mplstp_fm, proto_mplstp_fm );
+  mplstp_fm_handle = new_create_dissector_handle( dissect_mplstp_fm, proto_mplstp_fm );
   dissector_add_uint("pwach.channel_type", 0x0058, mplstp_fm_handle); /* KM: MPLSTP FM, RFC 6427 */
 }
 
index 4cc9a0cc8284469bee08ffe0bd67491434fc587f..7ab19dda2e258f68e842744f0d19aae5826f6c28 100644 (file)
@@ -4037,13 +4037,14 @@ static guint get_mq_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
 static int dissect_mq_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
 {
     tcp_dissect_pdus(tvb, pinfo, tree, mq_desegment, 28, get_mq_pdu_len, reassemble_mq, data);
-    return tvb_reported_length(tvb);
+    return tvb_captured_length(tvb);
 }
 
-static void dissect_mq_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mq_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     /* Since SPX has no standard desegmentation, MQ cannot be performed as well */
     dissect_mq_pdu(tvb, pinfo, tree);
+    return tvb_captured_length(tvb);
 }
 
 static gboolean dissect_mq_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint iProto, void *data)
@@ -4779,7 +4780,7 @@ void proto_reg_handoff_mq(void)
     *  known port number, the MQ applications are most often specific to a business application */
 
     mq_tcp_handle = new_create_dissector_handle(dissect_mq_tcp, proto_mq);
-    mq_spx_handle = create_dissector_handle(dissect_mq_spx, proto_mq);
+    mq_spx_handle = new_create_dissector_handle(dissect_mq_spx, proto_mq);
 
     dissector_add_for_decode_as("tcp.port", mq_tcp_handle);
     heur_dissector_add("tcp",     dissect_mq_heur_tcp, "WebSphere MQ over TCP", "mq_tcp", proto_mq, HEURISTIC_ENABLE);
index a9a9454365aecc978cfa55cfb715641d5a1de419..daf1f8668adaf286b019902490f62eb3b9d6b202 100644 (file)
@@ -500,7 +500,7 @@ static void dissect_mqttsn_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree
 }
 
 /* Dissect a complete MQTT-SN message. */
-static void dissect_mqttsn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_mqttsn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     /* Various variables. */
     int offset = 0;
@@ -532,6 +532,7 @@ static void dissect_mqttsn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     /* Dissect a MQTT-SN packet. */
     dissect_mqttsn_packet(tvb, pinfo, tree, offset);
+    return tvb_captured_length(tvb);
 }
 
 /* Register the protocol with Wireshark. */
@@ -686,7 +687,7 @@ void proto_register_mqttsn(void)
     proto_mqttsn = proto_register_protocol("MQ Telemetry Transport Protocol for Sensor Networks", "MQTT-SN", "mqttsn");
 
     /* Create the dissector handle. */
-    mqttsn_handle = create_dissector_handle(dissect_mqttsn, proto_mqttsn);
+    mqttsn_handle = new_create_dissector_handle(dissect_mqttsn, proto_mqttsn);
 
     /* Register fields and subtrees. */
     proto_register_field_array(proto_mqttsn, hf_mqttsn, array_length(hf_mqttsn));
index 98ea0f250bd0109d6e4da81d54ab6531bc98c33e..f39d49709e9ba8ba3f616613f0c25a69a5000308 100644 (file)
@@ -215,9 +215,8 @@ dissect_mmrp_three_packed_event(proto_tree *vect_attr_tree, tvbuff_t *tvb, guint
  *
  * main dissect function that calls the other functions listed above as necessary
  */
-static void
-dissect_mmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-{
+static int
+dissect_mmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
     /* Set up structures needed to add the protocol subtrees and manage them */
     proto_item *ti, *msg_ti, *attr_list_ti, *vect_attr_ti;
     proto_tree *mmrp_tree, *msg_tree, *attr_list_tree, *vect_attr_tree;
@@ -344,6 +343,7 @@ dissect_mmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
         proto_tree_add_item(mmrp_tree, hf_mmrp_end_mark, tvb, offset+2, 2, ENC_BIG_ENDIAN); /* Message EndMark */
     }
+    return tvb_captured_length(tvb);
 }
 
 
@@ -426,7 +426,7 @@ proto_reg_handoff_mrp_mmrp(void)
 {
     dissector_handle_t mmrp_handle;
 
-    mmrp_handle = create_dissector_handle(dissect_mmrp, proto_mmrp);
+    mmrp_handle = new_create_dissector_handle(dissect_mmrp, proto_mmrp);
     dissector_add_uint("ethertype", ETHERTYPE_MMRP, mmrp_handle);
 }
 
index 50186a610625ba297bc8d94d43815df907e599c2..614444848337dd6419f7cebd334197b3927737d4 100644 (file)
@@ -447,8 +447,8 @@ dissect_msrp_four_packed_event(proto_tree *vect_attr_tree, tvbuff_t *tvb, guint
  *
  * main dissect function that calls the other functions listed above as necessary
  */
-static void
-dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     /* Set up structures needed to add the protocol subtrees and manage them */
     proto_item *ti, *msg_ti, *attr_list_ti, *vect_attr_ti, *first_value_ti;
@@ -629,6 +629,7 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         } /* Multiple Message while() */
         proto_tree_add_item(msrp_tree, hf_msrp_end_mark, tvb, offset+2, 2, ENC_BIG_ENDIAN); /* Message EndMark */
     }
+    return tvb_captured_length(tvb);
 }
 
 
@@ -788,7 +789,7 @@ proto_reg_handoff_mrp_msrp(void)
 {
     dissector_handle_t msrp_handle;
 
-    msrp_handle = create_dissector_handle(dissect_msrp, proto_msrp);
+    msrp_handle = new_create_dissector_handle(dissect_msrp, proto_msrp);
     dissector_add_uint("ethertype", ETHERTYPE_MSRP, msrp_handle);
 }
 
index 843f6dc6c02e56887572eb23fb4e9db0ac4d2f36..94d9460252674c17103b4521bcf081626e8ee54d 100644 (file)
@@ -212,8 +212,8 @@ dissect_mvrp_three_packed_event(proto_tree *vect_attr_tree, tvbuff_t *tvb, guint
  *
  * main dissect function that calls the other functions listed above as necessary
  */
-static void
-dissect_mvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     /* Set up structures needed to add the protocol subtrees and manage them */
     proto_item *ti, *msg_ti, *attr_list_ti, *vect_attr_ti, *first_value_ti;
@@ -345,6 +345,7 @@ dissect_mvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             proto_tree_add_item(mvrp_tree, hf_mvrp_end_mark, tvb, offset+2, 2, ENC_BIG_ENDIAN); /* Message EndMark */
         }
     }
+    return tvb_captured_length(tvb);
 }
 
 
@@ -431,7 +432,7 @@ proto_reg_handoff_mrp_mvrp(void)
 {
     dissector_handle_t mvrp_handle;
 
-    mvrp_handle = create_dissector_handle(dissect_mvrp, proto_mvrp);
+    mvrp_handle = new_create_dissector_handle(dissect_mvrp, proto_mvrp);
     dissector_add_uint("ethertype", ETHERTYPE_MVRP, mvrp_handle);
 }
 /*
index 1c6c61e15055e0e93a9b20e9bec4a5c6354e0295..4be3ec5e0fced57b4a8be6a74e2437dd1655ea4d 100644 (file)
@@ -175,8 +175,8 @@ static void
 dissect_msdp_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, guint16 tlv_len);
 
 
-static void
-dissect_msdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_msdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
         proto_item *ti;
         proto_tree *msdp_tree;
@@ -230,7 +230,7 @@ dissect_msdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         if (tvb_reported_length_remaining(tvb, offset) > 0)
                 proto_tree_add_item(msdp_tree, hf_msdp_trailing_junk, tvb, offset, -1, ENC_NA);
 
-        return;
+        return tvb_captured_length(tvb);
 }
 
 /* Both Source-Active and Source-Active Response have the same format
@@ -427,7 +427,7 @@ static void dissect_msdp_notification(tvbuff_t *tvb, packet_info *pinfo, proto_t
                  * sent back.
                  */
                 next_tvb = tvb_new_subset_remaining(tvb, *offset);
-                dissect_msdp(next_tvb, pinfo, tree);
+                dissect_msdp(next_tvb, pinfo, tree, NULL);
                 }
                 break;
         case FSM_ERROR:
@@ -585,7 +585,7 @@ proto_reg_handoff_msdp(void)
 {
         dissector_handle_t msdp_handle;
 
-        msdp_handle = create_dissector_handle(dissect_msdp, proto_msdp);
+        msdp_handle = new_create_dissector_handle(dissect_msdp, proto_msdp);
         dissector_add_uint("tcp.port", 639, msdp_handle);
 
         ip_handle = find_dissector("ip");
index d1a148f7aae1822b24169732fadf3dc1f0b79960..111afd1dda862c40fbdf65e2963ef9ac4eb4501b 100644 (file)
@@ -59,8 +59,8 @@ static gint ett_msnms = -1;
 
 #define TCP_PORT_MSNMS    1863
 
-static void
-dissect_msnms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_msnms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_tree   *msnms_tree;
     proto_item   *ti;
@@ -113,6 +113,7 @@ dissect_msnms(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             offset = next_offset;
         }
     }
+    return tvb_captured_length(tvb);
 }
 
 void
@@ -131,7 +132,7 @@ proto_reg_handoff_msnms(void)
 {
     dissector_handle_t msnms_handle;
 
-    msnms_handle = create_dissector_handle(dissect_msnms, proto_msnms);
+    msnms_handle = new_create_dissector_handle(dissect_msnms, proto_msnms);
     dissector_add_uint("tcp.port", TCP_PORT_MSNMS, msnms_handle);
     /*
      * For MSN Messenger Protocol over HTTP
index d96838f335f247997bc2400a45906b8c9da3b87e..78318c69fc9a8fdbaaf0030822329797bc85cd9f 100644 (file)
@@ -123,8 +123,8 @@ version_base_custom(gchar *result, guint32 version)
   g_snprintf(result, ITEM_LABEL_LENGTH, "%d.%d", (version  >> 8) & 0xFF, (version & 0xFF));
 }
 
-static void
-dissect_msnlb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_msnlb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   proto_item  *ti;
   proto_tree  *msnlb_tree = NULL, *msnlb_subtree;
@@ -333,6 +333,7 @@ dissect_msnlb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     break;
   }
 
+  return tvb_captured_length(tvb);
 }
 
 void
@@ -631,7 +632,7 @@ proto_reg_handoff_msnlb(void)
 {
   dissector_handle_t msnlb_handle;
 
-  msnlb_handle = create_dissector_handle(dissect_msnlb, proto_msnlb);
+  msnlb_handle = new_create_dissector_handle(dissect_msnlb, proto_msnlb);
   dissector_add_uint("ethertype", ETHERTYPE_MS_NLB_HEARTBEAT, msnlb_handle);
 }
 
index c6a4276392e4e83af17131b9c57780f88f09c446..41d531ddc8cc67a5823587c8f28151c3b2d9daac 100644 (file)
@@ -191,8 +191,8 @@ typedef struct {
 /************** negotiated conversation hash stuff ***************/
 
 
-static void msproxy_sub_dissector( tvbuff_t *tvb, packet_info *pinfo,
-               proto_tree *tree) {
+static int msproxy_sub_dissector( tvbuff_t *tvb, packet_info *pinfo,
+               proto_tree *tree, void* data _U_) {
 
 /* Conversation dissector called from TCP or UDP dissector. Decode and */
 /* display the msproxy header, the pass the rest of the data to the tcp        */
@@ -249,6 +249,7 @@ static void msproxy_sub_dissector( tvbuff_t *tvb, packet_info *pinfo,
                        pinfo->destport, -1);
 
        *ptr = redirect_info->server_int_port;
+       return tvb_captured_length(tvb);
 }
 
 
@@ -1046,8 +1047,7 @@ static void dissect_msproxy_response(tvbuff_t *tvb, packet_info *pinfo,
 
 
 
-static void dissect_msproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
-
+static int dissect_msproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
 
        proto_tree      *msproxy_tree;
        proto_item      *ti;
@@ -1085,6 +1085,8 @@ static void dissect_msproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                dissect_msproxy_response( tvb, pinfo, msproxy_tree, hash_info);
        else
                dissect_msproxy_request( tvb, pinfo, msproxy_tree, hash_info);
+
+       return tvb_captured_length(tvb);
 }
 
 
@@ -1254,7 +1256,7 @@ proto_register_msproxy( void){
        expert_msproxy = expert_register_protocol(proto_msproxy);
        expert_register_field_array(expert_msproxy, ei, array_length(ei));
 
-       msproxy_sub_handle = create_dissector_handle(msproxy_sub_dissector,
+       msproxy_sub_handle = new_create_dissector_handle(msproxy_sub_dissector,
                proto_msproxy);
 }
 
@@ -1266,7 +1268,7 @@ proto_reg_handoff_msproxy(void) {
 
        dissector_handle_t msproxy_handle;
 
-       msproxy_handle = create_dissector_handle(dissect_msproxy,
+       msproxy_handle = new_create_dissector_handle(dissect_msproxy,
                proto_msproxy);
        dissector_add_uint("udp.port", UDP_PORT_MSPROXY, msproxy_handle);
 }
index d7175ce0263df06f7b995c5c2919f881ae159438..7f5793716cab6d2213779117363024602cc55890 100644 (file)
@@ -350,14 +350,16 @@ dissect_mtp2_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 }
 
 /* Dissect MTP2 frame without CRC16 and with a pseudo-header */
-static void
-dissect_mtp2_with_phdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_mtp2_with_phdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   if (pinfo->pseudo_header->mtp2.annex_a_used == MTP2_ANNEX_A_USED_UNKNOWN)
     dissect_mtp2_common(tvb, pinfo, tree, FALSE, use_extended_sequence_numbers_default);
   else
     dissect_mtp2_common(tvb, pinfo, tree, FALSE,
                         (pinfo->pseudo_header->mtp2.annex_a_used == MTP2_ANNEX_A_USED));
+
+  return tvb_captured_length(tvb);
 }
 
 /* Dissect MTP2 frame with CRC16 included at end of payload */
@@ -435,7 +437,7 @@ proto_reg_handoff_mtp2(void)
   dissector_handle_t mtp2_with_phdr_handle;
 
   dissector_add_uint("wtap_encap", WTAP_ENCAP_MTP2, mtp2_handle);
-  mtp2_with_phdr_handle = create_dissector_handle(dissect_mtp2_with_phdr,
+  mtp2_with_phdr_handle = new_create_dissector_handle(dissect_mtp2_with_phdr,
                                                   proto_mtp2);
   dissector_add_uint("wtap_encap", WTAP_ENCAP_MTP2_WITH_PHDR,
                                    mtp2_with_phdr_handle);
index 0aafd41f80be07723c4ded5ed440b4adc742afa2..4a84891f3df1b228dab8e269db91c3256a892701 100644 (file)
@@ -148,8 +148,8 @@ dissect_nasdaq_soup_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent
 }
 
 /* ---------------------------- */
-static void
-dissect_nasdaq_soup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_nasdaq_soup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_item *ti;
     proto_tree *nasdaq_soup_tree = NULL;
@@ -172,7 +172,7 @@ dissect_nasdaq_soup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
          */
         pinfo->desegment_offset = offset;
         pinfo->desegment_len = DESEGMENT_ONE_MORE_SEGMENT;
-        return;
+        return tvb_captured_length(tvb);
       }
 
       nasdaq_soup_type = tvb_get_guint8(tvb, offset);
@@ -193,6 +193,7 @@ dissect_nasdaq_soup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
       dissect_nasdaq_soup_packet(tvb, pinfo, tree, nasdaq_soup_tree, offset, linelen);
       offset = next_offset;
     }
+    return tvb_captured_length(tvb);
 }
 
 /* Register the protocol with Wireshark */
@@ -289,7 +290,7 @@ proto_register_nasdaq_soup(void)
 void
 proto_reg_handoff_nasdaq_soup(void)
 {
-    nasdaq_soup_handle = create_dissector_handle(dissect_nasdaq_soup, proto_nasdaq_soup);
+    nasdaq_soup_handle = new_create_dissector_handle(dissect_nasdaq_soup, proto_nasdaq_soup);
     nasdaq_itch_handle = find_dissector("nasdaq-itch");
     dissector_add_for_decode_as("tcp.port", nasdaq_soup_handle);
 }
index 2366fbd7e149420cae63bb2391c8aa15f7d69afa..f025bfed06b941a0b18e926e0df3ec01e7c9a10d 100644 (file)
@@ -748,8 +748,8 @@ static gint ett_nmpi = -1;
 static gint ett_nmpi_name_type_flags = -1;
 
 
-static void
-dissect_nmpi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_nmpi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        proto_tree      *nmpi_tree = NULL;
        proto_item      *ti;
@@ -843,6 +843,7 @@ dissect_nmpi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                next_tvb = tvb_new_subset_remaining(tvb, offset);
                dissect_netbios_payload(next_tvb, pinfo, tree);
        }
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -869,7 +870,7 @@ proto_reg_handoff_nmpi(void)
 {
        dissector_handle_t nmpi_handle;
 
-       nmpi_handle = create_dissector_handle(dissect_nmpi, proto_nmpi);
+       nmpi_handle = new_create_dissector_handle(dissect_nmpi, proto_nmpi);
        dissector_add_uint("ipx.socket", IPX_SOCKET_NWLINK_SMB_NAMEQUERY,
            nmpi_handle);
        dissector_add_uint("ipx.socket", IPX_SOCKET_NWLINK_SMB_MAILSLOT,
index 37a2dd46c483d286907866a5ff68e778b442833f..2403a56b3e88ff5c32064a61fd2d9b9f81e7580a 100644 (file)
@@ -1001,8 +1001,8 @@ dissect_answer_records(tvbuff_t *tvb, packet_info *pinfo, int cur_off, int nbns_
     return cur_off - start_off;
 }
 
-static void
-dissect_nbns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_nbns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     int          offset    = 0;
     int          nbns_data_offset;
@@ -1091,6 +1091,8 @@ dissect_nbns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                                               nbns_data_offset,
                                               add, NULL, nbns_tree, opcode,
                                               "Additional records");
+
+    return tvb_captured_length(tvb);
 }
 
 static heur_dissector_list_t netbios_heur_subdissector_list;
@@ -1168,8 +1170,8 @@ static const value_string nbds_error_codes[] = {
     { 0x00, NULL }
 };
 
-static void
-dissect_nbdgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_nbdgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     int                  offset     = 0;
     proto_tree          *nbdgm_tree = NULL;
@@ -1320,6 +1322,7 @@ dissect_nbdgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
             proto_item_set_len(ti, offset);
         break;
     }
+    return tvb_captured_length(tvb);
 }
 
 /*
@@ -2083,10 +2086,10 @@ proto_reg_handoff_nbt(void)
 {
     dissector_handle_t nbns_handle, nbdgm_handle, nbss_handle;
 
-    nbns_handle  = create_dissector_handle(dissect_nbns, proto_nbns);
+    nbns_handle  = new_create_dissector_handle(dissect_nbns, proto_nbns);
     dissector_add_uint("udp.port", UDP_PORT_NBNS, nbns_handle);
 
-    nbdgm_handle = create_dissector_handle(dissect_nbdgm, proto_nbdgm);
+    nbdgm_handle = new_create_dissector_handle(dissect_nbdgm, proto_nbdgm);
     dissector_add_uint("udp.port", UDP_PORT_NBDGM, nbdgm_handle);
 
     nbss_handle  = new_create_dissector_handle(dissect_nbss, proto_nbss);
index e4384d46557e4c21ca4d301dc48e010eefd16d4a..7aa34fbd1ac06ee32917bf2901d79eca73a10c5f 100644 (file)
@@ -1108,10 +1108,11 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
     }
 }
 
-static void
-dissect_ncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     dissect_ncp_common(tvb, pinfo, tree, FALSE);
+    return tvb_captured_length(tvb);
 }
 
 static guint
@@ -1390,7 +1391,7 @@ proto_reg_handoff_ncp(void)
     dissector_handle_t ncp_handle;
     dissector_handle_t ncp_tcp_handle;
 
-    ncp_handle = create_dissector_handle(dissect_ncp, proto_ncp);
+    ncp_handle = new_create_dissector_handle(dissect_ncp, proto_ncp);
     ncp_tcp_handle = new_create_dissector_handle(dissect_ncp_tcp, proto_ncp);
     dissector_add_uint("tcp.port", TCP_PORT_NCP, ncp_tcp_handle);
     dissector_add_uint("udp.port", UDP_PORT_NCP, ncp_handle);
index 5017edca658842df3aa5ca3d8fdf27c7c7e0bf70..21fb3c0b5eb192f317c42c1835d9f8d190fbae93 100644 (file)
@@ -38,8 +38,8 @@ static int proto_ncs = -1;
 static int hf_panning_id = -1;
 static int hf_incarnation = -1;
 
-static void
-dissect_ncs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ncs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   proto_tree  *ncs_tree;
   proto_item  *ti;
@@ -52,6 +52,7 @@ dissect_ncs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
   proto_tree_add_item(ncs_tree, hf_panning_id, tvb, 4, 4, ENC_BIG_ENDIAN);
   proto_tree_add_item(ncs_tree, hf_incarnation, tvb, 8, 4, ENC_BIG_ENDIAN);
+  return tvb_captured_length(tvb);
 }
 
 void
@@ -85,7 +86,7 @@ proto_reg_handoff_ncs(void)
 {
   dissector_handle_t ncs_handle;
 
-  ncs_handle = create_dissector_handle(dissect_ncs, proto_ncs);
+  ncs_handle = new_create_dissector_handle(dissect_ncs, proto_ncs);
   dissector_add_uint("ip.proto", IP_PROTO_NCS_HEARTBEAT, ncs_handle);
 }
 
index 29941e47f2ab2ddae07bd4e77ca6717cd9b42e15..195dc4426d97874f4353a32df19c255c7249f2c3 100644 (file)
@@ -297,8 +297,8 @@ dissect_netanalyzer_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
 
 /* Ethernet capture mode */
-static void
-dissect_netanalyzer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_netanalyzer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   tvbuff_t                *next_tvb;
 
@@ -318,12 +318,13 @@ dissect_netanalyzer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     proto_tree_add_expert_format(tree, pinfo, &ei_netanalyzer_header_version_none, tvb, 4, -1,
         "netANALYZER - No netANALYZER header found");
   }
+  return tvb_captured_length(tvb);
 }
 
 
 /* Transparent capture mode */
-static void
-dissect_netanalyzer_transparent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_netanalyzer_transparent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   proto_tree              *transparent_payload_tree = NULL;
   tvbuff_t                *next_tvb;
@@ -352,6 +353,7 @@ dissect_netanalyzer_transparent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
     proto_tree_add_expert_format(tree, pinfo, &ei_netanalyzer_header_version_none, tvb, 4, -1,
         "netANALYZER transparent mode - No netANALYZER header found");
   }
+  return tvb_captured_length(tvb);
 }
 
 
@@ -462,8 +464,8 @@ void proto_reg_handoff_netanalyzer(void)
   eth_dissector_handle  = find_dissector("eth_withfcs");
   data_dissector_handle = find_dissector("data");
 
-  netana_handle             = create_dissector_handle(dissect_netanalyzer,             proto_netanalyzer);
-  netana_handle_transparent = create_dissector_handle(dissect_netanalyzer_transparent, proto_netanalyzer);
+  netana_handle             = new_create_dissector_handle(dissect_netanalyzer,             proto_netanalyzer);
+  netana_handle_transparent = new_create_dissector_handle(dissect_netanalyzer_transparent, proto_netanalyzer);
   dissector_add_uint("wtap_encap", WTAP_ENCAP_NETANALYZER,             netana_handle);
   dissector_add_uint("wtap_encap", WTAP_ENCAP_NETANALYZER_TRANSPARENT, netana_handle_transparent);
 }
index 92cf3a91436fdb72e8dd11efb23f950db02c32be..d9bc3d40161a8f78f7607265f561315184b63606 100644 (file)
@@ -81,14 +81,9 @@ static const value_string reply_code_names[] = {
 
 
 /* Code to actually dissect the packets */
-static void
-dissect_netdump(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_netdump(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
-
-       /* Check that there's enough data */
-       if (tvb_reported_length(tvb) == 0)
-               return;
-
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "Netdump");
        /* Clear out stuff in the info column */
        col_clear(pinfo->cinfo, COL_INFO);
@@ -114,6 +109,7 @@ dissect_netdump(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                        proto_tree_add_item(netdump_tree, hf_netdump_payload, tvb, 13, -1, ENC_NA);
                }
        }
+       return tvb_captured_length(tvb);
 }
 
 void proto_register_netdump(void)
@@ -207,7 +203,7 @@ void proto_reg_handoff_netdump(void)
        static int CurrentPort;
 
        if (!initalized) {
-               netdump_handle = create_dissector_handle(dissect_netdump,
+               netdump_handle = new_create_dissector_handle(dissect_netdump,
                                proto_netdump);
 
                dissector_add_for_decode_as("udp.port", netdump_handle);
index 22ebf2b87458ff165853db7f31949ad0f986b0fe..cd8391db13cbffc861a9f61a83aae8783df6ca01 100644 (file)
@@ -477,13 +477,15 @@ dissect_netrom_routing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 }
 
 /* Code to actually dissect the packets */
-static void
-dissect_netrom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_netrom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        if ( tvb_get_guint8( tvb, 0 ) == 0xff )
                dissect_netrom_routing( tvb, pinfo, tree );
        else
                dissect_netrom_proto( tvb, pinfo, tree );
+
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -624,7 +626,7 @@ proto_register_netrom(void)
 void
 proto_reg_handoff_netrom(void)
 {
-       dissector_add_uint( "ax25.pid", AX25_P_NETROM, create_dissector_handle( dissect_netrom, proto_netrom ) );
+       dissector_add_uint( "ax25.pid", AX25_P_NETROM, new_create_dissector_handle( dissect_netrom, proto_netrom ) );
 
        ip_handle   = find_dissector( "ip" );
        data_handle = find_dissector( "data" );
index bb42dfecdabda1c3529fe41274294e8b7fbcda96..fd0d4d3628f8fed5c6fda811c90f8635184e904e 100644 (file)
@@ -203,11 +203,9 @@ static value_string_ext subsystem_ext = VALUE_STRING_EXT_INIT(subsystem);
 
 /* Code to actually dissect the nettl record headers */
 
-static void
-dissect_nettl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_nettl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
-    pinfo->current_proto = "nettl";
-
     if (tree) {
         proto_tree *nettl_tree;
         proto_item *nettl_item;
@@ -285,6 +283,7 @@ dissect_nettl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                          val_to_str_ext_const(pinfo->pseudo_header->nettl.subsys, &subsystem_ext, "Unknown"));
             call_dissector(data_handle, tvb, pinfo, tree);
     }
+    return tvb_captured_length(tvb);
 }
 
 
@@ -355,7 +354,7 @@ proto_reg_handoff_nettl(void)
     ip_proto_dissector_table = find_dissector_table("ip.proto");
     tcp_subdissector_table   = find_dissector_table("tcp.port");
 
-    nettl_handle = create_dissector_handle(dissect_nettl, proto_nettl);
+    nettl_handle = new_create_dissector_handle(dissect_nettl, proto_nettl);
     dissector_add_uint("wtap_encap", WTAP_ENCAP_NETTL_ETHERNET,   nettl_handle);
     dissector_add_uint("wtap_encap", WTAP_ENCAP_NETTL_TOKEN_RING, nettl_handle);
     dissector_add_uint("wtap_encap", WTAP_ENCAP_NETTL_FDDI,       nettl_handle);
index 140ba97bb34e6b8201c7d7fc0c93dd7d3d92f1af..84f872c5a50c92ca486193ab1b28241caf7c7d9d 100644 (file)
@@ -1325,8 +1325,8 @@ nfs_fmt_fsid( gchar *result, guint32 revision )
 }
 
 /* SVR4: checked with ReliantUNIX (5.43, 5.44, 5.45), OpenSolaris (build 101a) */
-static void
-dissect_fhandle_data_SVR4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree)
+static int
+dissect_fhandle_data_SVR4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
 {
        guint encoding = ENC_BIG_ENDIAN;        /* We support little endian and big endian. Default is big endian*/
        gboolean have_flag = FALSE;     /* The flag field at the end is optional. Assume no flag is there */
@@ -1485,13 +1485,15 @@ dissect_fhandle_data_SVR4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tre
        /* flag */
        if (have_flag)
                proto_tree_add_item(tree, hf_nfs_fh_flag, tvb, nof, 4, encoding);
+
+       return tvb_captured_length(tvb);
 }
 
 
 /* Checked with RedHat Linux 6.2 (kernel 2.2.14 knfsd) */
 
-static void
-dissect_fhandle_data_LINUX_KNFSD_LE(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree)
+static int
+dissect_fhandle_data_LINUX_KNFSD_LE(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
 {
        if (tree) {
                int     offset = 0;
@@ -1538,13 +1540,14 @@ dissect_fhandle_data_LINUX_KNFSD_LE(tvbuff_t* tvb, packet_info *pinfo _U_, proto
                proto_tree_add_item(tree, hf_nfs_fh_xfn_inode, tvb, offset+20, 4, ENC_LITTLE_ENDIAN);
                proto_tree_add_item(tree, hf_nfs_fh_fn_generation, tvb, offset+24, 4, ENC_LITTLE_ENDIAN);
        }
+       return tvb_captured_length(tvb);
 }
 
 
 /* Checked with RedHat Linux 5.2 (nfs-server 2.2beta47 user-land nfsd) */
 
-static void
-dissect_fhandle_data_LINUX_NFSD_LE(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree)
+static int
+dissect_fhandle_data_LINUX_NFSD_LE(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
 {
        int offset = 0;
 
@@ -1567,11 +1570,12 @@ dissect_fhandle_data_LINUX_NFSD_LE(tvbuff_t* tvb, packet_info *pinfo _U_, proto_
                        proto_tree_add_item(hash_tree, hf_nfs_fh_hp_key, tvb, offset+5, hashlen, ENC_NA);
                }
        }
+       return tvb_captured_length(tvb);
 }
 
 
-static void
-dissect_fhandle_data_NETAPP(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree)
+static int
+dissect_fhandle_data_NETAPP(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
 {
        int offset = 0;
        static const int * flags[] = {
@@ -1621,6 +1625,7 @@ dissect_fhandle_data_NETAPP(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *t
                                           tvb, offset + 31, 1,
                                           export_snapgen >> 24);
        }
+       return tvb_captured_length(tvb);
 }
 
 static const value_string handle_type_strings[] = {
@@ -1632,8 +1637,8 @@ static const value_string handle_type_strings[] = {
        { 0, NULL }
 };
 
-static void
-dissect_fhandle_data_NETAPP_V4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree)
+static int
+dissect_fhandle_data_NETAPP_V4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
 {
        static const int * flags[] = {
                &hf_nfs_fh_file_flag_mntpoint,
@@ -1656,7 +1661,7 @@ dissect_fhandle_data_NETAPP_V4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree
        };
 
        if (tree == NULL)
-               return;
+               return tvb_captured_length(tvb);
 
        {
                int         offset = 0;
@@ -1690,6 +1695,7 @@ dissect_fhandle_data_NETAPP_V4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree
                proto_tree_add_item(subtree, hf_nfs_fh_fsid, tvb, offset + 20, 4, encoding);
                proto_tree_add_item(tree, hf_nfs_fh_handle_type, tvb, offset+24, 4, encoding);
        }
+       return tvb_captured_length(tvb);
 }
 
 #define NETAPP_GX_FH3_LENGTH           44
@@ -1705,8 +1711,8 @@ dissect_fhandle_data_NETAPP_V4(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree
 #define SPINNP_FH_FLAG_SNAPDIR_MASK    0x02
 #define SPINNP_FH_FLAG_STREAMDIR_MASK  0x01
 
-static void
-dissect_fhandle_data_NETAPP_GX_v3(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree)
+static int
+dissect_fhandle_data_NETAPP_GX_v3(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
 {
        if (tree) {
                proto_item *tf;
@@ -1813,6 +1819,7 @@ dissect_fhandle_data_NETAPP_GX_v3(tvbuff_t* tvb, packet_info *pinfo _U_, proto_t
                proto_tree_add_item(tree, hf_nfs3_gxfh_exportptuid, tvb, offset+40, 4, ENC_LITTLE_ENDIAN);
 
        }  /* end of (tree) */
+       return tvb_captured_length(tvb);
 }
 
 /* Checked with SuSE 7.1 (kernel 2.4.0 knfsd) */
@@ -2152,12 +2159,13 @@ dissect_fhandle_data_CELERRA_VNX(tvbuff_t* tvb, packet_info *pinfo _U_, proto_tr
 }
 
 
-static void
-dissect_fhandle_data_unknown(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
+static int
+dissect_fhandle_data_unknown(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
 {
        guint fhlen = tvb_reported_length(tvb);
 
        proto_tree_add_item(tree, hf_nfs_fh_fhandle_data, tvb, 0, fhlen, ENC_NA);
+       return tvb_captured_length(tvb);
 }
 
 
@@ -2222,7 +2230,7 @@ dissect_fhandle_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *
                   have a unique identifier to determine subdissector */
                fh_tvb = tvb_new_subset(tvb, offset, fhlen, fhlen);
                if (!dissector_try_uint(nfs_fhandle_table, 0, fh_tvb, pinfo, tree))
-                       dissect_fhandle_data_unknown(fh_tvb, pinfo, tree);
+                       dissect_fhandle_data_unknown(fh_tvb, pinfo, tree, NULL);
        }
 }
 
@@ -13748,25 +13756,25 @@ proto_reg_handoff_nfs(void)
        rpc_init_prog(proto_nfs, NFS_CB_PROGRAM, ett_nfs,
            G_N_ELEMENTS(nfs_cb_vers_info), nfs_cb_vers_info);
 
-       fhandle_handle = create_dissector_handle(dissect_fhandle_data_SVR4, proto_nfs_svr4);
+       fhandle_handle = new_create_dissector_handle(dissect_fhandle_data_SVR4, proto_nfs_svr4);
        dissector_add_for_decode_as("nfs_fhandle.type", fhandle_handle);
 
-       fhandle_handle = create_dissector_handle(dissect_fhandle_data_LINUX_KNFSD_LE, proto_nfs_knfsd_le);
+       fhandle_handle = new_create_dissector_handle(dissect_fhandle_data_LINUX_KNFSD_LE, proto_nfs_knfsd_le);
        dissector_add_for_decode_as("nfs_fhandle.type", fhandle_handle);
 
-       fhandle_handle = create_dissector_handle(dissect_fhandle_data_LINUX_NFSD_LE, proto_nfs_nfsd_le);
+       fhandle_handle = new_create_dissector_handle(dissect_fhandle_data_LINUX_NFSD_LE, proto_nfs_nfsd_le);
        dissector_add_for_decode_as("nfs_fhandle.type", fhandle_handle);
 
        fhandle_handle = create_dissector_handle(dissect_fhandle_data_LINUX_KNFSD_NEW, proto_nfs_knfsd_new);
        dissector_add_for_decode_as("nfs_fhandle.type", fhandle_handle);
 
-       fhandle_handle = create_dissector_handle(dissect_fhandle_data_NETAPP, proto_nfs_ontap_v3);
+       fhandle_handle = new_create_dissector_handle(dissect_fhandle_data_NETAPP, proto_nfs_ontap_v3);
        dissector_add_for_decode_as("nfs_fhandle.type", fhandle_handle);
 
-       fhandle_handle = create_dissector_handle(dissect_fhandle_data_NETAPP_V4, proto_nfs_ontap_v4);
+       fhandle_handle = new_create_dissector_handle(dissect_fhandle_data_NETAPP_V4, proto_nfs_ontap_v4);
        dissector_add_for_decode_as("nfs_fhandle.type", fhandle_handle);
 
-       fhandle_handle = create_dissector_handle(dissect_fhandle_data_NETAPP_GX_v3, proto_nfs_ontap_gx_v3);
+       fhandle_handle = new_create_dissector_handle(dissect_fhandle_data_NETAPP_GX_v3, proto_nfs_ontap_gx_v3);
        dissector_add_for_decode_as("nfs_fhandle.type", fhandle_handle);
 
        fhandle_handle = create_dissector_handle(dissect_fhandle_data_CELERRA_VNX, proto_nfs_celerra_vnx);
@@ -13778,7 +13786,7 @@ proto_reg_handoff_nfs(void)
        fhandle_handle = create_dissector_handle(dissect_fhandle_data_DCACHE, proto_nfs_dcache);
        dissector_add_for_decode_as("nfs_fhandle.type", fhandle_handle);
 
-       fhandle_handle = create_dissector_handle(dissect_fhandle_data_unknown, proto_nfs_unknown);
+       fhandle_handle = new_create_dissector_handle(dissect_fhandle_data_unknown, proto_nfs_unknown);
        dissector_add_for_decode_as("nfs_fhandle.type", fhandle_handle);
 }
 
index f8f5b6412c2282bb279fdbb8f85b90ed1cc5e355..ab43844acf4ac96e00c5898a820c92bf36422acc 100644 (file)
@@ -952,9 +952,10 @@ skip_switch:
     *pOffset = extEnd;
 }
 
-static void dissect_nhrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_nhrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     _dissect_nhrp(tvb, pinfo, tree, FALSE, TRUE);
+    return tvb_captured_length(tvb);
 }
 
 static void _dissect_nhrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
@@ -1392,7 +1393,7 @@ proto_reg_handoff_nhrp(void)
     osinl_excl_subdissector_table = find_dissector_table("osinl.excl");
     ethertype_subdissector_table  = find_dissector_table("ethertype");
 
-    nhrp_handle = create_dissector_handle(dissect_nhrp, proto_nhrp);
+    nhrp_handle = new_create_dissector_handle(dissect_nhrp, proto_nhrp);
     dissector_add_uint("ip.proto", IP_PROTO_NARP, nhrp_handle);
     dissector_add_uint("gre.proto", GRE_NHRP, nhrp_handle);
     dissector_add_uint("llc.iana_pid", IANA_PID_MARS_NHRP_CONTROL, nhrp_handle);
index fc980d28d7865c800e16b7cd5696c699ec9637ea..56d316783277d1ff85db6b6d012ad95d60eca098 100644 (file)
@@ -1226,8 +1226,8 @@ nlsp_dissect_nlsp_psnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
  * Output:
  *     void, but we will add to the proto_tree if it is not NULL.
  */
-static void
-dissect_nlsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_nlsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        proto_item *ti, *type_item;
        proto_tree *nlsp_tree;
@@ -1306,6 +1306,7 @@ dissect_nlsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        default:
                expert_add_info(pinfo, type_item, &ei_nlsp_type);
        }
+       return tvb_captured_length(tvb);
 }
 
 /*
@@ -1774,7 +1775,7 @@ proto_reg_handoff_nlsp(void)
 {
        dissector_handle_t nlsp_handle;
 
-       nlsp_handle = create_dissector_handle(dissect_nlsp, proto_nlsp);
+       nlsp_handle = new_create_dissector_handle(dissect_nlsp, proto_nlsp);
        dissector_add_uint("ipx.socket", IPX_SOCKET_NLSP, nlsp_handle);
 }
 
index 69b9f459bbe543e94a0813623cdbcb4d716decfc..91f87db53306185f6259568739fb170bdafda802 100644 (file)
@@ -36,8 +36,8 @@ static gint ett_nntp = -1;
 
 #define TCP_PORT_NNTP                  119
 
-static void
-dissect_nntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_nntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        const gchar     *type;
        proto_tree      *nntp_tree;
@@ -101,6 +101,7 @@ dissect_nntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                        offset = next_offset;
                }
        }
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -132,7 +133,7 @@ proto_reg_handoff_nntp(void)
 {
        dissector_handle_t nntp_handle;
 
-       nntp_handle = create_dissector_handle(dissect_nntp, proto_nntp);
+       nntp_handle = new_create_dissector_handle(dissect_nntp, proto_nntp);
        dissector_add_uint("tcp.port", TCP_PORT_NNTP, nntp_handle);
 }
 
index 9eec836730cb788ddea1dbe8be0f7b596a29b252..40ad06ec02698ea435ced553700287186a065f7e 100644 (file)
@@ -145,8 +145,8 @@ static const value_string nsrp_encflag_vals[] = {
 static gint ett_nsrp = -1;
 
 /* Code to actually dissect the packets */
-static void
-dissect_nsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_nsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
     proto_item  *ti;
     proto_tree  *nsrp_tree = NULL;
@@ -345,6 +345,7 @@ dissect_nsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
     }
 
+    return tvb_captured_length(tvb);
 }
 
 
@@ -509,7 +510,7 @@ proto_reg_handoff_nsrp(void)
 {
     dissector_handle_t nsrp_handle;
 
-    nsrp_handle = create_dissector_handle(dissect_nsrp, proto_nsrp);
+    nsrp_handle = new_create_dissector_handle(dissect_nsrp, proto_nsrp);
     dissector_add_uint("ethertype", ETHERTYPE_NSRP, nsrp_handle);
 }
 
index 65d4aa4bf552798944683b7cd6d6342a7ca44784..0a088147f4ea7cc454d9e8c1922eb0ec06347bce 100644 (file)
@@ -416,8 +416,8 @@ void add35records(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tre
 #define VMNAMERECOFFSET(field)    (guint)(offsetof(nspr_rec_vmname_t, field))
 #define SSLRECOFFSET(field)       (guint)(offsetof(nspr_rec_ssl_t, field))
 #define MPTCPRECOFFSET(field)     (guint)(offsetof(nspr_rec_mptcp_t, field))
-static void
-dissect_nstrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_nstrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        proto_tree     *ns_tree = NULL, *flagtree = NULL;
        proto_item     *ti = NULL, *flagitem = NULL;
@@ -564,6 +564,8 @@ dissect_nstrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                next_tvb_eth_client = tvb_new_subset_remaining(tvb, offset);
                call_dissector(eth_withoutfcs_handle, next_tvb_eth_client, pinfo, tree);
        }
+
+       return tvb_captured_length(tvb);
 }
 
 void add35records(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *ns_tree)
@@ -1139,7 +1141,7 @@ void proto_reg_handoff_ns(void)
 
        eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
 
-       nstrace_handle = create_dissector_handle(dissect_nstrace, proto_nstrace);
+       nstrace_handle = new_create_dissector_handle(dissect_nstrace, proto_nstrace);
        dissector_add_uint("wtap_encap", WTAP_ENCAP_NSTRACE_1_0, nstrace_handle);
        dissector_add_uint("wtap_encap", WTAP_ENCAP_NSTRACE_2_0, nstrace_handle);
        dissector_add_uint("wtap_encap", WTAP_ENCAP_NSTRACE_3_0, nstrace_handle);
index 3854a19c6bab01ca456ee3fb74b0efe9a5355847..d0cb9ba1dabb9d346199e44b1a59050c288ef827 100644 (file)
@@ -1357,8 +1357,8 @@ dissect_ntp_priv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *ntp_tree)
  * pinfo - packet info
  * proto_tree - resolved protocol tree
  */
-static void
-dissect_ntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_ntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
        proto_tree      *ntp_tree;
        proto_item      *ti = NULL;
@@ -1399,6 +1399,7 @@ dissect_ntp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
        /* Dissect according to mode */
        (*dissector)(tvb, pinfo, ntp_tree);
+       return tvb_captured_length(tvb);
 }
 
 void
@@ -1702,7 +1703,7 @@ proto_reg_handoff_ntp(void)
 {
        dissector_handle_t ntp_handle;
 
-       ntp_handle = create_dissector_handle(dissect_ntp, proto_ntp);
+       ntp_handle = new_create_dissector_handle(dissect_ntp, proto_ntp);
        dissector_add_uint("udp.port", UDP_PORT_NTP, ntp_handle);
        dissector_add_uint("tcp.port", TCP_PORT_NTP, ntp_handle);
 }
index 361b74fb24cac5b3689fb04702de48a72c8c05e0..98c9b2592335286c59598c8e9555fe0f0fbd58e8 100644 (file)
@@ -369,8 +369,8 @@ capture_loop( const guchar *pd, int len, packet_counts *ld )
   }
 }
 
-static void
-dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   guint32       null_header;
   proto_tree    *fh_tree;
@@ -473,14 +473,15 @@ dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
       }
     }
   }
+  return tvb_captured_length(tvb);
 }
 
 /*
  * OpenBSD DLT_LOOP; like DLT_NULL, but with the first 4 byte *always*
  * being a *big-endian* type.
  */
-static void
-dissect_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int
+dissect_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
 {
   guint32       loop_family;
   proto_tree    *fh_tree;
@@ -509,6 +510,7 @@ dissect_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     /* No sub-dissector found.  Label rest of packet as "Data" */
     call_dissector(data_handle,next_tvb, pinfo, tree);
   }
+  return tvb_captured_length(tvb);
 }
 
 void
@@ -552,10 +554,10 @@ proto_reg_handoff_null(void)
 
   ethertype_dissector_table = find_dissector_table("ethertype");
 
-  null_handle = create_dissector_handle(dissect_null, proto_null);
+  null_handle = new_create_dissector_handle(dissect_null, proto_null);
   dissector_add_uint("wtap_encap", WTAP_ENCAP_NULL, null_handle);
 
-  loop_handle = create_dissector_handle(dissect_loop, proto_null);
+  loop_handle = new_create_dissector_handle(dissect_loop, proto_null);
   dissector_add_uint("wtap_encap", WTAP_ENCAP_LOOP, loop_handle);
 }