aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-stun.c
AgeCommit message (Collapse)AuthorFilesLines
2014-06-27Tighten the dump-glossary test.Evan Huus1-2/+2
1. The only indication we get of an out-of-order value string is a message on STDERR, so check that and fail the test if STDERR wasn't empty. 2. This exposes an out-of-order value string in packet-stun.c; fix it. 3. This triggered the pre-commit hook on packet-stun.c, which noticed an API error (ENC_ASCII -> ENC_ASCII|ENC_NA); fix that too. Change-Id: I36f87a2a87b40537119562f22a7e3012716ff239 Lesson: automated testing/tooling is both wonderful and scary. Reviewed-on: https://code.wireshark.org/review/2682 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-26STUN: Add support of MS-ICE2 (Used by Lync)Britt McKinley1-0/+15
Interactive Connectivity Establishment ICE Extensions 2.0 http://msdn.microsoft.com/en-us/library/office/cc431504.aspx Change from review: 1) Change encoding for foundation to ASCII 2) Move case for MS_IMPLEMENTATION_VER. Change-Id: Ic524a2fe811695478aba81af9cbb3dbd031bbce3 Reviewed-on: https://code.wireshark.org/review/2579 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-20Rename dissector_add_handle() to dissector_add_for_decode_as().Guy Harris1-2/+2
Hopefully that name makes it clear what the routiner's purpose is, and will encourage people to use it rather than using dissector_add_uint() with a bogus integer value. Change-Id: Ic5be456d0ad40b176aab01712ab7b13aed5de2a8 Reviewed-on: https://code.wireshark.org/review/2483 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-16Fix copy/paste errors in stun attributes value_string[] array.Jakub Zawadzki1-3/+3
Found thanks to warning: ** (process:20239): WARNING **: Extended value string 'attributes' forced to fall back to linear search: entry 53, value 32858 [0x805a] < previous entry, value 32861 [0x805d] Change-Id: I12396380b42bbcb90dd139775c4b8d0bfdc79972 Reviewed-on: https://code.wireshark.org/review/2273 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16STUN: Add support of MS-TURNBWMAlexis La Goutte1-1/+179
Traversal using Relay NAT (TURN) Bandwidth Management Extensions http://msdn.microsoft.com/en-us/library/ff595670.aspx Change-Id: I58c7b758ae96226a45095243939b2ad2b4a91d4d Reviewed-on: https://code.wireshark.org/review/1973 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-07tvb_new_subset -> tvb_new_subset_length when length parameters are equal.Michael Mann1-1/+1
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-06-05STUN: Add error code from MS-ICE2BWMAlexis La Goutte1-0/+3
Interactive Connectivity Establishment (ICE) 2.0 Bandwidth Management Extensions http://msdn.microsoft.com/en-us/library/ff595756.aspx Change-Id: I218229225ea5c64cfe2d5f269625deafe7eb8292 Reviewed-on: https://code.wireshark.org/review/1972 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-05STUN: Add support of MS-TURN (Used by Lync)Alexis La Goutte1-1/+91
MS-TURN: Traversal Using Relay NAT (TURN) Extensions http://msdn.microsoft.com/en-us/library/cc431507.aspx Change-Id: I2a6f28f5f7db4da45543816caecce1da7cf03c35 Reviewed-on: https://code.wireshark.org/review/1971 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-21Change the signature of dissector_try_heuristic() to return hdtbl_entryAndersBroman1-2/+4
which can be used to call the found heuristic dissector on the next pass. Introduce call_heur_dissector_direct() to be used to call a heuristic dissector which accepted the frame on the first pass. Change-Id: I524edd717b7d92b510bd60acfeea686d5f2b4582 Reviewed-on: https://code.wireshark.org/review/1697 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-17Introduce col_add_lstr(), use it instead of slower col_add_fstr.Jakub Zawadzki1-2/+5
We have callgrind benchmarks which shows that col_add_fstr() takes 5% of Ir count cause of formatting done in g_vsnprintf(). New col_add_lstr() can be used in few dissectors without much ugliness, and it should be a little faster. Change-Id: Ifddd951063dfd3a27c2a7da4dafce9b242c0472c Reviewed-on: https://code.wireshark.org/review/1629 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-15STUN dissector: fix (soft) warning about tvb_lengthAlexis La Goutte1-2/+2
Change-Id: I2b6c4e44d406585204b805ae3efa53c31e7d2574 Reviewed-on: https://code.wireshark.org/review/1655 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-15STUN dissector: fix hf name (stun_... => hf_stun_....)Alexis La Goutte1-140/+140
Change-Id: I0a4a12cc18a03824827a3bb57b7e58a8f1bd6ba8 Reviewed-on: https://code.wireshark.org/review/1654 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-06Apply found fix-encoding-args.pl errors in the dissector directory.Michael Mann1-7/+7
I coincidentally found a few files with errors, so I thought it might be time to run it on the whole directory again. Change-Id: Ia32e54b3b1b94e5a418ed758ea79807c8bc7e798 Reviewed-on: https://code.wireshark.org/review/978 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-04Change tvb_get_string() -> tvb_get_string_enc and ENC_ASCII -> ENC_UTF_8AndersBroman1-15/+14
Change-Id: I07ecca5612ae9fa2b053a62c69014612c5125d5e Reviewed-on: https://code.wireshark.org/review/962 Reviewed-by: Anders Broman <a.broman58@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-12In one or more of the files:Bill Meier1-451/+453
- Create/use some extended value-strings; - Remove some unneeded initializers; - 'offset++' --> 'offset += 1' for consistency; - Set editor modelines 'tab-width' to 8 (not 4); - tabs --> spaces (to match editor modelines); - Rework/add whitespace. svn path=/trunk/; revision=53998
2013-12-10- Forward declaration of register functions.Anders Broman1-0/+3
svn path=/trunk/; revision=53918
2013-11-09Add data parameter to tcp_dissect_pdus() as well as convert it to using ↵Michael Mann1-13/+8
"new" style dissectors. Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that? Should tcp_dissect_pdus return length (bytes consumed)? There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb). Seems like that could all be rolled into one. svn path=/trunk/; revision=53198
2013-11-09Include <epan/to_str.h> only when needed.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53189
2013-10-29From didier gautheron: remove redundant or use faster col_xxx functionsBill Meier1-1/+1
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster. - same for replace col_append_fstr and col_append_str - remove col_clear() when it's redundant: + before a col_set/col_add if the dissector can't throw an exception. - replace col_append() after a col_clear() with faster col_add... or col_set https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9344 svn path=/trunk/; revision=52948
2013-10-23#if 0 numerous "unused const variables" (mostly value-string-arrays);Bill Meier1-0/+2
Also; fix a few "set but not used" warnings. svn path=/trunk/; revision=52780
2013-10-15Try to optimize heuristics slightly.Anders Broman1-478/+483
svn path=/trunk/; revision=52624
2013-10-13whitespace fixes; mostly: remove trailing blanksBill Meier1-1/+1
svn path=/trunk/; revision=52591
2013-09-22emem -> wmem conversion:Pascal Quantin1-8/+8
- 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-09-15Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if ↵Michael Mann1-4/+4
hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly. The script didn't catch as many as I would have liked, but it's a start. The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum. svn path=/trunk/; revision=52045
2013-09-12mark unused parametersMartin Kaiser1-1/+1
svn path=/trunk/; revision=51986
2013-09-12Try to make the STUN heuristic sligtly more efficient.Anders Broman1-18/+17
svn path=/trunk/; revision=51985
2013-09-01More dissectors to wmem. There are no more dissectors using se_tree now, just aEvan Huus1-9/+10
few other places. svn path=/trunk/; revision=51622
2013-04-10Add "Modern" STUN to the preference.Anders Broman1-0/+3
svn path=/trunk/; revision=48806
2013-03-19From beroset:Anders Broman1-6/+6
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48430
2013-03-17Remove some whitespacesAlexis La Goutte1-2/+2
svn path=/trunk/; revision=48364
2013-01-20Replace tvb_get_ipv4 / ip_to_str ... by tvb_ip_to_strAlexis La Goutte1-9/+4
svn path=/trunk/; revision=47181
2013-01-20Fix indent (Replace tabs by space) and add Modelines infoAlexis La Goutte1-1119/+1131
svn path=/trunk/; revision=47180
2013-01-20Use proto_tree_add_item for stun_att_reserved and use FT_BYTES type.Alexis La Goutte1-10/+10
svn path=/trunk/; revision=47179
2013-01-18Replace tvb_get_ipv4 / ip_to_str ... by tvb_ip_to_strAlexis La Goutte1-14/+8
svn path=/trunk/; revision=47150
2013-01-17Register in the UDP heuristic table rather than the internal one.Anders Broman1-1/+1
svn path=/trunk/; revision=47133
2013-01-09From David Bergeron:Added unknown attributes for STUN from RFC3489 that are ↵Anders Broman1-1/+64
now deprecated but does'nt appear with classicstun. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8179 svn path=/trunk/; revision=47002
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45017
2012-09-11Add data parameter to call_dissector_only.Jakub Zawadzki1-2/+2
svn path=/trunk/; revision=44872
2012-09-11Add data parameter to dissector_try_heuristicJakub Zawadzki1-2/+2
svn path=/trunk/; revision=44871
2012-09-10Initial commit to support yet another method of passing data between dissectors.Jakub Zawadzki1-2/+2
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL svn path=/trunk/; revision=44860
2012-08-10Use val_to_str_const() where appropriate;Bill Meier1-5/+5
Also (for a few files): - create/use some extended value strings; - remove unneeded #include files; - remove unneeded variable initialization; - re-order fcns slightly so prefs_reg_handoff...() at end, etc svn path=/trunk/; revision=44438
2012-08-09se_tree_lookup32_array() can destroy its key. Make sure we refresh itGerald Combs1-0/+6
before passing it to se_tree_insert32_array(). Fixes bug 7569 reported by Laurent Butti. svn path=/trunk/; revision=44366
2012-07-27Address bug 4097 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4097) ↵Michael Mann1-6/+19
by improving heuristics by limiting when the heuristics can be evaluated. TURN and STUN channel data is negotiated by STUN, so its heuristics should only be based on a STUN negotiation, not raw UDP/TCP packets. "Decode As" is still available for TURN and STUN channel data if the STUN negotiation isn't captured. svn path=/trunk/; revision=44068
2012-06-28Update FSF address - part II.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43538
2012-01-12Don't do fcn calls in arg of g_?to??(); Macro may very well eval args ↵Bill Meier1-7/+7
multiple times. svn path=/trunk/; revision=40444
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-2/+2
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503
2011-10-15Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, ↵Bill Meier1-5/+5
FT_STRINGZ, FT_UINT_STRING as follows: 1. If there's no character encoding (ENC_ASCII, ...) specified then use ENC_ASCII. 2. For all but FT_UINT_STRING, always use ENC_NA (replacing any existing True/1/FALSE/0 /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN). svn path=/trunk/; revision=39426
2011-10-10 Convert 'encoding' parameter of certain proto_tree_add_item() calls in ↵Bill Meier1-1/+1
non-autogenerated epan/dissectors: Specifically: Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as the encoding parameter for proto_tree_add_item() calls which directly reference an item in hf[] which has a type of: FT_BOOLEAN FT_IPv4 FT_EUI64 FT_GUID FT_UINT_STRING Also: For type FT_ITv6 use ENC_NA. (This was missed in SVN #39260) svn path=/trunk/; revision=39328
2011-10-04Use ENC_NA as encoding for proto_tree_add_item() calls which directly ↵Bill Meier1-11/+11
reference an hf item (in hf[] with types: FT_NONE FT_BYTES FT_IPV6 FT_IPXNET FT_OID Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN svn path=/trunk/; revision=39260