aboutsummaryrefslogtreecommitdiffstats
path: root/pcapio.c
AgeCommit message (Collapse)AuthorFilesLines
2014-08-24Modify includes of config.h so that out-of-tree builds, i.e. CMakeGraham Bloice1-1/+1
don't pick up the in-tree copy. Change-Id: I7ec473876cdba1a025c52362d7f6adc62d24ce71 Reviewed-on: https://code.wireshark.org/review/3798 Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-08-05Fix whitespace/indentation to match editor modelines.Bill Meier1-5/+5
Change-Id: I3445ae22f10584582d465bf632942e016f5f70ca Reviewed-on: https://code.wireshark.org/review/3452 Reviewed-by: Bill Meier <wmeier@newsguy.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-20Change G_GINT64_CONSTANT(xxxxU) to G_GUINT64_CONSTANT(xxxx)Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=54314
2013-10-18Fix writing enhanced packet blocks when flags areMichael Tüxen1-4/+0
provided: Don't write the end od options parameter twice. svn path=/trunk/; revision=52682
2013-09-29For an EPB, write out an "end of options" option if we write out anyGuy Harris1-2/+8
other options. Eliminate duplicate comment. Fix indentation. svn path=/trunk/; revision=52280
2013-09-29Add a routine to return the length of a string option, given the string;Guy Harris1-90/+65
0 means "this option won't be written", and use it when writing pcap-ng blocks. svn path=/trunk/; revision=52277
2013-09-29Rename routines that write pcap-ng files to "pcapng_xxx" rather thanGuy Harris1-184/+116
"libpcap_xxx". Rename the low-level write routine in pcapio.c to write_to_file(), as it's used for both pcap and pcap-ng files. svn path=/trunk/; revision=52275
2013-09-29We always write to a FILE *, so:Guy Harris1-81/+81
make libpcap_write_to_file() static; don't pass it as an argument to write routines, just have them call it directly; make the handle argument a FILE *. Make the data length argument to libpcap_write_to_file() a size_t, as that's what, for example, fwrite() takes as a size argument. svn path=/trunk/; revision=52274
2013-09-29Use a common routine to write out string options.Guy Harris1-65/+43
This fixes a problem noted in bug 9202, where the calculation of the padding for the SHB_HARDWARE option was wrong. svn path=/trunk/; revision=52273
2013-01-02Whitespace changes. Use 8-space indents consistently.Michael Tüxen1-96/+96
svn path=/trunk/; revision=46898
2013-01-02Fix bug introduced by myself inMichael Tüxen1-1/+1
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=46592 svn path=/trunk/; revision=46897
2013-01-02Fix bug introduced in Michael Tüxen1-1/+1
http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=46891 svn path=/trunk/; revision=46896
2013-01-02Use consistent indentation.Michael Tüxen1-18/+18
svn path=/trunk/; revision=46894
2013-01-02Cast size_t to something the Visual C++ CRT will accept.Gerald Combs1-13/+13
svn path=/trunk/; revision=46893
2013-01-02Allow pcap/pcapng format to be written to more than just a file (FILE*). ↵Michael Mann1-127/+198
Gives more flexibility if needed. WRITE_DATA macro replaced and applied consistently throughout pcapio.c svn path=/trunk/; revision=46891
2012-12-26Fix a bunch of warnings.Guy Harris1-50/+57
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-12-25Fix writing of PCAP-NG files when flags are provided.Michael Tüxen1-3/+0
svn path=/trunk/; revision=46742
2012-12-23Add support for writing per packet comments when using pcapng.Michael Tüxen1-2/+29
Not actually used with this commit, which just brings in the infrastructure. svn path=/trunk/; revision=46715
2012-12-20Need to include Windows.h for gettting FILETIME.Michael Tüxen1-0/+3
svn path=/trunk/; revision=46638
2012-12-20Don't use an pcap structures in pcapio.[ch]. Michael Tüxen1-24/+24
Currently, pcapio is only used by dumpcap, which is only compiled if there is pcap support. However, making pcapio independent from libpcap allows it also to be used from text2pcap, which does not rely on libpcap. svn path=/trunk/; revision=46637
2012-12-20Add ws_fclose(), ws_fflush(), and ws_fdopen() to the fileutils.Michael Tüxen1-35/+0
Retire libpcap_fdopen(), libpcap_dump_flush(), and libpcap_dump_close(). svn path=/trunk/; revision=46636
2012-12-19Add support for writing the flags option in the enhancedMichael Tüxen1-0/+15
packet block (pcapng). svn path=/trunk/; revision=46619
2012-12-18Simplify code.Michael Tüxen1-4/+4
svn path=/trunk/; revision=46594
2012-12-18fwrite() returns the number of objects written, not the number of bytes.Michael Tüxen1-4/+4
svn path=/trunk/; revision=46593
2012-12-18Fix sequence of parameters. The size is the second parameter of fwrite,Michael Tüxen1-4/+4
the nitems the third, not vice versa. svn path=/trunk/; revision=46592
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=45015
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-04-25Allow writing ISB with given recv/drop counters.Michael Tüxen1-21/+14
No functional change by this commit. svn path=/trunk/; revision=42242
2012-04-15Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7048Michael Tüxen1-2/+12
Write timetamps for the interface statistic blocks the way specified by http://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html svn path=/trunk/; revision=42080
2012-03-26Fix Coverty 1392 ('name' might be NULL): don't write out the interface name ↵Jeff Morriss1-1/+1
when we're trying to write out the interface description. svn path=/trunk/; revision=41779
2012-03-20To be consistent with the wiretap API don't null terminate the counted strings.Anders Broman1-49/+49
svn path=/trunk/; revision=41682
2012-03-12From Jose Pedro Oliveira:Anders Broman1-530/+530
Enforce the modelines in dumpcap.c and in pcapio.c svn path=/trunk/; revision=41505
2012-03-12From Jose Pedro Oliveira: Add ModlinesAnders Broman1-0/+13
svn path=/trunk/; revision=41496
2012-03-10In pcapng.c use the units per second value from the interface instead ofGerald Combs1-3/+4
the default. Add support for reading nseclibpcap files to dumpcap. svn path=/trunk/; revision=41455
2012-03-09From Jose Pedro Oliveira:Anders Broman1-42/+43
pcapio.c: write IDB options in numeric order and corrects the IDB block_total_length. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6718 svn path=/trunk/; revision=41447
2012-03-06Add a note about using GetSystemTimePreciseAsFileTime.Gerald Combs1-3/+6
svn path=/trunk/; revision=41382
2012-03-05Fix calculation of pading for if_filter_str.Anders Broman1-3/+3
svn path=/trunk/; revision=41351
2012-03-04if_filter isn't a string per se,The first byte of the Option Data keeps a ↵Anders Broman1-3/+8
code of the filter used svn path=/trunk/; revision=41339
2012-02-25From Jose Pedro Oliveira: pcapio is writing the if_speed value in the ↵Anders Broman1-1/+1
IDB_TSRESOL optiones svn path=/trunk/; revision=41184
2012-02-24Fix a typo and revert previous.Anders Broman1-1/+1
svn path=/trunk/; revision=41179
2012-02-22- Write ISB(s) at start and end of capture.Anders Broman1-4/+2
- Read all options. - Prepare to write ISB. svn path=/trunk/; revision=41137
2012-02-22Expand the API for ISB:sAnders Broman1-4/+60
svn path=/trunk/; revision=41136
2012-02-21Correctly write os string...Michael Tüxen1-2/+2
svn path=/trunk/; revision=41125
2012-02-21Whitespace changes.Michael Tüxen1-2/+2
svn path=/trunk/; revision=41117
2012-02-21Whitespace changes.Michael Tüxen1-10/+10
svn path=/trunk/; revision=41113
2012-02-21Use tab indentation as elsewhere in the files.Michael Tüxen1-148/+156
Only whitespace changes. svn path=/trunk/; revision=41110
2012-02-21Check if the string exists first.Anders Broman1-10/+10
svn path=/trunk/; revision=41109
2012-02-21Extend libpcap_write_interface_description_block() wiyh more optionsAnders Broman1-67/+162
all exept os curently unused. svn path=/trunk/; revision=41108
2012-02-14From Anders: Add support for options in the SHB.Michael Tüxen1-6/+65
From me: Some whitespace changes. svn path=/trunk/; revision=41026