aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/pcap-common.h
AgeCommit message (Collapse)AuthorFilesLines
2018-09-25Get rid of unused flag argument.Guy Harris1-2/+1
We always tell pcap_process_pseudo_header() to check to make sure the pseudo-header isn't bigger than the captured data; no need for a flag argument to tell it to do so. Change-Id: I8310bb06a390a7f4a7a232ad140ae07955d52da1 Reviewed-on: https://code.wireshark.org/review/29833 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-09Generalize wtap_pkthdr into a structure for packet and non-packet records.Guy Harris1-2/+2
Separate the stuff that any record could have from the stuff that only particular record types have; put the latter into a union, and put all that into a wtap_rec structure. Add some record-type checks as necessary. Change-Id: Id6b3486858f826fce4b096c59231f463e44bfaa2 Reviewed-on: https://code.wireshark.org/review/25696 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
The first is deprecated, as per https://spdx.org/licenses/. Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed Reviewed-on: https://code.wireshark.org/review/25661 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-20wiretap: use SPDX identifiers (partial work).Dario Lombardo1-13/+1
Change-Id: I28436e003ce7fe31d53e6663f3cc7aca00845e4b Reviewed-on: https://code.wireshark.org/review/25392 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-09Use pcapng as the name of the file format.Guy Harris1-2/+2
At one point, I remember a discussion resulting in the official name of the next-generation replacement for pcap format being changed to "pcapng", with no hyphen. Make Wireshark reflect that. Change-Id: Ie66fb13a0fe3a8682143106dab601952e9154e2a Reviewed-on: https://code.wireshark.org/review/25214 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-05Allow bigger snapshot lengths for D-Bus captures.Guy Harris1-0/+2
Use WTAP_MAX_PACKET_SIZE_STANDARD, set to 256KB, for everything except for D-Bus captures. Use WTAP_MAX_PACKET_SIZE_DBUS, set to 128MB, for them, because that's the largest possible D-Bus message size. See https://bugs.freedesktop.org/show_bug.cgi?id=100220 for an example of the problems caused by limiting the snapshot length to 256KB for D-Bus. Have a snapshot length of 0 in a capture_file structure mean "there is no snapshot length for the file"; we don't need the has_snap field in that case, a value of 0 mean "no, we don't have a snapshot length". In dumpcap, start out with a pipe buffer size of 2KB, and grow it as necessary. When checking for a too-big packet from a pipe, check against the appropriate maximum - 128MB for DLT_DBUS, 256KB for everything else. Change-Id: Ib2ce7a0cf37b971fbc0318024fd011e18add8b20 Reviewed-on: https://code.wireshark.org/review/21952 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-03Don't use <wtap.h> to refer to the main libwiretap header file.Guy Harris1-1/+1
Either use "wtap.h", if it's only for files in the wiretap directory, or <wiretap/wtap.h>, if it's also a header that stuff outside libwiretap can include. Change-Id: If1c71b3dae9a3c0d64661ae1734f925319e447d1 Reviewed-on: https://code.wireshark.org/review/14788 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-09Revert "Refactor Wiretap"Guy Harris1-1/+1
This reverts commit 1abeb277f5e6bd27fbaebfecc8184e37ba9d008a. This isn't building, and looks as if it requires significant work to fix. Change-Id: I622b1bb243e353e874883a302ab419532b7601f2 Reviewed-on: https://code.wireshark.org/review/1568 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-09Refactor WiretapMichael Mann1-1/+1
Start of refactoring Wiretap and breaking structures down into "generally useful fields for dissection" and "capture specific". Since this in intended as a "base" for Wiretap and Filetap, the "wft" prefix is used for "common" functionality. The "architectural" changes can be found in cfile.h, wtap.h, wtap-int.h and (new file) wftap-int.h. Most of the other (painstaking) changes were really just the result of compiling those new architecture changes. bug:9607 Change-Id: Ife858a61760d7a8a03be073546c0e7e582cab2ae Reviewed-on: https://code.wireshark.org/review/1485 Reviewed-by: Michael Mann <mmann78@netscape.net>
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>
2014-02-06Make some routines take a struct wtap_pkthdr * as an argument.Guy Harris1-2/+1
For some routines that take multiple arguments that come from a struct wtap_pkthdr, pass a pointer to the struct wtap_pkthdr in question, rather than the separate arguments. Do this even if we're passing expressions that were earlier assigned to the struct wtap_pkthdr fields in question. This simplifies the calling sequences and ensures that the right values are picked up by the called routine; in at least one case we were *not* passing the right values (the code to handle Simple Packet Blocks in pcap-ng files). Also, call the byte-swapping routines for pseudo-header fields only if we need to do byte-swapping. Change-Id: I3a8badfcfeb0237dfc1d1014185a67f18c0f2ebe Reviewed-on: https://code.wireshark.org/review/119 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2013-05-18In the pcapng seek-read routine, *don't* fill in wth->phdr; seek-readGuy Harris1-2/+2
routines are passed a separate struct wtap_pkthdr to be filled in. Get rid of the pseudo_header member of the wblock structure - the pseudo-header is part of the struct wtap_pkthdr. Get rid of the union wtap_pseudo_header * argument to pcap_process_pseudo_header() - it's passed a pointer to a struct pcap_pkthdr, and that structure contains the union in question. Have libpcap_read_header() take a FILE_T argument, rather than using only the "sequential" handle of the wtap it's handed. Have the libpcap read routine return the offset of the beginning of the pcap record, and have the seek-read routine read the header and fill in the struct wtap_pkthdr handed to it. svn path=/trunk/; revision=49401
2013-03-01Export libwireshark symbols using WS_DLL_PUBLIC defineBalint Reczey1-4/+0
Also remove old WS_VAR_IMPORT define and related Makefile magic everywhere in the project. svn path=/trunk/; revision=47992
2013-02-28Export libwiretap symbols using WS_DLL_PUBLIC defineBalint Reczey1-0/+5
TODO: hide flex-generated functions svn path=/trunk/; revision=47948
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2011-09-01Merge pcap_fill_in_pseudo_header() into pcap_read_post_process().Guy Harris1-6/+3
svn path=/trunk/; revision=38844
2011-09-01Use guint8 rather than guchar for raw octets and pointers to arrays ofGuy Harris1-1/+5
same. Add to wiretap/pcap-common.c a routine to fill in the pseudo-header for ATM (by looking at the VPI, VCI, and packet data, and guessing) and Ethernet (setting the FCS length appropriately). Use it for both pcap and pcap-ng files. svn path=/trunk/; revision=38840
2011-06-04Fix wiretap headers to allow error-free ABI dumping.Balint Reczey1-0/+8
svn path=/trunk/; revision=37543
2010-04-21From Chris Maynard:Guy Harris1-2/+4
Support PPP-over-USB. Don't remove the USB pseudo-header from the packet data for Linux USB packets, just byte-swap it if necessary and have the USB dissector fetch the pseudo-header from the raw packet data. Update USB language ID values. svn path=/trunk/; revision=32534
2010-02-23Move the declarations of wtap_pcap_encap_to_wtap_encap() andGuy Harris1-2/+0
wtap_wtap_encap_to_pcap_encap() to wiretap/pcap-encap.h. Include it where it's needed; don't include other Wiretap headers where they're not needed. Include pcapng.h in pcapng.c, to declare the functions defined in pcapng.c. Add some casts to squelch some warnings, and add to a comment to indicate one of the problems. svn path=/trunk/; revision=31960
2009-06-27Cleanup. Should be included in Wireshark 1.2.1 and higher to keepMichael Tüxen1-2/+3
merging future bug fixes simple. svn path=/trunk/; revision=28863
2009-06-27This patchMichael Tüxen1-1/+1
* adds an encapsulation argument to pcap_write_phdr. * writes the pseudo header when writing pcapng files. This fixes a bug where you could not write pcapng files when using encapsulations requiring pseudo headers. svn path=/trunk/; revision=28859
2009-06-27This commitMichael Tüxen1-1/+1
* adds an encap argument to pcap_process_pseudo_header. * adds support for reading pseudo headers. It fixes Bug 3560. Thanks to Tyson Key for reporting the bug and providing trace files. This fix will be scheduled for inclusion in Wireshark 1.2.1 and higher. svn path=/trunk/; revision=28857
2009-06-02When doing a seek-and-read, don't check the packet size, as we don'tGuy Harris1-2/+2
have it (we have the size with the pseudo-header length already removed); we've already read the packet, and thus have already checked it. Fixes bug 3501. svn path=/trunk/; revision=28607
2009-04-27pcap_to_wtap_map is not used outside wiretap/pcap-common.c, so make itGuy Harris1-7/+0
static. svn path=/trunk/; revision=28186
2009-04-27Move pseudo-header routines from libpcap.c to pcap-common.c, for useGuy Harris1-0/+10
with pcap-NG files. svn path=/trunk/; revision=28184
2009-04-27Have the libpcap and pcap-NG code share the LINKTYPE_-to-WTAP_ENCAP_Guy Harris1-0/+34
mapping table - they should be using the same values. Share the mapping routines as well. svn path=/trunk/; revision=28173