aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-sdp.c
AgeCommit message (Collapse)AuthorFilesLines
2015-02-21Remove tvb_ from the names of wsutil mempbrk routines.Guy Harris1-7/+7
Routines that don't take a tvbuff as an argument shouldn't have tvb_ in the name. Change-Id: I3550256551e30b3f329cbbfca71ef27c727d29c0 Reviewed-on: https://code.wireshark.org/review/7302 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-12Fix crash at startup in SSE4.2 code when running a 32 bits Windows buildPascal Quantin1-2/+2
There is no guarantee that a g_malloc'ed memory block will be aligned on a 128 bits boundary Instead use a static variable definition (at the cost of exposing the HAVE_SSE4_2 compilation flag in ws_mempbrk.h) Change-Id: I661bf479a9d458d64c96bafc940c519d29a4780b Reviewed-on: https://code.wireshark.org/review/7070 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-02-11Combine SSE and pre-compiled patterns for faster pbrkHadriel Kaplan1-2/+10
This combines the SSE4.2 instructions usage, with pre-compiled pattern searching usage, for a faster pbrk search method. Testing against large files of HTTP and SIP, there is about a 5% performance improvement by using pre-"compiled" patterns for guint8_pbrk() instead of passing it the search string and having it build the match array every time. Similar to regular expressions, "compiling" the pattern match array in advance only once and using the "compiled" patterns for the searches is faster than compiling it every time. Change-Id: Ifcbc14a6c93f32d15663a10d974bacdca5119a8e Ping-Bug: 10798 Reviewed-on: https://code.wireshark.org/review/6990 Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-10Do not iterate over reported length when using tvb_find_line_endPascal Quantin1-2/+2
if captured length < reported length, this will trigger an infinite loop Change-Id: I6557b455e7bbff12658a934e5bb13a42c023e133 Reviewed-on: https://code.wireshark.org/review/7053 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-30SDP: add ability to display port as a stringPascal Quantin1-4/+21
Bug: 10898 Change-Id: Ib1b5698c85cd568b8874b44690cafe391eea28f3 Reviewed-on: https://code.wireshark.org/review/6849 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-29SDP: check that media format starts with a digit before trying to identify ↵Pascal Quantin1-9/+14
media type Bug: 10899 Change-Id: I92319a668ae795247d4021f32d629f5000ceb395 Reviewed-on: https://code.wireshark.org/review/6841 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-25Deleting unnecessary #includes from dissectors.Martin Mathieson1-2/+0
Fifth batch (packet-rtp.c -> end). Will look at cleaning up and committing script afterwards. Change-Id: I8ed61dc941d98d3f7259a9d1f74e214eb7b4bfa2 Reviewed-on: https://code.wireshark.org/review/6052 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-3/+0
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-13dissector_try_uint(_new) and dissector_try_string now return the number of ↵Pascal Quantin1-1/+1
bytes consumed Change-Id: I528ad736caee1f29e2f0abfc0afcca6587d74eca Reviewed-on: https://code.wireshark.org/review/5743 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-11-20Eliminate proto_tree_add_text from some dissectors.Michael Mann1-10/+28
Change-Id: Ib160211198ca02f7eacf29d04568628c11f208a5 Reviewed-on: https://code.wireshark.org/review/5407 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-19Do encoding-arg changes (all benign)Bill Meier1-2/+2
For: - FT_BYTES: Always use just ENC_NA - integral/floating (other than FT_[U]INT8): Do ENC_NA --> ENC_BIG_ENDIAN Also: - FT_UINT... --> FT_UINT8 in a few cases (to match proto_tree_add_item...) - Change one case of incorrect '||' to '|' Change-Id: I427e0e61618ff8faf55691c8a695930f67d455b0 Reviewed-on: https://code.wireshark.org/review/4184 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-09convert to proto_tree_add_subtree[_format]Michael Mann1-3/+2
Change-Id: I8d66b1bc7dbdfee3d4bf6fd3b3c21c6323b66f44 Reviewed-on: https://code.wireshark.org/review/2946 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-06H264: Add support of packetization modes, SVC, MS-H264Britt McKinley1-1/+1
Add support for Prefix, STAP, MTAP, NI-MTAP, and PACSI packet types. Add support for Microsoft SEI messages [MS-H264PF] Add support for dissecting scalable profiles SDP: Add profile-level-id decode for payload type H264-SVC MS-H264PF: http://msdn.microsoft.com/en-us/library/hh659565.aspx Update #1 - Fix Tabs -> Spaces, Reinsert accidentally removed entry 19 from h264_type_values Update #2 - Changed to using expert info for exceptions and Microsoft errata. Update #3: - Correct handling of truncated packets - Use guid functions and compare techniques - Correct ranges for expert info messages - Change to using reported_length from captured_length Change-Id: I520a3c9a6d85c78a976b520cf5a6a405064a48f1 Reviewed-on: https://code.wireshark.org/review/2580 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-10/+10
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-10/+10
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18Fixup: tvb_get_string(z) -> tvb_get_string(z)_encDario Lombardo1-5/+5
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe Reviewed-on: https://code.wireshark.org/review/2376 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-07tvb_new_subset -> tvb_new_subset_length when length parameters are equal.Michael Mann1-4/+2
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is. Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d Reviewed-on: https://code.wireshark.org/review/1999 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-07Fix Bug 9958: 'SDP displays double spaces between payload formats as a 0 ↵Hadriel Kaplan1-98/+162
payload format' Given an SDP m= line such as this: m=audio 29156 RTP/AVP 18 0 SDP will show a media format of G.729 (the 18) and then two G.711 entries: one for the extra space between the 18 and 0, and one format for the 0. The latter is correct, but the extra space one isn't. Technically such an m= line is malformed, since only one space is allowed between payload formats; but it's definitely not a format of 0. A similar thing happens in many parts of SDP dissection code. It needs to issue an expert error and handle it gracefully. Change-Id: I1f1500489a13a55e03fc8ea14b37d99a019fc449 Reviewed-on: https://code.wireshark.org/review/989 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-03(Pedantic): set editor modelines tab-width & etc to 8; Also: fix some ↵Bill Meier1-3/+3
indentation in packet-sip.c Change-Id: I623fc5e4c1247dbe5e15f0f33270f4f0994268ab Reviewed-on: https://code.wireshark.org/review/943 Reviewed-by: Bill Meier <wmeier@newsguy.com> Tested-by: Bill Meier <wmeier@newsguy.com>
2014-04-03Fix Bug 9920 Buildbot crash due to SDP/RTP mismatchHadriel Kaplan1-76/+31
For details see comments in Bug 9920. The executive summary: Bug 9920 is a crash caused by a couple of issues: 1) The memory ownership model for the rtp_dyn_payload hashtable is split: SDP creates the rtp_dyn_payload hashtable, but RTP can free it. Since there isn't *one* pointer to the hashtable, RTP freeing it means SDP has a dangling pointer. 2) Either the SDP dissector shouldn't be creating two separate, unique hashtables for multiple media channels of the same addr:port, or RTP shouldn't be free'ing the previous one. Change-Id: I436e67de6882f84aa82dcbdfe60bf313fe4fd99c Reviewed-on: https://code.wireshark.org/review/918 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-01For now use UTF-8 for all strings for performance reasons.AndersBroman1-78/+78
Change-Id: If47ffbee58d534ce3d44f00e1e5b966bc42a2ea8 Reviewed-on: https://code.wireshark.org/review/906 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-28tvb_get_ascii_string is really expensive. On a large capture file which IAndersBroman1-32/+32
profiled in october Fetch cost has gone from 15,6M to 24,2M, changing tvb_get_string() to tvb_get_string_enc() with ENC_UTF_8 where it seems safe helps a bit and should be done any way. Change-Id: I4d3e640bfde3304a991c09e2a30ad7dd132fc5ac Reviewed-on: https://code.wireshark.org/review/855 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-21Fix using '%hh' for printf format because MS Visual C++ is lameHadriel Kaplan1-6/+12
Change-Id: I1d80b82d7c6a5aa85bf59b449326874c0f851737 Reviewed-on: https://code.wireshark.org/review/763 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-21Add debug printing functions for conversations, sip, sdp, rtpHadriel Kaplan1-23/+309
There have been enough gnarly bus in sip/sdp/rtp that it needs to have good debug printing. Using a debugger isn't good enough because there's interaction across multiple frames and it's too hard to follow what's going on without real printed data history. Change-Id: Ifb5bb1fb580be81f988569ece79d238a9c030c34 Reviewed-on: https://code.wireshark.org/review/688 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-19Fix Bug 9885: 'Buildbot crash output: fuzz-2014-03-14-15333.pcap'Hadriel Kaplan1-0/+12
The Buildbot found a crash which is cause by a bug that has been there all along, but a recent change exposed. This bug is likely in 1.10.6 as well, so I'll backport this if I can reproduce it in 1.10.6. Change-Id: I505bc73cbe6281e6d64f00de441c8e6231b55000 Reviewed-on: https://code.wireshark.org/review/702 Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-12Fix bug 9021: 'RTP not decoded inside the conversation in v.1.10.1'Hadriel Kaplan1-4/+17
The behavior for SIP/SDP handling of RTP conversation tracking changed in v1.10, with some unintended consequences. The bugs did not show up at the time because wireshark makes 2 passes of the packet list, and so the problems auto-corrected themselves in most cases. Unfortunately, a change in r53641 modified how UDP behaves, making it always create conversations for UDP packets, and that exposed the bugs inherent in the SIP/SDP code changes. This commit reverts the behavior of SIP/SDP to its pre-1.10 model, but creates a new preference setting for "Delay SDP changes for tracking media", which if enabled, will turn on the new (but buggy) model introduced in 1.10. This preference is *disabled* by default, since for a majority of cases the new behavior is worse than the previous behavior. The preference, and this commit's fix, is not intended to last long. I intend to re-write the SIP/SDP/RTP interaction model for release 1.11 - I think it's too big a change for 1.10, however, which is why I submitted this commit. Change-Id: Ic5601749d6c2344e952ced8206dd9296bfdc4b90 Reviewed-on: https://code.wireshark.org/review/543 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-12Fix whitespace tabs to spaces, indent by 4, modelinesHadriel Kaplan1-2183/+2201
Change-Id: I8bb64a879d1aa779c9ac85db306cbd34d1188243 Reviewed-on: https://code.wireshark.org/review/617 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-07Fix bug 9835 disabled second media stream disables all media streamsHadriel Kaplan1-15/+25
When a single media line is rejected in an SDP answer, for example a second 'm=video' line, wireshark disables ALL media sessions, instead of just that one. But per the RFCs, all it should do is disable just the one RTP media session the m= line represents. This commit fixes that, so that a disabled media session (one with a m= port of 0) in the SDP answer only disables its associated/paired media stream in the offer. Change-Id: I9bd0d3fc88b8eaa55207c9bf3f3e37da7746fd14 Reviewed-on: https://code.wireshark.org/review/526 Reviewed-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-12-21Add missing includesJakub Zawadzki1-0/+1
svn path=/trunk/; revision=54332
2013-12-21New functions: str_to_ip6(), str_to_ip()Jakub Zawadzki1-26/+4
This way we can avoid including lot of system header files in some dissectors and it might fix bug #9581 svn path=/trunk/; revision=54330
2013-12-21Move base64_to_tvb() to tvbuff_base64.cJakub Zawadzki1-1/+0
svn path=/trunk/; revision=54325
2013-12-14Remove not needed ';'Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=54088
2013-12-11- Make local functions static.Anders Broman1-0/+3
- Forward declaration of register functions. svn path=/trunk/; revision=53942
2013-11-12Add "rtp handle protection" inside ↵Michael Mann1-16/+12
srtp_add_address/rtp_add_address/bluetooth_add_address so dissectors calling it don't need to find "rtp" just for the handle check. svn path=/trunk/; revision=53288
2013-11-12Add "T.38 handle protection" inside t38_add_address() so dissectors calling ↵Michael Mann1-6/+2
it don't need to find "t38" just for the handle check. svn path=/trunk/; revision=53283
2013-11-10Add missing includes in order to remove exceptions.h from proto.h (next commit).Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53230
2013-11-02Require dissector_try_string to pass a data parameter to its subdissectors. ↵Michael Mann1-1/+1
There weren't that many calls, so might as well modify the function than create a need for dissector_try_string_new. svn path=/trunk/; revision=53049
2013-09-22emem -> wmem conversion:Pascal Quantin1-36/+36
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits() - tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup() - tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode() - tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string() - tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string() - tvb_get_ephemeral_string_enc() -> tvb_get_string_enc() - update docs accordingly svn path=/trunk/; revision=52172
2013-08-23Purge some emem.Evan Huus1-35/+24
- In kingfisher it wasn't even needed, just use a variable on the stack. - In SDP convert to wmem. Use auto-resetting trees to avoid the need for an init routine and somewhat simplify that whole thing. svn path=/trunk/; revision=51484
2013-08-19Change some dissectors to use pinfo memory pool instead of malloc if it can ↵Pascal Quantin1-2/+2
trigger an exception between between buffer allocation and tvb_set_free_cb call svn path=/trunk/; revision=51427
2013-07-16"man inet_pton" only says that it returns a negative value, zero or a ↵Chris Maynard1-46/+46
postive value, and not specifically -1, 0, or 1, so even though we know that's what wsutil's inet_pton will return, we shouldn't test against those exact values. svn path=/trunk/; revision=50670
2013-05-27Batch of filterable expert infosMichael Mann1-4/+13
svn path=/trunk/; revision=49600
2013-05-15SDP adds per-packet-data twice, refactor to not use per-packet data.Anders Broman1-10/+9
svn path=/trunk/; revision=49314
2013-05-12Add the posibillity to use a key for per-packet-data.Anders Broman1-4/+4
svn path=/trunk/; revision=49259
2013-03-18From beroset:Anders Broman1-12/+14
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48399
2013-02-27Move show_exception() and show_reported_bounds_error() toGuy Harris1-7/+4
epan/show_exception.c, as it's used outside epan/dissectors/packet-frame.c. Update their callers to include <epan/show_exception.h> to get their declaration. Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if there's more stuff in the packet to dissect after the dissector call that threw the exception, doesn't mean you shouldn't go ahead and dissect that stuff. Use it in all those cases, including ones where BoundsError was inappropriately being caught (you want those passed up to the top level, so that the packet is reported as having been cut short in the capture process). Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that correspond to running past the end of the data for a tvbuff; use it rather than explicitly catching those exceptions individually, and rather than just catching all exceptions (the only place that DissectorError should be caught, for example, is at the top level, so dissector bugs show up in the protocol tree). Don't catch and then immediately rethrow exceptions without doing anything else; just let the exceptions go up to the final catcher. Use show_exception() to report non-fatal errors, rather than doing it yourself. If a dissector is called from Lua, catch all non-fatal errors and use show_exception() to report them rather than catching only ReportedBoundsError and adding a proto_malformed item. Don't catch exceptions when constructing a trailer tvbuff in packet-ieee8023.c - just construct it after the payload has been dissected, and let whatever exceptions that throws be handled at the top level. Avoid some TRY/CATCH/ENDTRY cases by using checks such as tvb_bytes_exist() before even looking in the tvbuff. svn path=/trunk/; revision=47924
2013-02-18For each dynamic-payload hash table, keep a Boolean indicating whetherGuy Harris1-16/+36
it's been used in an rtp_set_address() or srtp_set_address() call and, if that Boolean is set, don't free the hash table; this fixes a case where the hash table was freed while it was in use. svn path=/trunk/; revision=47740
2013-02-17Only allow one packet to act as an SDP response. This should probably be ↵Michael Mann1-2/+3
caught at a higher layer (SIP), but the safety net should be there. Also, cleanup SIP "response error" range. Fixes crash in bug 8343 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8343) svn path=/trunk/; revision=47705
2013-02-14Fix crash with SDP setup mechanism, bug 8323 ↵Michael Mann1-1/+7
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8323) The issue was that hash tables were being accessed after they were freed from a "rejected answer". The code was also too generous in considering many SIP status codes as "rejected answers", so now less SIP status codes are treated as "rejected answers" and are ignored by the transport API. svn path=/trunk/; revision=47652