diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-11-27 07:13:32 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-11-27 07:13:32 +0000 |
commit | 07b2709f8a32951cc2503d2e048d662a01cb472c (patch) | |
tree | 21d265bf7402a2739905bd87227383ae0a9f78ab /packet-rtcp.c | |
parent | fd456eaf0b5af46449882983b95529e073fd989f (diff) |
Change "conversation_set_dissector()" to take a dissector handle, rather
than a pointer to a dissector function, as an argument.
This means that the conversation dissector is called through
"call_dissector()", so the dissector itself doesn't have to worry about
checking whether the protocol is enabled or setting
"pinfo->current_proto", so get rid of the code that does that in
conversation dissectors. Also, make the conversation dissectors static.
Get rid of some direct calls to dissectors; replace them with calls
through handles, and, again, get rid of code to check whether a protocol
is enabled and set "pinfo->current_proto" where that code isn't needed.
Make those dissectors static if they aren't already static.
Add a routine "create_dissector_handle()" to create a dissector handle
without registering it by name, if the dissector isn't used outside the
module in which it's defined.
svn path=/trunk/; revision=4281
Diffstat (limited to 'packet-rtcp.c')
-rw-r--r-- | packet-rtcp.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/packet-rtcp.c b/packet-rtcp.c index ffb94eb50b..053b25e4a6 100644 --- a/packet-rtcp.c +++ b/packet-rtcp.c @@ -1,6 +1,6 @@ /* packet-rtcp.c * - * $Id: packet-rtcp.c,v 1.23 2001/11/26 05:13:12 hagbard Exp $ + * $Id: packet-rtcp.c,v 1.24 2001/11/27 07:13:26 guy Exp $ * * Routines for RTCP dissection * RTCP = Real-time Transport Control Protocol @@ -178,10 +178,10 @@ static gint ett_sdes_item = -1; static address fake_addr; static int heur_init = FALSE; -static dissector_handle_t data_handle; - static gboolean dissect_rtcp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ); +static void dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, + proto_tree *tree ); void rtcp_add_address( packet_info *pinfo, const unsigned char* ip_addr, int prt ) @@ -251,9 +251,6 @@ dissect_rtcp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) { conversation_t* pconv; - if (!proto_is_protocol_enabled(proto_rtcp)) - return FALSE; /* RTCP has been disabled */ - /* This is a heuristic dissector, which means we get all the UDP * traffic not sent to a known dissector and not claimed by * a heuristic dissector called before us! @@ -626,7 +623,7 @@ dissect_rtcp_sr( tvbuff_t *tvb, int offset, frame_data *fd, proto_tree *tree, return offset; } -void +static void dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) { proto_item *ti = NULL; @@ -638,10 +635,6 @@ dissect_rtcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) unsigned int offset = 0; guint16 packet_length = 0; - CHECK_DISPLAY_AS_X(data_handle,proto_rtcp, tvb, pinfo, tree); - - pinfo->current_proto = "RTCP"; - if ( check_col( pinfo->fd, COL_PROTOCOL ) ) { col_set_str( pinfo->fd, COL_PROTOCOL, "RTCP" ); } @@ -1230,7 +1223,6 @@ proto_register_rtcp(void) void proto_reg_handoff_rtcp(void) { - data_handle = find_dissector("data"); /* * Register this dissector as one that can be assigned to a * UDP conversation. |