prefs: More cleanup, auto prefs

Remove callback function from pref registrations for dissectors that
don't need a callback. In other dissectors, move registration that
only needs to be done once inside the check for initialization,
avoiding some console messages when preferences are changed
("Duplicate dissectors (anonymous) and (anonymous) for protocol...")
and the like.

Add a couple auto preferences for dissectors missed in previous waves.

Ping #14319
This commit is contained in:
John Thacker 2022-08-07 09:28:32 -04:00 committed by AndersBroman
parent 862803de5c
commit 203cd2cba9
41 changed files with 180 additions and 338 deletions

View File

@ -74,9 +74,6 @@ struct e2ap_private_data {
guint32 ran_ue_e2ap_id;
};
/* Global variables */
static guint gbl_e2apSctpPort = SCTP_PORT_E2AP;
/* Dissector tables */
static dissector_table_t e2ap_ies_dissector_table;
//static dissector_table_t e2ap_ies_p1_dissector_table;
@ -193,31 +190,16 @@ dissect_e2ap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
void
proto_reg_handoff_e2ap(void)
{
static gboolean Initialized=FALSE;
static guint SctpPort;
if (!Initialized) {
dissector_add_for_decode_as("sctp.port", e2ap_handle);
dissector_add_uint_with_preference("sctp.port", SCTP_PORT_E2AP, e2ap_handle);
#if 0
/* TODO: should one or more of these be registered? */
dissector_add_uint("sctp.ppi", E2_CP_PROTOCOL_ID, e2ap_handle);
dissector_add_uint("sctp.ppi", E2_UP_PROTOCOL_ID, e2ap_handle);
dissector_add_uint("sctp.ppi", E2_DU_PROTOCOL_ID, e2ap_handle);
/* TODO: should one or more of these be registered? */
dissector_add_uint("sctp.ppi", E2_CP_PROTOCOL_ID, e2ap_handle);
dissector_add_uint("sctp.ppi", E2_UP_PROTOCOL_ID, e2ap_handle);
dissector_add_uint("sctp.ppi", E2_DU_PROTOCOL_ID, e2ap_handle);
#endif
Initialized=TRUE;
#include "packet-e2ap-dis-tab.c"
} else {
if (SctpPort != 0) {
dissector_delete_uint("sctp.port", SctpPort, e2ap_handle);
}
}
SctpPort=gbl_e2apSctpPort;
if (SctpPort != 0) {
dissector_add_uint("sctp.port", SctpPort, e2ap_handle);
}
}
/*--- proto_register_e2ap -------------------------------------------*/
@ -237,7 +219,7 @@ void proto_register_e2ap(void) {
};
module_t *e2ap_module;
/* module_t *e2ap_module; */
/* Register protocol */
proto_e2ap = proto_register_protocol(PNAME, PSNAME, PFNAME);
@ -260,13 +242,8 @@ void proto_register_e2ap(void) {
e2ap_n2_ie_type_dissector_table = register_dissector_table("e2ap.n2_ie_type", "E2AP N2 IE Type", proto_e2ap, FT_STRING, FALSE);
/* Register configuration options for ports */
e2ap_module = prefs_register_protocol(proto_e2ap, proto_reg_handoff_e2ap);
/* e2ap_module = prefs_register_protocol(proto_e2ap, NULL); */
prefs_register_uint_preference(e2ap_module, "sctp.port",
"e2ap SCTP Port",
"Set the SCTP port for e2ap messages",
10,
&gbl_e2apSctpPort);
}
/*

View File

@ -40,10 +40,6 @@
void proto_register_pcap(void);
void proto_reg_handoff_pcap(void);
static range_t *global_ssn_range;
static dissector_table_t sccp_ssn_table;
#include "packet-pcap-val.h"
static dissector_handle_t pcap_handle = NULL;
@ -133,19 +129,8 @@ dissect_pcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
void
proto_reg_handoff_pcap(void)
{
static gboolean prefs_initialized = FALSE;
static range_t *ssn_range;
if (! prefs_initialized) {
sccp_ssn_table = find_dissector_table("sccp.ssn");
prefs_initialized = TRUE;
#include "packet-pcap-dis-tab.c"
} else {
dissector_delete_uint_range("sccp.ssn", ssn_range, pcap_handle);
wmem_free(wmem_epan_scope(), ssn_range);
}
ssn_range = range_copy(wmem_epan_scope(), global_ssn_range);
dissector_add_uint_range("sccp.ssn", ssn_range, pcap_handle);
dissector_add_for_decode_as_with_preference("sccp.ssn", pcap_handle);
}
/*--- proto_register_pcap -------------------------------------------*/
@ -164,7 +149,7 @@ void proto_register_pcap(void) {
#include "packet-pcap-ettarr.c"
};
module_t *pcap_module;
/* module_t *pcap_module; */
/* Register protocol */
proto_pcap = proto_register_protocol(PNAME, PSNAME, PFNAME);
@ -172,7 +157,7 @@ void proto_register_pcap(void) {
proto_register_field_array(proto_pcap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
pcap_module = prefs_register_protocol(proto_pcap, proto_reg_handoff_pcap);
/* pcap_module = prefs_register_protocol(proto_pcap, NULL); */
/* Register dissector */
pcap_handle = register_dissector("pcap", dissect_pcap, proto_pcap);
@ -188,13 +173,6 @@ void proto_register_pcap(void) {
pcap_proc_out_dissector_table = register_dissector_table("pcap.proc.out", "PCAP-ELEMENTARY-PROCEDURE Outcome", proto_pcap, FT_UINT32, BASE_DEC);
/* Preferences */
/* Set default SSNs */
range_convert_str(wmem_epan_scope(), &global_ssn_range, "", MAX_SSN);
prefs_register_range_preference(pcap_module, "ssn", "SCCP SSNs",
"SCCP (and SUA) SSNs to decode as PCAP",
&global_ssn_range, MAX_SSN);
}

View File

@ -369,6 +369,8 @@ void proto_reg_handoff_q932(void) {
/* Notification indicator */
dissector_add_uint("q931.ie", (0x00 << 8) | Q932_IE_NOTIFICATION_INDICATOR, q932_ie_handle);
q932_ros_handle = find_dissector_add_dependency("q932.ros", proto_q932);
q931_prefs_initialized = TRUE;
}
if(g_facility_encoding == FACILITY_QSIG){

View File

@ -165,9 +165,6 @@ static dissector_handle_t ranap_handle;
int pdu_type = 0; /* 0 means wildcard */
/* Initialise the Preferences */
static gint global_ranap_sccp_ssn = SCCP_SSN_RANAP;
/* Dissector tables */
static dissector_table_t ranap_ies_dissector_table;
static dissector_table_t ranap_ies_p1_dissector_table;
@ -440,10 +437,7 @@ void proto_register_ranap(void) {
nas_pdu_dissector_table = register_dissector_table("ranap.nas_pdu", "RANAP NAS PDU", proto_ranap, FT_UINT8, BASE_DEC);
ranap_module = prefs_register_protocol(proto_ranap, proto_reg_handoff_ranap);
prefs_register_uint_preference(ranap_module, "sccp_ssn", "SCCP SSN for RANAP",
"The SCCP SubSystem Number for RANAP (default 142)", 10,
&global_ranap_sccp_ssn);
ranap_module = prefs_register_protocol(proto_ranap, NULL);
prefs_register_bool_preference(ranap_module, "dissect_rrc_container",
"Attempt to dissect RRC-Container",
"Attempt to dissect RRC message embedded in RRC-Container IE",
@ -455,24 +449,15 @@ void proto_register_ranap(void) {
void
proto_reg_handoff_ranap(void)
{
static gboolean initialized = FALSE;
static gint local_ranap_sccp_ssn;
if (!initialized) {
rrc_s_to_trnc_handle = find_dissector_add_dependency("rrc.s_to_trnc_cont", proto_ranap);
rrc_t_to_srnc_handle = find_dissector_add_dependency("rrc.t_to_srnc_cont", proto_ranap);
rrc_ho_to_utran_cmd = find_dissector_add_dependency("rrc.irat.ho_to_utran_cmd", proto_ranap);
bssgp_handle = find_dissector("bssgp");
heur_dissector_add("sccp", dissect_sccp_ranap_heur, "RANAP over SCCP", "ranap_sccp", proto_ranap, HEURISTIC_ENABLE);
heur_dissector_add("sua", dissect_sccp_ranap_heur, "RANAP over SUA", "ranap_sua", proto_ranap, HEURISTIC_ENABLE);
initialized = TRUE;
rrc_s_to_trnc_handle = find_dissector_add_dependency("rrc.s_to_trnc_cont", proto_ranap);
rrc_t_to_srnc_handle = find_dissector_add_dependency("rrc.t_to_srnc_cont", proto_ranap);
rrc_ho_to_utran_cmd = find_dissector_add_dependency("rrc.irat.ho_to_utran_cmd", proto_ranap);
bssgp_handle = find_dissector("bssgp");
heur_dissector_add("sccp", dissect_sccp_ranap_heur, "RANAP over SCCP", "ranap_sccp", proto_ranap, HEURISTIC_ENABLE);
heur_dissector_add("sua", dissect_sccp_ranap_heur, "RANAP over SUA", "ranap_sua", proto_ranap, HEURISTIC_ENABLE);
dissector_add_uint_with_preference("sccp.ssn", SCCP_SSN_RANAP, ranap_handle);
#include "packet-ranap-dis-tab.c"
} else {
dissector_delete_uint("sccp.ssn", local_ranap_sccp_ssn, ranap_handle);
}
dissector_add_uint("sccp.ssn", global_ranap_sccp_ssn, ranap_handle);
local_ranap_sccp_ssn = global_ranap_sccp_ssn;
}
/*

View File

@ -13466,6 +13466,8 @@ proto_reg_handoff_amqp(void)
dissector_add_uint("amqp.version", AMQP_V0_10, create_dissector_handle( dissect_amqpv0_10, proto_amqpv0_10 ));
dissector_add_uint("amqp.version", AMQP_V1_0, create_dissector_handle( dissect_amqpv1_0, proto_amqpv1_0 ));
media_type_subdissector_table = find_dissector_table ("media_type");
initialize = TRUE;
}
@ -13476,8 +13478,6 @@ proto_reg_handoff_amqp(void)
ssl_dissector_add(amqps_port, amqp_tcp_handle);
old_amqps_port = amqps_port;
}
media_type_subdissector_table = find_dissector_table ("media_type");
}
/*

View File

@ -1773,7 +1773,7 @@ proto_register_ansi_tcap(void)
expert_ansi_tcap = expert_register_protocol(proto_ansi_tcap);
expert_register_field_array(expert_ansi_tcap, ei, array_length(ei));
ansi_tcap_module = prefs_register_protocol(proto_ansi_tcap, proto_reg_handoff_ansi_tcap);
ansi_tcap_module = prefs_register_protocol(proto_ansi_tcap, NULL);
prefs_register_enum_preference(ansi_tcap_module, "transaction.matchtype",
"Type of matching invoke/response",

View File

@ -463,7 +463,7 @@ proto_register_mim(void)
proto_fp = proto_register_protocol("Cisco FabricPath", "CFP", "cfp");
mim_module = prefs_register_protocol (proto_fp, proto_reg_handoff_fabricpath);
mim_module = prefs_register_protocol (proto_fp, NULL);
prefs_register_obsolete_preference (mim_module, "enable");
@ -482,25 +482,20 @@ proto_register_mim(void)
void
proto_reg_handoff_fabricpath(void)
{
static gboolean prefs_initialized = FALSE;
/*
* Using Heuristic dissector (As opposed to
* registering the ethertype) in order to
* get outer source and destination MAC
* before the standard ethernet dissector
*/
heur_dissector_add ("eth", dissect_fp_heur, "Cisco FabricPath over Ethernet", "fp_eth", proto_fp, HEURISTIC_ENABLE);
if (!prefs_initialized) {
/*
* Using Heuristic dissector (As opposed to
* registering the ethertype) in order to
* get outer source and destination MAC
* before the standard ethernet dissector
*/
heur_dissector_add ("eth", dissect_fp_heur, "Cisco FabricPath over Ethernet", "fp_eth", proto_fp, HEURISTIC_ENABLE);
/*
* The FCS in FabricPath frames covers the entire FabricPath frame,
* not the encapsulated Ethernet frame, so we don't want to treat
* the encapsulated frame as if it had an FCS.
*/
eth_withoutfcs_dissector = find_dissector_add_dependency( "eth_withoutfcs", proto_fp );
prefs_initialized = TRUE;
}
/*
* The FCS in FabricPath frames covers the entire FabricPath frame,
* not the encapsulated Ethernet frame, so we don't want to treat
* the encapsulated frame as if it had an FCS.
*/
eth_withoutfcs_dissector = find_dissector_add_dependency( "eth_withoutfcs", proto_fp );
}
/*

View File

@ -1267,7 +1267,7 @@ proto_register_doip(void)
proto_register_subtree_array(ett, array_length(ett));
doip_handle = register_dissector("doip", dissect_doip, proto_doip);
doip_module = prefs_register_protocol(proto_doip, &proto_reg_handoff_doip);
doip_module = prefs_register_protocol(proto_doip, NULL);
/* UATs */
doip_diag_addr_uat = uat_new("Diagnostic Addresses",

View File

@ -2303,13 +2303,13 @@ proto_reg_handoff_dtls(void)
dtls_parse_uat();
dtls_parse_old_keys();
#endif
exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7);
if (initialized == FALSE) {
heur_dissector_add("udp", dissect_dtls_heur, "DTLS over UDP", "dtls_udp", proto_dtls, HEURISTIC_ENABLE);
heur_dissector_add("stun", dissect_dtls_heur, "DTLS over STUN", "dtls_stun", proto_dtls, HEURISTIC_DISABLE);
heur_dissector_add("classicstun", dissect_dtls_heur, "DTLS over CLASSICSTUN", "dtls_classicstun", proto_dtls, HEURISTIC_DISABLE);
dissector_add_uint("sctp.ppi", DIAMETER_DTLS_PROTOCOL_ID, dtls_handle);
exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7);
}
initialized = TRUE;

View File

@ -6430,8 +6430,7 @@ proto_register_dvbci(void)
expert_dvbci = expert_register_protocol(proto_dvbci);
expert_register_field_array(expert_dvbci, ei, array_length(ei));
dvbci_module = prefs_register_protocol(
proto_dvbci, proto_reg_handoff_dvbci);
dvbci_module = prefs_register_protocol(proto_dvbci, proto_reg_handoff_dvbci);
prefs_register_string_preference(dvbci_module,
"sek", "SAC Encryption Key", "SAC Encryption Key (16 hex bytes)",
&dvbci_sek);
@ -6472,14 +6471,19 @@ proto_register_dvbci(void)
void
proto_reg_handoff_dvbci(void)
{
dissector_add_uint("wtap_encap", WTAP_ENCAP_DVBCI, dvbci_handle);
static gboolean initialized = FALSE;
data_handle = find_dissector("data");
mpeg_pmt_handle = find_dissector_add_dependency("mpeg_pmt", proto_dvbci);
dvb_nit_handle = find_dissector_add_dependency("dvb_nit", proto_dvbci);
mime_handle = find_dissector_add_dependency("mime_dlt", proto_dvbci);
tcp_dissector_table = find_dissector_table("tcp.port");
udp_dissector_table = find_dissector_table("udp.port");
if (!initialized) {
dissector_add_uint("wtap_encap", WTAP_ENCAP_DVBCI, dvbci_handle);
data_handle = find_dissector("data");
mpeg_pmt_handle = find_dissector_add_dependency("mpeg_pmt", proto_dvbci);
dvb_nit_handle = find_dissector_add_dependency("dvb_nit", proto_dvbci);
mime_handle = find_dissector_add_dependency("mime_dlt", proto_dvbci);
tcp_dissector_table = find_dissector_table("tcp.port");
udp_dissector_table = find_dissector_table("udp.port");
initialized = TRUE;
}
g_free(dvbci_sek_bin);
g_free(dvbci_siv_bin);

View File

@ -478,9 +478,6 @@ struct e2ap_private_data {
guint32 ran_ue_e2ap_id;
};
/* Global variables */
static guint gbl_e2apSctpPort = SCTP_PORT_E2AP;
/* Dissector tables */
static dissector_table_t e2ap_ies_dissector_table;
//static dissector_table_t e2ap_ies_p1_dissector_table;
@ -3772,7 +3769,7 @@ static int dissect_RANcallProcess_ID_string_PDU(tvbuff_t *tvb _U_, packet_info *
/*--- End of included file: packet-e2ap-fn.c ---*/
#line 121 "./asn1/e2ap/packet-e2ap-template.c"
#line 118 "./asn1/e2ap/packet-e2ap-template.c"
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
@ -3848,19 +3845,14 @@ dissect_e2ap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
void
proto_reg_handoff_e2ap(void)
{
static gboolean Initialized=FALSE;
static guint SctpPort;
if (!Initialized) {
dissector_add_for_decode_as("sctp.port", e2ap_handle);
dissector_add_uint_with_preference("sctp.port", SCTP_PORT_E2AP, e2ap_handle);
#if 0
/* TODO: should one or more of these be registered? */
dissector_add_uint("sctp.ppi", E2_CP_PROTOCOL_ID, e2ap_handle);
dissector_add_uint("sctp.ppi", E2_UP_PROTOCOL_ID, e2ap_handle);
dissector_add_uint("sctp.ppi", E2_DU_PROTOCOL_ID, e2ap_handle);
/* TODO: should one or more of these be registered? */
dissector_add_uint("sctp.ppi", E2_CP_PROTOCOL_ID, e2ap_handle);
dissector_add_uint("sctp.ppi", E2_UP_PROTOCOL_ID, e2ap_handle);
dissector_add_uint("sctp.ppi", E2_DU_PROTOCOL_ID, e2ap_handle);
#endif
Initialized=TRUE;
/*--- Included file: packet-e2ap-dis-tab.c ---*/
#line 1 "./asn1/e2ap/packet-e2ap-dis-tab.c"
@ -3919,18 +3911,8 @@ proto_reg_handoff_e2ap(void)
/*--- End of included file: packet-e2ap-dis-tab.c ---*/
#line 210 "./asn1/e2ap/packet-e2ap-template.c"
#line 202 "./asn1/e2ap/packet-e2ap-template.c"
} else {
if (SctpPort != 0) {
dissector_delete_uint("sctp.port", SctpPort, e2ap_handle);
}
}
SctpPort=gbl_e2apSctpPort;
if (SctpPort != 0) {
dissector_add_uint("sctp.port", SctpPort, e2ap_handle);
}
}
/*--- proto_register_e2ap -------------------------------------------*/
@ -4776,7 +4758,7 @@ void proto_register_e2ap(void) {
NULL, HFILL }},
/*--- End of included file: packet-e2ap-hfarr.c ---*/
#line 230 "./asn1/e2ap/packet-e2ap-template.c"
#line 212 "./asn1/e2ap/packet-e2ap-template.c"
};
@ -4901,11 +4883,11 @@ void proto_register_e2ap(void) {
&ett_e2ap_PerQCIReportListItemFormat,
/*--- End of included file: packet-e2ap-ettarr.c ---*/
#line 237 "./asn1/e2ap/packet-e2ap-template.c"
#line 219 "./asn1/e2ap/packet-e2ap-template.c"
};
module_t *e2ap_module;
/* module_t *e2ap_module; */
/* Register protocol */
proto_e2ap = proto_register_protocol(PNAME, PSNAME, PFNAME);
@ -4928,13 +4910,8 @@ void proto_register_e2ap(void) {
e2ap_n2_ie_type_dissector_table = register_dissector_table("e2ap.n2_ie_type", "E2AP N2 IE Type", proto_e2ap, FT_STRING, FALSE);
/* Register configuration options for ports */
e2ap_module = prefs_register_protocol(proto_e2ap, proto_reg_handoff_e2ap);
/* e2ap_module = prefs_register_protocol(proto_e2ap, NULL); */
prefs_register_uint_preference(e2ap_module, "sctp.port",
"e2ap SCTP Port",
"Set the SCTP port for e2ap messages",
10,
&gbl_e2apSctpPort);
}
/*

View File

@ -208,8 +208,8 @@ proto_register_etag(void)
proto_register_field_array(proto_etag, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
etag_module = prefs_register_protocol(proto_etag, proto_reg_handoff_etag);
prefs_register_bool_preference(etag_module, "summary_in_tree",
etag_module = prefs_register_protocol(proto_etag, NULL);
prefs_register_bool_preference(etag_module, "summary_in_tree",
"Show E-Tag summary in protocol tree",
"Whether the E-Tag summary line should be shown in the protocol tree",
&etag_summary_in_tree);

View File

@ -313,7 +313,7 @@ proto_register_fcoib(void)
expert_fcoib = expert_register_protocol(proto_fcoib);
expert_register_field_array(expert_fcoib, ei, array_length(ei));
fcoib_module = prefs_register_protocol(proto_fcoib, proto_reg_handoff_fcoib);
fcoib_module = prefs_register_protocol(proto_fcoib, NULL);
prefs_register_static_text_preference(fcoib_module, "use_decode_as",
"Heuristic matching preferences removed. Use Infiniband protocol preferences or Decode As.",

View File

@ -576,15 +576,6 @@ proto_register_gfp(void)
register_decode_as(&gfp_da);
}
/* If this function is registered as a prefs callback (see
* prefs_register_protocol above) this function is also called by Wireshark's
* preferences manager whenever "Apply" or "OK" are pressed. In that case, it
* should accommodate being called more than once by use of the static
* 'initialized' variable included below.
*
* This form of the reg_handoff function is used if you perform registration
* functions which are dependent upon prefs.
*/
void
proto_reg_handoff_gfp(void)
{

View File

@ -507,7 +507,7 @@ proto_register_grpc(void)
proto_register_field_array(proto_grpc, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
grpc_module = prefs_register_protocol(proto_grpc, proto_reg_handoff_grpc);
grpc_module = prefs_register_protocol(proto_grpc, NULL);
prefs_register_bool_preference(grpc_module, "detect_json_automatically",
"Always check whether the message is JSON regardless of content-type.",

View File

@ -282,7 +282,6 @@ static gboolean http_decompress_body = TRUE;
#define SCTP_DEFAULT_RANGE "80"
#define TLS_DEFAULT_RANGE "443"
static range_t *global_http_sctp_range = NULL;
static range_t *global_http_tls_range = NULL;
static range_t *http_tcp_range = NULL;
@ -3923,10 +3922,7 @@ range_add_http_tls_callback(guint32 port, gpointer ptr _U_) {
static void reinit_http(void) {
http_tcp_range = prefs_get_range_value("http", "tcp.port");
dissector_delete_uint_range("sctp.port", http_sctp_range, http_sctp_handle);
wmem_free(wmem_epan_scope(), http_sctp_range);
http_sctp_range = range_copy(wmem_epan_scope(), global_http_sctp_range);
dissector_add_uint_range("sctp.port", http_sctp_range, http_sctp_handle);
http_sctp_range = prefs_get_range_value("http", "sctp.port");
range_foreach(http_tls_range, range_delete_http_tls_callback, NULL);
wmem_free(wmem_epan_scope(), http_tls_range);
@ -4315,11 +4311,6 @@ proto_register_http(void)
#endif
prefs_register_obsolete_preference(http_module, "tcp_alternate_port");
range_convert_str(wmem_epan_scope(), &global_http_sctp_range, SCTP_DEFAULT_RANGE, 65535);
prefs_register_range_preference(http_module, "sctp.port", "SCTP Ports",
"SCTP Ports range",
&global_http_sctp_range, 65535);
range_convert_str(wmem_epan_scope(), &global_http_tls_range, TLS_DEFAULT_RANGE, 65535);
prefs_register_range_preference(http_module, "tls.port", "SSL/TLS Ports",
"SSL/TLS Ports range",
@ -4543,6 +4534,7 @@ proto_reg_handoff_message_http(void)
proto_http2 = proto_get_id_by_filter_name("http2");
dissector_add_uint_range_with_preference("tcp.port", TCP_DEFAULT_RANGE, http_tcp_handle);
dissector_add_uint_range_with_preference("sctp.port", SCTP_DEFAULT_RANGE, http_sctp_handle);
reinit_http();
}

View File

@ -7050,6 +7050,29 @@ void proto_reg_handoff_ieee802154(void)
dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE802_15_4_TAP, ieee802154_tap_handle);
dissector_add_uint("sll.ltype", LINUX_SLL_P_IEEE802154, ieee802154_handle);
/* Register internal IE handlers */
dissector_add_uint(IEEE802154_HEADER_IE_DTABLE, IEEE802154_HEADER_IE_TIME_CORR, create_dissector_handle(dissect_hie_time_correction, -1));
dissector_add_uint(IEEE802154_HEADER_IE_DTABLE, IEEE802154_HEADER_IE_CSL, create_dissector_handle(dissect_hie_csl, -1));
dissector_add_uint(IEEE802154_HEADER_IE_DTABLE, IEEE802154_HEADER_IE_RENDEZVOUS, create_dissector_handle(dissect_hie_rendezvous_time, -1));
dissector_add_uint(IEEE802154_HEADER_IE_DTABLE, IEEE802154_HEADER_IE_GLOBAL_TIME, create_dissector_handle(dissect_hie_global_time, -1));
dissector_add_uint(IEEE802154_HEADER_IE_DTABLE, IEEE802154_HEADER_IE_VENDOR_SPECIFIC, create_dissector_handle(dissect_hie_vendor_specific, -1));
dissector_add_uint(IEEE802154_PAYLOAD_IE_DTABLE, IEEE802154_PAYLOAD_IE_MLME, create_dissector_handle(dissect_pie_mlme, -1));
dissector_add_uint(IEEE802154_PAYLOAD_IE_DTABLE, IEEE802154_PAYLOAD_IE_VENDOR, create_dissector_handle(dissect_pie_vendor, -1));
dissector_add_uint(IEEE802154_PAYLOAD_IE_DTABLE, IEEE802154_PAYLOAD_IE_MPX, create_dissector_handle(dissect_mpx_ie, -1));
dissector_add_uint(IEEE802154_PAYLOAD_IE_DTABLE, IEEE802154_PAYLOAD_IE_IETF, create_dissector_handle(dissect_ietf_ie, -1));
dissector_add_uint(IEEE802154_MLME_IE_DTABLE, IEEE802154_MLME_SUBIE_CHANNEL_HOPPING, create_dissector_handle(dissect_802154_channel_hopping, -1));
dissector_add_uint(IEEE802154_MLME_IE_DTABLE, IEEE802154_MLME_SUBIE_TSCH_SYNCH, create_dissector_handle(dissect_802154_tsch_time_sync, -1));
dissector_add_uint(IEEE802154_MLME_IE_DTABLE, IEEE802154_MLME_SUBIE_TSCH_SLOTFR_LINK, create_dissector_handle(dissect_802154_tsch_slotframe_link, -1));
dissector_add_uint(IEEE802154_MLME_IE_DTABLE, IEEE802154_MLME_SUBIE_TSCH_TIMESLOT, create_dissector_handle(dissect_802154_tsch_timeslot, -1));
dissector_add_uint(IEEE802154_MLME_IE_DTABLE, IEEE802154_MLME_SUBIE_ENHANCED_BEACON_FILTER, create_dissector_handle(dissect_802154_eb_filter, -1));
/* For the MPX-IE */
ethertype_table = find_dissector_table("ethertype");
eapol_handle = find_dissector("eapol");
lowpan_handle = find_dissector("6lowpan");
wisun_sec_handle = find_dissector("wisun.sec");
prefs_initialized = TRUE;
} else {
dissector_delete_uint("ethertype", old_ieee802154_ethertype, ieee802154_handle);
@ -7060,29 +7083,6 @@ void proto_reg_handoff_ieee802154(void)
/* Register dissector handles. */
dissector_add_uint("ethertype", ieee802154_ethertype, ieee802154_handle);
/* Register internal IE handlers */
dissector_add_uint(IEEE802154_HEADER_IE_DTABLE, IEEE802154_HEADER_IE_TIME_CORR, create_dissector_handle(dissect_hie_time_correction, -1));
dissector_add_uint(IEEE802154_HEADER_IE_DTABLE, IEEE802154_HEADER_IE_CSL, create_dissector_handle(dissect_hie_csl, -1));
dissector_add_uint(IEEE802154_HEADER_IE_DTABLE, IEEE802154_HEADER_IE_RENDEZVOUS, create_dissector_handle(dissect_hie_rendezvous_time, -1));
dissector_add_uint(IEEE802154_HEADER_IE_DTABLE, IEEE802154_HEADER_IE_GLOBAL_TIME, create_dissector_handle(dissect_hie_global_time, -1));
dissector_add_uint(IEEE802154_HEADER_IE_DTABLE, IEEE802154_HEADER_IE_VENDOR_SPECIFIC, create_dissector_handle(dissect_hie_vendor_specific, -1));
dissector_add_uint(IEEE802154_PAYLOAD_IE_DTABLE, IEEE802154_PAYLOAD_IE_MLME, create_dissector_handle(dissect_pie_mlme, -1));
dissector_add_uint(IEEE802154_PAYLOAD_IE_DTABLE, IEEE802154_PAYLOAD_IE_VENDOR, create_dissector_handle(dissect_pie_vendor, -1));
dissector_add_uint(IEEE802154_PAYLOAD_IE_DTABLE, IEEE802154_PAYLOAD_IE_MPX, create_dissector_handle(dissect_mpx_ie, -1));
dissector_add_uint(IEEE802154_PAYLOAD_IE_DTABLE, IEEE802154_PAYLOAD_IE_IETF, create_dissector_handle(dissect_ietf_ie, -1));
dissector_add_uint(IEEE802154_MLME_IE_DTABLE, IEEE802154_MLME_SUBIE_CHANNEL_HOPPING, create_dissector_handle(dissect_802154_channel_hopping, -1));
dissector_add_uint(IEEE802154_MLME_IE_DTABLE, IEEE802154_MLME_SUBIE_TSCH_SYNCH, create_dissector_handle(dissect_802154_tsch_time_sync, -1));
dissector_add_uint(IEEE802154_MLME_IE_DTABLE, IEEE802154_MLME_SUBIE_TSCH_SLOTFR_LINK, create_dissector_handle(dissect_802154_tsch_slotframe_link, -1));
dissector_add_uint(IEEE802154_MLME_IE_DTABLE, IEEE802154_MLME_SUBIE_TSCH_TIMESLOT, create_dissector_handle(dissect_802154_tsch_timeslot, -1));
dissector_add_uint(IEEE802154_MLME_IE_DTABLE, IEEE802154_MLME_SUBIE_ENHANCED_BEACON_FILTER, create_dissector_handle(dissect_802154_eb_filter, -1));
/* For the MPX-IE */
ethertype_table = find_dissector_table("ethertype");
eapol_handle = find_dissector("eapol");
lowpan_handle = find_dissector("6lowpan");
wisun_sec_handle = find_dissector("wisun.sec");
} /* proto_reg_handoff_ieee802154 */
/*

View File

@ -435,6 +435,9 @@ proto_reg_handoff_ieee8021ah(void)
capture_dissector_add_uint("ethertype", ETHERTYPE_IEEE_802_1AD, ieee8021ah_cap_handle);
capture_dissector_add_uint("ethertype", ETHERTYPE_IEEE_802_1AH, ieee8021ah_cap_handle);
ipx_cap_handle = find_capture_dissector("ipx");
llc_cap_handle = find_capture_dissector("llc");
prefs_initialized = TRUE;
}
else {
@ -443,9 +446,6 @@ proto_reg_handoff_ieee8021ah(void)
old_ieee8021ah_ethertype = ieee8021ah_ethertype;
dissector_add_uint("ethertype", ieee8021ah_ethertype, ieee8021ah_handle);
ipx_cap_handle = find_capture_dissector("ipx");
llc_cap_handle = find_capture_dissector("llc");
}
/*

View File

@ -436,7 +436,7 @@ proto_register_ib_sdp(void)
proto_register_subtree_array(ett, array_length(ett));
/* Register preferences */
ib_sdp_module = prefs_register_protocol(proto_ib_sdp, proto_reg_handoff_ib_sdp);
ib_sdp_module = prefs_register_protocol(proto_ib_sdp, NULL);
prefs_register_static_text_preference(ib_sdp_module, "use_decode_as",
"Heuristic matching preferences removed. Use Infiniband protocol preferences or Decode As.",

View File

@ -2391,6 +2391,10 @@ void proto_reg_handoff_jxta(void)
media_handle = find_dissector_add_dependency("media", proto_jxta);
heur_dissector_add("udp", dissect_jxta_UDP_heur, "JXTA over UDP", "jxta_udp", proto_jxta, HEURISTIC_ENABLE);
heur_dissector_add("tcp", dissect_jxta_TCP_heur, "JXTA over TCP", "jxta_tcp", proto_jxta, HEURISTIC_ENABLE);
heur_dissector_add("sctp", dissect_jxta_SCTP_heur, "JXTA over SCTP", "jxta_sctp", proto_jxta, HEURISTIC_ENABLE);
init_done = TRUE;
}
@ -2407,15 +2411,6 @@ void proto_reg_handoff_jxta(void)
msg_media_register_done = FALSE;
}
}
/* ws_message( "Registering UDP Heuristic dissector" ); */
heur_dissector_add("udp", dissect_jxta_UDP_heur, "JXTA over UDP", "jxta_udp", proto_jxta, HEURISTIC_ENABLE);
/* ws_message( "Registering TCP Heuristic dissector" ); */
heur_dissector_add("tcp", dissect_jxta_TCP_heur, "JXTA over TCP", "jxta_tcp", proto_jxta, HEURISTIC_ENABLE);
/* ws_message( "Registering SCTP Heuristic dissector" ); */
heur_dissector_add("sctp", dissect_jxta_SCTP_heur, "JXTA over SCTP", "jxta_sctp", proto_jxta, HEURISTIC_ENABLE);
}
/*

View File

@ -1365,7 +1365,7 @@ proto_register_lorawan(void)
);
module_t *lorawan_module;
lorawan_module = prefs_register_protocol(proto_lorawan, proto_reg_handoff_lorawan);
lorawan_module = prefs_register_protocol(proto_lorawan, NULL);
prefs_register_uat_preference(lorawan_module, "encryption_keys_lorawan", "LoRaWAN Encryption Keys",
"A table to define encryption keys for LoRaWAN devices",
device_encryption_keys_uat);
@ -1374,7 +1374,7 @@ proto_register_lorawan(void)
void
proto_reg_handoff_lorawan(void)
{
static dissector_handle_t lorawan_handle;
dissector_handle_t lorawan_handle;
lorawan_handle = create_dissector_handle(dissect_lorawan, proto_lorawan);
dissector_add_uint("loratap.syncword", 0x34, lorawan_handle);
dissector_add_for_decode_as("udp.port", lorawan_handle);

View File

@ -905,7 +905,8 @@ void proto_register_lwm(void)
* proto_reg_handoff_lwm
* DESCRIPTION
* Registers the lwm dissector with Wireshark.
* Will be called during Wireshark startup.
* Will be called during Wireshark startup, and whenever
* preferences are changed.
* PARAMETERS
* none
* RETURNS
@ -914,9 +915,17 @@ void proto_register_lwm(void)
*/
void proto_reg_handoff_lwm(void)
{
static gboolean initialized = FALSE;
GByteArray *bytes;
gboolean res;
if (!initialized) {
/* Register our dissector with IEEE 802.15.4 */
dissector_add_for_decode_as(IEEE802154_PROTOABBREV_WPAN_PANID, lwm_handle);
heur_dissector_add(IEEE802154_PROTOABBREV_WPAN, dissect_lwm_heur, "Lightweight Mesh over IEEE 802.15.4", "lwm_wlan", proto_lwm, HEURISTIC_ENABLE);
initialized = TRUE;
}
/* Convert key to raw bytes */
bytes = g_byte_array_new();
res = hex_str_to_bytes(lwmes_key_str, bytes, FALSE);
@ -926,11 +935,6 @@ void proto_reg_handoff_lwm(void)
}
g_byte_array_free(bytes, TRUE);
/* Register our dissector with IEEE 802.15.4 */
dissector_add_for_decode_as(IEEE802154_PROTOABBREV_WPAN_PANID, lwm_handle);
heur_dissector_add(IEEE802154_PROTOABBREV_WPAN, dissect_lwm_heur, "Lightweight Mesh over IEEE 802.15.4", "lwm_wlan", proto_lwm, HEURISTIC_ENABLE);
} /* proto_reg_handoff_lwm */
/*

View File

@ -21021,10 +21021,10 @@ proto_reg_handoff_netflow(void)
static range_t *netflow_ports;
static range_t *ipfix_ports;
/* Find eth_handle used for IE315*/
eth_handle = find_dissector ("eth_withoutfcs");
if (!netflow_prefs_initialized) {
/* Find eth_handle used for IE315*/
eth_handle = find_dissector ("eth_withoutfcs");
netflow_handle = create_dissector_handle(dissect_netflow, proto_netflow);
netflow_tcp_handle = create_dissector_handle(dissect_tcp_netflow, proto_netflow);
netflow_prefs_initialized = TRUE;

View File

@ -808,7 +808,6 @@ proto_register_nvme_rdma(void)
proto_register_subtree_array(ett, array_length(ett));
/* Register preferences */
//nvme_rdma_module = prefs_register_protocol(proto_nvme_rdma, proto_reg_handoff_nvme_rdma);
nvme_rdma_module = prefs_register_protocol(proto_nvme_rdma, NULL);
range_convert_str(wmem_epan_scope(), &gPORT_RANGE, NVME_RDMA_TCP_PORT_RANGE, MAX_TCP_PORT);

View File

@ -13663,7 +13663,7 @@ void proto_register_opa_mad(void)
range_convert_str(wmem_epan_scope(), &global_mad_reserved_class, OPA_RESERVED_RANGE_STR, 0xFF);
range_convert_str(wmem_epan_scope(), &global_mad_opa_class, OPA_MGMTCLASS_RANGE_STR, 0xFF);
opa_mad_module = prefs_register_protocol(proto_opa_mad, proto_reg_handoff_opa_mad);
opa_mad_module = prefs_register_protocol(proto_opa_mad, NULL);
prefs_register_bool_preference(opa_mad_module, "parse_mad_error",
"Enable Parsing of Mad Payload on Mad Status Error",
"Attempt to parse mad payload even when MAD.Status is non-zero",

View File

@ -48,10 +48,6 @@
void proto_register_pcap(void);
void proto_reg_handoff_pcap(void);
static range_t *global_ssn_range;
static dissector_table_t sccp_ssn_table;
/*--- Included file: packet-pcap-val.h ---*/
#line 1 "./asn1/pcap/packet-pcap-val.h"
@ -240,7 +236,7 @@ typedef enum _ProtocolIE_ID_enum {
} ProtocolIE_ID_enum;
/*--- End of included file: packet-pcap-val.h ---*/
#line 48 "./asn1/pcap/packet-pcap-template.c"
#line 44 "./asn1/pcap/packet-pcap-template.c"
static dissector_handle_t pcap_handle = NULL;
@ -1393,7 +1389,7 @@ static int hf_pcap_AvailableSubChannelNumbers_subCh1 = -1;
static int hf_pcap_AvailableSubChannelNumbers_subCh0 = -1;
/*--- End of included file: packet-pcap-hf.c ---*/
#line 55 "./asn1/pcap/packet-pcap-template.c"
#line 51 "./asn1/pcap/packet-pcap-template.c"
/* Initialize the subtree pointers */
static int ett_pcap = -1;
@ -1796,7 +1792,7 @@ static gint ett_pcap_UnsuccessfulOutcome = -1;
static gint ett_pcap_Outcome = -1;
/*--- End of included file: packet-pcap-ett.c ---*/
#line 60 "./asn1/pcap/packet-pcap-template.c"
#line 56 "./asn1/pcap/packet-pcap-template.c"
/* Global variables */
static guint32 ProcedureCode;
@ -13540,7 +13536,7 @@ static int dissect_PCAP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto
/*--- End of included file: packet-pcap-fn.c ---*/
#line 84 "./asn1/pcap/packet-pcap-template.c"
#line 80 "./asn1/pcap/packet-pcap-template.c"
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
@ -13593,12 +13589,6 @@ dissect_pcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
void
proto_reg_handoff_pcap(void)
{
static gboolean prefs_initialized = FALSE;
static range_t *ssn_range;
if (! prefs_initialized) {
sccp_ssn_table = find_dissector_table("sccp.ssn");
prefs_initialized = TRUE;
/*--- Included file: packet-pcap-dis-tab.c ---*/
#line 1 "./asn1/pcap/packet-pcap-dis-tab.c"
@ -13740,13 +13730,8 @@ proto_reg_handoff_pcap(void)
/*--- End of included file: packet-pcap-dis-tab.c ---*/
#line 143 "./asn1/pcap/packet-pcap-template.c"
} else {
dissector_delete_uint_range("sccp.ssn", ssn_range, pcap_handle);
wmem_free(wmem_epan_scope(), ssn_range);
}
ssn_range = range_copy(wmem_epan_scope(), global_ssn_range);
dissector_add_uint_range("sccp.ssn", ssn_range, pcap_handle);
#line 133 "./asn1/pcap/packet-pcap-template.c"
dissector_add_for_decode_as_with_preference("sccp.ssn", pcap_handle);
}
/*--- proto_register_pcap -------------------------------------------*/
@ -18321,7 +18306,7 @@ void proto_register_pcap(void) {
NULL, HFILL }},
/*--- End of included file: packet-pcap-hfarr.c ---*/
#line 159 "./asn1/pcap/packet-pcap-template.c"
#line 144 "./asn1/pcap/packet-pcap-template.c"
};
/* List of subtrees */
@ -18725,10 +18710,10 @@ void proto_register_pcap(void) {
&ett_pcap_Outcome,
/*--- End of included file: packet-pcap-ettarr.c ---*/
#line 165 "./asn1/pcap/packet-pcap-template.c"
#line 150 "./asn1/pcap/packet-pcap-template.c"
};
module_t *pcap_module;
/* module_t *pcap_module; */
/* Register protocol */
proto_pcap = proto_register_protocol(PNAME, PSNAME, PFNAME);
@ -18736,7 +18721,7 @@ void proto_register_pcap(void) {
proto_register_field_array(proto_pcap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
pcap_module = prefs_register_protocol(proto_pcap, proto_reg_handoff_pcap);
/* pcap_module = prefs_register_protocol(proto_pcap, NULL); */
/* Register dissector */
pcap_handle = register_dissector("pcap", dissect_pcap, proto_pcap);
@ -18752,13 +18737,6 @@ void proto_register_pcap(void) {
pcap_proc_out_dissector_table = register_dissector_table("pcap.proc.out", "PCAP-ELEMENTARY-PROCEDURE Outcome", proto_pcap, FT_UINT32, BASE_DEC);
/* Preferences */
/* Set default SSNs */
range_convert_str(wmem_epan_scope(), &global_ssn_range, "", MAX_SSN);
prefs_register_range_preference(pcap_module, "ssn", "SCCP SSNs",
"SCCP (and SUA) SSNs to decode as PCAP",
&global_ssn_range, MAX_SSN);
}

View File

@ -1117,6 +1117,8 @@ void proto_reg_handoff_q932(void) {
/* Notification indicator */
dissector_add_uint("q931.ie", (0x00 << 8) | Q932_IE_NOTIFICATION_INDICATOR, q932_ie_handle);
q932_ros_handle = find_dissector_add_dependency("q932.ros", proto_q932);
q931_prefs_initialized = TRUE;
}
if(g_facility_encoding == FACILITY_QSIG){

View File

@ -1717,9 +1717,6 @@ static dissector_handle_t ranap_handle;
int pdu_type = 0; /* 0 means wildcard */
/* Initialise the Preferences */
static gint global_ranap_sccp_ssn = SCCP_SSN_RANAP;
/* Dissector tables */
static dissector_table_t ranap_ies_dissector_table;
static dissector_table_t ranap_ies_p1_dissector_table;
@ -15056,7 +15053,7 @@ static int dissect_RANAP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, prot
/*--- End of included file: packet-ranap-fn.c ---*/
#line 196 "./asn1/ranap/packet-ranap-template.c"
#line 193 "./asn1/ranap/packet-ranap-template.c"
static int
dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
@ -18440,7 +18437,7 @@ void proto_register_ranap(void) {
NULL, HFILL }},
/*--- End of included file: packet-ranap-hfarr.c ---*/
#line 411 "./asn1/ranap/packet-ranap-template.c"
#line 408 "./asn1/ranap/packet-ranap-template.c"
};
/* List of subtrees */
@ -18804,7 +18801,7 @@ void proto_register_ranap(void) {
&ett_ranap_Outcome,
/*--- End of included file: packet-ranap-ettarr.c ---*/
#line 419 "./asn1/ranap/packet-ranap-template.c"
#line 416 "./asn1/ranap/packet-ranap-template.c"
};
@ -18829,10 +18826,7 @@ void proto_register_ranap(void) {
nas_pdu_dissector_table = register_dissector_table("ranap.nas_pdu", "RANAP NAS PDU", proto_ranap, FT_UINT8, BASE_DEC);
ranap_module = prefs_register_protocol(proto_ranap, proto_reg_handoff_ranap);
prefs_register_uint_preference(ranap_module, "sccp_ssn", "SCCP SSN for RANAP",
"The SCCP SubSystem Number for RANAP (default 142)", 10,
&global_ranap_sccp_ssn);
ranap_module = prefs_register_protocol(proto_ranap, NULL);
prefs_register_bool_preference(ranap_module, "dissect_rrc_container",
"Attempt to dissect RRC-Container",
"Attempt to dissect RRC message embedded in RRC-Container IE",
@ -18844,17 +18838,13 @@ void proto_register_ranap(void) {
void
proto_reg_handoff_ranap(void)
{
static gboolean initialized = FALSE;
static gint local_ranap_sccp_ssn;
if (!initialized) {
rrc_s_to_trnc_handle = find_dissector_add_dependency("rrc.s_to_trnc_cont", proto_ranap);
rrc_t_to_srnc_handle = find_dissector_add_dependency("rrc.t_to_srnc_cont", proto_ranap);
rrc_ho_to_utran_cmd = find_dissector_add_dependency("rrc.irat.ho_to_utran_cmd", proto_ranap);
bssgp_handle = find_dissector("bssgp");
heur_dissector_add("sccp", dissect_sccp_ranap_heur, "RANAP over SCCP", "ranap_sccp", proto_ranap, HEURISTIC_ENABLE);
heur_dissector_add("sua", dissect_sccp_ranap_heur, "RANAP over SUA", "ranap_sua", proto_ranap, HEURISTIC_ENABLE);
initialized = TRUE;
rrc_s_to_trnc_handle = find_dissector_add_dependency("rrc.s_to_trnc_cont", proto_ranap);
rrc_t_to_srnc_handle = find_dissector_add_dependency("rrc.t_to_srnc_cont", proto_ranap);
rrc_ho_to_utran_cmd = find_dissector_add_dependency("rrc.irat.ho_to_utran_cmd", proto_ranap);
bssgp_handle = find_dissector("bssgp");
heur_dissector_add("sccp", dissect_sccp_ranap_heur, "RANAP over SCCP", "ranap_sccp", proto_ranap, HEURISTIC_ENABLE);
heur_dissector_add("sua", dissect_sccp_ranap_heur, "RANAP over SUA", "ranap_sua", proto_ranap, HEURISTIC_ENABLE);
dissector_add_uint_with_preference("sccp.ssn", SCCP_SSN_RANAP, ranap_handle);
/*--- Included file: packet-ranap-dis-tab.c ---*/
#line 1 "./asn1/ranap/packet-ranap-dis-tab.c"
@ -19233,13 +19223,8 @@ proto_reg_handoff_ranap(void)
/*--- End of included file: packet-ranap-dis-tab.c ---*/
#line 470 "./asn1/ranap/packet-ranap-template.c"
} else {
dissector_delete_uint("sccp.ssn", local_ranap_sccp_ssn, ranap_handle);
}
#line 460 "./asn1/ranap/packet-ranap-template.c"
dissector_add_uint("sccp.ssn", global_ranap_sccp_ssn, ranap_handle);
local_ranap_sccp_ssn = global_ranap_sccp_ssn;
}
/*

View File

@ -70,7 +70,7 @@ static expert_field ei_s5066dts_eow_hftrp_invalid = EI_INIT;
/* TCP port that will be listened by the application that peer
* dts layers will be connected through
*/
static guint config_s5066dts_port = 0;
static range_t *config_s5066dts_ports = NULL;
static gint hf_s5066dts_sync_word = -1;
static gint hf_s5066dts_dpdu_type = -1;
@ -927,7 +927,7 @@ static int dissect_s5066dts_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
}
/* Drop packets with port matches other than the destination port. */
if ( pinfo->destport != config_s5066dts_port) {
if (!value_is_in_range(config_s5066dts_ports, pinfo->destport)) {
/* Configured to dissect TCP destination port matches only, dropping.. */
return 0;
}
@ -942,7 +942,7 @@ static void
apply_s5066dts_prefs(void)
{
/* STANAG 5066 uses the port preference for some heuristics */
config_s5066dts_port = prefs_get_uint_value("s5066dts", "tcp.port");;
config_s5066dts_ports = prefs_get_range_value("s5066dts", "tcp.port");;
}
void proto_register_s5066dts (void)

View File

@ -7785,6 +7785,14 @@ proto_reg_handoff_sip(void)
heur_dissector_add("tcp", dissect_sip_tcp_heur, "SIP over TCP", "sip_tcp", proto_sip, HEURISTIC_ENABLE);
heur_dissector_add("sctp", dissect_sip_heur, "SIP over SCTP", "sip_sctp", proto_sip, HEURISTIC_ENABLE);
heur_dissector_add("stun", dissect_sip_heur, "SIP over TURN", "sip_stun", proto_sip, HEURISTIC_ENABLE);
dissector_add_uint("acdr.tls_application_port", 5061, sip_handle);
dissector_add_uint("acdr.tls_application", TLS_APP_SIP, sip_handle);
dissector_add_string("protobuf_field", "adc.sip.ResponsePDU.body", sip_handle);
dissector_add_string("protobuf_field", "adc.sip.RequestPDU.body", sip_handle);
exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7);
sip_prefs_initialized = TRUE;
} else {
ssl_dissector_delete(saved_sip_tls_port, sip_tcp_handle);
@ -7793,12 +7801,6 @@ proto_reg_handoff_sip(void)
ssl_dissector_add(sip_tls_port, sip_tcp_handle);
saved_sip_tls_port = sip_tls_port;
dissector_add_uint("acdr.tls_application_port", 5061, sip_handle);
dissector_add_uint("acdr.tls_application", TLS_APP_SIP, sip_handle);
dissector_add_string("protobuf_field", "adc.sip.ResponsePDU.body", sip_handle);
dissector_add_string("protobuf_field", "adc.sip.RequestPDU.body", sip_handle);
exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7);
}
/*

View File

@ -1358,7 +1358,7 @@ dissect_solaredge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void
void
proto_reg_handoff_solaredge(void)
{
static dissector_handle_t solaredge_handle;
dissector_handle_t solaredge_handle;
solaredge_handle = create_dissector_handle(dissect_solaredge, proto_solaredge);
dissector_add_for_decode_as("tcp.port", solaredge_handle);
}
@ -1660,7 +1660,7 @@ proto_register_solaredge(void)
"solaredge"
);
module_t * module_solaredge = prefs_register_protocol(proto_solaredge, proto_reg_handoff_solaredge);
module_t * module_solaredge = prefs_register_protocol(proto_solaredge, NULL);
prefs_register_bool_preference(module_solaredge, "unknown", "Show unknown fields", "Show unidentified fields (\"padding\") in packet dissections", &global_show_unknown_fields);
prefs_register_string_preference(module_solaredge, "system_encryption_key", "System encryption key", "Inverter system encryption key", &global_system_encryption_key);

View File

@ -234,9 +234,6 @@ static const fragment_items someip_tp_frag_items = {
static reassembly_table someip_tp_reassembly_table;
static range_t *someip_ports_udp = NULL;
static range_t *someip_ports_tcp = NULL;
static gboolean someip_tp_reassemble = TRUE;
static gboolean someip_deserializer_activated = TRUE;
static gboolean someip_deserializer_wtlv_default = FALSE;
@ -4074,16 +4071,6 @@ proto_register_someip(void) {
/* Register preferences */
someip_module = prefs_register_protocol(proto_someip, &proto_reg_handoff_someip);
range_convert_str(wmem_epan_scope(), &someip_ports_udp, "", 65535);
prefs_register_range_preference(someip_module, "ports.udp", "UDP Ports",
"SOME/IP Port Ranges UDP.",
&someip_ports_udp, 65535);
range_convert_str(wmem_epan_scope(), &someip_ports_tcp, "", 65535);
prefs_register_range_preference(someip_module, "ports.tcp", "TCP Ports",
"SOME/IP Port Ranges TCP.",
&someip_ports_tcp, 65535);
/* UATs */
someip_service_uat = uat_new("SOME/IP Services",
sizeof(generic_one_id_string_t), /* record size */
@ -4396,16 +4383,13 @@ proto_reg_handoff_someip(void) {
stats_tree_register("someip_messages", "someip_messages", "SOME/IP Messages", 0, someip_messages_stats_tree_packet, someip_messages_stats_tree_init, NULL);
dissector_add_uint_range_with_preference("udp.port", "", someip_handle_udp);
dissector_add_uint_range_with_preference("tcp.port", "", someip_handle_tcp);
initialized = TRUE;
} else {
/* delete all my ports even the dynamically registered ones */
dissector_delete_all("udp.port", someip_handle_udp);
dissector_delete_all("tcp.port", someip_handle_tcp);
clean_all_hashtables_with_empty_uat();
}
dissector_add_uint_range("udp.port", someip_ports_udp, someip_handle_udp);
dissector_add_uint_range("tcp.port", someip_ports_tcp, someip_handle_tcp);
update_dynamic_hf_entries_someip_parameter_list();
update_dynamic_hf_entries_someip_parameter_arrays();

View File

@ -375,11 +375,11 @@ proto_reg_handoff_sscop(void)
if (!prefs_initialized) {
initialize_handles_once();
dissector_add_uint_range_with_preference("udp.port", "", sscop_handle);
dissector_add_uint("atm.aal5.type", TRAF_SSCOP, sscop_handle);
prefs_initialized = TRUE;
}
dissector_add_uint("atm.aal5.type", TRAF_SSCOP, sscop_handle);
switch(sscop_payload_dissector) {
case DATA_DISSECTOR: default_handle = data_handle; break;
case Q2931_DISSECTOR: default_handle = q2931_handle; break;

View File

@ -426,12 +426,13 @@ proto_reg_handoff_ssyncp(void)
if (!initialized) {
ssyncp_handle = create_dissector_handle(dissect_ssyncp, proto_ssyncp);
dissector_add_uint("udp.port", SSYNCP_UDP_PORT, ssyncp_handle);
initialized = TRUE;
}
dissector_protobuf = find_dissector("protobuf");
if (dissector_protobuf == NULL) {
report_failure("unable to find protobuf dissector");
dissector_protobuf = find_dissector("protobuf");
if (dissector_protobuf == NULL) {
report_failure("unable to find protobuf dissector");
}
initialized = TRUE;
}
have_ssyncp_key = FALSE;

View File

@ -151,7 +151,7 @@ proto_register_tdmoe(void)
proto_tdmoe = proto_register_protocol("Digium TDMoE Protocol", "TDMoE", "tdmoe");
proto_register_field_array(proto_tdmoe, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
tdmoe_module = prefs_register_protocol(proto_tdmoe, proto_reg_handoff_tdmoe);
tdmoe_module = prefs_register_protocol(proto_tdmoe, NULL);
prefs_register_uint_preference(tdmoe_module, "d_channel",
"TDMoE D-Channel",
"The TDMoE channel that contains the D-Channel.",

View File

@ -3365,7 +3365,7 @@ proto_register_thread(void)
proto_thread = proto_register_protocol("Thread", "Thread", "thread");
thread_module = prefs_register_protocol(proto_thread, proto_reg_handoff_thread);
thread_module = prefs_register_protocol(proto_thread, NULL);
prefs_register_obsolete_preference(thread_module, "thr_coap_decode");
prefs_register_string_preference(thread_module, "thr_seq_ctr",
"Thread sequence counter",

View File

@ -2607,7 +2607,7 @@ proto_register_tibia(void)
expert_module_t *expert_tibia = expert_register_protocol(proto_tibia);
expert_register_field_array (expert_tibia, ei, array_length (ei));
module_t *tibia_module = prefs_register_protocol(proto_tibia, proto_reg_handoff_tibia);
module_t *tibia_module = prefs_register_protocol(proto_tibia, NULL);
prefs_register_bool_preference(tibia_module, "try_otserv_key", "Try OTServ's RSA key",
"Try the default RSA key in use by nearly all Open Tibia servers", &try_otserv_key);

View File

@ -55,7 +55,6 @@ static dissector_handle_t osi_tp_handle;
static dissector_handle_t tpkt_handle;
#define DEFAULT_TPKT_PORT_RANGE "102"
static range_t *tpkt_tcp_port_range;
/*
* Check whether this could be a TPKT-encapsulated PDU.
@ -675,20 +674,13 @@ proto_register_tpkt(void)
proto_register_subtree_array(ett, array_length(ett));
tpkt_handle = register_dissector("tpkt", dissect_tpkt, proto_tpkt);
tpkt_module = prefs_register_protocol(proto_tpkt, proto_reg_handoff_tpkt);
tpkt_module = prefs_register_protocol(proto_tpkt, NULL);
prefs_register_bool_preference(tpkt_module, "desegment",
"Reassemble TPKT messages spanning multiple TCP segments",
"Whether the TPKT dissector should reassemble messages spanning multiple TCP segments. "
"To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
&tpkt_desegment);
range_convert_str(wmem_epan_scope(), &tpkt_tcp_port_range, DEFAULT_TPKT_PORT_RANGE, MAX_TCP_PORT);
prefs_register_range_preference(tpkt_module, "tcp.ports", "TPKT TCP ports",
"TCP ports to be decoded as TPKT (default: "
DEFAULT_TPKT_PORT_RANGE ")",
&tpkt_tcp_port_range, MAX_TCP_PORT);
/* heuristic dissectors for premable CredSSP before RDP and Fast-Path RDP packets */
tpkt_heur_subdissector_list = register_heur_dissector_list("tpkt", proto_tpkt);
@ -698,17 +690,9 @@ proto_register_tpkt(void)
void
proto_reg_handoff_tpkt(void)
{
static range_t *port_range = NULL;
osi_tp_handle = find_dissector("ositp");
dissector_add_uint_range_with_preference("tcp.port", TCP_PORT_TPKT_RANGE, tpkt_handle);
dissector_delete_uint_range("tcp.port", port_range, tpkt_handle);
wmem_free(wmem_epan_scope(), port_range);
port_range = range_copy(wmem_epan_scope(), tpkt_tcp_port_range);
dissector_add_uint_range("tcp.port", port_range, tpkt_handle);
/* ssl_dissector_add registers TLS as the dissector for TCP for the
* given port. We can't use it, since on port 3389 TPKT (for RDP) can be
* over TLS or directly over TCP, depending on the RDP security settings.

View File

@ -536,15 +536,16 @@ void proto_reg_handoff_uasip(void)
{
ua_sys_to_term_handle = find_dissector_add_dependency("ua_sys_to_term", proto_uasip);
ua_term_to_sys_handle = find_dissector_add_dependency("ua_term_to_sys", proto_uasip);
/* Enable decoding "Internet media type" as UASIP */
dissector_add_for_decode_as("media_type", uasip_handle);
prefs_initialized = TRUE;
}
use_proxy_ipaddr = FALSE;
memset(proxy_ipaddr, 0, sizeof(proxy_ipaddr));
/* Enable decoding "Internet media type" as UASIP */
dissector_add_for_decode_as("media_type", uasip_handle);
if (strcmp(pref_proxy_ipaddr_s, "") != 0) {
if (str_to_ip(pref_proxy_ipaddr_s, proxy_ipaddr)) {
use_proxy_ipaddr = TRUE;

View File

@ -5265,8 +5265,7 @@ proto_register_woww(void)
proto_register_field_array(proto_woww, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
prefs_register_protocol(proto_woww,
NULL);
prefs_register_protocol(proto_woww, NULL);
}

View File

@ -5254,6 +5254,8 @@ deprecated_port_pref(gchar *pref_name, const gchar *value)
{"rua.port", "rua", "sctp.port", 10},
/* SCTP PPI */
{"lapd.sctp_payload_protocol_identifier", "lapd", "sctp.ppi", 10},
/* SCCP SSN */
{"ranap.sccp_ssn", "ranap", "sccp.ssn", 10},
};
struct port_pref_name port_range_prefs[] = {
@ -5267,7 +5269,9 @@ deprecated_port_pref(gchar *pref_name, const gchar *value)
{"pdu_transport.ports.tcp", "pdu_transport", "tcp.port", 10},
{"rtsp.tcp.port_range", "rtsp", "tcp.port", 10},
{"sip.tcp.ports", "sip", "tcp.port", 10},
{"someip.ports.tcp", "someip", "tcp.port", 10},
{"tds.tcp_ports", "tds", "tcp.port", 10},
{"tpkt.tcp.ports", "tpkt", "tcp.port", 10},
{"uma.tcp.ports", "uma", "tcp.port", 10},
/* UDP */
{"aruba_erm.udp.ports", "arubs_erm", "udp.port", 10},
@ -5283,6 +5287,7 @@ deprecated_port_pref(gchar *pref_name, const gchar *value)
{"pdu_transport.ports.udp", "pdu_transport", "udp.port", 10},
{"radius.ports", "radius", "udp.port", 10},
{"sflow.ports", "sflow", "udp.port", 10},
{"someip.ports.udp", "someip", "udp.port", 10},
{"sscop.udp.ports", "sscop", "udp.port", 10},
{"tftp.udp_ports", "tftp", "udp.port", 10},
{"tipc.udp.ports", "tipc", "udp.port", 10},
@ -5308,6 +5313,8 @@ deprecated_port_pref(gchar *pref_name, const gchar *value)
/* SCTP */
{"diameter.sctp.ports", "diameter", "sctp.port", 10},
{"sgsap.sctp_ports", "sgsap", "sctp.port", 10},
/* SCCP SSN */
{"pcap.ssn", "pcap", "sccp.ssn", 10},
};
/* These are subdissectors of TPKT/OSITP that used to have a