- Move register_dissector(...) from proto_reg_handoff() to proto_register();
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 19 Mar 2009 01:54:09 +0000 (01:54 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 19 Mar 2009 01:54:09 +0000 (01:54 +0000)
- Use dissector_add_handle("udp",...)  rather than dissector_add(""udp",0,...)

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27794 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-ccsds.c
epan/dissectors/packet-ehs.c
epan/dissectors/packet-vcdu.c

index 8176193719993a92d5bd30c30d90d368c1f743d2..4e989f1503e57484e04c0ca76947730accece1a0 100644 (file)
@@ -436,7 +436,7 @@ dissect_ccsds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
 
 /* Register the protocol with Wireshark
- * this format is require because a script is used to build the C function
+ * this format is required because a script is used to build the C function
  * that calls all the protocol registration.
  */
 void
@@ -592,6 +592,7 @@ proto_register_ccsds(void)
        proto_register_field_array(proto_ccsds, hf, array_length(hf));
        proto_register_subtree_array(ett, array_length(ett));
 
+       register_dissector ( "ccsds", dissect_ccsds, proto_ccsds );
 }
 
 
@@ -602,7 +603,6 @@ proto_register_ccsds(void)
 void
 proto_reg_handoff_ccsds(void)
 {
-       register_dissector ( "ccsds", dissect_ccsds, proto_ccsds );
-       dissector_add ( "udp.port", 0, find_dissector("ccsds") );
+       dissector_add_handle ( "udp.port", find_dissector("ccsds") ); /* for 'decode as' */
 }
 
index cbe2e81bb190d60670bb1397edf528b69bf1a884..b8930e729034aca5b10650f9dfff9b5a3417014e 100644 (file)
@@ -208,7 +208,7 @@ static int hf_ehs_dz_udsm_num_pkts_xmtd_rollover = -1;
 
 
 /* handle to ccsds packet dissector */
-static dissector_handle_t ccsds_handle = (dissector_handle_t)-1;
+static dissector_handle_t ccsds_handle;
 
 /* Initialize the subtree pointers */
 static gint ett_ehs = -1;
@@ -1906,6 +1906,9 @@ proto_register_ehs(void)
        proto_register_field_array(proto_ehs, hf, array_length(hf));
        proto_register_subtree_array(ett, array_length(ett));
 
+       /* XX: Does this dissector need to be publicly registered ?? */
+       register_dissector ( "ehs", dissect_ehs, proto_ehs );
+
 }
 
 
@@ -1916,8 +1919,7 @@ proto_register_ehs(void)
 void
 proto_reg_handoff_ehs(void)
 {
-       register_dissector ( "ehs", dissect_ehs, proto_ehs );
-       dissector_add ( "udp.port", 0, find_dissector("ehs") );
+       dissector_add_handle ( "udp.port", find_dissector("ehs") ); /* for 'decode as' */
        ccsds_handle = find_dissector ( "ccsds" );
 }
 
index 7020944fc504a7794d98cd6bdea0b401a5d48343..60c0199d9b39ca80d71a9ea2b329ede79dd1953b 100644 (file)
@@ -76,7 +76,7 @@ static int hf_vcdu_replay = -1;
 static int hf_vcdu_fhp = -1;
 static int hf_vcdu_lbp = -1;
 
-static dissector_handle_t ccsds_handle = (dissector_handle_t)-1;
+static dissector_handle_t ccsds_handle;
 
 /* Initialize the subtree pointers */
 static gint ett_vcdu = -1;
@@ -631,6 +631,8 @@ proto_register_vcdu(void)
        proto_register_field_array(proto_vcdu, hf, array_length(hf));
        proto_register_subtree_array(ett, array_length(ett));
 
+       /* XX: Does this dissector need to be publicly registered ?? */
+       register_dissector ( "vcdu", dissect_vcdu, proto_vcdu );
 }
 
 
@@ -641,8 +643,7 @@ proto_register_vcdu(void)
 void
 proto_reg_handoff_vcdu(void)
 {
-       register_dissector ( "vcdu", dissect_vcdu, proto_vcdu );
-       dissector_add ( "udp.port", 0, find_dissector("vcdu") );
+       dissector_add_handle ( "udp.port", find_dissector("vcdu") ); /* for 'decode as' */
        ccsds_handle = find_dissector ( "ccsds" );
 }