diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-11-20 23:34:31 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-11-20 23:34:31 +0000 |
commit | 9687947b5ff4edcfde5c2a04e7bacb74e67d7609 (patch) | |
tree | 20877cc6d4d81c8aa37c92cd3a4ed5bfb1b5aeef /packet-rtp.c | |
parent | bb0b226ca63e88e35e0eb86e1823f864693fc642 (diff) |
From Lars Roland:
- added a pointer to raw rtp data to _rtp_info that can be used by
taps;
- RTP packets are passed to the tap queue only if they are not
error packets (so that you don't need to filter out ICMP
packets)
- use that pointer in rtp_stream, so it handles packets with
padding, and should handle RTP packets fragmented across
lower-level packets
- moved rtp_stream from tap sources to normal files
(prevents on-start-up registration of the rtp_stream tap
listener)
- rtp_stream tap gets registered/unregistered with the "RTP
Streams" dialog box
i.e. the tap is registered as long as the dialog box is open.
Alternatively, it is de-/registered on demand if RTP Analysis is
called directly on a packet.
- rtp_stream tap listener no longer uses a filter in dissection
` and does not need to have a proto tree being built.
(performance increase)
- fixed: RTP Streams list will get updated in real time if the
dialog box is open while a redissection takes place.
svn path=/trunk/; revision=9051
Diffstat (limited to 'packet-rtp.c')
-rw-r--r-- | packet-rtp.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/packet-rtp.c b/packet-rtp.c index ac2eb7df69..813676da81 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.42 2003/11/09 22:55:34 guy Exp $ + * $Id: packet-rtp.c,v 1.43 2003/11/20 23:34:29 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -349,7 +349,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) timestamp = tvb_get_ntohl( tvb, offset + 4 ); sync_src = tvb_get_ntohl( tvb, offset + 8 ); - /* fill in the rtp_info structure */ + /* fill in the rtp_info structure */ rtp_info.info_padding_set = padding_set; rtp_info.info_padding_count = 0; rtp_info.info_marker_set = marker_set; @@ -359,6 +359,16 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) rtp_info.info_sync_src = sync_src; rtp_info.info_data_len = tvb_reported_length_remaining( tvb, offset ); + /* + * Save the pointer to raw rtp data (header + payload incl. padding) + * That should be safe because the "epan_dissect_t" constructed for the packet + * has not yet been freed when the taps are called. + * (destroying the "epan_dissect_t" will end up freeing all the tvbuffs + * and hence invalidating pointers to their data). + * See "add_packet_to_packet_list()" for details. + */ + rtp_info.info_data = tvb_get_ptr(tvb, 0, -1); + if ( check_col( pinfo->cinfo, COL_PROTOCOL ) ) { col_set_str( pinfo->cinfo, COL_PROTOCOL, "RTP" ); } @@ -534,7 +544,8 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) rtp_info.info_payload_offset = offset; rtp_info.info_payload_len = tvb_length_remaining(tvb, offset); } - tap_queue_packet(rtp_tap, pinfo, &rtp_info); + if (!pinfo->in_error_pkt) + tap_queue_packet(rtp_tap, pinfo, &rtp_info); } void |