diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-11-27 07:13:32 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-11-27 07:13:32 +0000 |
commit | f8783ef2faf90cd0a2d4c98608afc70ebd2b58ca (patch) | |
tree | 21d265bf7402a2739905bd87227383ae0a9f78ab /packet-rtp.c | |
parent | 5f90e47799c83f2e69f021af2622bebadaa37176 (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4281 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-rtp.c')
-rw-r--r-- | packet-rtp.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/packet-rtp.c b/packet-rtp.c index 7af447fcb7..076a824b44 100644 --- a/packet-rtp.c +++ b/packet-rtp.c @@ -6,7 +6,7 @@ * Copyright 2000, Philips Electronics N.V. * Written by Andreas Sikkema <andreas.sikkema@philips.com> * - * $Id: packet-rtp.c,v 1.27 2001/11/26 05:13:12 hagbard Exp $ + * $Id: packet-rtp.c,v 1.28 2001/11/27 07:13:26 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -102,6 +102,11 @@ static dissector_handle_t h261_handle; static dissector_handle_t mpeg1_handle; static dissector_handle_t data_handle; +static gboolean dissect_rtp_heur( tvbuff_t *tvb, packet_info *pinfo, + proto_tree *tree ); +static void dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, + proto_tree *tree ); + /* * Fields in the first octet of the RTP header. */ @@ -258,14 +263,11 @@ static void rtp_init( void ) } #endif -gboolean +static gboolean dissect_rtp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) { conversation_t* pconv; - if (!proto_is_protocol_enabled(proto_rtp)) - return FALSE; /* RTP has been disabled */ - /* This is a heuristic dissector, which means we get all the TCP * traffic not sent to a known dissector and not claimed by * a heuristic dissector called before us! @@ -322,7 +324,7 @@ dissect_rtp_data( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } } -void +static void dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) { proto_item *ti = NULL; @@ -345,10 +347,6 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) guint32 sync_src; guint32 csrc_item; - CHECK_DISPLAY_AS_X(data_handle,proto_rtp, tvb, pinfo, tree); - - pinfo->current_proto = "RTP"; - /* Get the fields in the first octet */ octet = tvb_get_guint8( tvb, offset ); version = RTP_VERSION( octet ); |