aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sdp.c
AgeCommit message (Collapse)AuthorFilesLines
2024-02-25Fix lots of spellingsMartin Mathieson1-1/+1
2023-12-06Remove init of tap variablesStig Bjørlykke1-1/+1
A tap_id is never 0, so initializing tap variables to -1 is not necessary.
2023-12-05SDP: Don't look past the fmtp parameter tokenlen for equalsJohn Thacker1-1/+1
Fixes an issue with SDP media format parameters that aren't in the "parameter=value" format being followed by parameters that are. Fix #19518
2023-11-20Remove init of proto variablesStig Bjørlykke1-112/+112
Remove init of proto, header field, expert info and subtree variables. This will reduces the binary size by approximate 1266320 bytes due to using .bss to zero-initialize the fields. The conversion is done using the tools/convert-proto-init.py script.
2023-09-27mgcp, sdp: disable handling SDP RTP if Osmux is announced in MGCP bodyPau Espin Pedrol1-4/+4
"X-Osmux: (*|<cid>)" is an Osmocom extension to MGCP which allows to signal request and acceptance of use of Osmux framing instead of RTP. It usually comes together with a regular SDP section which defines the AMR data to be transported (in Osmux frames rather than RTP packets). Hence, if Osmux is signalled, we want to avoid telling the RTP subsystem to decode the recorded packets as RTP, which would then override the default Osmux dissector. This is accomplished by passing a setup_info struct to SDP dissector from MGCP, similar to what's already done in MEGACO and SIP protocols. An extra bool field is introduced to signal whether Osmux packets are expected instead of RTP.
2023-09-15SDP: Handle incomplete session attributesJohn Thacker1-0/+5
The same issue as incomplete media attributes (commit e71219c711e80a5534a03ab03e1c412cd53c1998 ) but for session attributes. The grammar specifies that if the value is missing the colon is missing, but if there's a colon without the value, report it as an error but continue dissecting the rest of the SDP.
2023-07-08SDP & RTP: Pass the channels information to RTPJohn Thacker1-5/+8
Add the number of channels from the SDP rtpmap information to the RTP dynamic payload information.
2023-07-07SDP: Add field for number of audio channelsJohn Thacker1-6/+48
Parse the (optional) encoding-params/audio channels field from the rtpmap in SDP. Go ahead and put it in the transport info struct. We don't actually do anything with this yet, also because the RTP Player doesn't handle audio with multiple channels yet either, assuming everything is mono and ignoring the channels information returned from the codec. (The Opus decoder "works" with stereo by always downmixing to mono, which is easy as Opus has in-band information in each Opus packet.) It's a start, though.
2023-07-08SDP: Copy format specific parameters and pass them to RTPJohn Thacker1-35/+53
RFC 8866 6.15 "fmtp (Format Parameters)": [fmtp] allows parameters that are specific to a particular format to be conveyed in a way that SDP does not have to understand them... Format-specific parameters... may be any set of parameters required to be conveyed by SDP and given unchanged to the media tool that will use this format. For some format specific parameters, it is sufficient to dissect them immediately when receiving the SDP. We do that currently, though that ought to be done in a more generic fashion allowing media type dissectors to register information instead of the SDP dissector have to understand various media types. Other parameters change the way that the payload is handled, and need to be accessed by payload dissectors, or the playback codecs. Copy the format parameters into a map and put that in the RTP dynamic payload struct. Use that to pass those parameters to RTP payload dissectors, so that they can change how they dissect the payload. Use that to put the parameter map in the rtp_info struct that gets passed to the RTP analysis and RTP player, and eventually to codecs. The codec interface needs to be changed for the latter to work. In particular, use this to determine whether AMR and AMR-WB are transmitted in the octet-aligned or bandwidth-efficient mode according to the SDP and change the dissection appropriately. Related #17608 to (the codec interface part still needs doing.)
2023-07-04SDP: Use convert_string_to_hexJohn Thacker1-83/+21
Use convert_string_to_hex from epan/strutil when turning a hex string in an SDP into a tvb. Skip over the '=' before calling it (it does skip whitespace, as needed for h248item), which means that we can always increment the offset the same in decode_sdp_fmtp instead of treating certain parameters differently.
2023-06-20BFCP: Setup UDP/BFCP conversations via SDPJohn Thacker1-0/+12
Use the SDP to setup conversations automatically for BFCP. Particularly useful since it's heuristic is weak. Related to #18717
2023-05-29More testing of check_dissector.pyMartin Mathieson1-1/+0
2023-05-18epan: Add STRING_CASE_[IN]SENSITIVE for dissector tablesJohn Thacker1-1/+1
The last parameter of register_dissector_table() indicates the base for integer tables, indicates case sensitivity for string tables, and is ignored for other tables (FT_NONE, FT_GUID). It can be a little difficult to remember what the code is doing when reading it, and which of 0 and 1 is sensitive and which is insensitive (0 is sensitive, the default). Add STRING_CASE_SENSITIVE and STRING_CASE_INSENSITIVE. Check in tools/fix-encoding-args.pl for STRING-like tables that use BASE_NONE, TRUE, or FALSE, and convert them to the new values.
2023-04-25Last batch of val_to_str() fussingMartin Mathieson1-1/+1
2023-04-18Decouple the media_type dissector table from HTTP.Guy Harris1-4/+4
Put the header containing the structure that should be passed to dissectors in the media_type dissector table, and the code that creates the media_type dissector table, into epan/dissectors/packet-media-type.h and epan/dissectors/packet-media-type.h, respectively. Change the names of types, enum values, structure fields, and variables to speak of "media containers" and "content" rather than to speak of HTTP or messages; HTTP is not the only protocol or data format that can contain media type headers and data whose type is specified by media type headers.
2022-05-18SDP: Minor Refactoring by Extract Methodeasonweii1-399/+444
Extract Method for multiple message of SDP Media Attribute to simplify things and Make processes clearer. dissect_sdp_media_attribute_rtpmap dissect_sdp_media_attribute_fmtp dissect_sdp_media_attribute_path dissect_sdp_media_attribute_h248_item dissect_sdp_media_attribute_crypto The original function remain unchanged.
2022-02-15Tools: Fix fix-encoding-args.pl ASCII string validationJoão Valverde1-6/+6
Do not require a useless ENC_NA parameter for string encodings. FT_STRING and FT_STRINGZ types don't have any ndianness. Follow-up to 6ec429622c9258eefd388caf21ce92ab5b9f54b4.
2021-12-19Fix errors found by fix-encoding-args.plJoão Valverde1-43/+43
2021-12-19Replace g_snprintf() with snprintf() (dissectors)João Valverde1-1/+1
Use macros from inttypes.h with format strings.
2021-09-22SDP: Handle fmpt:ipdc-ksm and fmpt:ipdc-kmmJohn Thacker1-13/+31
ETSI IP Datacast is another protocol that uses strings instead of numeric payload types after the fmpt attribute. (ETSI TS 102 472, ETSI TS 102 592). Since we're up to five special case strings to check for, refactor the code a bit.
2021-07-27Change some `wmem_packet_scope()` to `pinfo->pool`David Perry1-51/+50
2021-04-30Cast away the return value of g_strlcpy() and g_strlcat().Guy Harris1-13/+13
Most of the time, the return value tells us nothing useful, as we've already decided that we're perfectly willing to live with string truncation. Hopefully this keeps Coverity from whining that those routines could return an error code (NARRATOR: They don't) and thus that we're ignoring the possibility of failure (as indicated, we've already decided that we can live with string truncation, so truncation is *NOT* a failure).
2020-09-10SDP: Handle fmpt:MCVideoAnders Broman1-8/+10
The dissector expect a numeral(PT) after fmtp: exept for listed strings, add MCVideo to those strings.
2020-07-06SDP: Try to fix -Wpointer-sign warnings.Anders Broman1-8/+7
Change-Id: Ia08bec34b64374fcad8c746274720e1a3ccd2689 Reviewed-on: https://code.wireshark.org/review/37739 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-13Standardise IETF RFC and Draft URLs in dissectors.Martin Mathieson1-2/+2
Prefer: - html (rather than txt) - https Also includes the script check_dissector_urls.py, that can be used to find links in code and test them. Change-Id: Iafd8bb8948674a38ad5232bf5b5432ffb2b1251b Reviewed-on: https://code.wireshark.org/review/36821 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2020-02-16More issues spotted by PVS-Studio in bug 16335.Martin Mathieson1-2/+0
Only the change to packet-imap.c really represents a bug. Change-Id: Ie270f97f3d94c338ea3c84a712f8f4d43ffd36f4 Reviewed-on: https://code.wireshark.org/review/36115 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-11SDP: clarify that the G722 sample rate is actually 16000Peter Wu1-1/+6
The actual sampling rate in plugins/codecs/G722/G722decode.c is reported as 16000 while the RTP clock rate as included in the SDP message is 8000 for historical reasons. Add some text to help people understand where this difference comes from. Example dissection for this cosmetic change: Session Description Protocol ... Media Attribute (a): rtpmap:9 G722/8000 Media Attribute Fieldname: rtpmap Media Format: 9 MIME Type: G722 Sample Rate: 8000 (RTP clock rate is 8kHz, actual sampling rate is 16kHz) Media Attribute (a): rtpmap:101 telephone-event/8000 Media Attribute Fieldname: rtpmap Media Format: 101 MIME Type: telephone-event Sample Rate: 8000 Change-Id: I47ccb798719a23713f28ae36fff6716b6dfbb22b Reviewed-on: https://code.wireshark.org/review/36073 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-10-31RTCP:Improve dissection of Mission Critical Push To Talk (MCPTT)Anders Broman1-8/+10
Change-Id: I6e15cd8e56e4ad327aa925b6bcc7a1baf9bb756c Reviewed-on: https://code.wireshark.org/review/34895 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-10-30SDP: Handle MCPTT fmtp parameter.Anders Broman1-11/+14
Change-Id: I1f1a6ce84395e5d3922b4bcb08f0d7627bef603c Reviewed-on: https://code.wireshark.org/review/34891 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-05-23SDP: show rtcp and rtcp-mux media attribute valuesJaap Keuter1-0/+4
With the addition of handling the rtcp and rtpc-mux media attributes (see cde023c3c5a08131495eb2574c00ff1f34cdce55) the default behaviour of presenting the media attribute value itself was lost. This change adds this back. Bug: 15791 Change-Id: Ib0084b99961bfadf1d89c70b54bd4a0805f9b9f6 Reviewed-on: https://code.wireshark.org/review/33314 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04epan: Convert our PROTO_ITEM_ macros to inline functions.Gerald Combs1-12/+12
Convert our various PROTO_ITEM_ macros to inline functions and document them. Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c Reviewed-on: https://code.wireshark.org/review/32706 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-03-27SIP: Add a preference to hide the generated/trace Call IDAnders Broman1-0/+6
Change-Id: Id936dfaa5278ce9f3bb62281497268fb4054fc56 Reviewed-on: https://code.wireshark.org/review/32579 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-23SDP: fix memleak of "trace_id"Peter Wu1-2/+2
The string value is stored in the conversation, so use file-scoped memory instead of g_strdup. Convert to union to save space. Bug: 15440 Change-Id: Ie2dabfc67ac1db1cc8f864601b8395dcdec7caf8 Fixes: v2.9.0rc0-2719-g8bd0616621 ("SDP: Show callid from all call legs with the same RTP cpnversation.") Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11845 Reviewed-on: https://code.wireshark.org/review/31704 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-27Try to squeeze some bytes out of the frame_data structure.Guy Harris1-3/+3
Make the time stamp precision a 4-bit bitfield, so, when combined with the other bitfields, we have 32 bits. That means we put the flags at the same structure level as the time stamp precision, so they can be combined; that gets rid of an extra "flags." for references to the flags. Put the two pointers next to each other, and after a multiple of 8 bytes worth of other fields, so that there's no padding before or between them. It's still not down to 64 bytes, which is the next lower power of 2, so there's more work to do. Change-Id: I6f3e9d9f6f48137bbee8f100c152d2c42adb8fbe Reviewed-on: https://code.wireshark.org/review/31213 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-03RTP: Restructure call id handling.Anders Broman1-0/+3
Change-Id: Id5471ad6e7051a7e00fd82d25d58912ef8ad886e Reviewed-on: https://code.wireshark.org/review/30898 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-03SDP: Show callid from all call legs with the same RTP cpnversation.Anders Broman1-0/+22
Change-Id: If17732c2bd0b23e7f62b7464b9f154c317019f16 Reviewed-on: https://code.wireshark.org/review/30893 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-29Add sip_call_id filter to RTP stream.Anders Broman1-8/+18
Change-Id: Ia525fa74457eef03a3a8bc85905036c19693cfbb Reviewed-on: https://code.wireshark.org/review/30830 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-18H.265: Parsing media format specific parameter from SDP.Asaf Kave1-0/+21
Change-Id: I2607068671f370517b1f0a2f65f47a221b630d91 Reviewed-on: https://code.wireshark.org/review/28725 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-05-03SDP: do not assume that media_desc pointer is always setPascal Quantin1-3/+7
Bug: 14648 Change-Id: I9d585a1b49e15529b19414be52c8bf198475fd62 Reviewed-on: https://code.wireshark.org/review/27304 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-30SDP/RTP: Support for "bundled" media.Robert Jongbloed1-7/+59
Modern SDP usage (e.g. SIP, WebRTC) can "bundle" multiple RTP media streams on a single port. Thus the RTP dissector has to be able to handle audio and video at the same time, so the gboolean flag in _rtp_info was changed to a bit mask. The SDP parsing was then changed to detect multiple "m=" lines using the same port, and combine their audio/video bit masks, and the rtp_dyn_payload used has all the audio and video payload descriptions. Change-Id: Ifa3c034260f892ed005fe28647d28f3b0b1b05cf Reviewed-on: https://code.wireshark.org/review/25431 Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-24SDP: Added support for "a=rtcp" and "a=rtcp-mux".Robert Jongbloed1-5/+20
Modern SIP endpoints often use non adjacent, or the same, port for the RTCP protocol as the RTP protocol. This is indicated via attributes in the SDP, which should be used to set up the correct dissector for the correct port on this SIP session. Change-Id: I37bf30b71541b6f924fbda5ac1cb29f3ba171515 Reviewed-on: https://code.wireshark.org/review/25430 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-26Add a ws_in6_addr typedef for struct e_in6_addr.Guy Harris1-1/+1
That allows a parallel typedef of ws_in4_addr for guint32. Change-Id: I03b230247065e0e3840eb87635315a8e523ef562 Reviewed-on: https://code.wireshark.org/review/24073 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-19SDP: Handle incomplete media attributesJaap Keuter1-6/+10
Media attributes have a format of name:value, where, if the value is missing the colon is missing too. Sometimes the colon is there, while the value is missing. Even though this is in error, continue dissecting the other attributes. Bug: 13698 Change-Id: I369b6db657b33a368f4b12134412100774105615 Reviewed-on: https://code.wireshark.org/review/21699 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-31Dissectors don't need a journey of self discovery.Michael Mann1-4/+2
They already know who they are when they register themselves. Saving the handle then to avoid finding it later. Not sure if this will increase unnecessary register_dissector functions (instead of using create_dissector_handle in proto_reg_handoff function) when other dissectors copy/paste, but it should make startup time a few microseconds better. Change-Id: I3839be791b32b84887ac51a6a65fb5733e9f1f43 Reviewed-on: https://code.wireshark.org/review/19481 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-18SIP/SDP, RTP: Dissectors shows information about ED-137 related states of ↵Jiri Novak1-5/+66
radio in info column/VoIP call flow Based on EUROCAE ED-137B specification: ED-137B, Part 1: RADIO, INTEROPERABILITY STANDARDS FOR VOIP ATM COMPONENTS https://boutique.eurocae.net/eshop/catalog/index.php Bug: 13252 Change-Id: Ifab1aaf47e3405fcd46309167237f11ce2d7e2ff Reviewed-on: https://code.wireshark.org/review/19302 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-18RTP: RTP dissector is able to decode RTP over TCP (RFC 4571)Jiri Novak1-2/+2
Bug: 13251 Change-Id: I56a01e779f7f0eadc8a078f88543269a91148f00 Reviewed-on: https://code.wireshark.org/review/19293 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-08sdp: decode pt for more RTP transport protocolsPeter Wu1-23/+32
Do not just decode the payload type for RTP/AVP, but also all RTP transport types. Add RTP/AVPF (same as normal RTP/AVP, but with additional RTCP formats). Similarly, add RTP/SAVPF and the two DTLS variants. Add references to the relevant specifications and order per IANA registry. Tested with dtls-srtp-ws-sip.pcapng, now the payload types under the "m=" tree have names and frames that were previously reported as RTP show up as SRTP. Frame 442 now shows "Encrypted RTCP Payload" warning instead of decoding it as garbage. Change-Id: I06893f385ec270391f8891e72a364d08d2354a0a Ping-Bug: 13193 Reviewed-on: https://code.wireshark.org/review/19139 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-07sdp: replace bitmask by enum for transport protocolPeter Wu1-28/+28
Previously the bitmask also stored whether the type of media (video) and address type (IPv4/IPv6). Now that these are gone, it makes more sense to use enums. There is no functional change (only debugging output is different). Change-Id: Idc9659cd21e36489a3f5720bbf13640c4beecc02 Reviewed-on: https://code.wireshark.org/review/19124 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>