aboutsummaryrefslogtreecommitdiffstats
path: root/pcapio.c
Commit message (Collapse)AuthorAgeFilesLines
* Modify includes of config.h so that out-of-tree builds, i.e. CMakeGraham Bloice2014-08-241-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>
* Fix whitespace/indentation to match editor modelines.Bill Meier2014-08-051-5/+5
| | | | | | Change-Id: I3445ae22f10584582d465bf632942e016f5f70ca Reviewed-on: https://code.wireshark.org/review/3452 Reviewed-by: Bill Meier <wmeier@newsguy.com>
* Remove all $Id$ from top of fileAlexis La Goutte2014-03-041-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>
* Change G_GINT64_CONSTANT(xxxxU) to G_GUINT64_CONSTANT(xxxx)Jakub Zawadzki2013-12-201-1/+1
| | | | svn path=/trunk/; revision=54314
* Fix writing enhanced packet blocks when flags areMichael Tüxen2013-10-181-4/+0
| | | | | | | provided: Don't write the end od options parameter twice. svn path=/trunk/; revision=52682
* For an EPB, write out an "end of options" option if we write out anyGuy Harris2013-09-291-2/+8
| | | | | | | | | | other options. Eliminate duplicate comment. Fix indentation. svn path=/trunk/; revision=52280
* Add a routine to return the length of a string option, given the string;Guy Harris2013-09-291-90/+65
| | | | | | | 0 means "this option won't be written", and use it when writing pcap-ng blocks. svn path=/trunk/; revision=52277
* Rename routines that write pcap-ng files to "pcapng_xxx" rather thanGuy Harris2013-09-291-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
* We always write to a FILE *, so:Guy Harris2013-09-291-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
* Use a common routine to write out string options.Guy Harris2013-09-291-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
* Whitespace changes. Use 8-space indents consistently.Michael Tüxen2013-01-021-96/+96
| | | | svn path=/trunk/; revision=46898
* Fix bug introduced by myself inMichael Tüxen2013-01-021-1/+1
| | | | | | http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=46592 svn path=/trunk/; revision=46897
* Fix bug introduced in Michael Tüxen2013-01-021-1/+1
| | | | | | http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=46891 svn path=/trunk/; revision=46896
* Use consistent indentation.Michael Tüxen2013-01-021-18/+18
| | | | svn path=/trunk/; revision=46894
* Cast size_t to something the Visual C++ CRT will accept.Gerald Combs2013-01-021-13/+13
| | | | svn path=/trunk/; revision=46893
* Allow pcap/pcapng format to be written to more than just a file (FILE*). ↵Michael Mann2013-01-021-127/+198
| | | | | | | | Gives more flexibility if needed. WRITE_DATA macro replaced and applied consistently throughout pcapio.c svn path=/trunk/; revision=46891
* Fix a bunch of warnings.Guy Harris2012-12-261-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
* Fix writing of PCAP-NG files when flags are provided.Michael Tüxen2012-12-251-3/+0
| | | | svn path=/trunk/; revision=46742
* Add support for writing per packet comments when using pcapng.Michael Tüxen2012-12-231-2/+29
| | | | | | | | Not actually used with this commit, which just brings in the infrastructure. svn path=/trunk/; revision=46715
* Need to include Windows.h for gettting FILETIME.Michael Tüxen2012-12-201-0/+3
| | | | svn path=/trunk/; revision=46638
* Don't use an pcap structures in pcapio.[ch]. Michael Tüxen2012-12-201-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
* Add ws_fclose(), ws_fflush(), and ws_fdopen() to the fileutils.Michael Tüxen2012-12-201-35/+0
| | | | | | Retire libpcap_fdopen(), libpcap_dump_flush(), and libpcap_dump_close(). svn path=/trunk/; revision=46636
* Add support for writing the flags option in the enhancedMichael Tüxen2012-12-191-0/+15
| | | | | | packet block (pcapng). svn path=/trunk/; revision=46619
* Simplify code.Michael Tüxen2012-12-181-4/+4
| | | | svn path=/trunk/; revision=46594
* fwrite() returns the number of objects written, not the number of bytes.Michael Tüxen2012-12-181-4/+4
| | | | svn path=/trunk/; revision=46593
* Fix sequence of parameters. The size is the second parameter of fwrite,Michael Tüxen2012-12-181-4/+4
| | | | | | the nitems the third, not vice versa. svn path=/trunk/; revision=46592
* We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss2012-09-201-2/+0
| | | | svn path=/trunk/; revision=45015
* Update Free Software Foundation address.Jakub Zawadzki2012-06-281-1/+1
| | | | | | (COPYING will be updated in next commit) svn path=/trunk/; revision=43536
* Allow writing ISB with given recv/drop counters.Michael Tüxen2012-04-251-21/+14
| | | | | | No functional change by this commit. svn path=/trunk/; revision=42242
* Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7048Michael Tüxen2012-04-151-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
* Fix Coverty 1392 ('name' might be NULL): don't write out the interface name ↵Jeff Morriss2012-03-261-1/+1
| | | | | | when we're trying to write out the interface description. svn path=/trunk/; revision=41779
* To be consistent with the wiretap API don't null terminate the counted strings.Anders Broman2012-03-201-49/+49
| | | | svn path=/trunk/; revision=41682
* From Jose Pedro Oliveira:Anders Broman2012-03-121-530/+530
| | | | | | Enforce the modelines in dumpcap.c and in pcapio.c svn path=/trunk/; revision=41505
* From Jose Pedro Oliveira: Add ModlinesAnders Broman2012-03-121-0/+13
| | | | svn path=/trunk/; revision=41496
* In pcapng.c use the units per second value from the interface instead ofGerald Combs2012-03-101-3/+4
| | | | | | | | the default. Add support for reading nseclibpcap files to dumpcap. svn path=/trunk/; revision=41455
* From Jose Pedro Oliveira:Anders Broman2012-03-091-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
* Add a note about using GetSystemTimePreciseAsFileTime.Gerald Combs2012-03-061-3/+6
| | | | svn path=/trunk/; revision=41382
* Fix calculation of pading for if_filter_str.Anders Broman2012-03-051-3/+3
| | | | svn path=/trunk/; revision=41351
* if_filter isn't a string per se,The first byte of the Option Data keeps a ↵Anders Broman2012-03-041-3/+8
| | | | | | code of the filter used svn path=/trunk/; revision=41339
* From Jose Pedro Oliveira: pcapio is writing the if_speed value in the ↵Anders Broman2012-02-251-1/+1
| | | | | | IDB_TSRESOL optiones svn path=/trunk/; revision=41184
* Fix a typo and revert previous.Anders Broman2012-02-241-1/+1
| | | | svn path=/trunk/; revision=41179
* - Write ISB(s) at start and end of capture.Anders Broman2012-02-221-4/+2
| | | | | | | - Read all options. - Prepare to write ISB. svn path=/trunk/; revision=41137
* Expand the API for ISB:sAnders Broman2012-02-221-4/+60
| | | | svn path=/trunk/; revision=41136
* Correctly write os string...Michael Tüxen2012-02-211-2/+2
| | | | svn path=/trunk/; revision=41125
* Whitespace changes.Michael Tüxen2012-02-211-2/+2
| | | | svn path=/trunk/; revision=41117
* Whitespace changes.Michael Tüxen2012-02-211-10/+10
| | | | svn path=/trunk/; revision=41113
* Use tab indentation as elsewhere in the files.Michael Tüxen2012-02-211-148/+156
| | | | | | Only whitespace changes. svn path=/trunk/; revision=41110
* Check if the string exists first.Anders Broman2012-02-211-10/+10
| | | | svn path=/trunk/; revision=41109
* Extend libpcap_write_interface_description_block() wiyh more optionsAnders Broman2012-02-211-67/+162
| | | | | | all exept os curently unused. svn path=/trunk/; revision=41108
* From Anders: Add support for options in the SHB.Michael Tüxen2012-02-141-6/+65
| | | | | | From me: Some whitespace changes. svn path=/trunk/; revision=41026