aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dccp.c
AgeCommit message (Collapse)AuthorFilesLines
2014-08-09Clean up Internet checksum handling.Guy Harris1-53/+45
Add macros to set entries of a vec_t, one for use when you have a pointer to private data, and one for use when you have data in a tvbuff. The latter wraps the use of tvb_get_ptr(), so that you're not directly calling it in a dissector. Move ip_checksum() to epan/in_cksum.c, and add an ip_checksum_tvb() that wraps the use of tvb_get_ptr(). In the CARP dissector, give the length variable an unsigned type - there's no benefit to it being signed, and that requires some casts to be thrown around. In the DCCP dissector, check only against the coverage length to see if we have enough data, combine the "should we check the checksum?" check with the "*can* we check the checksum?" check in a single if, and throw a dissector assertion if the source network address type isn't IPv4 or IPv6. Get rid of inclues of <epan/in_cksum.h> in dissectors that don't use any of the Internet checksum routines. In the HIP dissector, make sure we have the data to calculate the checksum before doing so. Change-Id: I2f9674775dbb54c533d33082632809f7d32ec8ae Reviewed-on: https://code.wireshark.org/review/3517 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-12/+12
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-12/+12
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-21Change the signature of dissector_try_heuristic() to return hdtbl_entryAndersBroman1-2/+3
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-04-19More name changes.Guy Harris1-6/+6
Add ep_ to routines that may return ephemeral strings. Change "get_XXX" to "XXX_to_display" if the routine returns a formatted string if it can't get a name. Change-Id: Ia0e82784349752cf4285bf82788316c9588fdd88 Reviewed-on: https://code.wireshark.org/review/1217 Reviewed-by: Guy Harris <guy@alum.mit.edu>
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-11-01Allow try_conversation_dissector() to pass data to subdissectors.Michael Mann1-1/+1
svn path=/trunk/; revision=53035
2013-10-13whitespace fixes; mostly: remove trailing blanksBill Meier1-1/+1
svn path=/trunk/; revision=52591
2013-09-14Convert some dissectors to wmem (leaving uat-like memory with emem for now)Pascal Quantin1-2/+2
svn path=/trunk/; revision=52031
2013-09-09expert_add_info_format_text -> expert_add_info_formatMichael Mann1-17/+17
svn path=/trunk/; revision=51852
2013-06-09Batch of filterable expert infos.Michael Mann1-19/+32
svn path=/trunk/; revision=49853
2013-03-16[-Wmissing-prototypes]Anders Broman1-3/+6
Use explicit casts. svn path=/trunk/; revision=48338
2013-03-08Dissect the DCCP header by stepping through it a field at a time andGuy Harris1-170/+162
adding the fields to the protocol tree as we fetch them, rather than fetching a bunch of them up front. That way, if the packet was cut short by a snapshot length, we'll dissect what we have. Create the top-level tree item at the beginning, with an unknown length, and set the length when we're done. If we're putting details into that item, update the item as we process each field; also update the Info column as we process each field. Don't use tvb_bytes_exist() to do our own tvbuff bounds-checking; let the tvbuffs themselves do that. Do not use it to do header-length checking; check the actual header length value instead. Do not fail if the *captured* data in the tvbuff is too short; we're selected by an IP protocol number, which we can expect to definitively identify us, not by a transport-layer port number, which is often an unreliable identifier. Do header length checks as we go along, and bail as soon as we identify the header length as wrong. (We do the first check once we get the X bit, so we know whether the generic header is 12 or 16 bytes long.) Treat a too-*large* header as a protocol violation, not a malformed packet indication. Use tvb_get_ntoh24() and tvb_get_ntoh48() to fetch the sequence number, rather than fetching it in pieces and putting them together ourselves. Correctly pluralize "byte". Don't use tvb_length_remaining() to check whether we have a payload, use tvb_reported_length_remaining(), so we base it on whether the packet actually had the data, not on whether we actually captured it. svn path=/trunk/; revision=48201
2013-03-02General cleanup including:Michael Mann1-246/+185
1. Convert proto_tree_add_text to proto_tree_add_item/expert info 2. Change to "new style" dissector 3. Use standard malformed packet interface Reviewed by Francesco Fondelli svn path=/trunk/; revision=48009
2013-01-31Comment out unused hf[] entries & etc.Bill Meier1-1/+3
(found by checkhf) svn path=/trunk/; revision=47389
2012-12-26Fix a bunch of warnings.Guy Harris1-1/+1
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45017
2012-09-11Add data parameter to dissector_try_heuristicJakub Zawadzki1-2/+2
svn path=/trunk/; revision=44871
2012-08-10Use val_to_str_const() where appropriate;Bill Meier1-14/+14
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-06-28Update FSF address - part II.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43538
2012-05-15Remove unneeded #includes (stdlib, stdio, ctypes, time);Bill Meier1-4/+2
In a few cases: do some whitespace, indentation cleanup & reformatting. svn path=/trunk/; revision=42632
2012-04-13Remove doubled semicolons and semicolons outside function.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=42053
2012-03-21'tab-width/tabstop/tabSize' in editor modelines should really always be 8;Bill Meier1-29/+29
Also: In some cases do some whitespace cleanup and some minor reformatting. svn path=/trunk/; revision=41724
2012-03-14From Francesco Fondelli via ↵Jeff Morriss1-934/+1223
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6946 : Support for DCCP Simultaneous-Open for NAT Traversal, RFC 5596. A new packet format is supported. I did a little code cleanup too. svn path=/trunk/; revision=41543
2012-02-04From Francesco Fondelli:Anders Broman1-58/+60
Fix indentation. (I restored "lost code") https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5924 svn path=/trunk/; revision=40839
2011-11-08packet_info's in_error_pkt is now a bitfield like in_gre_pkt.Chris Maynard1-1/+1
svn path=/trunk/; revision=39764
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-1/+1
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503
2011-09-26Get rid of check_col, while at it set ENC.Anders Broman1-23/+14
svn path=/trunk/; revision=39148
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-3/+3
keys to have _uint in their names, to match the routines that handle dissector tables with string keys. (Using _port can confuse people into thinking they're intended solely for use with TCP/UDP/etc. ports when, in fact, they work better for things such as Ethernet types, where the binding of particular values to particular protocols are a lot stronger.) svn path=/trunk/; revision=35224
2010-04-06#include <string.h> not needed.Bill Meier1-1/+0
svn path=/trunk/; revision=32410
2009-10-25From Jakub Zawadzki:Anders Broman1-3/+1
Cleanup dissector code - use proper memory functions. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164 svn path=/trunk/; revision=30691
2009-08-16Switch a bunch of dissectors over to using tvb_new_subset_remaining()Kovarththanan Rajaratnam1-1/+1
svn path=/trunk/; revision=29446
2009-08-09Don't guard col_clear with col_checkKovarththanan Rajaratnam1-2/+1
svn path=/trunk/; revision=29344
2009-08-09Don't guard col_set_str (COL_INFO) with col_checkKovarththanan Rajaratnam1-2/+1
svn path=/trunk/; revision=29342
2009-08-09Don't guard col_set_str (COL_PROTOCOL) with col_checkKovarththanan Rajaratnam1-2/+1
svn path=/trunk/; revision=29340
2009-06-18From Kovarththanan Rajaratnam via bug 3548:Stig Bjørlykke1-29/+29
(1) Trailing/leading spaces are removed from 'name's/'blurb's (2) Duplicate 'blurb's are replaced with NULL (3) Empty ("") 'blurb's are replaced with NULL (4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME, FT_PROTOCOL, FT_STRING and FT_STRINGZ field types (5) Only allow non-zero value for 'display' if 'bitmask' is non-zero svn path=/trunk/; revision=28770
2009-05-08FT_BOOLEAN fields w/o bitmasks really should use BASE_NONE (not BASE_DEC,...).Bill Meier1-3/+3
svn path=/trunk/; revision=28317
2008-12-18Fix various typos and spelling errors (mostly in text strings)Bill Meier1-3/+3
svn path=/trunk/; revision=27050
2008-05-15Fix some of the Errors/warnings detected by checkapi.Bill Meier1-17/+33
svn path=/trunk/; revision=25305
2008-05-13Fix some of the Errors/warnings detected by checkapi.Bill Meier1-10/+22
svn path=/trunk/; revision=25282
2008-04-09Fix name of file in comment to reflect current reality.Guy Harris1-1/+1
svn path=/trunk/; revision=24867
2008-03-16OK, now use DCCP rather than DCP for the Datagram Congestion ControlGuy Harris1-0/+1141
Protocol. (Better late than never....) svn path=/trunk/; revision=24646
2008-03-15Rename Distributed Checksum Clearinghouse protocol from "DCCP" to justGuy Harris1-564/+0
"DCC". Googling for DCCP "Distributed Checksum Clearinghouse Protocol" finds only hits related to Ethereal/Wireshark, either on the Ethereal or Wireshark Web site, or on discussions where Datagram Congestion Control Protocol developers were griping that Ethereal/Wireshark already used DCCP for the Distributed Checksum Clearinghouse protocol. Next step: fix the Datagram Congestion Control Protocol dissector. svn path=/trunk/; revision=24645
2007-11-09Apply yet another set of the optimization patches:Anders Broman1-2/+2
When offset parameter is 0 replace tvb_bytes_exist() with the faster tvb_length(). On the other hand if (tvb_bytes_exist(tvb, 0, 20) is more readable than if (tvb_length(tvb) >= 20 so only do it in heuristic function svn path=/trunk/; revision=23412
2006-05-21change a whole bunch of ethereal into wiresharkRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18196
2005-12-16From Jaap Keuter:Anders Broman1-1/+1
Bug 373 complains about a field type. Trivial fix attached. svn path=/trunk/; revision=16821
2004-07-18Move dissectors to epan/dissectors directory.Gilbert Ramirez1-0/+564
Also move ncp222.py, x11-fields, process-x11-fields.pl, make-reg-dotc, and make-reg-dotc.py. Adjust #include lines in files that include packet-*.h files. svn path=/trunk/; revision=11410