Cleanup related to prefs & proto_reg_handoff

svn path=/trunk/; revision=26124
This commit is contained in:
Bill Meier 2008-09-02 21:40:46 +00:00
parent 80b87dfaf3
commit 8d9c5d9b2b
7 changed files with 98 additions and 142 deletions

View File

@ -434,12 +434,6 @@ static actrace_info_t *actrace_pi;
*/
static guint global_actrace_udp_port = UDP_PORT_ACTRACE;
/*
* Variables to allow for proper deletion of dissector registration when
* the user changes port from the gui.
*/
static guint actrace_udp_port = 0;
/* Some basic utility functions that are specific to this dissector */
static int is_actrace(tvbuff_t *tvb, gint offset);
@ -807,15 +801,15 @@ void proto_register_actrace(void)
/* The registration hand-off routine */
void proto_reg_handoff_actrace(void)
{
static int actrace_prefs_initialized = FALSE;
static gboolean actrace_prefs_initialized = FALSE;
static dissector_handle_t actrace_handle;
/* Get a handle for the lapd dissector. */
lapd_handle = find_dissector("lapd");
static guint actrace_udp_port = 0;
if (!actrace_prefs_initialized)
{
actrace_handle = new_create_dissector_handle(dissect_actrace, proto_actrace);
/* Get a handle for the lapd dissector. */
lapd_handle = find_dissector("lapd");
actrace_prefs_initialized = TRUE;
}
else

View File

@ -53,7 +53,7 @@
/*
* IOS 4, probably most common
*/
gint a_global_variant = A_VARIANT_IOS401;
gint global_a_variant = A_VARIANT_IOS401;
/* PROTOTYPES/FORWARDS */
@ -694,15 +694,8 @@ static gint ett_adds_user_part = -1;
static gint ett_scr = -1;
static gint ett_srvc_con_rec = -1;
/*
* Variables to allow for proper deletion of dissector registration when
* the user changes values
*/
static gint a_variant = 0;
static char a_bigbuf[1024];
static dissector_handle_t data_handle;
static dissector_handle_t bsmap_handle;
static dissector_handle_t dtap_handle;
static dissector_table_t is637_dissector_table; /* IS-637-A Transport Layer (SMS) */
static dissector_table_t is683_dissector_table; /* IS-683-A (OTA) */
@ -931,7 +924,7 @@ elem_chan_num(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar
value = tvb_get_ntohs(tvb, curr_offset);
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS401:
proto_tree_add_text(tree,
@ -3399,7 +3392,7 @@ elem_is2000_chan_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len,
oct = tvb_get_guint8(tvb, curr_offset);
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS401:
other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
@ -3473,7 +3466,7 @@ elem_is2000_chan_id(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len,
a_bigbuf,
value);
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS401:
other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
@ -4826,7 +4819,7 @@ elem_hho_params(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gcha
oct = tvb_get_guint8(tvb, curr_offset);
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS401:
other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
@ -5830,7 +5823,7 @@ elem_is2000_mob_cap(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len,
oct = tvb_get_guint8(tvb, curr_offset);
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS401:
other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
@ -6793,7 +6786,7 @@ elem_ext_ho_dir_params(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint le
a_bigbuf,
(oct & 0xf0) >> 4);
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS401:
other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
@ -8924,7 +8917,7 @@ dtap_cm_srvc_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS501:
ELEM_OPT_TLV(ANSI_A_E_SSCI, "");
@ -8995,7 +8988,7 @@ bsmap_page_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS501:
ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
@ -9060,7 +9053,7 @@ dtap_page_resp(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS501:
ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
@ -9199,7 +9192,7 @@ bsmap_ass_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
ELEM_OPT_TLV(ANSI_A_E_QOS_PARAMS, "");
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS501:
ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
@ -9238,7 +9231,7 @@ bsmap_ass_complete(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
ELEM_OPT_TV(ANSI_A_E_SO, "");
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS501:
ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
@ -10218,7 +10211,7 @@ dtap_lu_accept(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
curr_offset = offset;
curr_len = len;
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS401:
ELEM_OPT_TV(ANSI_A_E_LAI, "");
@ -10251,7 +10244,7 @@ dtap_lu_reject(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
ELEM_MAND_V(ANSI_A_E_REJ_CAUSE);
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS501:
ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
@ -10445,7 +10438,7 @@ bsmap_ho_reqd(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS401:
ELEM_OPT_TLV(ANSI_A_E_PDSN_IP_ADDR, "");
@ -10530,7 +10523,7 @@ bsmap_ho_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS401:
ELEM_OPT_TLV(ANSI_A_E_PDSN_IP_ADDR, "");
@ -10543,7 +10536,7 @@ bsmap_ho_req(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
ELEM_OPT_TLV(ANSI_A_E_PTYPE, "");
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS501:
ELEM_OPT_TLV(ANSI_A_E_SRNC_TRNC_TC, "");
@ -10606,7 +10599,7 @@ bsmap_ho_req_ack(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS501:
ELEM_OPT_TLV(ANSI_A_E_TRNC_SRNC_TC, "");
@ -10679,7 +10672,7 @@ bsmap_ho_command(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS501:
ELEM_OPT_TLV(ANSI_A_E_TRNC_SRNC_TC, "");
@ -11316,7 +11309,7 @@ dissect_cdma2000_a1_elements(tvbuff_t *tvb, _U_ packet_info *pinfo, proto_tree *
ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
/* 0x14 PDSN IP Address */
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS401:
ELEM_OPT_TLV(ANSI_A_E_PDSN_IP_ADDR, "");
@ -11583,7 +11576,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* octet 2
*/
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IS634:
other_decode_bitfield_value(a_bigbuf, oct_2, 0x80, 8);
@ -11904,7 +11897,7 @@ proto_register_ansi_a(void)
"global_variant",
"Dissect PDU as",
"(if other than the default of IOS 4.0.1)",
&a_global_variant,
&global_a_variant,
a_variant_options,
FALSE);
@ -11915,28 +11908,22 @@ proto_register_ansi_a(void)
void
proto_reg_handoff_ansi_a(void)
{
static int ansi_a_prefs_initialized = FALSE;
static gboolean ansi_a_prefs_initialized = FALSE;
static dissector_handle_t bsmap_handle;
if (!ansi_a_prefs_initialized)
{
bsmap_handle = create_dissector_handle(dissect_bsmap, proto_a_bsmap);
dtap_handle = create_dissector_handle(dissect_dtap, proto_a_dtap);
data_handle = find_dissector("data");
dissector_add("bsap.pdu_type", BSSAP_PDU_TYPE_BSMAP, bsmap_handle);
dissector_add("bsap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
ansi_a_prefs_initialized = TRUE;
}
else
{
dissector_delete("bsap.pdu_type", BSSAP_PDU_TYPE_BSMAP, bsmap_handle);
dissector_delete("bsap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
}
if (a_variant != a_global_variant)
{
a_variant = a_global_variant;
}
switch (a_variant)
switch (global_a_variant)
{
case A_VARIANT_IOS501:
ansi_a_bsmap_strings = ansi_a_ios501_bsmap_strings;
@ -11951,8 +11938,4 @@ proto_reg_handoff_ansi_a(void)
break;
}
dissector_add("bsap.pdu_type", BSSAP_PDU_TYPE_BSMAP, bsmap_handle);
dissector_add("bsap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
data_handle = find_dissector("data");
}

View File

@ -45,9 +45,6 @@
#define CMPP_ISMG_LONG_PORT 7930
#define CMPP_ISMG_SHORT_PORT 9168
/* Forward declaration we need below */
void proto_reg_handoff_cmpp(void);
/* Initialize the protocol and registered fields */
static gint proto_cmpp = -1;
@ -632,8 +629,6 @@ dissect_cmpp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Register the protocol with Wireshark */
/* Get the CMPP PDU Length */
static guint
get_cmpp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, gint offset)
@ -676,6 +671,7 @@ dissect_cmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Register the protocol with Wireshark */
/* this format is require because a script is used to build the C function
that calls all the protocol registration.
@ -991,18 +987,11 @@ proto_register_cmpp(void) {
void
proto_reg_handoff_cmpp(void)
{
static gboolean inited = FALSE;
dissector_handle_t cmpp_handle;
if (!inited)
{
dissector_handle_t cmpp_handle;
cmpp_handle = new_create_dissector_handle(dissect_cmpp, proto_cmpp);
dissector_add("tcp.port", CMPP_SP_LONG_PORT, cmpp_handle);
dissector_add("tcp.port", CMPP_SP_SHORT_PORT, cmpp_handle);
dissector_add("tcp.port", CMPP_ISMG_LONG_PORT, cmpp_handle);
dissector_add("tcp.port", CMPP_ISMG_SHORT_PORT, cmpp_handle);
inited = TRUE;
}
cmpp_handle = new_create_dissector_handle(dissect_cmpp, proto_cmpp);
dissector_add("tcp.port", CMPP_SP_LONG_PORT, cmpp_handle);
dissector_add("tcp.port", CMPP_SP_SHORT_PORT, cmpp_handle);
dissector_add("tcp.port", CMPP_ISMG_LONG_PORT, cmpp_handle);
dissector_add("tcp.port", CMPP_ISMG_SHORT_PORT, cmpp_handle);
}

View File

@ -88,12 +88,6 @@ static guint global_cops_tcp_port = TCP_PORT_COPS;
/* Preference: desegmentation of COPS */
static gboolean cops_desegment = TRUE;
/* Variable to allow for proper deletion of dissector registration
* when the user changes port from the gui
*/
static guint cops_tcp_port = 0;
#define COPS_OBJECT_HDR_SIZE 4
/* Null string of type "guchar[]". */
@ -2431,21 +2425,21 @@ void proto_register_cops(void)
void proto_reg_handoff_cops(void)
{
static int cops_prefs_initialized = FALSE;
static gboolean cops_prefs_initialized = FALSE;
static dissector_handle_t cops_handle;
static guint cops_tcp_port;
if (!cops_prefs_initialized) {
cops_handle = create_dissector_handle(dissect_cops, proto_cops);
cops_handle = find_dissector("cops");
dissector_add("tcp.port", TCP_PORT_PKTCABLE_COPS, cops_handle);
dissector_add("tcp.port", TCP_PORT_PKTCABLE_MM_COPS, cops_handle);
cops_prefs_initialized = TRUE;
} else
} else {
dissector_delete("tcp.port",cops_tcp_port,cops_handle);
/* Set our port numbers for future use */
}
cops_tcp_port = global_cops_tcp_port;
dissector_add("tcp.port", cops_tcp_port, cops_handle);
dissector_add("tcp.port", TCP_PORT_PKTCABLE_COPS, cops_handle);
dissector_add("tcp.port", TCP_PORT_PKTCABLE_MM_COPS, cops_handle);
}

View File

@ -419,24 +419,23 @@ proto_reg_handoff_distcc(void)
static int distcc_tcp_port;
static dissector_handle_t distcc_handle;
if (registered_dissector) {
/*
* We've registered the dissector with a TCP port number
* of "distcc_tcp_port"; we might be changing the TCP port
* number, so remove that registration.
*/
dissector_delete("tcp.port", distcc_tcp_port, distcc_handle);
} else {
if (!registered_dissector) {
/*
* We haven't registered the dissector yet; get a handle
* for it.
*/
distcc_handle = create_dissector_handle(dissect_distcc,
proto_distcc);
data_handle = find_dissector("data");
registered_dissector = TRUE;
} else {
/*
* We've registered the dissector with a TCP port number
* of "distcc_tcp_port"; we might be changing the TCP port
* number, so remove that registration.
*/
dissector_delete("tcp.port", distcc_tcp_port, distcc_handle);
}
distcc_tcp_port = glb_distcc_tcp_port;
dissector_add("tcp.port", distcc_tcp_port, distcc_handle);
data_handle = find_dissector("data");
}

View File

@ -134,8 +134,7 @@ static gint ett_dtpt_blob = -1;
static dissector_handle_t dtpt_conversation_handle;
static dissector_handle_t dtpt_data_handle;
static dissector_handle_t dtpt_handle;
/** static dissector_handle_t dtpt_data_handle; **/
static dissector_handle_t data_handle;
@ -845,13 +844,19 @@ dissect_dtpt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_reg_handoff_dtpt(void)
{
static int Initialized=FALSE;
static dissector_handle_t dtpt_handle;
static gboolean Initialized=FALSE;
static int ServerPort=0;
if (Initialized) {
dissector_delete("tcp.port", ServerPort, dtpt_handle);
} else {
if (!Initialized) {
dtpt_handle = new_create_dissector_handle(dissect_dtpt, proto_dtpt);
dtpt_conversation_handle = new_create_dissector_handle(dissect_dtpt_conversation, proto_dtpt);
/** dtpt_data_handle = new_create_dissector_handle(dissect_dtpt_data, proto_dtpt); **/
data_handle = find_dissector("data");
Initialized=TRUE;
} else {
dissector_delete("tcp.port", ServerPort, dtpt_handle);
}
/* set port for future deletes */
@ -1184,11 +1189,6 @@ proto_register_dtpt(void)
proto_register_field_array(proto_dtpt, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
dtpt_conversation_handle = new_create_dissector_handle(dissect_dtpt_conversation, proto_dtpt);
dtpt_data_handle = new_create_dissector_handle(dissect_dtpt_data, proto_dtpt);
dtpt_handle = new_create_dissector_handle(dissect_dtpt, proto_dtpt);
data_handle = find_dissector("data");
/* Register a configuration option for port */
dtpt_module = prefs_register_protocol(proto_dtpt,
proto_reg_handoff_dtpt);

View File

@ -69,6 +69,7 @@ static dissector_table_t ppp_subdissector_table;
#define GTP_OPTIONAL 2
#define GTP_CONDITIONAL 4
static gboolean g_gtp_over_tcp = TRUE;
static guint g_gtpv0_port = GTPv0_PORT;
static guint g_gtpv1c_port = GTPv1C_PORT;
static guint g_gtpv1u_port = GTPv1U_PORT;
@ -287,12 +288,8 @@ static gint ett_gtp_ext_ps_handover_xid = -1;
static gint ett_gtp_target_id = -1;
static gint ett_gtp_utran_cont = -1;
static gboolean gtp_tpdu = TRUE;
static gboolean gtp_over_tcp = TRUE;
static gboolean gtp_etsi_order = FALSE;
static guint gtpv0_port = 0;
static guint gtpv1c_port = 0;
static guint gtpv1u_port = 0;
static gboolean g_gtp_tpdu = TRUE;
static gboolean g_gtp_etsi_order = FALSE;
/* Definition of flags masks */
#define GTP_VER_MASK 0xE0
@ -6062,7 +6059,7 @@ dissect_gtp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
else
ext_hdr_val = tvb_get_guint8 (tvb, offset);
if (gtp_etsi_order) {
if (g_gtp_etsi_order) {
checked_field = check_field_presence (gtp_hdr.message, ext_hdr_val , (int *)&mandatory);
switch (checked_field) {
case -2: proto_tree_add_text (gtp_tree, tvb, 0, 0, "[WARNING] message not found");
@ -6084,7 +6081,7 @@ dissect_gtp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
if ((gtp_hdr.message == GTP_MSG_TPDU) && gtp_tpdu) {
if ((gtp_hdr.message == GTP_MSG_TPDU) && g_gtp_tpdu) {
if (gtp_prime)
offset = 6;
@ -6495,18 +6492,18 @@ proto_register_gtp(void)
prefs_register_uint_preference(gtp_module, "v0_port", "GTPv0 port", "GTPv0 port (default 3386)", 10, &g_gtpv0_port);
prefs_register_uint_preference(gtp_module, "v1c_port", "GTPv1 control plane (GTP-C) port", "GTPv1 control plane port (default 2123)", 10, &g_gtpv1c_port);
prefs_register_uint_preference(gtp_module, "v1u_port", "GTPv1 user plane (GTP-U) port", "GTPv1 user plane port (default 2152)", 10, &g_gtpv1u_port);
prefs_register_bool_preference(gtp_module, "dissect_tpdu", "Dissect T-PDU", "Dissect T-PDU", &gtp_tpdu);
prefs_register_bool_preference(gtp_module, "dissect_tpdu", "Dissect T-PDU", "Dissect T-PDU", &g_gtp_tpdu);
prefs_register_obsolete_preference (gtp_module, "v0_dissect_cdr_as");
prefs_register_obsolete_preference (gtp_module, "v0_check_etsi");
prefs_register_obsolete_preference (gtp_module, "v1_check_etsi");
prefs_register_bool_preference (gtp_module, "check_etsi", "Compare GTP order with ETSI", "GTP ETSI order", &gtp_etsi_order);
prefs_register_bool_preference (gtp_module, "check_etsi", "Compare GTP order with ETSI", "GTP ETSI order", &g_gtp_etsi_order);
prefs_register_obsolete_preference(gtp_module, "ppp_reorder");
/* This preference can be used to disable the dissection of GTP over TCP. Most of the Wireless operators uses GTP over UDP.
* The preference is set to TRUE by default forbackward compatibility
*/
prefs_register_bool_preference(gtp_module, "dissect_gtp_over_tcp", "Dissect GTP over TCP", "Dissect GTP over TCP", &gtp_over_tcp);
prefs_register_bool_preference(gtp_module, "dissect_gtp_over_tcp", "Dissect GTP over TCP", "Dissect GTP over TCP", &g_gtp_over_tcp);
register_dissector("gtp", dissect_gtp, proto_gtp);
}
@ -6514,9 +6511,12 @@ proto_register_gtp(void)
void
proto_reg_handoff_gtp(void)
{
static int Initialized = FALSE;
static gboolean Initialized = FALSE;
static dissector_handle_t gtp_handle;
static gboolean gtp_over_tcp;
static guint gtpv0_port;
static guint gtpv1c_port;
static guint gtpv1u_port;
if (!Initialized) {
gtp_handle = find_dissector("gtp");
@ -6527,47 +6527,44 @@ proto_reg_handoff_gtp(void)
radius_register_avp_dissector(VENDOR_THE3GPP,21,dissect_radius_rat_type);
radius_register_avp_dissector(VENDOR_THE3GPP,22,dissect_radius_user_loc);
ip_handle = find_dissector("ip");
ipv6_handle = find_dissector("ipv6");
ppp_handle = find_dissector("ppp");
data_handle = find_dissector("data");
gtpcdr_handle = find_dissector("gtpcdr");
sndcpxid_handle = find_dissector("sndcpxid");
bssap_pdu_type_table = find_dissector_table("bssap.pdu_type");
/* AVP Code: 904 MBMS-Session-Duration */
dissector_add("diameter.3gpp", 904, new_create_dissector_handle(dissect_gtp_mbms_ses_dur, proto_gtp));
/* AVP Code: 911 MBMS-Time-To-Data-Transfer */
dissector_add("diameter.3gpp", 911, new_create_dissector_handle(dissect_gtp_mbms_time_to_data_tr, proto_gtp));
Initialized = TRUE;
} else {
dissector_delete ("udp.port", gtpv0_port, gtp_handle);
dissector_delete ("udp.port", gtpv1c_port, gtp_handle);
dissector_delete ("udp.port", gtpv1u_port, gtp_handle);
if ( !gtp_over_tcp ) {
if ( gtp_over_tcp ) {
dissector_delete ("tcp.port", gtpv0_port, gtp_handle);
dissector_delete ("tcp.port", gtpv1c_port, gtp_handle);
dissector_delete ("tcp.port", gtpv1u_port, gtp_handle);
}
}
gtpv0_port = g_gtpv0_port;
gtpv1c_port = g_gtpv1c_port;
gtpv1u_port = g_gtpv1u_port;
gtp_over_tcp = g_gtp_over_tcp;
gtpv0_port = g_gtpv0_port;
gtpv1c_port = g_gtpv1c_port;
gtpv1u_port = g_gtpv1u_port;
dissector_add ("udp.port", g_gtpv0_port, gtp_handle);
dissector_add ("udp.port", g_gtpv1c_port, gtp_handle);
dissector_add ("udp.port", g_gtpv1u_port, gtp_handle);
if ( gtp_over_tcp ) {
if ( g_gtp_over_tcp ) {
dissector_add ("tcp.port", g_gtpv0_port, gtp_handle);
dissector_add ("tcp.port", g_gtpv1c_port, gtp_handle);
dissector_add ("tcp.port", g_gtpv1u_port, gtp_handle);
}
ip_handle = find_dissector("ip");
ipv6_handle = find_dissector("ipv6");
ppp_handle = find_dissector("ppp");
data_handle = find_dissector("data");
gtpcdr_handle = find_dissector("gtpcdr");
sndcpxid_handle = find_dissector("sndcpxid");
bssap_pdu_type_table = find_dissector_table("bssap.pdu_type");
/* AVP Code: 904 MBMS-Session-Duration */
dissector_add("diameter.3gpp", 904, new_create_dissector_handle(dissect_gtp_mbms_ses_dur, proto_gtp));
/* AVP Code: 911 MBMS-Time-To-Data-Transfer */
dissector_add("diameter.3gpp", 911, new_create_dissector_handle(dissect_gtp_mbms_time_to_data_tr, proto_gtp));
}