aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tpncp.c
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2014-04-04 08:14:57 +0200
committerAnders Broman <a.broman58@gmail.com>2014-04-04 07:22:22 +0000
commit8db838ed1d8fb8c95ca99a1b85e175a4820c00dc (patch)
tree6d203b01f1add66296674a100c29271cbd8813dd /epan/dissectors/packet-tpncp.c
parente2ded09289463cb362392700a99ddd7e3f6a5447 (diff)
Fix indent and add modelines
(Indent typo coming from 23d7d2ca2674565404262734f1a5855f83535c85) Change-Id: Ic4deae30d64db9f264223366d2d9d880708001d8 Reviewed-on: https://code.wireshark.org/review/956 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-tpncp.c')
-rw-r--r--epan/dissectors/packet-tpncp.c103
1 files changed, 58 insertions, 45 deletions
diff --git a/epan/dissectors/packet-tpncp.c b/epan/dissectors/packet-tpncp.c
index 0b158cdfdd..f75cbf6a50 100644
--- a/epan/dissectors/packet-tpncp.c
+++ b/epan/dissectors/packet-tpncp.c
@@ -790,16 +790,16 @@ void proto_reg_handoff_tpncp(void) {
dissector_delete_uint("udp.port", host_udp_port, tpncp_handle);
}
- if(global_tpncp_load_db){
- trunkpack_tcp_port = global_tpncp_trunkpack_tcp_port;
- trunkpack_udp_port = global_tpncp_trunkpack_udp_port;
+ if(global_tpncp_load_db){
+ trunkpack_tcp_port = global_tpncp_trunkpack_tcp_port;
+ trunkpack_udp_port = global_tpncp_trunkpack_udp_port;
- host_tcp_port = global_tpncp_host_tcp_port;
- host_udp_port = global_tpncp_host_udp_port;
+ host_tcp_port = global_tpncp_host_tcp_port;
+ host_udp_port = global_tpncp_host_udp_port;
- dissector_add_uint("tcp.port", global_tpncp_trunkpack_tcp_port, tpncp_tcp_handle);
- dissector_add_uint("udp.port", global_tpncp_trunkpack_udp_port, tpncp_handle);
- }
+ dissector_add_uint("tcp.port", global_tpncp_trunkpack_tcp_port, tpncp_tcp_handle);
+ dissector_add_uint("udp.port", global_tpncp_trunkpack_udp_port, tpncp_handle);
+ }
}
/*-------------------------------------------------------------------------------------------------------------------------------------------*/
@@ -814,48 +814,48 @@ void proto_register_tpncp(void) {
proto_tpncp = proto_register_protocol("AudioCodes TPNCP (TrunkPack Network Control Protocol)",
"TPNCP", "tpncp");
- if(global_tpncp_load_db){
- if (init_tpncp_db() == -1) {
- g_warning("Could not load tpncp.dat file, tpncp dissector will not work");
- return;
- }
-
-
- /* Rather than duplicating large quantities of code from
- * proto_register_field_array() and friends to sanitize the tpncp.dat file
- * when we read it, just catch any exceptions we get while registering and
- * take them as a hint that the file is corrupt. Then move on, so that at
- * least the rest of the protocol dissectors will still work.
- */
- TRY {
- /* The function proto_register_field_array does not work with dynamic
- * arrays, so pass dynamic array elements one-by-one in the loop.
- */
- for(idx = 0; idx < hf_size; idx++) {
- proto_register_field_array(proto_tpncp, &hf[idx], 1);
- }
- }
-
- CATCH_ALL {
- g_warning("Corrupt tpncp.dat file, tpncp dissector will not work.");
- }
-
- ENDTRY;
-
- proto_register_subtree_array(ett, array_length(ett));
- }
+ if(global_tpncp_load_db){
+ if (init_tpncp_db() == -1) {
+ g_warning("Could not load tpncp.dat file, tpncp dissector will not work");
+ return;
+ }
+
+
+ /* Rather than duplicating large quantities of code from
+ * proto_register_field_array() and friends to sanitize the tpncp.dat file
+ * when we read it, just catch any exceptions we get while registering and
+ * take them as a hint that the file is corrupt. Then move on, so that at
+ * least the rest of the protocol dissectors will still work.
+ */
+ TRY {
+ /* The function proto_register_field_array does not work with dynamic
+ * arrays, so pass dynamic array elements one-by-one in the loop.
+ */
+ for(idx = 0; idx < hf_size; idx++) {
+ proto_register_field_array(proto_tpncp, &hf[idx], 1);
+ }
+ }
+
+ CATCH_ALL {
+ g_warning("Corrupt tpncp.dat file, tpncp dissector will not work.");
+ }
+
+ ENDTRY;
+
+ proto_register_subtree_array(ett, array_length(ett));
+ }
tpncp_handle = new_register_dissector("tpncp", dissect_tpncp, proto_tpncp);
tpncp_module = prefs_register_protocol(proto_tpncp, proto_reg_handoff_tpncp);
- /* See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9569 for some discussion on this as well */
- prefs_register_bool_preference(tpncp_module, "load_db",
- "Whether to load DB or not, if DB not loaded dissector is passive",
- "Whether to load the Data base or not, not loading the DB "
- "dissaables the protocol, Wireshar has to be restarted for the"
- "setting to take effect ",
- &global_tpncp_load_db);
+ /* See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9569 for some discussion on this as well */
+ prefs_register_bool_preference(tpncp_module, "load_db",
+ "Whether to load DB or not, if DB not loaded dissector is passive",
+ "Whether to load the Data base or not, not loading the DB "
+ "dissaables the protocol, Wireshar has to be restarted for the"
+ "setting to take effect ",
+ &global_tpncp_load_db);
prefs_register_uint_preference(tpncp_module, "tcp.trunkpack_port",
"TPNCP \"well-known\" TrunkPack TCP Port",
@@ -865,3 +865,16 @@ void proto_register_tpncp(void) {
"TPNCP \"well-known\" TrunkPack UDP Port",
"", 10, &global_tpncp_trunkpack_udp_port);
}
+
+/*
+ * Editor modelines
+ *
+ * Local Variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * ex: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */