Commit Graph

28 Commits

Author SHA1 Message Date
Bill Meier 1b8b2a8aa8 Add editor modelines; Adjust whitespace as needed.
Change-Id: I4da7b335d905dbca10bbce03aa88e1cdeeb1f8ad
Reviewed-on: https://code.wireshark.org/review/4626
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-12 18:58:32 +00:00
Alexis La Goutte d029cf158b Fix warning when generate documentation (doxygen)
pcapio.h:65: Warning: The following parameters of pcapng_write_session_header_block(FILE *pfile, const char *comment, const char *hw, const char *os, const char *appname, guint64 section_length, guint64 *bytes_written, int *err) are not documented:
  parameter 'err'

Change-Id: I0eaa55a44436de5b9687c9b7846c199fe77d98e4
Reviewed-on: https://code.wireshark.org/review/1135
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-14 20:24:36 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(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-03-04 14:27:33 +00:00
Bill Meier 11b5c15fdb Remove trailing whitespace
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0
Reviewed-on: https://code.wireshark.org/review/385
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 20:46:49 +00:00
Alexis La Goutte c00a12652f Fix warning found by doxygen
svn path=/trunk/; revision=54130
2013-12-15 19:07:26 +00:00
Guy Harris b06876390d Rename routines that write pcap-ng files to "pcapng_xxx" rather than
"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-29 20:53:13 +00:00
Guy Harris c42263f28a We always write to a FILE *, so:
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-29 20:26:25 +00:00
Michael Mann 18580d6703 Allow pcap/pcapng format to be written to more than just a file (FILE*). Gives more flexibility if needed.
WRITE_DATA macro replaced and applied consistently throughout pcapio.c

svn path=/trunk/; revision=46891
2013-01-02 04:01:22 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
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-26 05:57:06 +00:00
Michael Tüxen 644f8485da Add support for writing per packet comments when using pcapng.
Not actually used with this commit, which just brings in the
infrastructure.


svn path=/trunk/; revision=46715
2012-12-23 09:25:42 +00:00
Michael Tüxen 9a2f4c8e9d Don't use an pcap structures in pcapio.[ch].
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-20 15:20:10 +00:00
Michael Tüxen 7e84abf005 Add ws_fclose(), ws_fflush(), and ws_fdopen() to the fileutils.
Retire libpcap_fdopen(), libpcap_dump_flush(), and libpcap_dump_close().

svn path=/trunk/; revision=46636
2012-12-20 14:53:09 +00:00
Michael Tüxen 10dbe80c65 Add support for writing the flags option in the enhanced
packet block (pcapng).

svn path=/trunk/; revision=46619
2012-12-19 20:27:12 +00:00
Michael Tüxen 3859fdc040 Whitespace change.
svn path=/trunk/; revision=46616
2012-12-19 13:08:24 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Michael Tüxen 8ea1984ddc Allow writing ISB with given recv/drop counters.
No functional change by this commit.

svn path=/trunk/; revision=42242
2012-04-25 20:50:38 +00:00
Gerald Combs 7a8df2f485 In pcapng.c use the units per second value from the interface instead of
the default.

Add support for reading nseclibpcap files to dumpcap.

svn path=/trunk/; revision=41455
2012-03-10 00:24:42 +00:00
Anders Broman 8fff390455 - Write ISB(s) at start and end of capture.
- Read all options.
- Prepare to write ISB.

svn path=/trunk/; revision=41137
2012-02-22 14:41:02 +00:00
Anders Broman af2100d4c3 Expand the API for ISB:s
svn path=/trunk/; revision=41136
2012-02-22 10:01:16 +00:00
Michael Tüxen e485ac5175 Use tab indentation as elsewhere in the files.
Only whitespace changes.

svn path=/trunk/; revision=41110
2012-02-21 15:16:45 +00:00
Anders Broman 5df11d41bb Extend libpcap_write_interface_description_block() wiyh more options
all exept os curently unused.

svn path=/trunk/; revision=41108
2012-02-21 13:35:04 +00:00
Michael Tüxen 68204c94a4 From Anders: Add support for options in the SHB.
From me: Some whitespace changes.

svn path=/trunk/; revision=41026
2012-02-14 17:07:52 +00:00
Guy Harris 37654b4023 Constify some arguments.
svn path=/trunk/; revision=37674
2011-06-15 20:13:42 +00:00
Michael Tüxen b09b4f4084 constify some args of libpcap_write_enhanced_packet_block()
similar to libpcap_write_packet().

svn path=/trunk/; revision=28161
2009-04-26 19:24:36 +00:00
Michael Tüxen b23f4a90fd Add functions to write several pcapng blocks.
svn path=/trunk/; revision=28159
2009-04-26 18:40:40 +00:00
Michael Tüxen f5547c0d78 Make ringbuffer.[ch] file format agnostic.
Move write routines to dumpcap.c
This is a preparation for pcapng support.

svn path=/trunk/; revision=28155
2009-04-26 15:51:25 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Guy Harris e6886d90ce When capturing, we only support writing to libpcap files. Given that,
bypass Wiretap; that means we don't have to run the packet through
wtap_process_pcap_packet() and then undo that conversion in Wiretap if
we're just going to write it out, shortening the code path.

svn path=/trunk/; revision=17461
2006-03-04 22:33:04 +00:00