Convert most UDP dissectors to use "auto" preferences.

Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67,
convert dissectors that use "udp.port".

More cleanup done on dissectors that use both TCP and UDP dissector
tables, so that less preference callbacks exist.

Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3
Reviewed-on: https://code.wireshark.org/review/18120
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Michael Mann 2016-10-05 16:33:54 -04:00
parent 4d8581d7e1
commit 2eb7b05b8c
297 changed files with 984 additions and 3218 deletions

View File

@ -191,7 +191,6 @@ static expert_field ei_c1222_epsem_field_length_error = EI_INIT;
static expert_field ei_c1222_mac_missing = EI_INIT;
/* Preferences */
static int global_c1222_port = C1222_PORT;
static gboolean c1222_desegment = TRUE;
#ifdef HAVE_LIBGCRYPT
static gboolean c1222_decrypt = TRUE;
@ -1419,7 +1418,7 @@ proto_reg_handoff_c1222(void)
c1222_handle = create_dissector_handle(dissect_c1222, proto_c1222);
c1222_udp_handle = create_dissector_handle(dissect_c1222_common, proto_c1222);
dissector_add_uint_with_preference("tcp.port", C1222_PORT, c1222_handle);
dissector_add_uint("udp.port", global_c1222_port, c1222_udp_handle);
dissector_add_uint_with_preference("udp.port", C1222_PORT, c1222_udp_handle);
initialized = TRUE;
}
if (c1222_baseoid_str && (c1222_baseoid_str[0] != '\0') &&

View File

@ -57,8 +57,7 @@
#define PSNAME "H.225.0"
#define PFNAME "h225"
#define UDP_PORT_RAS1 1718
#define UDP_PORT_RAS2 1719
#define UDP_PORT_RAS_RANGE "1718-1719"
#define TCP_PORT_CS 1720
#define TLS_PORT_CS 1300
@ -936,8 +935,7 @@ proto_reg_handoff_h225(void)
static guint saved_h225_tls_port;
if (!h225_prefs_initialized) {
dissector_add_uint("udp.port", UDP_PORT_RAS1, h225ras_handle);
dissector_add_uint("udp.port", UDP_PORT_RAS2, h225ras_handle);
dissector_add_uint_range_with_preference("udp.port", UDP_PORT_RAS_RANGE, h225ras_handle);
h245_handle = find_dissector("h245");
h245dg_handle = find_dissector("h245dg");

View File

@ -611,7 +611,7 @@ void proto_reg_handoff_h245(void) {
dissector_add_for_decode_as_with_preference("tcp.port", h245_handle);
dissector_add_for_decode_as("udp.port", MultimediaSystemControlMessage_handle);
dissector_add_for_decode_as_with_preference("udp.port", MultimediaSystemControlMessage_handle);
}
static void init_h245_packet_info(h245_packet_info *pi)

View File

@ -835,9 +835,8 @@ void gcp_analyze_msg(proto_tree* gcp_tree, packet_info* pinfo, tvbuff_t* gcp_tvb
/* END Gateway Control Protocol -- Context Tracking */
#define H248_PORT 2945
static gboolean keep_persistent_data = FALSE;
static guint global_udp_port = 2945;
#define H248_TCP_PORT 2945
static gboolean h248_desegment = TRUE;
@ -2373,16 +2372,11 @@ void proto_register_h248(void) {
subdissector_table = register_dissector_table("h248.magic_num", "H248 Magic Num", proto_h248, FT_UINT32, BASE_HEX);
h248_module = prefs_register_protocol(proto_h248, proto_reg_handoff_h248);
h248_module = prefs_register_protocol(proto_h248, NULL);
prefs_register_bool_preference(h248_module, "ctx_info",
"Track Context",
"Maintain relationships between transactions and contexts and display an extra tree showing context data",
&keep_persistent_data);
prefs_register_uint_preference(h248_module, "udp_port",
"UDP port",
"Port to be decoded as h248",
10,
&global_udp_port);
prefs_register_bool_preference(h248_module, "desegment",
"Desegment H.248 over TCP",
"Desegment H.248 messages that span more TCP segments",
@ -2399,24 +2393,10 @@ void proto_register_h248(void) {
/*--- proto_reg_handoff_h248 -------------------------------------------*/
void proto_reg_handoff_h248(void) {
static gboolean initialized = FALSE;
static guint32 udp_port;
if (!initialized) {
dissector_add_uint("mtp3.service_indicator", MTP_SI_GCP, h248_handle);
h248_term_handle = find_dissector_add_dependency("h248term", proto_h248);
dissector_add_uint_with_preference("tcp.port", H248_TCP_PORT, h248_tpkt_handle);
initialized = TRUE;
} else {
if (udp_port != 0)
dissector_delete_uint("udp.port", udp_port, h248_handle);
}
udp_port = global_udp_port;
if (udp_port != 0) {
dissector_add_uint("udp.port", udp_port, h248_handle);
}
dissector_add_uint("mtp3.service_indicator", MTP_SI_GCP, h248_handle);
h248_term_handle = find_dissector_add_dependency("h248term", proto_h248);
dissector_add_uint_with_preference("tcp.port", H248_PORT, h248_tpkt_handle);
dissector_add_uint_with_preference("udp.port", H248_PORT, h248_handle);
ss7pc_address_type = address_type_get_by_name("AT_SS7PC");
exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7);

View File

@ -99,7 +99,7 @@ void proto_register_h283(void) {
/*--- proto_reg_handoff_h283 -------------------------------------------*/
void proto_reg_handoff_h283(void)
{
dissector_add_for_decode_as("udp.port", h283_udp_handle);
dissector_add_for_decode_as_with_preference("udp.port", h283_udp_handle);
rdc_pdu_handle = find_dissector_add_dependency("rdc", proto_h283);
rdc_device_list_handle = find_dissector_add_dependency("rdc.device_list", proto_h283);

View File

@ -51,8 +51,7 @@ static int ett_h501 = -1;
static dissector_handle_t h501_pdu_handle;
/* Preferences */
#define H501_TCP_PORT 2099
static guint h501_udp_port = 2099;
#define H501_PORT 2099
static gboolean h501_desegment_tcp = TRUE;
void proto_reg_handoff_h501(void);
@ -111,11 +110,7 @@ void proto_register_h501(void) {
h501_pdu_handle = register_dissector(PFNAME, dissect_h501_pdu, proto_h501);
h501_module = prefs_register_protocol(proto_h501, proto_reg_handoff_h501);
prefs_register_uint_preference(h501_module, "udp.port",
"UDP port",
"Port to be decoded as h501",
10, &h501_udp_port);
h501_module = prefs_register_protocol(proto_h501, NULL);
prefs_register_bool_preference(h501_module, "desegment",
"Desegment H.501 over TCP",
"Desegment H.501 messages that span more TCP segments",
@ -126,23 +121,12 @@ void proto_register_h501(void) {
/*--- proto_reg_handoff_h501 -------------------------------------------*/
void proto_reg_handoff_h501(void)
{
static gboolean h501_prefs_initialized = FALSE;
static dissector_handle_t h501_udp_handle;
static dissector_handle_t h501_tcp_handle;
static guint saved_h501_udp_port;
if (!h501_prefs_initialized) {
h501_udp_handle = create_dissector_handle(dissect_h501_udp, proto_h501);
h501_tcp_handle = create_dissector_handle(dissect_h501_tcp, proto_h501);
dissector_add_uint_with_preference("tcp.port", H501_TCP_PORT, h501_tcp_handle);
h501_prefs_initialized = TRUE;
} else {
dissector_delete_uint("udp.port", saved_h501_udp_port, h501_udp_handle);
}
/* Set our port number for future use */
saved_h501_udp_port = h501_udp_port;
dissector_add_uint("udp.port", saved_h501_udp_port, h501_udp_handle);
dissector_handle_t h501_udp_handle;
dissector_handle_t h501_tcp_handle;
h501_udp_handle = create_dissector_handle(dissect_h501_udp, proto_h501);
h501_tcp_handle = create_dissector_handle(dissect_h501_tcp, proto_h501);
dissector_add_uint_with_preference("tcp.port", H501_PORT, h501_tcp_handle);
dissector_add_uint_with_preference("udp.port", H501_PORT, h501_udp_handle);
}

View File

@ -2338,7 +2338,7 @@ proto_reg_handoff_kerberos(void)
kerberos_handle_tcp = create_dissector_handle(dissect_kerberos_tcp,
proto_kerberos);
dissector_add_uint("udp.port", UDP_PORT_KERBEROS, kerberos_handle_udp);
dissector_add_uint_with_preference("udp.port", UDP_PORT_KERBEROS, kerberos_handle_udp);
dissector_add_uint_with_preference("tcp.port", TCP_PORT_KERBEROS, kerberos_handle_tcp);
register_dcerpc_auth_subdissector(DCE_C_AUTHN_LEVEL_CONNECT,

View File

@ -2246,7 +2246,7 @@ proto_reg_handoff_ldap(void)
dissector_handle_t cldap_handle;
cldap_handle = create_dissector_handle(dissect_mscldap, proto_cldap);
dissector_add_uint("udp.port", UDP_PORT_CLDAP, cldap_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_CLDAP, cldap_handle);
gssapi_handle = find_dissector_add_dependency("gssapi", proto_ldap);
gssapi_wrap_handle = find_dissector_add_dependency("gssapi_verf", proto_ldap);

View File

@ -4023,7 +4023,7 @@ proto_reg_handoff_lte_rrc(void)
static dissector_handle_t lte_rrc_dl_ccch_handle;
lte_rrc_dl_ccch_handle = find_dissector("lte_rrc.dl_ccch");
dissector_add_for_decode_as("udp.port", lte_rrc_dl_ccch_handle);
dissector_add_for_decode_as_with_preference("udp.port", lte_rrc_dl_ccch_handle);
nas_eps_handle = find_dissector("nas-eps");
rrc_irat_ho_to_utran_cmd_handle = find_dissector("rrc.irat.ho_to_utran_cmd");
rrc_sys_info_cont_handle = find_dissector("rrc.sysinfo.cont");

View File

@ -288,7 +288,7 @@ void proto_register_sabp(void) {
void
proto_reg_handoff_sabp(void)
{
dissector_add_uint("udp.port", SABP_PORT, sabp_handle);
dissector_add_uint_with_preference("udp.port", SABP_PORT, sabp_handle);
dissector_add_uint_with_preference("tcp.port", SABP_PORT, sabp_tcp_handle);
dissector_add_uint("sctp.ppi", SABP_PAYLOAD_PROTOCOL_ID, sabp_handle);

View File

@ -2579,9 +2579,7 @@ void proto_register_snmp(void) {
void proto_reg_handoff_snmp(void) {
dissector_handle_t snmp_tcp_handle;
dissector_add_uint("udp.port", UDP_PORT_SNMP, snmp_handle);
dissector_add_uint("udp.port", UDP_PORT_SNMP_TRAP, snmp_handle);
dissector_add_uint("udp.port", UDP_PORT_SNMP_PATROL, snmp_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_SNMP, snmp_handle);
dissector_add_uint("ethertype", ETHERTYPE_SNMP, snmp_handle);
dissector_add_uint("ipx.socket", IPX_SOCKET_SNMP_AGENT, snmp_handle);
dissector_add_uint("ipx.socket", IPX_SOCKET_SNMP_SINK, snmp_handle);
@ -2593,6 +2591,8 @@ void proto_reg_handoff_snmp(void) {
the "trap" port doesn't really need a separate preference. Just register
normally */
dissector_add_uint("tcp.port", TCP_PORT_SNMP_TRAP, snmp_tcp_handle);
dissector_add_uint("udp.port", UDP_PORT_SNMP_TRAP, snmp_handle);
dissector_add_uint("udp.port", UDP_PORT_SNMP_PATROL, snmp_handle);
data_handle = find_dissector("data");

View File

@ -739,7 +739,6 @@ proto_register_t38(void)
"be dissected as RTP packet or T.38 packet. If enabled there is a risk that T.38 UDPTL "
"packets with sequence number higher than 32767 may be dissected as RTP.",
&dissect_possible_rtpv2_packets_as_rtp);
prefs_register_obsolete_preference(t38_module, "udp.port");
prefs_register_bool_preference(t38_module, "reassembly",
"Reassemble T.38 PDUs over TPKT over TCP",
"Whether the dissector should reassemble T.38 PDUs spanning multiple TCP segments "

View File

@ -48,7 +48,7 @@ static int proto_tetra = -1;
static dissector_handle_t tetra_handle;
static int global_tetra_port = 7074;
#define TETRA_UDP_PORT 7074 /* Not IANA assigned */
/* Whether the capture data include carrier numbers */
static gboolean include_carrier_number = TRUE;
@ -546,13 +546,8 @@ dissect_tetra(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U
void proto_reg_handoff_tetra(void)
{
static gboolean initialized=FALSE;
if (!initialized) {
tetra_handle = create_dissector_handle(dissect_tetra, proto_tetra);
dissector_add_uint("udp.port", global_tetra_port, tetra_handle);
}
tetra_handle = create_dissector_handle(dissect_tetra, proto_tetra);
dissector_add_uint_with_preference("udp.port", TETRA_UDP_PORT, tetra_handle);
}

View File

@ -52,7 +52,6 @@ static dissector_handle_t lpp_handle;
* oma-ulp 7275/udp OMA UserPlane Location
*/
#define ULP_PORT 7275
static guint gbl_ulp_udp_port = ULP_PORT;
/* Initialize the protocol and registered fields */
static int proto_ulp = -1;
@ -419,21 +418,13 @@ void proto_register_ulp(void) {
proto_register_field_array(proto_ulp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
ulp_module = prefs_register_protocol(proto_ulp,proto_reg_handoff_ulp);
ulp_module = prefs_register_protocol(proto_ulp, NULL);
prefs_register_bool_preference(ulp_module, "desegment_ulp_messages",
"Reassemble ULP messages spanning multiple TCP segments",
"Whether the ULP 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.",
&ulp_desegment);
/* Register a configuration option for port */
prefs_register_uint_preference(ulp_module, "udp.port",
"ULP UDP Port",
"Set the UDP port for ULP messages (IANA registered port is 7275)",
10,
&gbl_ulp_udp_port);
}
@ -441,23 +432,15 @@ void proto_register_ulp(void) {
void
proto_reg_handoff_ulp(void)
{
static gboolean initialized = FALSE;
static dissector_handle_t ulp_udp_handle;
static guint local_ulp_udp_port;
dissector_handle_t ulp_udp_handle;
if (!initialized) {
dissector_add_string("media_type","application/oma-supl-ulp", ulp_tcp_handle);
dissector_add_string("media_type","application/vnd.omaloc-supl-init", ulp_tcp_handle);
ulp_udp_handle = create_dissector_handle(dissect_ULP_PDU_PDU, proto_ulp);
rrlp_handle = find_dissector_add_dependency("rrlp", proto_ulp);
lpp_handle = find_dissector_add_dependency("lpp", proto_ulp);
dissector_add_uint_with_preference("tcp.port", ULP_PORT, ulp_tcp_handle);
initialized = TRUE;
} else {
dissector_delete_uint("udp.port", local_ulp_udp_port, ulp_udp_handle);
}
local_ulp_udp_port = gbl_ulp_udp_port;
dissector_add_uint("udp.port", gbl_ulp_udp_port, ulp_udp_handle);
dissector_add_uint_with_preference("tcp.port", ULP_PORT, ulp_tcp_handle);
dissector_add_uint_with_preference("udp.port", ULP_PORT, ulp_udp_handle);
}

View File

@ -97,6 +97,7 @@ static int hf_njack_getresp_unknown1 = -1;
#define PROTO_SHORT_NAME "NJACK"
#define PROTO_LONG_NAME "3com Network Jack"
#define NJACK_PORT_RANGE "5264-5265"
#define PORT_NJACK_PC 5264
#define PORT_NJACK_SWITCH 5265
@ -784,9 +785,8 @@ proto_reg_handoff_njack(void)
dissector_handle_t njack_handle;
njack_handle = create_dissector_handle(dissect_njack_static, proto_njack);
dissector_add_uint("udp.port", PORT_NJACK_PC, njack_handle);
dissector_add_uint_range_with_preference("udp.port", NJACK_PORT_RANGE, njack_handle);
/* dissector_add_uint_with_preference("tcp.port", PORT_NJACK_PC, njack_handle); */
dissector_add_uint("udp.port", PORT_NJACK_SWITCH, njack_handle);
/* dissector_add_uint_with_preference("tcp.port", PORT_NJACK_SWITCH, njack_handle); */
heur_dissector_add("udp", dissect_njack_heur, "NJACK over UDP", "njack_udp", proto_njack, HEURISTIC_ENABLE);

View File

@ -224,7 +224,7 @@ static expert_field ei_a11_entry_data_not_dissected = EI_INIT;
static expert_field ei_a11_session_data_not_dissected = EI_INIT;
/* Port used for Mobile IP based Tunneling Protocol (A11) */
#define UDP_PORT_3GA11 699
#define UDP_PORT_3GA11 699 /* Not IANA registered */
typedef enum {
REGISTRATION_REQUEST = 1,
@ -2739,7 +2739,7 @@ proto_reg_handoff_a11(void)
dissector_handle_t a11_handle;
a11_handle = find_dissector("a11");
dissector_add_uint("udp.port", UDP_PORT_3GA11, a11_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_3GA11, a11_handle);
/* 3GPP2-Service-Option-Profile(74) */
radius_register_avp_dissector(VENDOR_THE3GPP2, 74, dissect_3gpp2_service_option_profile);

View File

@ -27,7 +27,6 @@
#include "config.h"
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/expert.h>
#include "packet-e212.h"
@ -36,11 +35,7 @@
void proto_register_a21(void);
void proto_reg_handoff_a21(void);
/* Preferences */
#define A21_PORT 23272
/* Default the port to zero */
static guint a21_udp_port = 0;
static dissector_handle_t gcsna_handle = NULL;
static int proto_a21 = -1;
@ -931,7 +926,6 @@ void proto_register_a21(void)
&ett_a21_record_content
};
module_t *a21_module;
expert_module_t *expert_a21;
static ei_register_info ei[] = {
@ -945,37 +939,15 @@ void proto_register_a21(void)
proto_register_subtree_array(ett_a21_array, array_length(ett_a21_array));
expert_a21 = expert_register_protocol(proto_a21);
expert_register_field_array(expert_a21, ei, array_length(ei));
a21_module = prefs_register_protocol(proto_a21, proto_reg_handoff_a21);
prefs_register_uint_preference(a21_module, "udp.port",
"A21 UDP Port",
"UDP port used by A21, usually 23272",
10, &a21_udp_port);
}
void proto_reg_handoff_a21(void)
{
static dissector_handle_t a21_handle;
static gboolean a21_prefs_initialized = FALSE;
static guint saved_a21_udp_port;
if (!a21_prefs_initialized) {
a21_handle = create_dissector_handle(dissect_a21, proto_a21);
gcsna_handle = find_dissector_add_dependency("gcsna", proto_a21);
dissector_add_uint("udp.port", a21_udp_port, a21_handle);
a21_prefs_initialized = TRUE;
} else {
dissector_delete_uint("udp.port", saved_a21_udp_port, a21_handle);
}
saved_a21_udp_port = a21_udp_port;
if (a21_udp_port != 0) {
dissector_add_uint("udp.port", a21_udp_port, a21_handle);
}
dissector_handle_t a21_handle;
a21_handle = create_dissector_handle(dissect_a21, proto_a21);
gcsna_handle = find_dissector_add_dependency("gcsna", proto_a21);
dissector_add_uint_with_preference("udp.port", A21_PORT, a21_handle);
}
/*

View File

@ -3266,7 +3266,7 @@ proto_reg_handoff_acn(void)
{
/* dissector_handle_t acn_handle; */
/* acn_handle = create_dissector_handle(dissect_acn, proto_acn); */
/* dissector_add_for_decode_as("udp.port", acn_handle); */
/* dissector_add_for_decode_as_with_preference("udp.port", acn_handle); */
heur_dissector_add("udp", dissect_acn_heur, "ACN over UDP", "acn_udp", proto_acn, HEURISTIC_DISABLE);
}

View File

@ -28,7 +28,7 @@
#include <epan/prefs.h>
#include <epan/tap.h>
#include "packet-actrace.h"
#define UDP_PORT_ACTRACE 2428
#define UDP_PORT_ACTRACE 2428 /* Not IANA registered */
#define NOT_ACTRACE 0
#define ACTRACE_CAS 1
@ -426,12 +426,6 @@ static int ett_actrace = -1;
static int actrace_tap = -1;
static actrace_info_t *actrace_pi;
/*
* Here are the global variables associated with
* the user definable characteristics of the dissection
*/
static guint global_actrace_udp_port = UDP_PORT_ACTRACE;
/* Some basic utility functions that are specific to this dissector */
static int is_actrace(tvbuff_t *tvb, gint offset);
@ -794,13 +788,7 @@ void proto_register_actrace(void)
proto_register_subtree_array(ett, array_length(ett));
/* Register our configuration options */
actrace_module = prefs_register_protocol(proto_actrace, proto_reg_handoff_actrace);
prefs_register_uint_preference(actrace_module, "udp_port",
"AudioCodes Trunk Trace UDP port",
"Set the UDP port for AudioCodes Trunk Traces."
"Use http://x.x.x.x/TrunkTraces to enable the traces in the Blade",
10, &global_actrace_udp_port);
actrace_module = prefs_register_protocol(proto_actrace, NULL);
prefs_register_obsolete_preference(actrace_module, "display_dissect_tree");
@ -810,26 +798,13 @@ void proto_register_actrace(void)
/* The registration hand-off routine */
void proto_reg_handoff_actrace(void)
{
static gboolean actrace_prefs_initialized = FALSE;
static dissector_handle_t actrace_handle;
static guint actrace_udp_port;
dissector_handle_t actrace_handle;
if (!actrace_prefs_initialized)
{
actrace_handle = create_dissector_handle(dissect_actrace, proto_actrace);
/* Get a handle for the lapd dissector. */
lapd_handle = find_dissector_add_dependency("lapd", proto_actrace);
actrace_prefs_initialized = TRUE;
}
else
{
dissector_delete_uint("udp.port", actrace_udp_port, actrace_handle);
}
/* Get a handle for the lapd dissector. */
lapd_handle = find_dissector_add_dependency("lapd", proto_actrace);
/* Set our port number for future use */
actrace_udp_port = global_actrace_udp_port;
dissector_add_uint("udp.port", global_actrace_udp_port, actrace_handle);
actrace_handle = create_dissector_handle(dissect_actrace, proto_actrace);
dissector_add_uint_with_preference("udp.port", UDP_PORT_ACTRACE, actrace_handle);
}
/*

View File

@ -30,8 +30,7 @@
void proto_reg_handoff_adwin(void);
void proto_register_adwin(void);
/* This is registered to a different protocol */
#define ADWIN_COMM_PORT 6543
#define ADWIN_COMM_PORT 6543 /* Not IANA registered */
/* lengths of valid packet structures */
#define UDPH1_OLD_LENGTH 52
@ -442,7 +441,6 @@ static value_string_ext packet_type_mapping_ext = VALUE_STRING_EXT_INIT(packet_t
/* Initialize the protocol and registered fields */
static int proto_adwin = -1;
static unsigned int global_adwin_udp_port = ADWIN_COMM_PORT;
static int global_adwin_dissect_data = 1;
static int hf_adwin_address = -1;
@ -1162,19 +1160,10 @@ dissect_adwin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
void
proto_reg_handoff_adwin(void)
{
static int adwin_prefs_initialized = FALSE;
static dissector_handle_t adwin_handle;
static unsigned int udp_port;
dissector_handle_t adwin_handle;
if (! adwin_prefs_initialized) {
adwin_handle = create_dissector_handle(dissect_adwin, proto_adwin);
adwin_prefs_initialized = TRUE;
} else {
dissector_delete_uint("udp.port", udp_port, adwin_handle);
}
udp_port = global_adwin_udp_port;
dissector_add_uint("udp.port", global_adwin_udp_port, adwin_handle);
adwin_handle = create_dissector_handle(dissect_adwin, proto_adwin);
dissector_add_uint_with_preference("udp.port", ADWIN_COMM_PORT, adwin_handle);
}
void
@ -1439,14 +1428,8 @@ proto_register_adwin(void)
proto_register_field_array(proto_adwin, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
/* Register our configuration options for ADwin, particularly
our port */
adwin_module = prefs_register_protocol(proto_adwin, proto_reg_handoff_adwin);
prefs_register_uint_preference(adwin_module, "udp.port", "ADwin UDP Port",
"Set the UDP port for ADwin packets (if other"
" than the default of 6543)",
10, &global_adwin_udp_port);
/* Register our configuration options for ADwin */
adwin_module = prefs_register_protocol(proto_adwin, NULL);
prefs_register_bool_preference(adwin_module, "dissect_data",
"Dissect Data sections",

View File

@ -3132,7 +3132,7 @@ void proto_register_aeron(void)
void proto_reg_handoff_aeron(void)
{
aeron_dissector_handle = create_dissector_handle(dissect_aeron, proto_aeron);
dissector_add_for_decode_as("udp.port", aeron_dissector_handle);
dissector_add_for_decode_as_with_preference("udp.port", aeron_dissector_handle);
heur_dissector_add("udp", test_aeron_packet, "Aeron over UDP", "aeron_udp", proto_aeron, HEURISTIC_DISABLE);
}

View File

@ -3027,23 +3027,19 @@ proto_register_AllJoyn(void)
void
proto_reg_handoff_AllJoyn(void)
{
static gboolean initialized = FALSE;
static dissector_handle_t alljoyn_handle_ns;
static dissector_handle_t alljoyn_handle_ardp;
dissector_handle_t alljoyn_handle_ns;
dissector_handle_t alljoyn_handle_ardp;
if(!initialized) {
alljoyn_handle_ns = create_dissector_handle(dissect_AllJoyn_name_server, proto_AllJoyn_ns);
alljoyn_handle_ardp = create_dissector_handle(dissect_AllJoyn_ardp, proto_AllJoyn_ardp);
dissector_add_uint_with_preference("tcp.port", ALLJOYN_NAME_SERVER_PORT, alljoyn_handle_ns);
dissector_add_uint_with_preference("tcp.port", ALLJOYN_MESSAGE_PORT, alljoyn_handle_ardp);
initialized = TRUE;
}
alljoyn_handle_ns = create_dissector_handle(dissect_AllJoyn_name_server, proto_AllJoyn_ns);
alljoyn_handle_ardp = create_dissector_handle(dissect_AllJoyn_ardp, proto_AllJoyn_ardp);
dissector_add_uint_with_preference("tcp.port", ALLJOYN_NAME_SERVER_PORT, alljoyn_handle_ns);
dissector_add_uint_with_preference("tcp.port", ALLJOYN_MESSAGE_PORT, alljoyn_handle_ardp);
dissector_add_uint("udp.port", ALLJOYN_NAME_SERVER_PORT, alljoyn_handle_ns);
dissector_add_uint_with_preference("udp.port", ALLJOYN_NAME_SERVER_PORT, alljoyn_handle_ns);
/* The ARDP dissector will directly call the AllJoyn message dissector if needed.
* This includes the case where there is no ARDP data. */
dissector_add_uint("udp.port", ALLJOYN_MESSAGE_PORT, alljoyn_handle_ardp);
dissector_add_uint_with_preference("udp.port", ALLJOYN_MESSAGE_PORT, alljoyn_handle_ardp);
}
/*

View File

@ -850,7 +850,7 @@ proto_reg_handoff_amr(void)
create_dissector_handle(ftr->content_pdu, proto_amr));
}
/* Activate the next line for testing with the randpkt tool
dissector_add_uint("udp.port", 55555, amr_handle);
dissector_add_uint_with_preference("udp.port", 55555, amr_handle);
*/
amr_prefs_initialized = TRUE;
} else {

View File

@ -927,7 +927,7 @@ proto_reg_handoff_aodv(void)
aodv_handle = create_dissector_handle(dissect_aodv,
proto_aodv);
dissector_add_uint("udp.port", UDP_PORT_AODV, aodv_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_AODV, aodv_handle);
}
/*

View File

@ -27,14 +27,11 @@
#include "config.h"
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/expert.h>
void proto_register_ar_drone(void);
void proto_reg_handoff_ar_drone(void);
static guint ar_drone_port = 0;
/* ************************************************ */
/* Begin static variable declaration/initialization */
/* ************************************************ */
@ -761,59 +758,27 @@ proto_register_ar_drone(void)
{ &ei_NO_CR, { "ar_drone.no_cr", PI_MALFORMED, PI_ERROR, "Carriage return delimiter (0x0d) not found", EXPFILL }},
};
module_t *drone_module;
expert_module_t* expert_drone;
/* Setup protocol info */
proto_ar_drone = proto_register_protocol (
"AR Drone Packet", /* name */
"AR Drone", /* short name */
"ar_drone" /* abbrev */
);
proto_ar_drone = proto_register_protocol("AR Drone Packet", "AR Drone", "ar_drone");
proto_register_field_array(proto_ar_drone, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_drone = expert_register_protocol(proto_ar_drone);
expert_register_field_array(expert_drone, ei, array_length(ei));
drone_module = prefs_register_protocol(proto_ar_drone, NULL);
prefs_register_uint_preference(drone_module, "udp.port",
"AR Drone UDP Port",
"AR Drone UDP port",
10,
&ar_drone_port);
}
void
proto_reg_handoff_ar_drone(void)
{
static dissector_handle_t ar_drone_handle;
static guint old_port = 0;
static gboolean initialized = FALSE;
dissector_handle_t ar_drone_handle;
if (initialized == FALSE)
{
ar_drone_handle = create_dissector_handle(dissect_ar_drone, proto_ar_drone);
ar_drone_handle = create_dissector_handle(dissect_ar_drone, proto_ar_drone);
heur_dissector_add("udp", dissect_ar_drone, "AR Drone over UDP", "ar_drone_udp", proto_ar_drone, HEURISTIC_ENABLE);
initialized = TRUE;
}
/* Register UDP port for dissection */
if (old_port != 0 && old_port != ar_drone_port)
{
dissector_delete_uint("udp.port", old_port, ar_drone_handle);
}
if (ar_drone_port != 0 && old_port != ar_drone_port)
{
dissector_add_uint("udp.port", ar_drone_port, ar_drone_handle);
}
old_port = ar_drone_port;
heur_dissector_add("udp", dissect_ar_drone, "AR Drone over UDP", "ar_drone_udp", proto_ar_drone, HEURISTIC_ENABLE);
dissector_add_for_decode_as_with_preference("udp.port", ar_drone_handle);
}
/*

View File

@ -40,8 +40,7 @@ static int hf_armagetronad_msg_subtree = -1;
static gint ett_armagetronad = -1;
static gint ett_message = -1;
#define UDP_PORT_ARMAGETRONAD 4534
#define UDP_PORT_MASTER 4533
#define ARMAGETRONAD_UDP_PORT_RANGE "4533-4534" /* 4533 is not IANA registered, 4534 is */
/*
* The ACK packet is so common that we treat it
@ -322,8 +321,7 @@ void proto_reg_handoff_armagetronad(void)
armagetronad_handle = find_dissector("armagetronad");
dissector_add_uint("udp.port", UDP_PORT_ARMAGETRONAD, armagetronad_handle);
dissector_add_uint("udp.port", UDP_PORT_MASTER, armagetronad_handle);
dissector_add_uint_range_with_preference("udp.port", ARMAGETRONAD_UDP_PORT_RANGE, armagetronad_handle);
}
/*

View File

@ -5368,7 +5368,7 @@ proto_reg_handoff_artnet(void) {
dissector_handle_t artnet_handle;
artnet_handle = create_dissector_handle(dissect_artnet, proto_artnet);
dissector_add_for_decode_as("udp.port", artnet_handle);
dissector_add_for_decode_as_with_preference("udp.port", artnet_handle);
rdm_handle = find_dissector_add_dependency("rdm", proto_artnet);
dmx_chan_handle = find_dissector_add_dependency("dmx-chan", proto_artnet);

View File

@ -27,7 +27,7 @@
#include <epan/packet.h>
#include <epan/addr_resolv.h>
#define UDP_PORT_ADP 8200
#define UDP_PORT_ADP 8200 /* Not IANA registered */
#define ADP_REQUEST 1
#define ADP_RESPONSE 2
@ -148,7 +148,7 @@ proto_reg_handoff_aruba_adp(void)
dissector_handle_t adp_handle;
adp_handle = create_dissector_handle(dissect_aruba_adp, proto_aruba_adp);
dissector_add_uint("udp.port", UDP_PORT_ADP, adp_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_ADP, adp_handle);
}
/*

View File

@ -122,7 +122,6 @@ void proto_register_aruba_erm(void);
void proto_reg_handoff_aruba_erm(void);
void proto_reg_handoff_aruba_erm_radio(void);
static range_t *global_aruba_erm_port_range;
#if 0
static gint aruba_erm_type = 0;
#endif
@ -435,15 +434,8 @@ proto_register_aruba_erm(void)
proto_aruba_erm_type4 = proto_register_protocol("Aruba Networks encapsulated remote mirroring - PPI (Type 4)", "ARUBA ERM PPI (Type 4)", "aruba_erm_type4");
proto_aruba_erm_type5 = proto_register_protocol("Aruba Networks encapsulated remote mirroring - PEEK (Type 5)", "ARUBA ERM PEEK-NG (type 5)", "aruba_erm_type5");
range_convert_str (&global_aruba_erm_port_range, "0", MAX_UDP_PORT);
aruba_erm_module = prefs_register_protocol(proto_aruba_erm, NULL);
aruba_erm_module = prefs_register_protocol(proto_aruba_erm, proto_reg_handoff_aruba_erm);
prefs_register_range_preference(aruba_erm_module, "udp.ports", "ARUBA_ERM UDP Port numbers",
"Set the UDP port numbers (typically the range 5555 to 5560) used for Aruba Networks"
" encapsulated remote mirroring frames;\n"
"0 (default) means that the ARUBA_ERM dissector is not active\n",
&global_aruba_erm_port_range, MAX_UDP_PORT);
#if 0
/* Obso...*/
prefs_register_enum_preference(aruba_erm_module, "type.captured",
@ -470,32 +462,19 @@ proto_register_aruba_erm(void)
void
proto_reg_handoff_aruba_erm(void)
{
static range_t *aruba_erm_port_range;
static range_t *aruba_erm_radio_port_range;
static gboolean initialized = FALSE;
wlan_radio_handle = find_dissector_add_dependency("wlan_radio", proto_aruba_erm);
wlan_withfcs_handle = find_dissector_add_dependency("wlan_withfcs", proto_aruba_erm);
ppi_handle = find_dissector_add_dependency("ppi", proto_aruba_erm);
peek_handle = find_dissector_add_dependency("peekremote", proto_aruba_erm);
aruba_erm_handle = create_dissector_handle(dissect_aruba_erm, proto_aruba_erm);
aruba_erm_handle_type0 = create_dissector_handle(dissect_aruba_erm_type0, proto_aruba_erm_type0);
aruba_erm_handle_type1 = create_dissector_handle(dissect_aruba_erm_type1, proto_aruba_erm_type1);
aruba_erm_handle_type2 = create_dissector_handle(dissect_aruba_erm_type2, proto_aruba_erm_type2);
aruba_erm_handle_type3 = create_dissector_handle(dissect_aruba_erm_type3, proto_aruba_erm_type3);
aruba_erm_handle_type4 = create_dissector_handle(dissect_aruba_erm_type4, proto_aruba_erm_type4);
aruba_erm_handle_type5 = create_dissector_handle(dissect_aruba_erm_type5, proto_aruba_erm_type5);
if (!initialized) {
wlan_radio_handle = find_dissector_add_dependency("wlan_radio", proto_aruba_erm);
wlan_withfcs_handle = find_dissector_add_dependency("wlan_withfcs", proto_aruba_erm);
ppi_handle = find_dissector_add_dependency("ppi", proto_aruba_erm);
peek_handle = find_dissector_add_dependency("peekremote", proto_aruba_erm);
aruba_erm_handle = create_dissector_handle(dissect_aruba_erm, proto_aruba_erm);
aruba_erm_handle_type0 = create_dissector_handle(dissect_aruba_erm_type0, proto_aruba_erm_type0);
aruba_erm_handle_type1 = create_dissector_handle(dissect_aruba_erm_type1, proto_aruba_erm_type1);
aruba_erm_handle_type2 = create_dissector_handle(dissect_aruba_erm_type2, proto_aruba_erm_type2);
aruba_erm_handle_type3 = create_dissector_handle(dissect_aruba_erm_type3, proto_aruba_erm_type3);
aruba_erm_handle_type4 = create_dissector_handle(dissect_aruba_erm_type4, proto_aruba_erm_type4);
aruba_erm_handle_type5 = create_dissector_handle(dissect_aruba_erm_type5, proto_aruba_erm_type5);
initialized = TRUE;
} else {
dissector_delete_uint_range("udp.port", aruba_erm_port_range, aruba_erm_handle);
g_free(aruba_erm_port_range);
g_free(aruba_erm_radio_port_range);
}
aruba_erm_port_range = range_copy(global_aruba_erm_port_range);
dissector_add_uint_range("udp.port", aruba_erm_port_range, aruba_erm_handle);
dissector_add_uint_range_with_preference("udp.port", "", aruba_erm_handle);
dissector_add_for_decode_as("aruba_erm.type", aruba_erm_handle_type0);
dissector_add_for_decode_as("aruba_erm.type", aruba_erm_handle_type1);
dissector_add_for_decode_as("aruba_erm.type", aruba_erm_handle_type2);

View File

@ -662,7 +662,7 @@ proto_reg_handoff_papi(void)
dissector_handle_t papi_handle;
papi_handle = create_dissector_handle(dissect_papi, proto_papi);
dissector_add_uint("udp.port", UDP_PORT_PAPI, papi_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_PAPI, papi_handle);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html

View File

@ -923,7 +923,7 @@ proto_reg_handoff_asap(void)
asap_handle = create_dissector_handle(dissect_asap, proto_asap);
dissector_add_uint("sctp.ppi", ASAP_PAYLOAD_PROTOCOL_ID, asap_handle);
dissector_add_uint("udp.port", ASAP_UDP_PORT, asap_handle);
dissector_add_uint_with_preference("udp.port", ASAP_UDP_PORT, asap_handle);
dissector_add_uint_with_preference("tcp.port", ASAP_TCP_PORT, asap_handle);
dissector_add_uint("sctp.port", ASAP_SCTP_PORT, asap_handle);
}

View File

@ -11431,7 +11431,7 @@ void proto_register_asterix (void)
void proto_reg_handoff_asterix (void)
{
dissector_add_uint ("udp.port", ASTERIX_PORT, asterix_handle);
dissector_add_uint_with_preference("udp.port", ASTERIX_PORT, asterix_handle);
}
/*

View File

@ -2058,7 +2058,7 @@ proto_reg_handoff_atalk(void)
nbp_handle = create_dissector_handle(dissect_nbp, proto_nbp);
dissector_add_uint("ddp.type", DDP_NBP, nbp_handle);
dissector_add_for_decode_as("udp.port", nbp_handle);
dissector_add_for_decode_as_with_preference("udp.port", nbp_handle);
atp_handle = create_dissector_handle(dissect_atp, proto_atp);
dissector_add_uint("ddp.type", DDP_ATP, atp_handle);

View File

@ -48,7 +48,7 @@ void proto_reg_handoff_ath(void);
*
*/
#define ATH_PORT 45564
#define ATH_PORT 45564 /* Not IANA registered */
static int proto_ath = -1;
@ -438,10 +438,10 @@ proto_register_ath(void)
void
proto_reg_handoff_ath(void)
{
static dissector_handle_t ath_handle;
dissector_handle_t ath_handle;
ath_handle = create_dissector_handle(dissect_ath, proto_ath);
dissector_add_uint("udp.port", ATH_PORT, ath_handle);
dissector_add_uint_with_preference("udp.port", ATH_PORT, ath_handle);
}
/*

View File

@ -284,12 +284,9 @@ void proto_register_auto_rp(void)
&ett_auto_rp_group
};
proto_auto_rp = proto_register_protocol("Cisco Auto-RP",
"Auto-RP", "auto_rp");
proto_auto_rp = proto_register_protocol("Cisco Auto-RP", "Auto-RP", "auto_rp");
proto_register_field_array(proto_auto_rp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
return;
}
void
@ -297,9 +294,8 @@ proto_reg_handoff_auto_rp(void)
{
dissector_handle_t auto_rp_handle;
auto_rp_handle = create_dissector_handle(dissect_auto_rp,
proto_auto_rp);
dissector_add_uint("udp.port", UDP_PORT_PIM_RP_DISC, auto_rp_handle);
auto_rp_handle = create_dissector_handle(dissect_auto_rp, proto_auto_rp);
dissector_add_uint_with_preference("udp.port", UDP_PORT_PIM_RP_DISC, auto_rp_handle);
}
/*

View File

@ -163,11 +163,11 @@ proto_reg_handoff_ax4000(void)
{
dissector_handle_t ax4000_handle;
ax4000_handle = create_dissector_handle(dissect_ax4000,
proto_ax4000);
ax4000_handle = create_dissector_handle(dissect_ax4000, proto_ax4000);
dissector_add_uint("ip.proto", IP_PROTO_AX4000, ax4000_handle);
dissector_add_uint_with_preference("tcp.port", AX4000_TCP_PORT, ax4000_handle);
dissector_add_uint("udp.port", AX4000_UDP_PORT, ax4000_handle);
dissector_add_uint_with_preference("udp.port", AX4000_UDP_PORT, ax4000_handle);
}
/*

View File

@ -208,7 +208,7 @@ proto_reg_handoff_ayiya(void)
dissector_handle_t ayiya_handle;
ayiya_handle = find_dissector("ayiya");
dissector_add_uint("udp.port", UDP_PORT_AYIYA, ayiya_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_AYIYA, ayiya_handle);
ip_dissector_table = find_dissector_table("ip.proto");
}

View File

@ -54,8 +54,7 @@ static int hf_babel_message_hopcount = -1;
static gint ett_subtree = -1;
#define UDP_PORT_BABEL 6696
#define UDP_PORT_BABEL_OLD 6697
#define UDP_PORT_RANGE_BABEL "6696-6697" /* 6697 Not IANA registered, 6696 is */
#define MESSAGE_PAD1 0
#define MESSAGE_PADN 1
@ -527,8 +526,7 @@ proto_reg_handoff_babel(void)
dissector_handle_t babel_handle;
babel_handle = create_dissector_handle(dissect_babel, proto_babel);
dissector_add_uint("udp.port", UDP_PORT_BABEL, babel_handle);
dissector_add_uint("udp.port", UDP_PORT_BABEL_OLD, babel_handle);
dissector_add_uint_range_with_preference("udp.port", UDP_PORT_RANGE_BABEL, babel_handle);
}
/*

View File

@ -24,16 +24,14 @@
#include "config.h"
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/tap.h>
#include <epan/addr_resolv.h>
void proto_register_bat(void);
void proto_reg_handoff_bat(void);
/* Start content from packet-bat.h */
#define BAT_BATMAN_PORT 4305
#define BAT_GW_PORT 4306
#define BAT_VIS_PORT 4307
#define BAT_GW_PORT 4306 /* Not IANA registered */
#define BAT_VIS_PORT 4307 /* Not IANA registered */
#define UNIDIRECTIONAL 0x80
#define DIRECTLINK 0x40
@ -179,13 +177,6 @@ static int proto_bat_vis = -1;
static int bat_tap = -1;
static int bat_follow_tap = -1;
/* values changed by preferences */
static guint global_bat_batman_udp_port = BAT_BATMAN_PORT;
static guint global_bat_gw_udp_port = BAT_GW_PORT;
static guint global_bat_vis_udp_port = BAT_VIS_PORT;
static int dissect_bat_batman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 version;
@ -690,8 +681,6 @@ static void dissect_vis_entry_v23(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
void proto_register_bat(void)
{
module_t *bat_module;
static hf_register_info hf[] = {
{ &hf_bat_batman_version,
{ "Version", "bat.batman.version",
@ -850,59 +839,28 @@ void proto_register_bat(void)
proto_bat_gw = proto_register_protocol("B.A.T.M.A.N. GW", "BAT GW", "bat.gw");
proto_bat_vis = proto_register_protocol("B.A.T.M.A.N. Vis", "BAT VIS", "bat.vis");
/* Register our configuration options for B.A.T.M.A.N. */
bat_module = prefs_register_protocol(proto_bat_plugin, proto_reg_handoff_bat);
proto_register_field_array(proto_bat_plugin, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
prefs_register_uint_preference(bat_module, "batman.bat.port", "BAT UDP Port",
"Set the port for B.A.T.M.A.N. BAT "
"messages (if other than the default of 4305)",
10, &global_bat_batman_udp_port);
prefs_register_uint_preference(bat_module, "batman.gw.port", "GW UDP Port",
"Set the port for B.A.T.M.A.N. Gateway "
"messages (if other than the default of 4306)",
10, &global_bat_gw_udp_port);
prefs_register_uint_preference(bat_module, "batman.vis.port", "VIS UDP Port",
"Set the port for B.A.T.M.A.N. VIS "
"messages (if other than the default of 4307)",
10, &global_bat_vis_udp_port);
}
void proto_reg_handoff_bat(void)
{
static gboolean inited = FALSE;
static dissector_handle_t batman_handle;
static dissector_handle_t gw_handle;
static dissector_handle_t vis_handle;
static guint batman_udp_port;
static guint gw_udp_port;
static guint vis_udp_port;
dissector_handle_t batman_handle;
dissector_handle_t gw_handle;
dissector_handle_t vis_handle;
if (!inited) {
bat_tap = register_tap("batman");
bat_follow_tap = register_tap("batman_follow");
bat_tap = register_tap("batman");
bat_follow_tap = register_tap("batman_follow");
batman_handle = create_dissector_handle(dissect_bat_batman, proto_bat_plugin);
gw_handle = create_dissector_handle(dissect_bat_gw, proto_bat_gw);
vis_handle = create_dissector_handle(dissect_bat_vis, proto_bat_vis);
batman_handle = create_dissector_handle(dissect_bat_batman, proto_bat_plugin);
gw_handle = create_dissector_handle(dissect_bat_gw, proto_bat_gw);
vis_handle = create_dissector_handle(dissect_bat_vis, proto_bat_vis);
ip_handle = find_dissector_add_dependency("ip", proto_bat_gw);
ip_handle = find_dissector_add_dependency("ip", proto_bat_gw);
inited = TRUE;
} else {
dissector_delete_uint("udp.port", batman_udp_port, batman_handle);
dissector_delete_uint("udp.port", gw_udp_port, gw_handle);
dissector_delete_uint("udp.port", vis_udp_port, vis_handle);
}
batman_udp_port = global_bat_batman_udp_port;
gw_udp_port = global_bat_gw_udp_port;
vis_udp_port = global_bat_vis_udp_port;
dissector_add_uint("udp.port", batman_udp_port, batman_handle);
dissector_add_uint("udp.port", gw_udp_port, gw_handle);
dissector_add_uint("udp.port", vis_udp_port, vis_handle);
dissector_add_uint_with_preference("udp.port", BAT_BATMAN_PORT, batman_handle);
dissector_add_uint_with_preference("udp.port", BAT_GW_PORT, gw_handle);
dissector_add_uint_with_preference("udp.port", BAT_VIS_PORT, vis_handle);
}
/*

View File

@ -713,7 +713,7 @@ void proto_reg_handoff_bfcp(void)
heur_dissector_add("tcp", dissect_bfcp_heur, "BFCP over TCP", "bfcp_tcp", proto_bfcp, HEURISTIC_DISABLE);
heur_dissector_add("udp", dissect_bfcp_heur, "BFCP over UDP", "bfcp_udp", proto_bfcp, HEURISTIC_DISABLE);
dissector_add_for_decode_as_with_preference("tcp.port", bfcp_handle);
dissector_add_for_decode_as("udp.port", bfcp_handle);
dissector_add_for_decode_as_with_preference("udp.port", bfcp_handle);
}
/*

View File

@ -43,8 +43,7 @@
void proto_register_bfd(void);
void proto_reg_handoff_bfd(void);
#define UDP_PORT_BFD_1HOP_CONTROL 3784 /* draft-katz-ward-bfd-v4v6-1hop-00.txt */
#define UDP_PORT_BFD_MULTIHOP_CONTROL 4784 /* draft-ietf-bfd-multihop-05.txt */
#define UDP_PORT_RANGE_BFD "3784,4784" /* draft-katz-ward-bfd-v4v6-1hop-00.txt */ /* draft-ietf-bfd-multihop-05.txt */
/* As per RFC 6428 : http://tools.ietf.org/html/rfc6428
Section: 3.5 */
@ -869,8 +868,7 @@ proto_reg_handoff_bfd(void)
dissector_handle_t bfd_control_handle;
bfd_control_handle = find_dissector("bfd");
dissector_add_uint("udp.port", UDP_PORT_BFD_1HOP_CONTROL, bfd_control_handle);
dissector_add_uint("udp.port", UDP_PORT_BFD_MULTIHOP_CONTROL, bfd_control_handle);
dissector_add_uint_range_with_preference("udp.port", UDP_PORT_RANGE_BFD, bfd_control_handle);
dissector_add_uint("pwach.channel_type", ACH_TYPE_BFD_CC, bfd_control_handle);
dissector_add_uint("pwach.channel_type", ACH_TYPE_BFD_CV, bfd_control_handle);

View File

@ -29,10 +29,7 @@
#define PSNAME "BJNP"
#define PFNAME "bjnp"
#define BJNP_PORT1 8611
#define BJNP_PORT2 8612
#define BJNP_PORT3 8613
#define BJNP_PORT4 8614
#define BJNP_PORT_RANGE "8611-8614"
/* dev_type */
#define PRINTER_COMMAND 0x01
@ -180,10 +177,7 @@ void proto_register_bjnp (void)
void proto_reg_handoff_bjnp (void)
{
dissector_add_uint ("udp.port", BJNP_PORT1, bjnp_handle);
dissector_add_uint ("udp.port", BJNP_PORT2, bjnp_handle);
dissector_add_uint ("udp.port", BJNP_PORT3, bjnp_handle);
dissector_add_uint ("udp.port", BJNP_PORT4, bjnp_handle);
dissector_add_uint_range_with_preference("udp.port", BJNP_PORT_RANGE, bjnp_handle);
}
/*

View File

@ -843,8 +843,7 @@ static const enum_val_t bootp_uuid_endian_vals[] = {
{ NULL, NULL, 0 }
};
#define UDP_PORT_BOOTPS 67
#define UDP_PORT_BOOTPC 68
#define BOOTP_UDP_PORT_RANGE "67-68"
#define BOOTP_BC 0x8000
#define BOOTP_MBZ 0x7FFF
@ -8683,8 +8682,7 @@ proto_register_bootp(void)
void
proto_reg_handoff_bootp(void)
{
dissector_add_uint("udp.port", UDP_PORT_BOOTPS, bootp_handle);
dissector_add_uint("udp.port", UDP_PORT_BOOTPC, bootp_handle);
dissector_add_uint_range_with_preference("udp.port", BOOTP_UDP_PORT_RANGE, bootp_handle);
}
/*

View File

@ -30,7 +30,6 @@
#include <epan/packet.h>
#include <epan/expert.h>
#include <epan/prefs.h>
/* Forward declaration we need below */
void proto_register_brp(void);
@ -43,8 +42,6 @@ static int proto_brp = -1;
static dissector_handle_t brp_handle;
/*static int global_brp_port = 1958; *//* The port is registered for another protocol */
static const value_string brp_packettype_names[] = {
{ 0, "BRP" },
{ 1, "Setup Request - BRC -> BRS" },
@ -127,9 +124,6 @@ static gint ett_brp_fltype = -1;
static expert_field ei_brp_type_unknown = EI_INIT;
/* Preferences */
static guint global_brp_port = 0;
static int
dissect_brp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
@ -324,7 +318,6 @@ return offset;
/*--- proto_register_brp ----------------------------------------------*/
void proto_register_brp (void)
{
module_t *brp_module;
expert_module_t* expert_brp;
/* A data field is something you can search/filter on.
@ -402,38 +395,13 @@ void proto_register_brp (void)
expert_brp = expert_register_protocol(proto_brp);
expert_register_field_array(expert_brp, ei, array_length(ei));
/* Register preferences module */
brp_module = prefs_register_protocol(proto_brp, proto_reg_handoff_brp);
/* Register preferences */
prefs_register_uint_preference(brp_module, "port",
"BRP Port",
"Set the UDP port for BRP messages",
10, &global_brp_port);
brp_handle = register_dissector("brp", dissect_brp, proto_brp);
}
/*--- proto_reg_handoff_brp -------------------------------------------*/
void proto_reg_handoff_brp(void)
{
static gboolean initialized = FALSE;
static guint saved_brp_port;
if (!initialized) {
dissector_add_for_decode_as("udp.port", brp_handle);
initialized = TRUE;
} else {
if (saved_brp_port != 0) {
dissector_delete_uint("udp.port", saved_brp_port, brp_handle);
}
}
/* Set the port number */
if (global_brp_port != 0) {
dissector_add_uint("udp.port", global_brp_port, brp_handle);
}
saved_brp_port = global_brp_port;
dissector_add_for_decode_as_with_preference("udp.port", brp_handle);
}
/*

View File

@ -567,13 +567,9 @@ proto_register_bt_dht(void)
module_t *bt_dht_module;
proto_bt_dht = proto_register_protocol (
"BitTorrent DHT Protocol", /* name */
"BT-DHT", /* short name */
"bt-dht" /* abbrev */
);
proto_bt_dht = proto_register_protocol ("BitTorrent DHT Protocol", "BT-DHT", "bt-dht");
bt_dht_module = prefs_register_protocol(proto_bt_dht, proto_reg_handoff_bt_dht);
bt_dht_module = prefs_register_protocol(proto_bt_dht, NULL);
prefs_register_obsolete_preference(bt_dht_module, "enable");
proto_register_field_array(proto_bt_dht, hf, array_length(hf));
@ -583,20 +579,14 @@ proto_register_bt_dht(void)
void
proto_reg_handoff_bt_dht(void)
{
static gboolean prefs_initialized = FALSE;
/* "Decode As" is always available;
* Heuristic dissection in disabled by default since the heuristic is quite weak.
* XXX - Still too weak?
*/
if (!prefs_initialized) {
heur_dissector_add("udp", dissect_bt_dht_heur, "BitTorrent DHT over UDP", "bittorrent_dht_udp", proto_bt_dht, HEURISTIC_DISABLE);
heur_dissector_add("udp", dissect_bt_dht_heur, "BitTorrent DHT over UDP", "bittorrent_dht_udp", proto_bt_dht, HEURISTIC_DISABLE);
bt_dht_handle = create_dissector_handle(dissect_bt_dht, proto_bt_dht);
dissector_add_for_decode_as("udp.port", bt_dht_handle);
prefs_initialized = TRUE;
}
bt_dht_handle = create_dissector_handle(dissect_bt_dht, proto_bt_dht);
dissector_add_for_decode_as_with_preference("udp.port", bt_dht_handle);
}
/*

View File

@ -466,13 +466,9 @@ proto_register_bt_utp(void)
module_t *bt_utp_module;
/* Register protocol */
proto_bt_utp = proto_register_protocol (
"uTorrent Transport Protocol", /* name */
"BT-uTP", /* short name */
"bt-utp" /* abbrev */
);
proto_bt_utp = proto_register_protocol ("uTorrent Transport Protocol", "BT-uTP", "bt-utp");
bt_utp_module = prefs_register_protocol(proto_bt_utp, proto_reg_handoff_bt_utp);
bt_utp_module = prefs_register_protocol(proto_bt_utp, NULL);
prefs_register_obsolete_preference(bt_utp_module, "enable");
proto_register_field_array(proto_bt_utp, hf, array_length(hf));
@ -482,17 +478,11 @@ proto_register_bt_utp(void)
void
proto_reg_handoff_bt_utp(void)
{
static gboolean prefs_initialized = FALSE;
/* disabled by default since heuristic is weak */
heur_dissector_add("udp", dissect_bt_utp, "BitTorrent UTP over UDP", "bt_utp_udp", proto_bt_utp, HEURISTIC_DISABLE);
if (!prefs_initialized) {
/* disabled by default since heuristic is weak */
heur_dissector_add("udp", dissect_bt_utp, "BitTorrent UTP over UDP", "bt_utp_udp", proto_bt_utp, HEURISTIC_DISABLE);
bt_utp_handle = create_dissector_handle(dissect_bt_utp, proto_bt_utp);
dissector_add_for_decode_as("udp.port", bt_utp_handle);
prefs_initialized = TRUE;
}
bt_utp_handle = create_dissector_handle(dissect_bt_utp, proto_bt_utp);
dissector_add_for_decode_as_with_preference("udp.port", bt_utp_handle);
}
/*

View File

@ -26,21 +26,11 @@
#include "config.h"
#include <epan/packet.h>
#include <epan/prefs.h>
void proto_register_bvlc(void);
void proto_reg_handoff_bvlc(void);
/* Taken from add-135a (BACnet-IP-standard paper):
*
* The default UDP port for both directed messages and broadcasts shall
* be X'BAC0' and all B/IP devices shall support it. In some cases,
* e.g., a situation where it is desirable for two groups of BACnet devices
* to coexist independently on the same IP subnet, the UDP port may be
* configured locally to a different value without it being considered
* a violation of this protocol.
*/
static guint global_additional_bvlc_udp_port = 0;
#define BVLC_UDP_PORT 0xBAC0
static int proto_bvlc = -1;
static int hf_bvlc_type = -1;
@ -389,20 +379,12 @@ proto_register_bvlc(void)
&ett_fdt,
};
module_t *bvlc_module;
proto_bvlc = proto_register_protocol("BACnet Virtual Link Control",
"BVLC", "bvlc");
proto_bvlc = proto_register_protocol("BACnet Virtual Link Control", "BVLC", "bvlc");
proto_register_field_array(proto_bvlc, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
bvlc_module = prefs_register_protocol(proto_bvlc, proto_reg_handoff_bvlc);
prefs_register_uint_preference(bvlc_module, "additional_udp_port",
"Additional UDP port", "Set an additional UDP port, "
"besides the standard X'BAC0' (47808) port.",
10, &global_additional_bvlc_udp_port);
register_dissector("bvlc", dissect_bvlc, proto_bvlc);
bvlc_dissector_table = register_dissector_table("bvlc.function",
@ -412,27 +394,10 @@ proto_register_bvlc(void)
void
proto_reg_handoff_bvlc(void)
{
static gboolean bvlc_initialized = FALSE;
static dissector_handle_t bvlc_handle;
static guint additional_bvlc_udp_port;
dissector_handle_t bvlc_handle;
if (!bvlc_initialized)
{
bvlc_handle = find_dissector("bvlc");
dissector_add_uint("udp.port", 0xBAC0, bvlc_handle);
bvlc_initialized = TRUE;
}
else
{
if (additional_bvlc_udp_port != 0) {
dissector_delete_uint("udp.port", additional_bvlc_udp_port, bvlc_handle);
}
}
if (global_additional_bvlc_udp_port != 0) {
dissector_add_uint("udp.port", global_additional_bvlc_udp_port, bvlc_handle);
}
additional_bvlc_udp_port = global_additional_bvlc_udp_port;
bvlc_handle = find_dissector("bvlc");
dissector_add_uint_with_preference("udp.port", BVLC_UDP_PORT, bvlc_handle);
}
/*

View File

@ -242,7 +242,6 @@ static expert_field ei_c1222_epsem_field_length_error = EI_INIT;
static expert_field ei_c1222_mac_missing = EI_INIT;
/* Preferences */
static int global_c1222_port = C1222_PORT;
static gboolean c1222_desegment = TRUE;
#ifdef HAVE_LIBGCRYPT
static gboolean c1222_decrypt = TRUE;
@ -2059,7 +2058,7 @@ proto_reg_handoff_c1222(void)
c1222_handle = create_dissector_handle(dissect_c1222, proto_c1222);
c1222_udp_handle = create_dissector_handle(dissect_c1222_common, proto_c1222);
dissector_add_uint_with_preference("tcp.port", C1222_PORT, c1222_handle);
dissector_add_uint("udp.port", global_c1222_port, c1222_udp_handle);
dissector_add_uint_with_preference("udp.port", C1222_PORT, c1222_udp_handle);
initialized = TRUE;
}
if (c1222_baseoid_str && (c1222_baseoid_str[0] != '\0') &&

View File

@ -25,6 +25,7 @@
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/prefs-int.h>
#include <epan/reassemble.h>
#include <epan/expert.h>
@ -37,7 +38,6 @@ void proto_reg_handoff_capwap(void);
#define UDP_PORT_CAPWAP_CONTROL 5246
#define UDP_PORT_CAPWAP_DATA 5247
static guint global_capwap_control_udp_port = UDP_PORT_CAPWAP_CONTROL;
static guint global_capwap_data_udp_port = UDP_PORT_CAPWAP_DATA;
static gboolean global_capwap_draft_8_cisco = FALSE;
static gboolean global_capwap_reassemble = TRUE;
@ -3395,6 +3395,13 @@ dissect_capwap_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
return tvb_captured_length(tvb);
}
static void
apply_capwap_prefs(void)
{
pref_t *control_port = prefs_find_preference(prefs_find_module("capwap.data"), "udp.port");
global_capwap_data_udp_port = *control_port->varp.uint;
}
void
proto_register_capwap_control(void)
{
@ -5764,15 +5771,9 @@ proto_register_capwap_control(void)
register_init_routine(&capwap_reassemble_init);
register_cleanup_routine(&capwap_reassemble_cleanup);
capwap_module = prefs_register_protocol(proto_capwap_control, proto_reg_handoff_capwap);
prefs_register_uint_preference(capwap_module, "udp.port.control", "CAPWAP Control UDP Port",
"Set the port for CAPWAP Control messages (if other than the default of 5246)",
10, &global_capwap_control_udp_port);
prefs_register_uint_preference(capwap_module, "udp.port.data", "CAPWAP Data UDP Port",
"Set the port for CAPWAP Data messages (if other than the default of 5247)",
10, &global_capwap_data_udp_port);
capwap_module = prefs_register_protocol(proto_capwap_control, NULL);
/* Need to create a placeholder for "port" preferences so there is a callback */
prefs_register_protocol(proto_capwap_data, apply_capwap_prefs);
prefs_register_bool_preference(capwap_module, "draft_8_cisco", "Cisco Wireless Controller Support",
"Enable support of Cisco Wireless Controller (based on old 8 draft revision).",
@ -5791,29 +5792,18 @@ proto_register_capwap_control(void)
void
proto_reg_handoff_capwap(void)
{
static gboolean inited = FALSE;
static dissector_handle_t capwap_control_handle, capwap_data_handle;
static guint capwap_control_udp_port, capwap_data_udp_port;
dissector_handle_t capwap_control_handle, capwap_data_handle;
if (!inited) {
capwap_control_handle = create_dissector_handle(dissect_capwap_control, proto_capwap_control);
capwap_data_handle = create_dissector_handle(dissect_capwap_data, proto_capwap_data);
dtls_handle = find_dissector_add_dependency("dtls", proto_capwap_control);
find_dissector_add_dependency("dtls", proto_capwap_data);
ieee8023_handle = find_dissector_add_dependency("eth_withoutfcs", proto_capwap_data);
ieee80211_handle = find_dissector_add_dependency("wlan_withoutfcs", proto_capwap_data);
ieee80211_bsfc_handle = find_dissector_add_dependency("wlan_bsfc", proto_capwap_data);
capwap_control_handle = create_dissector_handle(dissect_capwap_control, proto_capwap_control);
capwap_data_handle = create_dissector_handle(dissect_capwap_data, proto_capwap_data);
dtls_handle = find_dissector_add_dependency("dtls", proto_capwap_control);
find_dissector_add_dependency("dtls", proto_capwap_data);
ieee8023_handle = find_dissector_add_dependency("eth_withoutfcs", proto_capwap_data);
ieee80211_handle = find_dissector_add_dependency("wlan_withoutfcs", proto_capwap_data);
ieee80211_bsfc_handle = find_dissector_add_dependency("wlan_bsfc", proto_capwap_data);
inited = TRUE;
} else {
dissector_delete_uint("udp.port", capwap_control_udp_port, capwap_control_handle);
dissector_delete_uint("udp.port", capwap_data_udp_port, capwap_data_handle);
}
dissector_add_uint("udp.port", global_capwap_control_udp_port, capwap_control_handle);
dissector_add_uint("udp.port", global_capwap_data_udp_port, capwap_data_handle);
capwap_control_udp_port = global_capwap_control_udp_port;
capwap_data_udp_port = global_capwap_data_udp_port;
dissector_add_uint_with_preference("udp.port", UDP_PORT_CAPWAP_CONTROL, capwap_control_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_CAPWAP_DATA, capwap_data_handle);
}
/*
* Editor modelines

View File

@ -560,7 +560,7 @@ proto_register_cattp(void)
expert_cattp = expert_register_protocol(proto_cattp);
expert_register_field_array(expert_cattp, ei, array_length(ei));
cattp_module = prefs_register_protocol(proto_cattp, proto_reg_handoff_cattp);
cattp_module = prefs_register_protocol(proto_cattp, NULL);
prefs_register_bool_preference(cattp_module, "checksum",
"Validate checksum of all messages",
"Whether the checksum of all messages should be validated or not",
@ -573,18 +573,13 @@ proto_register_cattp(void)
void
proto_reg_handoff_cattp(void)
{
static gboolean initialized = FALSE;
dissector_handle_t cattp_handle;
if (!initialized) {
dissector_handle_t cattp_handle;
/* Create dissector handle */
cattp_handle = create_dissector_handle(dissect_cattp, proto_cattp);
/* Create dissector handle */
cattp_handle = create_dissector_handle(dissect_cattp, proto_cattp);
heur_dissector_add("udp", dissect_cattp_heur, "CAT-TP over UDP", "cattp_udp", proto_cattp, HEURISTIC_ENABLE);
dissector_add_for_decode_as("udp.port", cattp_handle);
initialized = TRUE;
}
heur_dissector_add("udp", dissect_cattp_heur, "CAT-TP over UDP", "cattp_udp", proto_cattp, HEURISTIC_ENABLE);
dissector_add_for_decode_as_with_preference("udp.port", cattp_handle);
}
/*

View File

@ -722,7 +722,7 @@ proto_register_ccsds(void)
void
proto_reg_handoff_ccsds(void)
{
dissector_add_for_decode_as ( "udp.port", find_dissector("ccsds") );
dissector_add_for_decode_as_with_preference( "udp.port", find_dissector("ccsds") );
}
/*

View File

@ -1631,7 +1631,7 @@ void
proto_reg_handoff_cfdp(void)
{
dissector_add_uint("ccsds.apid", CFDP_APID, cfdp_handle);
dissector_add_for_decode_as("udp.port", cfdp_handle);
dissector_add_for_decode_as_with_preference("udp.port", cfdp_handle);
}
/*

View File

@ -93,7 +93,7 @@ proto_reg_handoff_chargen(void)
dissector_handle_t chargen_handle;
chargen_handle = create_dissector_handle(dissect_chargen, proto_chargen);
dissector_add_uint("udp.port", CHARGEN_PORT_UDP, chargen_handle);
dissector_add_uint_with_preference("udp.port", CHARGEN_PORT_UDP, chargen_handle);
dissector_add_uint_with_preference("tcp.port", CHARGEN_PORT_TCP, chargen_handle);
}

View File

@ -12040,7 +12040,7 @@ proto_reg_handoff_cigi(void)
if( !inited ) {
cigi_handle = create_dissector_handle(dissect_cigi, proto_cigi);
dissector_add_for_decode_as("udp.port", cigi_handle);
dissector_add_for_decode_as_with_preference("udp.port", cigi_handle);
dissector_add_for_decode_as_with_preference("tcp.port", cigi_handle);
heur_dissector_add("udp", dissect_cigi_heur, "CIGI over UDP", "cigi_udp", proto_cigi, HEURISTIC_ENABLE);

View File

@ -209,7 +209,7 @@ proto_register_erpsan_marker(void)
void
proto_reg_handoff_erspan_marker(void)
{
dissector_add_for_decode_as("udp.port", marker_handle);
dissector_add_for_decode_as_with_preference("udp.port", marker_handle);
}
/*

View File

@ -50,11 +50,8 @@
#include <epan/packet.h>
#include <epan/exceptions.h>
#include <epan/expert.h>
#include <epan/prefs.h>
#include <epan/show_exception.h>
static guint global_udp_port = 0;
static int proto_cwids = -1;
static int hf_cwids_version = -1;
static int hf_cwids_timestamp = -1;
@ -179,7 +176,6 @@ proto_register_cwids(void)
{ &ie_ieee80211_subpacket, { "cwids.ieee80211_malformed", PI_MALFORMED, PI_ERROR, "Malformed or short IEEE80211 subpacket", EXPFILL }},
};
module_t *cwids_module;
expert_module_t* expert_cwids;
proto_cwids = proto_register_protocol("Cisco Wireless IDS Captures", "CWIDS", "cwids");
@ -187,36 +183,16 @@ proto_register_cwids(void)
proto_register_subtree_array(ett, array_length(ett));
expert_cwids = expert_register_protocol(proto_cwids);
expert_register_field_array(expert_cwids, ei, array_length(ei));
cwids_module = prefs_register_protocol(proto_cwids, proto_reg_handoff_cwids);
prefs_register_uint_preference(cwids_module, "udp.port",
"CWIDS port",
"Set the destination UDP port Cisco wireless IDS messages",
10, &global_udp_port);
}
void
proto_reg_handoff_cwids(void)
{
static dissector_handle_t cwids_handle;
static guint saved_udp_port;
static gboolean initialized = FALSE;
dissector_handle_t cwids_handle;
if (!initialized) {
cwids_handle = create_dissector_handle(dissect_cwids, proto_cwids);
dissector_add_for_decode_as("udp.port", cwids_handle);
ieee80211_radio_handle = find_dissector_add_dependency("wlan_noqos_radio", proto_cwids);
initialized = TRUE;
} else {
if (saved_udp_port != 0) {
dissector_delete_uint("udp.port", saved_udp_port, cwids_handle);
}
}
if (global_udp_port != 0) {
dissector_add_uint("udp.port", global_udp_port, cwids_handle);
}
saved_udp_port = global_udp_port;
cwids_handle = create_dissector_handle(dissect_cwids, proto_cwids);
dissector_add_for_decode_as_with_preference("udp.port", cwids_handle);
ieee80211_radio_handle = find_dissector_add_dependency("wlan_noqos_radio", proto_cwids);
}
/*

View File

@ -705,7 +705,7 @@ proto_reg_handoff_classicstun(void)
classicstun_handle = find_dissector("classicstun");
dissector_add_uint_with_preference("tcp.port", TCP_PORT_STUN, classicstun_handle);
dissector_add_uint("udp.port", UDP_PORT_STUN, classicstun_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_STUN, classicstun_handle);
#endif
heur_dissector_add("udp", dissect_classicstun_heur, "Classic STUN over UDP", "classicstun_udp", proto_classicstun, HEURISTIC_ENABLE);
heur_dissector_add("tcp", dissect_classicstun_heur, "Classic STUN over TCP", "classicstun_tcp", proto_classicstun, HEURISTIC_ENABLE);

View File

@ -29,6 +29,8 @@
#define DATA_PACKET 0x01
#define CNIP_UDP_PORT_RANGE "1628-1629" /* Not IANA registered */
static const value_string type_tuple[]=
{
{0x01, "Data Packet"},
@ -243,8 +245,7 @@ void proto_reg_handoff_cnip(void)
cnip_handle = create_dissector_handle(dissect_cnip, proto_cnip);
dissector_add_uint ("udp.port", 1628, cnip_handle);
dissector_add_uint ("udp.port", 1629, cnip_handle);
dissector_add_uint_range_with_preference("udp.port", CNIP_UDP_PORT_RANGE, cnip_handle);
}
/*

View File

@ -33,7 +33,6 @@
#include <epan/conversation.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/expert.h>
#include <epan/wmem/wmem.h>
@ -97,8 +96,6 @@ static expert_field ei_coap_option_length_bad = EI_INIT;
#define DEFAULT_COAP_CTYPE_VALUE ~0U
#define DEFAULT_COAP_BLOCK_NUMBER ~0U
static guint global_coap_port_number = DEFAULT_COAP_PORT;
static const gchar *coap_ctype_str = NULL;
static guint coap_ctype_value = DEFAULT_COAP_CTYPE_VALUE;
static guint coap_block_number = DEFAULT_COAP_BLOCK_NUMBER;
@ -1244,7 +1241,6 @@ proto_register_coap(void)
{ "coap.option_length_bad", PI_MALFORMED, PI_WARN, "Option length bad", EXPFILL }},
};
module_t *coap_module;
expert_module_t *expert_coap;
proto_coap = proto_register_protocol("Constrained Application Protocol", "CoAP", "coap");
@ -1254,34 +1250,17 @@ proto_register_coap(void)
expert_register_field_array(expert_coap, ei, array_length(ei));
register_dissector("coap", dissect_coap, proto_coap);
/* Register our configuration options */
coap_module = prefs_register_protocol (proto_coap, proto_reg_handoff_coap);
prefs_register_uint_preference (coap_module, "udp_port",
"CoAP port number",
"Port number used for CoAP traffic",
10, &global_coap_port_number);
}
void
proto_reg_handoff_coap(void)
{
static gboolean coap_prefs_initialized = FALSE;
static dissector_handle_t coap_handle;
static guint coap_port_number;
dissector_handle_t coap_handle;
if (!coap_prefs_initialized) {
coap_handle = find_dissector("coap");
media_type_dissector_table = find_dissector_table("media_type");
dissector_add_uint_with_preference("tcp.port", DEFAULT_COAP_PORT, coap_handle);
coap_prefs_initialized = TRUE;
} else {
dissector_delete_uint("udp.port", coap_port_number, coap_handle);
}
coap_port_number = global_coap_port_number;
dissector_add_uint("udp.port", coap_port_number, coap_handle);
coap_handle = find_dissector("coap");
media_type_dissector_table = find_dissector_table("media_type");
dissector_add_uint_with_preference("tcp.port", DEFAULT_COAP_PORT, coap_handle);
dissector_add_uint_with_preference("udp.port", DEFAULT_COAP_PORT, coap_handle);
}
/*

View File

@ -26,7 +26,6 @@
#include "config.h"
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/expert.h>
#include <epan/stats_tree.h>
#include <epan/to_str.h>
@ -144,8 +143,7 @@ static const val64_string severity_names[] = {
{ 0, NULL }
};
#define UDP_PORT_COLLECTD 25826
static guint collectd_udp_port = UDP_PORT_COLLECTD;
#define UDP_PORT_COLLECTD 25826 /* Not IANA registered */
static gint proto_collectd = -1;
static gint tap_collectd = -1;
@ -1348,7 +1346,6 @@ dissect_collectd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
void proto_register_collectd(void)
{
module_t *collectd_module;
expert_module_t* expert_collectd;
/* Setup list of header fields */
@ -1484,43 +1481,16 @@ void proto_register_collectd(void)
expert_register_field_array(expert_collectd, ei, array_length(ei));
tap_collectd = register_tap ("collectd");
/*
* Create an unsigned integer preference to allow the user to specify the
* UDP port on which to capture DIS packets.
*/
collectd_module = prefs_register_protocol (proto_collectd,
proto_reg_handoff_collectd);
prefs_register_uint_preference (collectd_module, "udp.port",
"collectd UDP port",
"Set the UDP port for collectd messages",
10, &collectd_udp_port);
} /* void proto_register_collectd */
}
void proto_reg_handoff_collectd (void)
{
static gboolean first_run = TRUE;
static gint registered_udp_port = -1;
static dissector_handle_t collectd_handle;
dissector_handle_t collectd_handle;
if (first_run)
collectd_handle = create_dissector_handle (dissect_collectd,
proto_collectd);
collectd_handle = create_dissector_handle(dissect_collectd, proto_collectd);
dissector_add_uint_with_preference("udp.port", UDP_PORT_COLLECTD, collectd_handle);
/* Change the dissector registration if the preferences have been
* changed. */
if (registered_udp_port != -1)
dissector_delete_uint ("udp.port", registered_udp_port,
collectd_handle);
dissector_add_uint ("udp.port", collectd_udp_port, collectd_handle);
registered_udp_port = collectd_udp_port;
if (first_run)
collectd_stats_tree_register ();
first_run = FALSE;
collectd_stats_tree_register ();
} /* void proto_reg_handoff_collectd */
/*

View File

@ -75,7 +75,7 @@ static gint ett_message_flags = -1;
static gint ett_association = -1;
#define COMPONENTSTATUSPROTOCOL_PORT 2960
#define COMPONENTSTATUSPROTOCOL_PORT 2960 /* Not IANA registered */
#define COMPONENTSTATUSPROTOCOL_VERSION 0x0200
@ -292,7 +292,7 @@ proto_reg_handoff_componentstatusprotocol(void)
dissector_handle_t componentstatusprotocol_handle;
componentstatusprotocol_handle = create_dissector_handle(dissect_componentstatusprotocol, proto_componentstatusprotocol);
dissector_add_uint("udp.port", COMPONENTSTATUSPROTOCOL_PORT, componentstatusprotocol_handle);
dissector_add_uint_with_preference("udp.port", COMPONENTSTATUSPROTOCOL_PORT, componentstatusprotocol_handle);
}
/*

View File

@ -40,7 +40,7 @@ static dissector_handle_t corosync_totemsrp_handle;
* Dissector body
*/
#define PORT_COROSYNC_TOTEMNET 5405
#define PORT_COROSYNC_TOTEMNET_RANGE "5404-5405" /* Not IANA registered */
/* Forward declaration we need below */
void proto_register_corosync_totemnet(void);
@ -56,7 +56,6 @@ static int hf_corosync_totemnet_security_crypto_type = -1;
static int hf_corosync_totemnet_security_crypto_key = -1;
/* configurable parameters */
static guint corosync_totemnet_port = PORT_COROSYNC_TOTEMNET;
static gchar* corosync_totemnet_private_keys = NULL;
static gchar** corosync_totemnet_private_keys_list = NULL;
@ -455,11 +454,6 @@ proto_register_corosync_totemnet(void)
corosync_totemnet_module = prefs_register_protocol(proto_corosync_totemnet,
proto_reg_handoff_corosync_totemnet);
prefs_register_uint_preference(corosync_totemnet_module, "udp.port",
"UDP Port",
"Set the UDP port for totem ring protocol implemented in corosync cluster engine",
10,
&corosync_totemnet_port);
prefs_register_string_preference(corosync_totemnet_module, "private_keys", "Private keys",
"Semicolon-separated list of keys for decryption(e.g. key1;key2;..." ,
(const gchar **)&corosync_totemnet_private_keys);
@ -470,33 +464,22 @@ proto_reg_handoff_corosync_totemnet(void)
{
static gboolean initialized = FALSE;
static dissector_handle_t corosync_totemnet_handle;
static int port = 0;
if (initialized)
{
dissector_delete_uint("udp.port", port, corosync_totemnet_handle);
dissector_delete_uint("udp.port", port - 1, corosync_totemnet_handle);
}
else
{
corosync_totemnet_handle = create_dissector_handle(dissect_corosynec_totemnet,
proto_corosync_totemnet);
corosync_totemsrp_handle = find_dissector_add_dependency("corosync_totemsrp", proto_corosync_totemnet);
if (!initialized)
{
corosync_totemnet_handle = create_dissector_handle(dissect_corosynec_totemnet, proto_corosync_totemnet);
corosync_totemsrp_handle = find_dissector_add_dependency("corosync_totemsrp", proto_corosync_totemnet);
initialized = TRUE;
}
dissector_add_uint_range_with_preference("udp.port", PORT_COROSYNC_TOTEMNET_RANGE, corosync_totemnet_handle);
initialized = TRUE;
}
if (corosync_totemnet_private_keys_list) {
g_strfreev(corosync_totemnet_private_keys_list);
corosync_totemnet_private_keys_list = NULL;
}
corosync_totemnet_private_keys_list = g_strsplit(corosync_totemnet_private_keys,
";",
0);
port = corosync_totemnet_port;
dissector_add_uint("udp.port", port, corosync_totemnet_handle);
dissector_add_uint("udp.port", port - 1, corosync_totemnet_handle);
corosync_totemnet_private_keys_list = g_strsplit(corosync_totemnet_private_keys, ";", 0);
}
/*

View File

@ -36,8 +36,8 @@
void proto_register_cpfi(void);
void proto_reg_handoff_cpfi(void);
#define CPFI_DEFAULT_UDP_PORT 5000
#define CPFI_DEFAULT_TTOT_UDP_PORT 5001
#define CPFI_DEFAULT_UDP_PORT 5000 /* Not IANA registered */
#define CPFI_DEFAULT_TTOT_UDP_PORT 5001 /* Not IANA registered */
#define FIRST_TIO_CARD_ADDRESS 0x380
@ -59,7 +59,6 @@ void proto_reg_handoff_cpfi(void);
#define CPFI_EOF_ERROR_MASK 0x7FE00000
/* configurable parameters */
static guint gbl_cpfi_udp_port = CPFI_DEFAULT_UDP_PORT;
static guint gbl_cpfi_ttot_udp_port = CPFI_DEFAULT_TTOT_UDP_PORT;
static gboolean cpfi_arrow_moves = TRUE;
@ -506,10 +505,6 @@ proto_register_cpfi(void)
/* Register our configuration options for CPFI */
cpfi_module = prefs_register_protocol(proto_cpfi, proto_reg_handoff_cpfi);
prefs_register_uint_preference(cpfi_module, "udp.port", "CPFI UDP Port",
"Set the port for CPFI messages (if other"
" than the default of 5000)",
10, &gbl_cpfi_udp_port);
prefs_register_uint_preference(cpfi_module, "udp.port2", "InstanceToInstance UDP Port",
"Set the port for InstanceToInstance messages (if other"
" than the default of 5001)",
@ -530,25 +525,24 @@ proto_reg_handoff_cpfi(void)
{
static gboolean cpfi_init_complete = FALSE;
static dissector_handle_t cpfi_handle;
static guint cpfi_udp_port;
static guint cpfi_ttot_udp_port;
if ( !cpfi_init_complete )
{
fc_handle = find_dissector_add_dependency("fc", proto_cpfi);
cpfi_handle = create_dissector_handle(dissect_cpfi, proto_cpfi);
dissector_add_uint_with_preference("udp.port", CPFI_DEFAULT_UDP_PORT, cpfi_handle);
cpfi_init_complete = TRUE;
}
else
{
dissector_delete_uint("udp.port", cpfi_udp_port, cpfi_handle);
dissector_delete_uint("udp.port", cpfi_ttot_udp_port, cpfi_handle);
}
cpfi_udp_port = gbl_cpfi_udp_port;
cpfi_ttot_udp_port = gbl_cpfi_ttot_udp_port;
dissector_add_uint("udp.port", cpfi_udp_port, cpfi_handle);
/* Port preference has a specific enough name to not use
the "auto" preference */
dissector_add_uint("udp.port", cpfi_ttot_udp_port, cpfi_handle);
}

View File

@ -522,8 +522,7 @@ proto_register_cpha(void)
&ett_cphap,
};
proto_cphap = proto_register_protocol("Check Point High Availability Protocol",
"CPHA", "cpha");
proto_cphap = proto_register_protocol("Check Point High Availability Protocol", "CPHA", "cpha");
proto_register_field_array(proto_cphap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
@ -534,7 +533,7 @@ proto_reg_handoff_cpha(void)
dissector_handle_t cpha_handle;
cpha_handle = create_dissector_handle(dissect_cpha, proto_cphap);
dissector_add_uint("udp.port", UDP_PORT_CPHA, cpha_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_CPHA, cpha_handle);
}
/*
* Editor modelines

View File

@ -389,9 +389,7 @@ proto_register_cups(void)
&ett_cups_ptype
};
proto_cups = proto_register_protocol(
"Common Unix Printing System (CUPS) Browsing Protocol",
"CUPS", "cups");
proto_cups = proto_register_protocol("Common Unix Printing System (CUPS) Browsing Protocol", "CUPS", "cups");
proto_register_field_array(proto_cups, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@ -405,7 +403,7 @@ proto_reg_handoff_cups(void)
dissector_handle_t cups_handle;
cups_handle = create_dissector_handle(dissect_cups, proto_cups);
dissector_add_uint("udp.port", UDP_PORT_CUPS, cups_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_CUPS, cups_handle);
}
/*

View File

@ -105,7 +105,7 @@ proto_register_daytime(void)
void
proto_reg_handoff_daytime(void)
{
dissector_add_uint("udp.port", DAYTIME_PORT, daytime_handle);
dissector_add_uint_with_preference("udp.port", DAYTIME_PORT, daytime_handle);
dissector_add_uint_with_preference("tcp.port", DAYTIME_PORT, daytime_handle);
}

View File

@ -272,7 +272,7 @@ proto_reg_handoff_db_lsp (void)
db_lsp_udp_handle = find_dissector ("db-lsp.udp");
dissector_add_uint_with_preference("tcp.port", DB_LSP_PORT, db_lsp_tcp_handle);
dissector_add_uint ("udp.port", DB_LSP_PORT, db_lsp_udp_handle);
dissector_add_uint_with_preference("udp.port", DB_LSP_PORT, db_lsp_udp_handle);
}
/*

View File

@ -210,8 +210,7 @@ proto_register_ddtp(void)
expert_module_t* expert_ddtp;
proto_ddtp = proto_register_protocol("Dynamic DNS Tools Protocol",
"DDTP", "ddtp");
proto_ddtp = proto_register_protocol("Dynamic DNS Tools Protocol", "DDTP", "ddtp");
proto_register_field_array(proto_ddtp, hf_ddtp, array_length(hf_ddtp));
proto_register_subtree_array(ett, array_length(ett));
expert_ddtp = expert_register_protocol(proto_ddtp);
@ -224,7 +223,7 @@ proto_reg_handoff_ddtp(void)
dissector_handle_t ddtp_handle;
ddtp_handle = create_dissector_handle(dissect_ddtp, proto_ddtp);
dissector_add_uint("udp.port", UDP_PORT_DDTP, ddtp_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_DDTP, ddtp_handle);
}
/*

View File

@ -228,8 +228,8 @@ static expert_field ei_dhcpv6_bulk_leasequery_bad_msg_type = EI_INIT;
static dissector_handle_t dhcpv6_handle;
#define UDP_PORT_DHCPV6_DOWNSTREAM 546
#define UDP_PORT_DHCPV6_UPSTREAM 547
#define TCP_PORT_DHCPV6_UPSTREAM 547
#define UDP_PORT_DHCPV6_RANGE "546-547" /* Downstream + Upstream */
#define DHCPV6_LEASEDURATION_INFINITY 0xffffffff
#define HOP_COUNT_LIMIT 32
@ -2459,12 +2459,11 @@ proto_reg_handoff_dhcpv6(void)
{
dissector_handle_t dhcpv6_bulkquery_handle;
dissector_add_uint("udp.port", UDP_PORT_DHCPV6_DOWNSTREAM, dhcpv6_handle);
dissector_add_uint("udp.port", UDP_PORT_DHCPV6_UPSTREAM, dhcpv6_handle);
dissector_add_uint_range_with_preference("udp.port", UDP_PORT_DHCPV6_RANGE, dhcpv6_handle);
dhcpv6_bulkquery_handle = create_dissector_handle(dissect_dhcpv6_bulk_leasequery,
proto_dhcpv6_bulk_leasequery);
dissector_add_uint_with_preference("tcp.port", UDP_PORT_DHCPV6_UPSTREAM, dhcpv6_bulkquery_handle);
dissector_add_uint_with_preference("tcp.port", TCP_PORT_DHCPV6_UPSTREAM, dhcpv6_bulkquery_handle);
}
/*

View File

@ -303,7 +303,6 @@ static dissector_handle_t diameter_udp_handle;
static dissector_handle_t diameter_tcp_handle;
static dissector_handle_t diameter_sctp_handle;
static range_t *global_diameter_sctp_port_range;
static range_t *global_diameter_udp_port_range;
/* This is used for TCP and SCTP */
#define DEFAULT_DIAMETER_PORT_RANGE "3868"
@ -2334,11 +2333,9 @@ proto_register_diameter(void)
/* Set default TCP ports */
range_convert_str(&global_diameter_sctp_port_range, DEFAULT_DIAMETER_PORT_RANGE, MAX_SCTP_PORT);
range_convert_str(&global_diameter_udp_port_range, "", MAX_UDP_PORT);
/* Register configuration options for ports */
diameter_module = prefs_register_protocol(proto_diameter,
proto_reg_handoff_diameter);
diameter_module = prefs_register_protocol(proto_diameter, proto_reg_handoff_diameter);
prefs_register_range_preference(diameter_module, "sctp.ports",
"Diameter SCTP Ports",
@ -2353,11 +2350,6 @@ proto_register_diameter(void)
" To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
&gbl_diameter_desegment);
prefs_register_range_preference(diameter_module, "udp.ports", "Diameter UDP ports",
"UDP ports to be decoded as Diameter (default: 0 as Diameter over UDP is nonstandard)",
&global_diameter_udp_port_range, MAX_UDP_PORT);
/* Register some preferences we no longer support, so we can report
* them as obsolete rather than just illegal.
*/
@ -2381,7 +2373,6 @@ proto_reg_handoff_diameter(void)
{
static gboolean Initialized=FALSE;
static range_t *diameter_sctp_port_range;
static range_t *diameter_udp_port_range;
if (!Initialized) {
diameter_sctp_handle = find_dissector("diameter");
@ -2424,20 +2415,18 @@ proto_reg_handoff_diameter(void)
/* Register dissector for Experimental result code, with 3GPP2's vendor Id */
dissector_add_uint("diameter.vnd_exp_res", VENDOR_THE3GPP2, create_dissector_handle(dissect_diameter_3gpp2_exp_res, proto_diameter));
dissector_add_uint_range_with_preference("tcp.port", DEFAULT_DIAMETER_PORT_RANGE, diameter_tcp_handle);
dissector_add_uint_range_with_preference("udp.port", "", diameter_udp_handle);
Initialized=TRUE;
} else {
dissector_delete_uint_range("sctp.port", diameter_sctp_port_range, diameter_sctp_handle);
dissector_delete_uint_range("udp.port", diameter_udp_port_range, diameter_udp_handle);
g_free(diameter_sctp_port_range);
g_free(diameter_udp_port_range);
}
/* set port for future deletes */
diameter_sctp_port_range = range_copy(global_diameter_sctp_port_range);
diameter_udp_port_range = range_copy(global_diameter_udp_port_range);
dissector_add_uint_range_with_preference("tcp.port", DEFAULT_DIAMETER_PORT_RANGE, diameter_tcp_handle);
dissector_add_uint_range("sctp.port", diameter_sctp_port_range, diameter_sctp_handle);
dissector_add_uint_range("udp.port", diameter_udp_port_range, diameter_udp_handle);
exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7);

View File

@ -33,10 +33,9 @@
#include "config.h"
#include <epan/packet.h>
#include <epan/prefs.h>
#include "packet-link16.h"
#define DEFAULT_DIS_UDP_PORT 3000
#define DEFAULT_DIS_UDP_PORT 3000 /* Not IANA registered */
/* Encoding type the last 14 bits */
#define DIS_ENCODING_TYPE(word) ((word) & 0x3FFF)
@ -7009,8 +7008,6 @@ static const true_false_string dis_time_hopping_value = {
"Time hopping modulation not used"
};
static guint dis_udp_port = DEFAULT_DIS_UDP_PORT;
typedef struct dis_header
{
guint8 version;
@ -9653,22 +9650,9 @@ void proto_register_dis(void)
&ett_iff_parameter_6,
};
module_t *dis_module;
proto_dis = proto_register_protocol("Distributed Interactive Simulation", "DIS", "dis");
proto_register_field_array(proto_dis, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
dis_module = prefs_register_protocol(proto_dis, proto_reg_handoff_dis);
/* Create an unsigned integer preference to allow the user to specify the
* UDP port on which to capture DIS packets.
*/
prefs_register_uint_preference(dis_module, "udp.port",
"DIS UDP Port",
"Set the UDP port for DIS messages",
10, &dis_udp_port);
}
/* Register handoff routine for DIS dissector. This will be invoked initially
@ -9677,23 +9661,12 @@ void proto_register_dis(void)
*/
void proto_reg_handoff_dis(void)
{
static gboolean dis_prefs_initialized = FALSE;
static dissector_handle_t dis_dissector_handle;
static guint saved_dis_udp_port;
dissector_handle_t dis_dissector_handle;
if (!dis_prefs_initialized)
{
dis_dissector_handle = create_dissector_handle(dissect_dis, proto_dis);
link16_handle = find_dissector_add_dependency("link16", proto_dis);
dis_prefs_initialized = TRUE;
}
else
{
dissector_delete_uint("udp.port", saved_dis_udp_port, dis_dissector_handle);
}
dis_dissector_handle = create_dissector_handle(dissect_dis, proto_dis);
dissector_add_uint_with_preference("udp.port", DEFAULT_DIS_UDP_PORT, dis_dissector_handle);
dissector_add_uint("udp.port", dis_udp_port, dis_dissector_handle);
saved_dis_udp_port = dis_udp_port;
link16_handle = find_dissector_add_dependency("link16", proto_dis);
}
/*

View File

@ -686,7 +686,7 @@ proto_reg_handoff_dlsw(void)
dissector_handle_t dlsw_udp_handle, dlsw_tcp_handle;
dlsw_udp_handle = create_dissector_handle(dissect_dlsw_udp, proto_dlsw);
dissector_add_uint("udp.port", UDP_PORT_DLSW, dlsw_udp_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_DLSW, dlsw_udp_handle);
dlsw_tcp_handle = create_dissector_handle(dissect_dlsw_tcp, proto_dlsw);
dissector_add_uint_with_preference("tcp.port", TCP_PORT_DLSW, dlsw_tcp_handle);

View File

@ -532,7 +532,6 @@ static struct dmp_data {
} dmp;
/* User definable values */
static range_t *global_dmp_port_range;
static gint dmp_nat_decode = NAT_DECODE_DMP;
static gint dmp_local_nation = 0;
static gboolean use_seq_ack_analysis = TRUE;
@ -4922,23 +4921,15 @@ void proto_register_dmp (void)
register_init_routine (&dmp_init_routine);
register_cleanup_routine (&dmp_cleanup_routine);
/* Set default UDP ports */
range_convert_str (&global_dmp_port_range, DEFAULT_DMP_PORT_RANGE,
MAX_UDP_PORT);
/* Build national values */
build_national_strings ();
/* Register our configuration options */
dmp_module = prefs_register_protocol (proto_dmp, proto_reg_handoff_dmp);
dmp_module = prefs_register_protocol (proto_dmp, NULL);
prefs_register_obsolete_preference (dmp_module, "udp_port");
prefs_register_obsolete_preference (dmp_module, "udp_port_second");
prefs_register_range_preference (dmp_module, "udp_ports",
"DMP port numbers",
"Port numbers used for DMP traffic",
&global_dmp_port_range, MAX_UDP_PORT);
prefs_register_enum_preference (dmp_module, "national_decode",
"National decoding",
"Select the type of decoding for nationally-defined values",
@ -4975,21 +4966,8 @@ void proto_register_dmp (void)
void proto_reg_handoff_dmp (void)
{
static range_t *dmp_port_range;
static gboolean dmp_prefs_initialized = FALSE;
if (!dmp_prefs_initialized) {
dmp_prefs_initialized = TRUE;
dissector_add_uint ("s5066sis.ctl.appid", S5066_CLIENT_S4406_ANNEX_E_TMI_4_DMP, dmp_handle);
} else {
dissector_delete_uint_range ("udp.port", dmp_port_range, dmp_handle);
g_free (dmp_port_range);
}
/* Save port number for later deletion */
dmp_port_range = range_copy (global_dmp_port_range);
dissector_add_uint_range ("udp.port", dmp_port_range, dmp_handle);
dissector_add_uint ("s5066sis.ctl.appid", S5066_CLIENT_S4406_ANNEX_E_TMI_4_DMP, dmp_handle);
dissector_add_uint_range_with_preference("udp.port", DEFAULT_DMP_PORT_RANGE, dmp_handle);
}
/*

View File

@ -4600,7 +4600,7 @@ proto_reg_handoff_dnp3(void)
dnp3_tcp_handle = create_dissector_handle(dissect_dnp3_tcp, proto_dnp3);
dnp3_udp_handle = create_dissector_handle(dissect_dnp3_udp, proto_dnp3);
dissector_add_uint_with_preference("tcp.port", TCP_PORT_DNP, dnp3_tcp_handle);
dissector_add_uint("udp.port", UDP_PORT_DNP, dnp3_udp_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_DNP, dnp3_udp_handle);
dissector_add_for_decode_as("rtacser.data", dnp3_udp_handle);
}

View File

@ -421,8 +421,6 @@ static dissector_table_t dns_tsig_dissector_table=NULL;
static dissector_handle_t dns_handle;
static range_t *global_dns_udp_port_range;
/* desegmentation of DNS over TCP */
static gboolean dns_desegment = TRUE;
@ -4078,18 +4076,13 @@ static int dns_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_di
void
proto_reg_handoff_dns(void)
{
static range_t *dns_udp_port_range;
static gboolean Initialized = FALSE;
if (!Initialized) {
dissector_handle_t mdns_udp_handle;
dissector_handle_t llmnr_udp_handle;
mdns_udp_handle = create_dissector_handle(dissect_mdns_udp, proto_mdns);
llmnr_udp_handle = create_dissector_handle(dissect_llmnr_udp, proto_llmnr);
dissector_add_uint("udp.port", UDP_PORT_MDNS, mdns_udp_handle);
dissector_add_uint("udp.port", UDP_PORT_LLMNR, llmnr_udp_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_MDNS, mdns_udp_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_LLMNR, llmnr_udp_handle);
dissector_add_uint("sctp.port", SCTP_PORT_DNS, dns_handle);
#if 0
dissector_add_uint("sctp.ppi", DNS_PAYLOAD_PROTOCOL_ID, dns_handle);
@ -4100,15 +4093,7 @@ proto_reg_handoff_dns(void)
ssl_dissector_add(TCP_PORT_DNS_TLS, dns_handle);
dtls_dissector_add(UDP_PORT_DNS_DTLS, dns_handle);
dissector_add_uint_range_with_preference("tcp.port", DEFAULT_DNS_TCP_PORT_RANGE, dns_handle);
Initialized = TRUE;
} else {
dissector_delete_uint_range("udp.port", dns_udp_port_range, dns_handle);
g_free(dns_udp_port_range);
}
dns_udp_port_range = range_copy(global_dns_udp_port_range);
dissector_add_uint_range("udp.port", dns_udp_port_range, dns_handle);
dissector_add_uint_range_with_preference("udp.port", DEFAULT_DNS_PORT_RANGE, dns_handle);
}
void
@ -5571,15 +5556,7 @@ proto_register_dns(void)
expert_dns = expert_register_protocol(proto_dns);
expert_register_field_array(expert_dns, ei, array_length(ei));
/* Set default ports */
range_convert_str(&global_dns_udp_port_range, DEFAULT_DNS_PORT_RANGE, MAX_UDP_PORT);
dns_module = prefs_register_protocol(proto_dns, proto_reg_handoff_dns);
prefs_register_range_preference(dns_module, "udp.ports", "DNS UDP ports",
"UDP ports to be decoded as DNS (default: "
DEFAULT_DNS_PORT_RANGE ")",
&global_dns_udp_port_range, MAX_UDP_PORT);
dns_module = prefs_register_protocol(proto_dns, NULL);
prefs_register_bool_preference(dns_module, "desegment_dns_messages",
"Reassemble DNS messages spanning multiple TCP segments",

View File

@ -877,11 +877,10 @@ static void dof_packet_delete_proto_data(dof_packet_data *packet, int proto);
* source address, and the DPS dissector is associated with that port. In this
* way, servers on non-standard ports will automatically be decoded using DPS.
*/
#define DOF_P2P_NEG_SEC_UDP_PORT 3567
#define DOF_NEG_SEC_UDP_PORT_RANGE "3567,5567" /* P2P + Multicast */
#define DOF_P2P_NEG_SEC_TCP_PORT 3567
/* Reserved UDP port 3568*/
#define DOF_TUN_SEC_TCP_PORT 3568
#define DOF_MCAST_NEG_SEC_UDP_PORT 5567
#define DOF_P2P_SEC_TCP_PORT 5567
/* Reserved UDP port 8567*/
#define DOF_TUN_NON_SEC_TCP_PORT 8567
@ -11051,8 +11050,7 @@ static void dof_handoff(void)
undissected_data_handle = find_dissector("data");
dissector_add_uint_with_preference("tcp.port", DOF_P2P_NEG_SEC_TCP_PORT, tcp_handle);
dissector_add_uint("udp.port", DOF_P2P_NEG_SEC_UDP_PORT, dof_udp_handle);
dissector_add_uint("udp.port", DOF_MCAST_NEG_SEC_UDP_PORT, dof_udp_handle);
dissector_add_uint_range_with_preference("udp.port", DOF_NEG_SEC_UDP_PORT_RANGE, dof_udp_handle);
}
/* OID Registration Support */

View File

@ -51,7 +51,6 @@
#include <stdio.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/reassemble.h>
#include <epan/expert.h>
#include "packet-dtn.h"
@ -290,7 +289,6 @@ static expert_field ei_tcp_convergence_ack_length = EI_INIT;
static dissector_handle_t bundle_handle;
#define BUNDLE_PORT 4556
static guint bundle_udp_port = BUNDLE_PORT;
typedef struct dictionary_data {
int bundle_header_dict_length;
@ -3049,21 +3047,13 @@ proto_register_bundle(void)
},
};
module_t *bundle_module;
expert_module_t *expert_bundle, *expert_tcpcl;
proto_bundle = proto_register_protocol("Bundle Protocol", "Bundle", "bundle");
bundle_handle = register_dissector("bundle", dissect_bundle, proto_bundle);
bundle_module = prefs_register_protocol(proto_bundle, proto_reg_handoff_bundle);
proto_tcp_conv = proto_register_protocol ("DTN TCP Convergence Layer Protocol", "TCPCL", "tcpcl");
prefs_register_uint_preference(bundle_module, "udp.port",
"Bundle Protocol UDP Port",
"UDP Port to Accept Bundle Protocol Connections",
10,
&bundle_udp_port);
proto_register_field_array(proto_bundle, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_bundle = expert_register_protocol(proto_bundle);
@ -3081,21 +3071,11 @@ proto_register_bundle(void)
void
proto_reg_handoff_bundle(void)
{
static dissector_handle_t tcpcl_handle;
static guint udp_port;
dissector_handle_t tcpcl_handle;
static int Initialized = FALSE;
if (!Initialized) {
tcpcl_handle = create_dissector_handle(dissect_tcpcl, proto_bundle);
dissector_add_uint_with_preference("tcp.port", BUNDLE_PORT, tcpcl_handle);
Initialized = TRUE;
}
else {
dissector_delete_uint("udp.port", udp_port, bundle_handle);
}
udp_port = bundle_udp_port;
dissector_add_uint("udp.port", udp_port, bundle_handle);
tcpcl_handle = create_dissector_handle(dissect_tcpcl, proto_bundle);
dissector_add_uint_with_preference("tcp.port", BUNDLE_PORT, tcpcl_handle);
dissector_add_uint_with_preference("udp.port", BUNDLE_PORT, bundle_handle);
}
/*

View File

@ -104,7 +104,7 @@ proto_reg_handoff_dvb_ipdc(void)
sub_handles[DVB_IPDC_SUB_FLUTE] = find_dissector_add_dependency("alc", proto_ipdc);
ipdc_handle = create_dissector_handle(dissect_ipdc, proto_ipdc);
dissector_add_uint("udp.port", UDP_PORT_IPDC_ESG_BOOTSTRAP, ipdc_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_IPDC_ESG_BOOTSTRAP, ipdc_handle);
}
/*

View File

@ -114,7 +114,7 @@ void proto_reg_handoff_echo(void)
echo_handle = create_dissector_handle(dissect_echo, proto_echo);
dissector_add_uint("udp.port", ECHO_PORT, echo_handle);
dissector_add_uint_with_preference("udp.port", ECHO_PORT, echo_handle);
dissector_add_uint_with_preference("tcp.port", ECHO_PORT, echo_handle);
}

View File

@ -51,9 +51,6 @@ static int proto_modbus = -1;
/* These are the handles of our subdissectors */
static dissector_handle_t modbus_handle = NULL;
/*stores the port number for our protocol (ECMP)*/
static const guint16 global_ecmp_port = 6160;
/*smallest size of a packet, number of bytes*/
static const gint ecmp_min_packet_size = 6;
@ -3565,18 +3562,14 @@ void proto_register_ecmp (void)
/* Wireshark literally scans this file (packet-ecmp.c) to find this function */
void proto_reg_handoff_ecmp(void)
{
static gboolean initialized = FALSE;
static dissector_handle_t ecmp_tcp_handle, ecmp_udp_handle;
dissector_handle_t ecmp_tcp_handle, ecmp_udp_handle;
if (!initialized) {
ecmp_tcp_handle = create_dissector_handle(dissect_ecmp_tcp, proto_ecmp);
ecmp_udp_handle = create_dissector_handle(dissect_ecmp_udp, proto_ecmp);
ecmp_tcp_handle = create_dissector_handle(dissect_ecmp_tcp, proto_ecmp);
ecmp_udp_handle = create_dissector_handle(dissect_ecmp_udp, proto_ecmp);
/* Cyclic frames are over UDP and non-cyclic are over TCP */
dissector_add_uint("udp.port", global_ecmp_port, ecmp_udp_handle);
dissector_add_uint_with_preference("tcp.port", ECMP_TCP_PORT, ecmp_tcp_handle);
initialized = TRUE;
}
/* Cyclic frames are over UDP and non-cyclic are over TCP */
dissector_add_uint_with_preference("udp.port", ECMP_TCP_PORT, ecmp_udp_handle);
dissector_add_uint_with_preference("tcp.port", ECMP_TCP_PORT, ecmp_tcp_handle);
/* Modbus dissector hooks */
modbus_handle = find_dissector_add_dependency("modbus", proto_ecmp);

View File

@ -183,6 +183,7 @@ static expert_field ei_kademlia_tag_type = EI_INIT;
static expert_field ei_kademlia_search_expression_type = EI_INIT;
#define EDONKEY_TCP_PORT_RANGE "4661-4663" /* Not IANA registered */
#define EDONKEY_UDP_PORT_RANGE "4665,4672" /* Not IANA registered */
/* desegmentation of eDonkey over TCP */
static gboolean edonkey_desegment = TRUE;
@ -3408,9 +3409,7 @@ void proto_reg_handoff_edonkey(void) {
edonkey_udp_handle = create_dissector_handle(dissect_edonkey_udp, proto_edonkey);
dissector_add_uint_range_with_preference("tcp.port", EDONKEY_TCP_PORT_RANGE, edonkey_tcp_handle);
dissector_add_uint("udp.port", 4665, edonkey_udp_handle);
dissector_add_uint("udp.port", 4672, edonkey_udp_handle);
dissector_add_uint_range_with_preference("udp.port", EDONKEY_UDP_PORT_RANGE, edonkey_udp_handle);
}
/*

View File

@ -28,7 +28,7 @@
#include <epan/packet.h>
#define EGD_PORT 18246 /* 0x4746 */
#define EGD_PORT 18246 /* 0x4746 - Not IANA registered */
#define EGD_ST_NONEW 0
#define EGD_ST_NOERROR 1
@ -226,11 +226,7 @@ void proto_register_egd(void)
&ett_status_item
};
proto_egd = proto_register_protocol (
"Ethernet Global Data", /* name */
"EGD", /* short name */
"egd" /* abbrev */
);
proto_egd = proto_register_protocol ("Ethernet Global Data", "EGD", "egd");
proto_register_field_array(proto_egd, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
@ -240,7 +236,7 @@ void proto_reg_handoff_egd(void)
dissector_handle_t egd_handle;
egd_handle = create_dissector_handle(dissect_egd, proto_egd);
dissector_add_uint("udp.port", EGD_PORT, egd_handle);
dissector_add_uint_with_preference("udp.port", EGD_PORT, egd_handle);
}
/*

View File

@ -1959,7 +1959,7 @@ proto_register_ehs(void)
void
proto_reg_handoff_ehs(void)
{
dissector_add_for_decode_as ( "udp.port", find_dissector("ehs") );
dissector_add_for_decode_as_with_preference( "udp.port", find_dissector("ehs") );
ccsds_handle = find_dissector_add_dependency ( "ccsds", proto_ehs );
}

View File

@ -26,7 +26,7 @@
#include <epan/expert.h>
#include "packet-tcp.h"
#define ELASTICSEARCH_DISCOVERY_PORT 54328
#define ELASTICSEARCH_DISCOVERY_PORT 54328 /* Not IANA registered */
#define ELASTICSEARCH_BINARY_PORT 9300 /* Not IANA registered */
#define IPv4_ADDRESS_LENGTH 4
@ -727,7 +727,7 @@ void proto_reg_handoff_elasticsearch(void) {
elasticsearch_handle_binary = create_dissector_handle(dissect_elasticsearch_binary, proto_elasticsearch);
elasticsearch_zen_handle = create_dissector_handle(dissect_elasticsearch_zen_ping, proto_elasticsearch);
dissector_add_uint("udp.port", ELASTICSEARCH_DISCOVERY_PORT, elasticsearch_zen_handle);
dissector_add_uint_with_preference("udp.port", ELASTICSEARCH_DISCOVERY_PORT, elasticsearch_zen_handle);
dissector_add_uint_with_preference("tcp.port", ELASTICSEARCH_BINARY_PORT, elasticsearch_handle_binary);
}

View File

@ -4427,11 +4427,11 @@ proto_reg_handoff_enip(void)
/* Register for EtherNet/IP, using UDP */
enip_udp_handle = create_dissector_handle(dissect_enip_udp, proto_enip);
dissector_add_uint("udp.port", ENIP_ENCAP_PORT, enip_udp_handle);
dissector_add_uint_with_preference("udp.port", ENIP_ENCAP_PORT, enip_udp_handle);
/* Register for EtherNet/IP IO data (UDP) */
enipio_handle = find_dissector("enip_io");
dissector_add_uint("udp.port", ENIP_IO_PORT, enipio_handle);
dissector_add_uint_with_preference("udp.port", ENIP_IO_PORT, enipio_handle);
/* Register for EtherNet/IP TLS */
ssl_dissector_add(ENIP_SECURE_PORT, enip_tcp_handle);

View File

@ -1092,7 +1092,7 @@ proto_reg_handoff_enrp(void)
enrp_handle = create_dissector_handle(dissect_enrp, proto_enrp);
dissector_add_uint("sctp.ppi", ENRP_PAYLOAD_PROTOCOL_ID, enrp_handle);
dissector_add_uint("sctp.port", ENRP_SCTP_PORT, enrp_handle);
dissector_add_uint("udp.port", ENRP_UDP_PORT, enrp_handle);
dissector_add_uint_with_preference("udp.port", ENRP_UDP_PORT, enrp_handle);
}
/*

View File

@ -36,7 +36,7 @@
/* Define UDP/TCP ports for ENTTEC */
#define UDP_PORT_ENTTEC 0x0D05
#define UDP_PORT_ENTTEC 0x0D05 /* Not IANA registered */
#define TCP_PORT_ENTTEC 0x0D05 /* Not IANA registered */
@ -107,8 +107,6 @@ static int ett_enttec = -1;
* for enttec
*/
static guint global_udp_port_enttec = UDP_PORT_ENTTEC;
static gint global_disp_chan_val_type = 0;
static gint global_disp_col_count = 16;
static gint global_disp_chan_nr_type = 0;
@ -544,12 +542,7 @@ proto_register_enttec(void)
proto_register_field_array(proto_enttec,hf,array_length(hf));
proto_register_subtree_array(ett,array_length(ett));
enttec_module = prefs_register_protocol(proto_enttec,
proto_reg_handoff_enttec);
prefs_register_uint_preference(enttec_module, "udp_port",
"ENTTEC UDP Port",
"The UDP port on which ENTTEC packets will be sent",
10,&global_udp_port_enttec);
enttec_module = prefs_register_protocol(proto_enttec, NULL);
prefs_register_enum_preference(enttec_module, "dmx_disp_chan_val_type",
"DMX Display channel value type",
@ -573,22 +566,13 @@ proto_register_enttec(void)
/* The registration hand-off routing */
void
proto_reg_handoff_enttec(void) {
static gboolean enttec_initialized = FALSE;
static dissector_handle_t enttec_udp_handle, enttec_tcp_handle;
static guint udp_port_enttec;
dissector_handle_t enttec_udp_handle, enttec_tcp_handle;
if(!enttec_initialized) {
enttec_udp_handle = create_dissector_handle(dissect_enttec_udp,proto_enttec);
enttec_tcp_handle = create_dissector_handle(dissect_enttec_tcp,proto_enttec);
dissector_add_uint_with_preference("tcp.port",TCP_PORT_ENTTEC,enttec_tcp_handle);
enttec_initialized = TRUE;
} else {
dissector_delete_uint("udp.port",udp_port_enttec,enttec_udp_handle);
}
enttec_udp_handle = create_dissector_handle(dissect_enttec_udp,proto_enttec);
enttec_tcp_handle = create_dissector_handle(dissect_enttec_tcp,proto_enttec);
udp_port_enttec = global_udp_port_enttec;
dissector_add_uint("udp.port",global_udp_port_enttec,enttec_udp_handle);
dissector_add_uint_with_preference("tcp.port",TCP_PORT_ENTTEC,enttec_tcp_handle);
dissector_add_uint_with_preference("udp.port",UDP_PORT_ENTTEC,enttec_udp_handle);
}
/*

View File

@ -4562,7 +4562,7 @@ proto_reg_handoff_epl(void)
dissector_handle_t epl_udp_handle = create_dissector_handle( dissect_epludp, proto_epl );
dissector_add_uint("ethertype", ETHERTYPE_EPL_V2, epl_handle);
dissector_add_uint("udp.port", UDP_PORT_EPL, epl_udp_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_EPL, epl_udp_handle);
/* register frame init routine */
register_init_routine( setup_dissector );

View File

@ -33,6 +33,8 @@
void proto_register_esio(void);
void proto_reg_handoff_esio(void);
#define ESIO_UDP_PORT 6060 /* Not IANA registered */
/* Initialize the protocol and registered fields */
static int proto_esio = -1;
static int hf_esio_type = -1;
@ -419,7 +421,7 @@ proto_reg_handoff_esio(void)
dissector_handle_t esio_handle;
esio_handle = create_dissector_handle(dissect_esio, proto_esio);
dissector_add_uint("udp.port", 6060, esio_handle);
dissector_add_uint_with_preference("udp.port", ESIO_UDP_PORT, esio_handle);
}
/*

View File

@ -1034,7 +1034,7 @@ proto_reg_handoff_eth(void)
* command - it encapsulates Ethernet frames in UDP packets, but
* the UDP port is user-defined.
*/
dissector_add_for_decode_as("udp.port", eth_withoutfcs_handle);
dissector_add_for_decode_as_with_preference("udp.port", eth_withoutfcs_handle);
dissector_add_for_decode_as("pcli.payload", eth_withoutfcs_handle);

View File

@ -15289,32 +15289,14 @@ proto_reg_handoff_ff(void)
* 4.8.4.2. Use
*
* - Device Annunciation
*/
dissector_add_uint("udp.port", UDP_PORT_FF_ANNUNC, ff_udp_handle);
/*
* 4.8.4.2. Use
*
* - Client / Server
*/
dissector_add_uint("udp.port", UDP_PORT_FF_FMS, ff_udp_handle);
dissector_add_uint_with_preference("tcp.port", TCP_PORT_FF_FMS, ff_tcp_handle);
/*
* 4.8.4.2. Use
*
* - Set/Clear Assignment Info and Clear Address
* - SM Identify
* - SM Find Tag
*/
dissector_add_uint("udp.port", UDP_PORT_FF_SM, ff_udp_handle);
/*
* 4.8.4.2. Use
*
* - LAN Redundancy Get and Put Information
*/
dissector_add_uint("udp.port", UDP_PORT_FF_LR_PORT, ff_udp_handle);
dissector_add_uint_range_with_preference("udp.port", UDP_PORT_FF_RANGE, ff_udp_handle);
dissector_add_uint_with_preference("tcp.port", TCP_PORT_FF_FMS, ff_tcp_handle);
}
/*

View File

@ -42,16 +42,13 @@
#ifndef __PACKET_FF_H__
#define __PACKET_FF_H__
#define UDP_PORT_FF_ANNUNC 1089
#define UDP_PORT_FF_RANGE "1089-1091,3622"
#define TCP_PORT_FF_ANNUNC 1089
#define UDP_PORT_FF_FMS 1090
#define TCP_PORT_FF_FMS 1090
#define UDP_PORT_FF_SM 1091
#define TCP_PORT_FF_SM 1091
#define UDP_PORT_FF_LR_PORT 3622
#define TCP_PORT_FF_LR_PORT 3622

View File

@ -144,8 +144,6 @@ static int hf_forces_unknown_tlv = -1;
For other type TMLs,no need to add these 2 bytes.*/
#define TCP_UDP_TML_FOCES_MESSAGE_OFFSET_TCP 2
/*TCP+UDP TML*/
static guint forces_alternate_udp_port = 0;
/*SCTP TML*/
static guint forces_alternate_sctp_high_prio_channel_port = 0;
static guint forces_alternate_sctp_med_prio_channel_port = 0;
@ -832,11 +830,6 @@ proto_register_forces(void)
forces_module = prefs_register_protocol(proto_forces,proto_reg_handoff_forces);
prefs_register_uint_preference(forces_module, "udp_alternate_port",
"UDP port",
"Decode packets on this UDP port as ForCES",
10, &forces_alternate_udp_port);
prefs_register_uint_preference(forces_module, "sctp_high_prio_port",
"SCTP High Priority channel port",
"Decode packets on this sctp port as ForCES",
@ -858,7 +851,6 @@ proto_reg_handoff_forces(void)
{
static gboolean inited = FALSE;
static guint alternate_udp_port = 0;
static guint alternate_sctp_high_prio_channel_port = 0; /* 6700 */
static guint alternate_sctp_med_prio_channel_port = 0;
static guint alternate_sctp_low_prio_channel_port = 0;
@ -871,18 +863,12 @@ proto_reg_handoff_forces(void)
ip_handle = find_dissector_add_dependency("ip", proto_forces);
/* Register TCP port for dissection */
dissector_add_for_decode_as_with_preference("tcp.port", forces_handle_tcp);
/* Register UDP port for dissection */
dissector_add_for_decode_as_with_preference("udp.port", forces_handle);
inited = TRUE;
}
/* Register UDP port for dissection */
if ((alternate_udp_port != 0) && (alternate_udp_port != forces_alternate_udp_port))
dissector_delete_uint("udp.port", alternate_udp_port, forces_handle);
if ((forces_alternate_udp_port != 0) && (alternate_udp_port != forces_alternate_udp_port))
dissector_add_uint("udp.port", forces_alternate_udp_port, forces_handle);
alternate_udp_port = forces_alternate_udp_port;
/* Register SCTP port for high priority dissection */
if ((alternate_sctp_high_prio_channel_port != 0) &&
(alternate_sctp_high_prio_channel_port != forces_alternate_sctp_high_prio_channel_port))

View File

@ -451,8 +451,7 @@ proto_reg_handoff_geneve(void)
dissector_handle_t geneve_handle;
geneve_handle = create_dissector_handle(dissect_geneve, proto_geneve);
dissector_add_uint("udp.port", UDP_PORT_GENEVE, geneve_handle);
dissector_add_for_decode_as("udp.port", geneve_handle);
dissector_add_uint_with_preference("udp.port", UDP_PORT_GENEVE, geneve_handle);
ethertype_dissector_table = find_dissector_table("ethertype");
}

View File

@ -44,6 +44,8 @@
void proto_register_glbp(void);
void proto_reg_handoff_glbp(void);
#define GLBP_UDP_PORT 3222
static int proto_glbp = -1;
/* glbp header? */
static gint hf_glbp_version = -1;
@ -596,8 +598,8 @@ proto_register_glbp(void)
expert_module_t* expert_glbp;
proto_glbp = proto_register_protocol(
"Gateway Load Balancing Protocol", "GLBP", "glbp");
proto_glbp = proto_register_protocol("Gateway Load Balancing Protocol", "GLBP", "glbp");
proto_register_field_array(proto_glbp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_glbp = expert_register_protocol(proto_glbp);
@ -610,7 +612,7 @@ proto_reg_handoff_glbp(void)
dissector_handle_t glbp_handle;
glbp_handle = create_dissector_handle(dissect_glbp_static, proto_glbp);
dissector_add_uint("udp.port", 3222, glbp_handle);
dissector_add_uint_with_preference("udp.port", GLBP_UDP_PORT, glbp_handle);
}
/*

View File

@ -72,12 +72,9 @@ void proto_reg_handoff_gsm_ipa(void);
************************************************************************
*/
#define IPA_TCP_PORTS "3002,3003,3006,4249,4250,5000"
#define IPA_UDP_PORTS "3006"
#define IPA_UDP_PORTS_DEFAULT "0"
static dissector_handle_t ipa_tcp_handle;
static dissector_handle_t ipa_udp_handle;
static range_t *global_ipa_udp_ports = NULL;
static gboolean global_ipa_in_root = FALSE;
static gboolean global_ipa_in_info = FALSE;
@ -456,15 +453,7 @@ void proto_register_ipa(void)
"GSM over IP ip.access Protocol", proto_ipa,
FT_UINT8, BASE_DEC);
range_convert_str(&global_ipa_udp_ports, IPA_UDP_PORTS_DEFAULT, MAX_UDP_PORT);
ipa_module = prefs_register_protocol(proto_ipa, proto_reg_handoff_gsm_ipa);
prefs_register_range_preference(ipa_module, "udp_ports",
"GSM IPA UDP Port(s)",
"Set the port(s) for ip.access IPA"
" (usually: " IPA_UDP_PORTS ")",
&global_ipa_udp_ports, MAX_UDP_PORT);
ipa_module = prefs_register_protocol(proto_ipa, NULL);
prefs_register_bool_preference(ipa_module, "hsl_debug_in_root_tree",
"HSL Debug messages in root protocol tree",
@ -476,28 +465,16 @@ void proto_register_ipa(void)
void proto_reg_handoff_gsm_ipa(void)
{
static gboolean ipa_initialized = FALSE;
static range_t *ipa_udp_ports;
sub_handles[SUB_RSL] = find_dissector_add_dependency("gsm_abis_rsl", proto_ipa);
sub_handles[SUB_OML] = find_dissector_add_dependency("gsm_abis_oml", proto_ipa);
sub_handles[SUB_SCCP] = find_dissector_add_dependency("sccp", proto_ipa);
sub_handles[SUB_MGCP] = find_dissector_add_dependency("mgcp", proto_ipa);
sub_handles[SUB_DATA] = find_dissector("data");
if (!ipa_initialized) {
sub_handles[SUB_RSL] = find_dissector_add_dependency("gsm_abis_rsl", proto_ipa);
sub_handles[SUB_OML] = find_dissector_add_dependency("gsm_abis_oml", proto_ipa);
sub_handles[SUB_SCCP] = find_dissector_add_dependency("sccp", proto_ipa);
sub_handles[SUB_MGCP] = find_dissector_add_dependency("mgcp", proto_ipa);
sub_handles[SUB_DATA] = find_dissector("data");
ipa_tcp_handle = create_dissector_handle(dissect_ipa_tcp, proto_ipa);
ipa_udp_handle = create_dissector_handle(dissect_ipa_udp, proto_ipa);
dissector_add_uint_range_with_preference("tcp.port", IPA_TCP_PORTS, ipa_tcp_handle);
ipa_initialized = TRUE;
} else {
dissector_delete_uint_range("udp.port", ipa_udp_ports, ipa_udp_handle);
g_free(ipa_udp_ports);
}
ipa_udp_ports = range_copy(global_ipa_udp_ports);
dissector_add_uint_range("udp.port", ipa_udp_ports, ipa_udp_handle);
ipa_tcp_handle = create_dissector_handle(dissect_ipa_tcp, proto_ipa);
ipa_udp_handle = create_dissector_handle(dissect_ipa_udp, proto_ipa);
dissector_add_uint_range_with_preference("tcp.port", IPA_TCP_PORTS, ipa_tcp_handle);
dissector_add_uint_range_with_preference("udp.port", "", ipa_udp_handle);
}
/*

View File

@ -282,17 +282,14 @@ void proto_register_osmux(void)
void proto_reg_handoff_osmux(void)
{
static gboolean osmux_initialized = FALSE;
osmux_handle = create_dissector_handle(dissect_osmux, proto_osmux);
dissector_add_for_decode_as_with_preference("udp.port", osmux_handle);
if (!osmux_initialized) {
osmux_handle = create_dissector_handle(dissect_osmux, proto_osmux);
dissector_add_for_decode_as("udp.port", osmux_handle);
osmux_tap = register_tap("osmux");
osmux_initialized = TRUE;
stats_tree_register("osmux", "osmux", "Osmux/Packets", 0,
osmux_stats_tree_packet, osmux_stats_tree_init,
NULL);
}
osmux_tap = register_tap("osmux");
stats_tree_register("osmux", "osmux", "Osmux/Packets", 0,
osmux_stats_tree_packet, osmux_stats_tree_init,
NULL);
}
/*

View File

@ -869,7 +869,7 @@ proto_reg_handoff_gsmtap(void)
rrc_sub_handles[GSMTAP_RRC_SUB_TargetRNC_ToSourceRNC_Container] = find_dissector_add_dependency("rrc.t_to_srnc_cont", proto_gsmtap);
gsmtap_handle = create_dissector_handle(dissect_gsmtap, proto_gsmtap);
dissector_add_uint("udp.port", GSMTAP_UDP_PORT, gsmtap_handle);
dissector_add_uint_with_preference("udp.port", GSMTAP_UDP_PORT, gsmtap_handle);
}
/*

View File

@ -10101,6 +10101,8 @@ proto_reg_handoff_gtp(void)
gtpv1c_port = g_gtpv1c_port;
gtpv1u_port = g_gtpv1u_port;
/* This doesn't use the "auto preference" API because the port
description is too specific */
dissector_add_uint("udp.port", g_gtpv0_port, gtp_prime_handle);
dissector_add_uint("udp.port", g_gtpv1c_port, gtp_handle);
dissector_add_uint("udp.port", g_gtpv1u_port, gtp_handle);

View File

@ -2274,19 +2274,14 @@ void proto_register_gvsp(void)
proto_register_field_array(proto_gvsp, hfgvsp, array_length(hfgvsp));
proto_register_subtree_array(ett, array_length(ett));
gvsp_module = prefs_register_protocol(proto_gvsp, proto_reg_handoff_gvsp);
gvsp_module = prefs_register_protocol(proto_gvsp, NULL);
prefs_register_obsolete_preference(gvsp_module, "enable_heuristic");
}
void proto_reg_handoff_gvsp(void)
{
static gboolean initialized = FALSE;
if (!initialized) {
dissector_add_for_decode_as("udp.port", gvsp_handle);
heur_dissector_add("udp", dissect_gvsp_heur, "GigE Vision over UDP", "gvsp_udp", proto_gvsp, HEURISTIC_ENABLE);
initialized = TRUE;
}
dissector_add_for_decode_as_with_preference("udp.port", gvsp_handle);
heur_dissector_add("udp", dissect_gvsp_heur, "GigE Vision over UDP", "gvsp_udp", proto_gvsp, HEURISTIC_ENABLE);
}
/*

Some files were not shown because too many files have changed in this diff Show More