summaryrefslogtreecommitdiff
path: root/epan/in_cksum.c
AgeCommit message (Collapse)AuthorFilesLines
2016-08-04Bump GLib minimum required version to 2.22.0João Valverde1-4/+0
Change-Id: I0ab85be8090f234f9ca10914063f97f13c894413 Reviewed-on: https://code.wireshark.org/review/16879 Petri-Dish: João Valverde <j@v6e.pt> Reviewed-by: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2015-06-08Fix MSCV 2015RC Warning in_cksum.c(92): warning C4311: 'type cast':Anders1-0/+4
pointer truncation from 'const guint16 *' to 'unsigned long'. Even if we only require GLIB 2.16 this will fix the Windows build as we do have a newer Glib on Windows. Change-Id: Ie0644536783e8b298de59094fec240e249c9b27f Reviewed-on: https://code.wireshark.org/review/8833 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-10Add editor modelines; Adjust whitespace as needed.Bill Meier1-0/+13
Change-Id: I3dc57f4c2ca57585103e3b71503ac4c332903e50 Reviewed-on: https://code.wireshark.org/review/4594 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-09Clean up Internet checksum handling.Guy Harris1-0/+19
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-03-04Fix warnings introduced in g2965913Pascal Quantin1-2/+0
Change-Id: I7b0fedf0c508404b3f2dea789f50b7b5db4e2eb7 Reviewed-on: https://code.wireshark.org/review/502 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Pascal Quantin <pascal.quantin@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>
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=45016
2011-06-16Attempt to squelch some compiler warnings.Guy Harris1-3/+3
svn path=/trunk/; revision=37677
2011-04-22We deal with pointer alignment ourselves, so we ensure the casts areGuy Harris1-3/+3
safe. Tell the compiler so. svn path=/trunk/; revision=36796
2011-01-19Add a note to the top about r35589's change of the ADDCARRY(x) macro.Stephen Fisher1-1/+2
svn path=/trunk/; revision=35592
2011-01-19Change the ADDCARRY(x) macro to eliminate clang warning about unusedStephen Fisher1-1/+1
result from the ADDCARRY portion of the REDUCE macro. -#define ADDCARRY(x) (x > 65535 ? x -= 65535 : x) +#define ADDCARRY(x) {if ((x) > 65535) (x) -= 65535;} The new code is from in_cksum.c in the Tahoe/CGI port of 4.4BSD-Lite2 (we're using the "Portable Version" copy otherwise). svn path=/trunk/; revision=35589
2004-09-28Move various checksum routines and headers to epan.Guy Harris1-0/+201
svn path=/trunk/; revision=12117