aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/pcapng.c
AgeCommit message (Collapse)AuthorFilesLines
2012-06-08Fix some dead assignments.Gerald Combs1-1/+0
svn path=/trunk/; revision=43157
2012-06-02Try to squelch warningsAnders Broman1-5/+5
svn path=/trunk/; revision=42998
2012-05-04file_seek() used to be a wrapper around fseek() or gzseek(), both ofGuy Harris1-15/+10
which could use lseek() and were thus expensive due to system call overhead. To avoid making a system call for every packet on a sequential read, we maintained a data_offset field in the wtap structure for sequential reads. It's now a routine that just returns information from the FILE_T data structure, so it's cheap. Use it, rather than maintaining the data_offset field. Readers for some file formats need to maintain file offset themselves; have them do so in their private data structures. svn path=/trunk/; revision=42423
2012-04-15Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7048Michael Tüxen1-10/+40
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-04-15Whitespace cleanup (done while debugging).Michael Tüxen1-65/+65
svn path=/trunk/; revision=42079
2012-03-26Print the correct block size in a debug message.Gerald Combs1-1/+1
svn path=/trunk/; revision=41773
2012-03-21Disable debug.Anders Broman1-1/+1
svn path=/trunk/; revision=41716
2012-03-20Try to make the buildbot happy.Anders Broman1-10/+10
svn path=/trunk/; revision=41684
2012-03-20Write ISB:s if we have them.Anders Broman1-32/+173
svn path=/trunk/; revision=41683
2012-03-15Initialize the new num_stat_entries and interface_statistics members ofGuy Harris1-4/+7
a wtapng_if_descr_t, so that we don't crash on a close (as is happening in the buildbot). Fix up some 4-space tabs. svn path=/trunk/; revision=41575
2012-03-15If we have one ISB, display the droped count from it.Anders Broman1-3/+6
svn path=/trunk/; revision=41561
2012-03-15- Store ISB data.Anders Broman1-4/+38
- free IDB and ISB data when closing. svn path=/trunk/; revision=41558
2012-03-13From Jose Pedro Oliveira:Anders Broman1-1/+0
Remove a printf line in wiretap/pcapng.c https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6718 svn path=/trunk/; revision=41534
2012-03-13Add data structure to hold information from ISB:sAnders Broman1-2/+3
svn path=/trunk/; revision=41522
2012-03-12From Jose Pedro Oliveira:Anders Broman1-2909/+2909
Enforce the modelines in wiretap/pcapng.c svn path=/trunk/; revision=41506
2012-03-12From Jose Pedro Oliveira: Add ModlinesAnders Broman1-0/+13
svn path=/trunk/; revision=41495
2012-03-10In pcapng.c use the units per second value from the interface instead ofGerald Combs1-73/+73
the default. Add support for reading nseclibpcap files to dumpcap. svn path=/trunk/; revision=41455
2012-03-09From Jose Pedro Oliveira: Corrects several 'wdh->bytes_dumped += ...' lines. ↵Anders Broman1-5/+5
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6718 svn path=/trunk/; revision=41443
2012-03-05Use correct lenght when writing if_filter_str.Anders Broman1-1/+3
svn path=/trunk/; revision=41352
2012-03-05Fix calculation of pading for if_filter_str.Anders Broman1-1/+1
svn path=/trunk/; revision=41351
2012-03-04Squelch a can't-really-happen uninitialized reference warning.Guy Harris1-1/+1
svn path=/trunk/; revision=41342
2012-03-04Use parenthesesAnders Broman1-1/+1
svn path=/trunk/; revision=41341
2012-03-04if_filter isn't a string per se,The first byte of the Option Data keeps a ↵Anders Broman1-11/+58
code of the filter used svn path=/trunk/; revision=41339
2012-03-04Make sure all names in NRB records are null-terminated; report an errorGuy Harris1-13/+138
if they're not. Also report an error for zero-length names. Handle multiple names per IP address - the pcap-NG spec says "one or more zero-terminated strings containing the DNS entries for that address." Use a Buffer to hold NRB records, so there's no maximum size (well, there is a maximum size, because the record length is 16 bits, but let's not allocate 64KiB on the stack if we don't have to). svn path=/trunk/; revision=41332
2012-03-03From Jose Pedro Oliveira: Fix typosAnders Broman1-9/+9
svn path=/trunk/; revision=41330
2012-03-03Don't look at the interface_id field of the packet header ifGuy Harris1-1/+10
WTAP_HAS_INTERFACE_ID isn't set in the presence flags. svn path=/trunk/; revision=41327
2012-03-02Get rid of no-longer-needed argument to pcapng_write_section_header_block().Guy Harris1-25/+3
svn path=/trunk/; revision=41292
2012-03-02Skip an intermediating wtapng_block_t in the code path to writeGuy Harris1-78/+44
Interface Description Blocks. Fix a typo (if_fcslen was meant rather than opt_comment when writing the FCS length). svn path=/trunk/; revision=41291
2012-03-02Simplify the code path for writing pcap-NG packets, and remove someGuy Harris1-87/+34
no-longer-needed elements from the wtapng_packet_t structure. svn path=/trunk/; revision=41289
2012-03-02Fill in the wtap_pkthdr fields in pcap_read_packet_block() andGuy Harris1-81/+75
pcap_read_simple_packet_block(), not in pcap_read() - the way the fields are filled in differs between simple and non-simple packet blocks. Clean up white space. svn path=/trunk/; revision=41284
2012-03-01Fix CID 1385.Michael Tüxen1-1/+1
svn path=/trunk/; revision=41264
2012-03-01Fix CID 354.Michael Tüxen1-6/+6
svn path=/trunk/; revision=41263
2012-03-01Read the complete NRB.Anders Broman1-2/+5
#Backport svn path=/trunk/; revision=41259
2012-03-01Add debuginfoAnders Broman1-1/+3
svn path=/trunk/; revision=41258
2012-02-25Add a presence flag field to the packet information structure filled inGuy Harris1-0/+8
by Wiretap, to indicate whether certain fields in that structure actually have data in them. Use the "time stamp present" flag to omit showing time stamp information for packets (and "packets") that don't have time stamps; don't bother working very hard to "fake" a time stamp for data files. Use the "interface ID present" flag to omit the interface ID for packets that don't have an interface ID. We don't use the "captured length, separate from packet length, present" flag to omit the captured length; that flag might be present but equal to the packet length, and if you want to know if a packet was cut short by a snapshot length, comparing the values would be the way to do that. More work is needed to have wiretap/pcapng.c properly report the flags, e.g. reporting no time stamp being present for a Simple Packet Block. svn path=/trunk/; revision=41185
2012-02-24Fix a typo and revert previous.Anders Broman1-1/+1
svn path=/trunk/; revision=41179
2012-02-24Fix a typo.Anders Broman1-1/+1
svn path=/trunk/; revision=41178
2012-02-23No debug output, please.Michael Tüxen1-1/+1
svn path=/trunk/; revision=41165
2012-02-23interface id is 32-bit, not 64-bit.Michael Tüxen1-2/+2
svn path=/trunk/; revision=41159
2012-02-23Do a check of the block total length in pcapng_read_unknown_block().Guy Harris1-15/+8
That means we don't need to do the block length check in pcapng_read_block(); each block type reader, including the one for unknown block types, does a check that's as stringent as that block length check or more stringent, which means any block whose length is less than the minimum will fail with the same error in both cases. Fix the message for a too-short NRB. svn path=/trunk/; revision=41152
2012-02-22Fix typo introduced by previous checkin.Guy Harris1-1/+1
svn path=/trunk/; revision=41145
2012-02-22Add sanity checks to make sure the claimed block size is big enough to:Guy Harris1-43/+240
1) contain the block length fields and block type field; 2) contain that plus the fixed-length portion of the block; 3) for blocks that have a variable-length portion other than the options, contain that variable-length portion. Fixes a crash we're seeing with a bad pcap-NG file in the Wireshark menagerie (7799-lastPacketWithoutComment.pcapng - the last packet's block length is 128, but it claims to have 98 bytes of packet data, which requires a 132-byte block). Clean up white space (use 8-space tabs). svn path=/trunk/; revision=41143
2012-02-22Grr forgot debug flag - again.Anders Broman1-1/+1
svn path=/trunk/; revision=41140
2012-02-22- Write ISB(s) at start and end of capture.Anders Broman1-10/+186
- Read all options. - Prepare to write ISB. svn path=/trunk/; revision=41137
2012-02-22Handle the case where there are no IDBs before the first non-SHB/non-IDBGuy Harris1-0/+4
block, which could be the case even in a *valid* file (consider a file with an SHB, an NRB, an IDB, and a packet block, in that order); even if there's no IDB before the first packet block, that should be reported to the user as "interface N not less than interface count M", to more precisely indicate the problem. (Yes, the loop should probably keep going until it finds a packet block, not just a non-IDB block.) svn path=/trunk/; revision=41132
2012-02-21Fix bugs which resulted in the buildbot errors.Michael Tüxen1-4/+4
svn path=/trunk/; revision=41126
2012-02-21Disable debug output...Michael Tüxen1-1/+1
svn path=/trunk/; revision=41119
2012-02-21When writing an option in an IDB, also write an endofoption option.Michael Tüxen1-60/+72
Use (consistently) 0 as the default for the interface speed. While there, do some whitespace cleanups. svn path=/trunk/; revision=41118
2012-02-21Improve the error handling.Michael Tüxen1-24/+34
svn path=/trunk/; revision=41112
2012-02-21Improve peeking for IDBs.Michael Tüxen1-17/+21
While there, cleanup some whitespaces. svn path=/trunk/; revision=41106