Minor cleanup related to proto_register & proto_reg_handoff

svn path=/trunk/; revision=26280
This commit is contained in:
Bill Meier 2008-09-26 20:06:40 +00:00
parent a14b7b5264
commit ffa7320de2
19 changed files with 72 additions and 108 deletions

View File

@ -3039,14 +3039,12 @@ void proto_register_acn(void)
};
module_t *acn_module;
if (proto_acn == -1) {
proto_acn = proto_register_protocol (
"Architecture for Control Networks", /* name */
"ACN", /* short name */
"acn" /* abbrev */
);
}
proto_acn = proto_register_protocol (
"Architecture for Control Networks", /* name */
"ACN", /* short name */
"acn" /* abbrev */
);
proto_register_field_array(proto_acn, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));

View File

@ -54,7 +54,6 @@ static int hf_bat_batman_flags_directlink = -1;
/* unknown */
static guint global_bat_batman_udp_port = BAT_BATMAN_PORT;
static guint udp_port = 0;
static void dissect_bat_batman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static void dissect_bat_hna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
@ -158,6 +157,7 @@ void reg_handoff_bat_batman(void)
{
static gboolean inited = FALSE;
static dissector_handle_t batman_handle;
static guint udp_port;
if (!inited) {
batman_handle = create_dissector_handle(dissect_bat_batman, proto_bat_plugin);

View File

@ -35,7 +35,6 @@ static int hf_bat_gw_type = -1;
static int hf_bat_gw_ip = -1;
static guint global_bat_gw_udp_port = BAT_GW_PORT;
static guint udp_port = 0;
static void dissect_bat_gw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
@ -81,6 +80,7 @@ void reg_handoff_bat_gw(void)
{
static gboolean inited = FALSE;
static dissector_handle_t gw_handle;
static guint udp_port;
if (!inited) {
gw_handle = create_dissector_handle(dissect_bat_gw, proto_bat_plugin);

View File

@ -43,7 +43,6 @@ static int hf_bat_vis_tq_v23 = -1;
static int hf_bat_vis_data_ip = -1;
static guint global_bat_vis_udp_port = BAT_VIS_PORT;
static guint udp_port = 0;
static void dissect_vis_entry_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static void dissect_bat_vis_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
@ -132,6 +131,7 @@ void reg_handoff_bat_vis(void)
{
static gboolean inited = FALSE;
static dissector_handle_t vis_handle;
static guint udp_port;
if (!inited) {
vis_handle = create_dissector_handle(dissect_bat_vis, proto_bat_plugin);

View File

@ -850,17 +850,14 @@ proto_register_dcp_etsi (void)
&ett_edcp_fragments
};
if (proto_dcp_etsi == -1) {
proto_dcp_etsi = proto_register_protocol ("ETSI Distribution & Communication Protocol (for DRM)", /* name */
"DCP (ETSI)", /* short name */
"dcp-etsi" /* abbrev */
);
proto_af = proto_register_protocol ("DCP Application Framing Layer", "DCP-AF", "dcp-af");
proto_pft = proto_register_protocol ("DCP Protection, Fragmentation & Transport Layer", "DCP-PFT", "dcp-pft");
proto_tpl = proto_register_protocol ("DCP Tag Packet Layer", "DCP-TPL", "dcp-tpl");
proto_dcp_etsi = proto_register_protocol ("ETSI Distribution & Communication Protocol (for DRM)", /* name */
"DCP (ETSI)", /* short name */
"dcp-etsi" /* abbrev */
);
proto_af = proto_register_protocol ("DCP Application Framing Layer", "DCP-AF", "dcp-af");
proto_pft = proto_register_protocol ("DCP Protection, Fragmentation & Transport Layer", "DCP-PFT", "dcp-pft");
proto_tpl = proto_register_protocol ("DCP Tag Packet Layer", "DCP-TPL", "dcp-tpl");
}
proto_register_field_array (proto_dcp_etsi, hf_edcp, array_length (hf_edcp));
proto_register_field_array (proto_af, hf_af, array_length (hf_af));
proto_register_field_array (proto_pft, hf_pft, array_length (hf_pft));

View File

@ -1757,16 +1757,13 @@ void proto_register_dplay()
&ett_dplay_type29_spp,
};
if(proto_dplay == -1)
{
proto_dplay = proto_register_protocol (
"DirectPlay Protocol",
"DPLAY",
"dplay"
);
proto_register_field_array(proto_dplay, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
proto_dplay = proto_register_protocol (
"DirectPlay Protocol",
"DPLAY",
"dplay"
);
proto_register_field_array(proto_dplay, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
void proto_reg_handoff_dplay(void)

View File

@ -411,8 +411,6 @@ static char a_bigbuf[1024];
static dissector_handle_t data_handle;
static dissector_handle_t gsm_map_handle;
static dissector_handle_t gsm_bsslap_handle = NULL;
static dissector_handle_t dtap_handle;
static dissector_handle_t rp_handle;
packet_info *gsm_a_dtap_pinfo;
@ -5724,15 +5722,15 @@ proto_register_gsm_a_dtap(void)
void
proto_reg_handoff_gsm_a_dtap(void)
{
dissector_handle_t dtap_handle;
dtap_handle = find_dissector("gsm_a_dtap");
rp_handle = find_dissector("gsm_a_rp");
dissector_add("bssap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
dissector_add("ranap.nas_pdu", BSSAP_PDU_TYPE_DTAP, dtap_handle);
dissector_add("llcgprs.sapi", 1 , dtap_handle); /* GPRS Mobility Management */
dissector_add("llcgprs.sapi", 7 , dtap_handle); /* SMS */
data_handle = find_dissector("data");
gsm_map_handle = find_dissector("gsm_map");
gsm_bsslap_handle = find_dissector("gsm_bsslap");
rp_handle = find_dissector("gsm_a_rp");
}

View File

@ -122,9 +122,8 @@ static gint ett_h223_al2 = -1;
static gint ett_h223_al_payload = -1;
/* These are the handles of our subdissectors */
static dissector_handle_t data_handle=NULL;
static dissector_handle_t srp_handle=NULL;
static dissector_handle_t h245dg_handle=NULL;
static dissector_handle_t data_handle;
static dissector_handle_t srp_handle;
static const fragment_items h223_mux_frag_items _U_ = {
&ett_h223_mux_fragment,
@ -1549,7 +1548,6 @@ void proto_register_h223 (void)
&ett_h223_al_payload
};
if (proto_h223 == -1) { /* execute protocol initialization only once */
proto_h223 =
proto_register_protocol ("ITU-T Recommendation H.223", "H.223", "h223");
proto_h223_bitswapped =
@ -1563,7 +1561,6 @@ void proto_register_h223 (void)
/* register our init routine to be called at the start of a capture,
to clear out our hash tables etc */
register_init_routine(&h223_init_protocol);
}
h245_set_h223_set_mc_handle( &h223_set_mc );
h245_set_h223_add_lc_handle( &h223_add_lc );
@ -1574,7 +1571,6 @@ void proto_reg_handoff_h223(void)
dissector_handle_t h223_bitswapped = find_dissector("h223_bitswapped");
dissector_handle_t h223 = find_dissector("h223");
data_handle = find_dissector("data");
h245dg_handle = find_dissector("h245dg");
srp_handle = find_dissector("srp");
dissector_add_handle("tcp.port", h223);

View File

@ -203,8 +203,8 @@ static dissector_table_t port_subdissector_table;
static dissector_table_t media_type_subdissector_table;
static heur_dissector_list_t heur_subdissector_list;
static dissector_handle_t ntlmssp_handle=NULL;
static dissector_handle_t gssapi_handle=NULL;
static dissector_handle_t ntlmssp_handle;
static dissector_handle_t gssapi_handle;
static const value_string vals_status_code[] = {
{ 100, "Continue" },
@ -2364,7 +2364,6 @@ proto_reg_handoff_http(void)
static gint proto_message_http = -1;
static gint ett_message_http = -1;
static dissector_handle_t message_http_handle;
static void
dissect_message_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
@ -2411,6 +2410,8 @@ proto_register_message_http(void)
void
proto_reg_handoff_message_http(void)
{
dissector_handle_t message_http_handle;
message_http_handle = create_dissector_handle(dissect_message_http,
proto_message_http);

View File

@ -730,13 +730,11 @@ proto_register_linx(void)
&ett_linx_ack
};
if (proto_linx == -1) {
proto_linx = proto_register_protocol (
"ENEA LINX", /* name */
"LINX", /* short name */
"linx" /* abbrev */
);
}
proto_linx = proto_register_protocol (
"ENEA LINX", /* name */
"LINX", /* short name */
"linx" /* abbrev */
);
/* Protocol Registering data structures. */
proto_register_field_array(proto_linx, hf, array_length(hf));

View File

@ -770,14 +770,12 @@ proto_register_nhrp(void)
&ett_nhrp_indication
};
if (proto_nhrp == -1) {
proto_nhrp = proto_register_protocol(
"NBMA Next Hop Resolution Protocol",
"NHRP",
"nhrp");
proto_register_field_array(proto_nhrp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
proto_nhrp = proto_register_protocol(
"NBMA Next Hop Resolution Protocol",
"NHRP",
"nhrp");
proto_register_field_array(proto_nhrp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
void

View File

@ -101,7 +101,6 @@
static int proto_rsvp = -1;
static dissector_table_t rsvp_dissector_table;
static dissector_handle_t data_handle;
static int rsvp_tap = -1;
@ -5946,6 +5945,5 @@ proto_reg_handoff_rsvp(void)
dissector_add("ip.proto", IP_PROTO_RSVP, rsvp_handle);
dissector_add("ip.proto", IP_PROTO_RSVPE2EI, rsvp_handle);
dissector_add("udp.port", UDP_PORT_PRSVP, rsvp_handle);
data_handle = find_dissector("data");
rsvp_tap = register_tap("rsvp");
}

View File

@ -53,8 +53,6 @@ static int hf_slimp3_data_ack = -1;
static gint ett_slimp3 = -1;
static dissector_handle_t slimp3_handle;
#define UDP_PORT_SLIMP3_V1 1069
#define UDP_PORT_SLIMP3_V2 3483
@ -746,13 +744,14 @@ proto_register_slimp3(void)
"SliMP3", "slimp3");
proto_register_field_array(proto_slimp3, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
slimp3_handle = new_create_dissector_handle(dissect_slimp3, proto_slimp3);
}
void
proto_reg_handoff_slimp3(void)
{
dissector_handle_t slimp3_handle;
slimp3_handle = new_create_dissector_handle(dissect_slimp3, proto_slimp3);
dissector_add("udp.port", UDP_PORT_SLIMP3_V1, slimp3_handle);
dissector_add("udp.port", UDP_PORT_SLIMP3_V2, slimp3_handle);
}

View File

@ -1194,10 +1194,6 @@ proto_register_socks( void){
proto_register_field_array(proto_socks, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
socks_udp_handle = create_dissector_handle(socks_udp_dissector,
proto_socks);
socks_handle = create_dissector_handle(dissect_socks, proto_socks);
}
@ -1205,6 +1201,8 @@ void
proto_reg_handoff_socks(void) {
/* dissector install routine */
socks_udp_handle = create_dissector_handle(socks_udp_dissector, proto_socks);
socks_handle = create_dissector_handle(dissect_socks, proto_socks);
dissector_add("tcp.port", TCP_PORT_SOCKS, socks_handle);
}

View File

@ -54,9 +54,8 @@ static int hf_ccsrl_ls = -1;
static gint ett_srp = -1;
static gint ett_ccsrl = -1;
static dissector_handle_t data_handle=NULL;
static dissector_handle_t ccsrl_handle=NULL;
static dissector_handle_t h245dg_handle=NULL;
static dissector_handle_t ccsrl_handle;
static dissector_handle_t h245dg_handle;
/*****************************************************************************/
#define SRP_SRP_COMMAND 249
@ -188,14 +187,10 @@ void proto_register_ccsrl (void)
&ett_ccsrl,
};
if (proto_ccsrl == -1) { /* execute protocol initialization only once */
proto_ccsrl =
proto_register_protocol ("H.324/CCSRL", "CCSRL", "ccsrl");
proto_register_field_array (proto_ccsrl, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
register_dissector("ccsrl", dissect_ccsrl, proto_ccsrl);
}
proto_ccsrl = proto_register_protocol ("H.324/CCSRL", "CCSRL", "ccsrl");
proto_register_field_array (proto_ccsrl, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
register_dissector("ccsrl", dissect_ccsrl, proto_ccsrl);
}
void proto_register_srp (void)
@ -219,24 +214,19 @@ void proto_register_srp (void)
&ett_srp,
};
if (proto_srp == -1) { /* execute protocol initialization only once */
proto_srp =
proto_register_protocol ("H.324/SRP", "SRP", "srp");
proto_srp = proto_register_protocol ("H.324/SRP", "SRP", "srp");
proto_register_field_array (proto_srp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
register_dissector("srp", dissect_srp, proto_srp);
proto_register_field_array (proto_srp, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
register_dissector("srp", dissect_srp, proto_srp);
/* register our init routine to be called at the start of a capture,
to clear out our hash tables etc */
/* register_init_routine(&srp_init_protocol); */
/* register our init routine to be called at the start of a capture,
to clear out our hash tables etc */
/* register_init_routine(&srp_init_protocol); */
}
}
void proto_reg_handoff_srp(void) {
data_handle = find_dissector("data");
ccsrl_handle = find_dissector("ccsrl");
h245dg_handle = find_dissector("h245dg");
}

View File

@ -49,9 +49,6 @@ static int hf_tsp_name = -1;
static gint ett_tsp = -1;
static dissector_handle_t tsp_handle;
/* timed port from /etc/services */
#define UDP_PORT_TIMED 525
@ -176,6 +173,9 @@ dissect_tsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
void
proto_reg_handoff_tsp(void)
{
dissector_handle_t tsp_handle;
tsp_handle = create_dissector_handle(dissect_tsp, proto_tsp);
dissector_add("udp.port", UDP_PORT_TIMED, tsp_handle);
}
@ -221,7 +221,5 @@ proto_register_tsp(void)
"TSP", "tsp");
proto_register_field_array(proto_tsp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
tsp_handle = create_dissector_handle(dissect_tsp, proto_tsp);
}

View File

@ -136,10 +136,9 @@ UAT_DEC_CB_DEF(user_encap, trailer_size, user_encap_t)
UAT_PROTO_DEF(user_encap, header_proto, header_proto, header_proto_name, user_encap_t)
UAT_PROTO_DEF(user_encap, trailer_proto, trailer_proto, trailer_proto_name, user_encap_t)
static dissector_handle_t user_encap_handle;
void proto_reg_handoff_user_encap(void)
{
dissector_handle_t user_encap_handle;
guint i;
user_encap_handle = find_dissector("user_dlt");
@ -184,10 +183,10 @@ void proto_register_user_encap(void)
user_flds );
prefs_register_uat_preference(module,
"encaps_table",
"Encapsulations Table",
"A table that enumerates the various protocols to be used against a cartain user DLT",
encaps_uat);
"encaps_table",
"Encapsulations Table",
"A table that enumerates the various protocols to be used against a cartain user DLT",
encaps_uat);
register_dissector("user_dlt",dissect_user,proto_user_encap);

View File

@ -106,8 +106,6 @@ static gint ett_winsrepl_send_reply = -1;
static gint ett_winsrepl_flags = -1;
static dissector_handle_t winsrepl_handle;
#define WINS_REPLICATION_PORT ( 42 )
#define WREPL_OPCODE_BITS ( 0x7800 )
@ -916,6 +914,8 @@ proto_register_winsrepl(void)
void
proto_reg_handoff_winsrepl(void)
{
dissector_handle_t winsrepl_handle;
winsrepl_handle = create_dissector_handle(dissect_winsrepl, proto_winsrepl);
dissector_add("tcp.port", glb_winsrepl_tcp_port, winsrepl_handle);
}

View File

@ -203,13 +203,12 @@ proto_register_xyplex(void)
proto_xyplex = proto_register_protocol("Xyplex", "XYPLEX", "xyplex");
proto_register_field_array(proto_xyplex, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
xyplex_handle = create_dissector_handle(dissect_xyplex, proto_xyplex);
}
void
proto_reg_handoff_xyplex(void)
{
xyplex_handle = create_dissector_handle(dissect_xyplex, proto_xyplex);
dissector_add("udp.port", UDP_PORT_XYPLEX, xyplex_handle);
}