Commit Graph

2410 Commits

Author SHA1 Message Date
Martin Kaiser 82f9e9ec68 use the correct record length for an IPv6 record in the NRB
this is already correct in 1.8 and 1.10 and was
accidentially(?) changed in r52176

svn path=/trunk/; revision=54479
2013-12-28 20:37:21 +00:00
Guy Harris e3d4fe8aae Add some new tags seen.
svn path=/trunk/; revision=54460
2013-12-26 12:58:26 +00:00
Jakub Zawadzki 33ef0c2600 isascii(x) && isprint(x) -> g_ascii_isprint(x)
svn path=/trunk/; revision=54328
2013-12-21 15:12:11 +00:00
Jakub Zawadzki 064082e68a Change G_GINT64_CONSTANT(xxxxU) to G_GUINT64_CONSTANT(xxxx)
svn path=/trunk/; revision=54314
2013-12-20 22:39:32 +00:00
Guy Harris 9628624867 Get rid of trailing periods in some error messages for consistency; the
others don't have trailing periods, and the caller adds a period as
desired.

svn path=/trunk/; revision=54199
2013-12-17 21:51:45 +00:00
Gerald Combs 75f1073fe6 Cast away shorten-64-to-32 warnings.
svn path=/trunk/; revision=54101
2013-12-14 18:12:32 +00:00
Gerald Combs 8fde85216a Squelch a bunch of shorten-64-to-32 warnings by parsing all of our
numeric values using strtoul and casting it the result to a guint32.
Hopefully no user or session IDs are negative or greater than 32 bits.

svn path=/trunk/; revision=54100
2013-12-14 18:07:01 +00:00
Guy Harris afa9f611d7 And another one.
svn path=/trunk/; revision=54018
2013-12-13 03:13:40 +00:00
Guy Harris 70e8da2d8c Add some more file types misidentified as VWR files.
svn path=/trunk/; revision=54017
2013-12-13 03:12:42 +00:00
Guy Harris c34050d629 The IxVeriWave heuristic now gets more false positives (after, I
suspect, the change to handle VWR files with no packets); shuffle it
after all the types we've seen misidentified as VWR files.

svn path=/trunk/; revision=54012
2013-12-13 02:38:11 +00:00
Chris Maynard 76eebd5561 Appease Visual Studio Code Analysis by ensuring that the string in csec[] is NULL-terminated.
svn path=/trunk/; revision=53995
2013-12-12 22:02:46 +00:00
Jakub Zawadzki 4904620661 Add WTAP_ENCAP_NETLINK which maps to DLT_NETLINK /253/
svn path=/trunk/; revision=53834
2013-12-07 23:25:36 +00:00
Jakub Zawadzki 01e08ae582 wiretap: start using <wsutil/pint.h>
svn path=/trunk/; revision=53764
2013-12-03 20:35:50 +00:00
Guy Harris 203ecca6da Space between STANAG and the standard number.
svn path=/trunk/; revision=53739
2013-12-02 23:09:08 +00:00
Jakub Zawadzki a4c78939b2 Fix encap_table_base[] array.
svn path=/trunk/; revision=53738
2013-12-02 22:38:00 +00:00
Guy Harris 0cc1545d05 Move most of the plugin code from epan to wsutil and remove all
knowledge of particular types of plugins.  Instead, let particular types
of plugins register with the common plugin code, giving a name and a
routine to recognize that type of plugin.

In particular applications, only process the relevant plugin types.

Add a Makefile.common to the codecs directory.

svn path=/trunk/; revision=53710
2013-12-02 08:30:29 +00:00
Michael Mann 6d3d1556dc STANAG 5066 DTS Layer dissector. Bug 9217 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9217)
From İbrahim Can Yüce

From me: Update to new tcp_dissect_pdus format, minor whitespace issues noticed in wiretap files.

svn path=/trunk/; revision=53669
2013-11-30 01:18:22 +00:00
Jakub Zawadzki d99fdfda63 Replace macros: BSWAP16, BSWAP32, BSWAP64 with glib-version.
XXX, people are not aware that expression of this macros might be evaluated multiple times, like:
 -  BSWAP16(tvb_get_letohs(tvb, off)) : \
 +  GUINT16_SWAP_LE_BE(tvb_get_letohs(tvb, off)) : \

Should be tvb_get_ntohs() called?


svn path=/trunk/; revision=53653
2013-11-29 19:21:20 +00:00
Jakub Zawadzki 288efa5128 Expand macros: htoles(), htolel(), htolell()
svn path=/trunk/; revision=53651
2013-11-29 18:44:00 +00:00
Michael Mann ea63042f9b Bluetooth improvements. Bug 9446 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9446)
From Michal Labedzki 

svn path=/trunk/; revision=53525
2013-11-23 21:41:08 +00:00
Guy Harris a36046c784 Get rid of C++ comments.
svn path=/trunk/; revision=53486
2013-11-21 18:50:44 +00:00
Martin Mathieson d5433fd9b6 Cope with empty VWR files (bug 9428)
svn path=/trunk/; revision=53475
2013-11-21 15:42:22 +00:00
Guy Harris f7f4efabb8 Add support for a new type of frame data record seen in a k18 file, and
handle that file not ending with a 2-byte 0xffff end-of-file record.

This fixes bug 9455, although it doesn't add support for reading an
"index" file for a capture that's in multiple .rf5 files, which is a
separate issue noted in that bug.

It also doesn't attempt to figure out what the data in the new record
type following the data that appears to be the same as that in the other
data record format but preceding the actual packet data is.

svn path=/trunk/; revision=53452
2013-11-20 21:00:55 +00:00
Guy Harris 7d2ae28357 Add code to dump part of a record as ASCII, and use it to dump strings
in a source description record, including the stack.  Dump some other
fields in those records as well.

Attach separate sequential and random read buffers to the private data
structure, rather than allocating them in various routines (and not
always freeing them) and, in at least one case, allocating a single
*common* buffer for all wth's to use.

Fix some comments (the DS0 mask is 32 bytes long, but gets turned into a
bitmask).

Put in a description of what a "stack file"'s contents look like.  Much
of it may be useless to us (for example, we have the notion that TCP has
protocol number 6 built-in...), but the RELATION entries that map from
"BASE" to a protocol could obviate the need to have the user specify a
map from stack file names to starting protocols, and we might be able to
use, for example, entries that map TCP/UDP/SCTP port numbers to
protocols to obviate the need for the user to explicitly use Decode As
or otherwise configure port-to-protocol mappings themselves.

Add a bunch of record length checks before we fetch data from records.

svn path=/trunk/; revision=53450
2013-11-20 20:17:33 +00:00
Guy Harris a8a3b22e25 Update URL for the Tektronix manual, and fix a typo in the same comment.
Dump the raw contents of records as hex and ASCII, not just hex.

Sort the record types, and add a new one for a type we've seen in a k18
file and about which we know nothing.

For unknown record types, print the type in hex.

svn path=/trunk/; revision=53441
2013-11-19 22:22:16 +00:00
Guy Harris ffd96e2317 Fix some problems with the debugging code.
svn path=/trunk/; revision=53438
2013-11-19 20:12:51 +00:00
Gerald Combs 16e27047d0 1.11.2 → 1.11.3.
svn path=/trunk/; revision=53412
2013-11-18 17:41:00 +00:00
Gerald Combs f772a268db 1.11.1 → 1.11.2.
svn path=/trunk/; revision=53346
2013-11-15 22:34:31 +00:00
Anders Broman 98bc5eedbc Export the right function name.
svn path=/trunk/; revision=53255
2013-11-11 19:50:17 +00:00
Jakub Zawadzki 38edae1c71 Replace wtap_nstime with nstime_t, remove wtap_nstime_to_sec.
After r50154 nstime_t is inside wsutil/ so wiretap don't need it's own copy. 

svn path=/trunk/; revision=53184
2013-11-09 10:38:02 +00:00
Bill Meier 5a0809c718 (Trivial) whitespace cleanup (mostly trailing whitespace).
svn path=/trunk/; revision=53172
2013-11-08 17:17:57 +00:00
Jörg Mayer 609cd8cf67 Looks like r53166 was not compile tested. Now k12text.l compiles again.
svn path=/trunk/; revision=53167
2013-11-08 11:42:57 +00:00
Guy Harris 853da2eb9b The "file types" we have are actually combinations of types and
subtypes, e.g. Network Monitor version 1 and Network Monitor version 2
are separate "file types", even though they both come from Network
Monitor.

Rename various functions, #defines, and variables appropriately.

svn path=/trunk/; revision=53166
2013-11-08 09:53:01 +00:00
Guy Harris bf4e84aba6 For open dialogs, offer a list of sets of extensions, not of file types;
.cap, for example, doesn't refer to a particular file type - a whole
bunch of file types use .cap.

Also offer, in addition to "All Files", "All Capture Files", which
matches all the extensions we know about.

svn path=/trunk/; revision=53156
2013-11-08 01:08:42 +00:00
Martin Kaiser 9f3740b414 simplify file_error()
svn path=/trunk/; revision=52944
2013-10-29 11:04:03 +00:00
Martin Kaiser 5ec452c288 allow err_info==NULL in file_error()
this fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9309
reported by Peter Wu

svn path=/trunk/; revision=52943
2013-10-29 09:15:02 +00:00
Bill Meier 6697d30b72 Revert SVN #52914;
OSX-10.6-x64 buildbot still givs an error
(At least we now know which line of code gives the error).

svn path=/trunk/; revision=52915
2013-10-28 04:07:52 +00:00
Bill Meier 2c3ec284db From Shekhar Chandra: support for version 3.0 of netscaler packet wire format.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9280

(Revised patch: let's see if this version compiles w/o error
                on all the buildbots)


svn path=/trunk/; revision=52914
2013-10-28 03:16:31 +00:00
Jeff Morriss c5bc8e95ff Fix up some formatting.
svn path=/trunk/; revision=52911
2013-10-28 00:25:20 +00:00
Jeff Morriss 2d20a6c864 Fix up some more svn properties.
svn path=/trunk/; revision=52882
2013-10-27 00:51:54 +00:00
Evan Huus 328a05630c From Michal Labedzki via
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8818

Add support for dissection ELF files. It opens as a "capture" file via wiretap
at the moment for simplicity's sake, but the intention is eventually to have
this (and other file types we dissect) open through some other program sharing
much of the libwireshark infrastructure.

svn path=/trunk/; revision=52775
2013-10-23 01:36:49 +00:00
Bill Meier 88b157d91c Fix "unused variable 'dct3trace_magic_l2_end' [-Werror,-Wunused-const-variable" found by clang v3.4
svn path=/trunk/; revision=52749
2013-10-21 23:57:42 +00:00
Balint Reczey 2ec414c257 Minor refactoring in CMake ABI dump generation
svn path=/trunk/; revision=52689
2013-10-19 15:51:36 +00:00
Balint Reczey 70dce86ab3 Set and use TMPDIR for ABI dump generation when using CMake
svn path=/trunk/; revision=52688
2013-10-19 14:55:12 +00:00
Guy Harris f86132a09a White space cleanups (thanks either to shekhar.chandra@citrix.com or
Bill Meier; see bug 9280).

svn path=/trunk/; revision=52677
2013-10-18 20:28:11 +00:00
Bill Meier 2197f291e5 Revert SVN #52665.
Compilation fails on (only the ?) OSX-10.6-x64 buildbot with error:

netscaler.c: In function 'nstrace_read_v30':
netscaler.c:1295: warning: implicit conversion shortens 64-bit value into a 32-bit value

(Life is too short for me to dig multiple levels deep into a set of macros to try to see which
 actual line of code is causing the problem.  Maybe the patch submitter can identify the problem).


svn path=/trunk/; revision=52666
2013-10-18 04:31:08 +00:00
Bill Meier c50b988807 From Shekhar Chandra: support for version 3.0 of netscaler packet wire format.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9280

From me: fix indentation(tabs->spaces) and trailing whitespace.


svn path=/trunk/; revision=52665
2013-10-18 03:36:04 +00:00
Bill Meier 55f3af2174 Fix various: whitespace, comments & etc.
Add editor modelines.

svn path=/trunk/; revision=52639
2013-10-16 02:39:09 +00:00
Gerald Combs 821e1a7c34 Add another cast.
svn path=/trunk/; revision=52622
2013-10-15 16:40:19 +00:00
Gerald Combs c70baa2037 Add casts to fix some shortening errors.
svn path=/trunk/; revision=52621
2013-10-15 16:29:38 +00:00
Martin Kaiser 156659e308 limit the values written to phdr.(cap)len to guint32, not to guint16
We read a two-byte length field and add a constant number of header
bytes to this length, so we could in theory be larger than guint16.

svn path=/trunk/; revision=52619
2013-10-15 15:15:59 +00:00
Martin Kaiser ef33b36768 code review of parse_s1_W_stats()
range check for array index
   don't assign the result of pntohs() to a gint16
   range check for the values stored in phdr.(cap)len

svn path=/trunk/; revision=52618
2013-10-15 15:11:40 +00:00
Balint Reczey 8956ee2a56 Factor out common parts of ABI checks to UseABICheck.cmake
svn path=/trunk/; revision=52614
2013-10-15 07:30:05 +00:00
Martin Kaiser 1eb36c1119 do some range checks when reading vwr files
don't assign the output of pntoh24() to a gint16

unfortunately, vwr detection does not work reliably and many pdf files
are recognized as vwr - this commit should prevent wireshark from
crashing when it tries to load the USB 2.0 spec as pdf ;-)


svn path=/trunk/; revision=52599
2013-10-14 15:03:28 +00:00
Graham Bloice 9c4ee86784 Add CMake properties to targets so that they are logically organised when using a Visual Studio solution.
Add CMake properties to group the source files in epan into logical blocks when using a Visual Studio solution.

svn path=/trunk/; revision=52580
2013-10-13 09:21:55 +00:00
Guy Harris 640a45d707 Get rid of a redundant check - pcapng_read_packet_block() already checks
whether the (zero-based) interface ID is < the number of interface IDs,
so we don't need to do so in pcapng_read().

Unions are tricky - if the compiler doesn't ensure that the right
component of the union is being used at any given time, various problems
can happen.

Remove some members from the "data" union in the wtapng_block_t
structure, and use a local variable of the specified type.

svn path=/trunk/; revision=52262
2013-09-29 00:37:04 +00:00
Guy Harris 658a16285e The pcap-ng spec says the captured length is the minimum of the
interface snapshot length and the packet length; make it so.

svn path=/trunk/; revision=52253
2013-09-28 21:06:17 +00:00
Guy Harris d399dcb52a Actually, the captured length must be the minimum of:
the number of bytes available for packet data in the block;

	the packet length;

	*and* the snapshot length for the interface.

One more fix for bug 9200, so it should *now* be fixed.

svn path=/trunk/; revision=52250
2013-09-28 20:08:39 +00:00
Guy Harris 1d00d587b4 Fix cut-and-pasteo.
Finishes the fix for bug 9200.

svn path=/trunk/; revision=52247
2013-09-28 19:26:23 +00:00
Guy Harris bdd237863f Correctly calculate the captured length in a Simple Packet Block -
subtract out the minimum SPB size, which includes the length of
*everything* except for the packet data.

Fixes one problem found by the file in bug 9200.

svn path=/trunk/; revision=52244
2013-09-28 18:25:07 +00:00
Guy Harris a582b7201a In a Simple Packet Block, the captured length isn't the block length
minus the lengths of the two length fields and the packet length field,
it's the minimum of that and the packet length, as there might be
padding.

Fixes one problem found by the file in bug 9200.

While we're at it, pcapng_read_packet_block() and
pcapng_read_simple_packet_block() return an integer, not a Boolean;
return 0, not FALSE (they have the same value, but returning 0 makes it
clearer that the return value isn't restricted to TRUE or FALSE).

svn path=/trunk/; revision=52241
2013-09-28 18:03:20 +00:00
Guy Harris 12912b657b There's no interface ID in a Simple Packet Block.
Fixes one problem found by the file in bug 9200.

svn path=/trunk/; revision=52238
2013-09-28 17:44:50 +00:00
Evan Huus d158983d7e Fix some typos, indentation. Don't try to write the NRB if the pointer to our
two lists is itself NULL.

svn path=/trunk/; revision=52181
2013-09-22 20:18:25 +00:00
Evan Huus 6aa5e30ed9 Remove unused parameter.
svn path=/trunk/; revision=52178
2013-09-22 19:58:22 +00:00
Anders Broman a8bd9fb7b6 Turn off debuging.
svn path=/trunk/; revision=52177
2013-09-22 19:43:51 +00:00
Anders Broman 20108d7950 Get rid of struct addrinfo, use the hastables for name resolution instead.
svn path=/trunk/; revision=52176
2013-09-22 19:40:02 +00:00
Alexis La Goutte cbf315b8ed From Tom Cook via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9147 Long / short guard interval not properly read from IxVeriWave vwr files
The short / long guard interval is located in a different spot than the current vwr reader looks.

svn path=/trunk/; revision=52047
2013-09-15 06:58:41 +00:00
Martin Kaiser c4f5a942d7 trivial: fix a typo
svn path=/trunk/; revision=51813
2013-09-07 09:03:21 +00:00
Guy Harris b862ff08fd Make sure we initialize the array of file type extensions before we use
it.

svn path=/trunk/; revision=51553
2013-08-27 22:10:35 +00:00
Guy Harris a505518e01 Have a separate list of extension sets to use in the Open dialog;
include only extensions used mostly by capture files (i.e., not ".txt"
or ".xml"), and list each extension set only once (it's silly to have,
for example, separate entries for NetMon, Shomiti Surveyor, and
NetScaler with ".cap" when you get all those types no matter which entry
you choose).

svn path=/trunk/; revision=51547
2013-08-27 20:46:47 +00:00
Guy Harris 32e1523bb2 For the Windows Open dialog for capture files, get rid of the "(*.*)" in
the "All Files" entry (the current UI guidelines from Microsoft say to
do so, and that's what Paint does, at least), and add an "All Capture
Files" entry with all the file extensions for the file types we support
(it'll pick up all text files, but there's not much we can do about
that, and it won't pick up files with *no* extension or weird
extensions, such as you might get from UN*X systems or from WinDump
commands, but at least it'll filter out some other crud).

Fix what appear to be memory leaks; that should be backported unless
I've missed something and they aren't leaks.

Fix an out-of-date comment, and add an additional comment.

svn path=/trunk/; revision=51481
2013-08-23 00:06:26 +00:00
Guy Harris d6e80b453e From Stephen Donnelly <stephen.donnelly@emulex.com>:
Move the check for vwr files *after* the check for ERF files, as it
sometimes thinks ERF files are VWR files.

svn path=/trunk/; revision=51467
2013-08-22 03:43:39 +00:00
Guy Harris 0c550e9090 Back out the previous change, so I can check it in again with the
*correct* checkin message.  Sigh....

svn path=/trunk/; revision=51466
2013-08-22 03:42:15 +00:00
Guy Harris a4609262b0 Copy over r51462 from trunk:
------------------------------------------------------------------------
  r51462 | guy | 2013-08-21 20:21:47 -0700 (Wed, 21 Aug 2013) | 8 lines

  What was I thinking?  ".caz" is used for compressed *Windows* Sniffer
  files (which are just gzipped uncompressed Windows Sniffer files, albeit
  with the checksum computed differently in some fashion, or perhaps just
  being computed incorrectly), not compressed *DOS* Sniffer files (which
  use their own form of compression, which doesn't compress the entire
  file, just most of it, and which use the same extensions as uncompressed
  DOS Sniffer files).

svn path=/trunk/; revision=51465
2013-08-22 03:40:30 +00:00
Guy Harris 7a1fdcec89 What was I thinking? ".caz" is used for compressed *Windows* Sniffer
files (which are just gzipped uncompressed Windows Sniffer files, albeit
with the checksum computed differently in some fashion, or perhaps just
being computed incorrectly), not compressed *DOS* Sniffer files (which
use their own form of compression, which doesn't compress the entire
file, just most of it, and which use the same extensions as uncompressed
DOS Sniffer files).

svn path=/trunk/; revision=51462
2013-08-22 03:21:47 +00:00
Jakub Zawadzki ba0edfeed2 Original ERF file format documentation is still 404, link to bugzilla.
svn path=/trunk/; revision=51382
2013-08-15 10:44:19 +00:00
Alexis La Goutte 25a8c57356 Fix error when enable "debug" in wiretap/pcapng.c file
With gcc :
pcapng.c: In function 'pcapng_read_packet_block':
pcapng.c:1147:9: error: request for member 'pseudo_header' in something not a structure or union

With clang :
pcapng.c:1150:86: error: member reference type 'struct wtap_pkthdr *' is a pointer; maybe you meant to use '->'?
                       pcap_get_phdr_size(int_data.wtap_encap, &wblock->packet_header.pseudo_header));
                                                                ~~~~~~~~~~~~~~~~~~~~~^
                                                                                     ->
(Error message from clang is better...)

svn path=/trunk/; revision=51317
2013-08-12 17:46:04 +00:00
Guy Harris 84239c0c06 Initialize float variables with float constants, not double constants,
and assign float constants, not double constants, to float variables. 
Floating-point constants are double by default; you have to add "f" to
the end to make them float.

This squelches 64-bit-to-32-bit warnings.

svn path=/trunk/; revision=51289
2013-08-10 21:34:15 +00:00
Alexis La Goutte 36f3b77f6d Fix error when build with clang 3.0
wiretap/lanalyzer.c:643:24: error: implicit conversion loses integer precision: 'const __suseconds_t'
      (aka 'const long') to 'gint32' (aka 'int') [-Werror,-Wshorten-64-to-32]
      gint32 usec = a->tv_usec;
             ~~~~   ~~~^~~~~~~

svn path=/trunk/; revision=51249
2013-08-10 21:27:17 +00:00
Martin Mathieson 1abc2eb191 IxVeriwave 11ac patch (bug 8912) from Tom Cook.
This was the 4th patch, but also:
- use gmalloc0() to allocate vwr struct.  Otherwise, valgrind says that
  many of fields were still uninitialised when parse_s1_W_stats later
read them
- whitespace tidyup, got rid of remaining tabs and trailing whitespace

Did a fair bit of fuzz-testing without seeing any problems.

svn path=/trunk/; revision=51248
2013-08-10 20:57:46 +00:00
Guy Harris 6e0c354769 Clarify what the special cases in wtap_wtap_encap_to_pcap_encap() are
doing.

svn path=/trunk/; revision=51209
2013-08-08 04:57:38 +00:00
Guy Harris 3734d4e2b3 Point to the tcpdump.org link-layer header types page.
svn path=/trunk/; revision=51203
2013-08-08 04:18:20 +00:00
Guy Harris 81865326d0 Rename "dlt_value" to "linktype_value", and give more details in
comments about LINKTYPE_ values vs. DLT_ values.

svn path=/trunk/; revision=51202
2013-08-08 04:16:53 +00:00
Guy Harris 365188e9a4 Back out previous checkin, which wasn't intended (and which had the
wrong checking message - wrong source tree...).

svn path=/trunk/; revision=51051
2013-07-31 05:04:20 +00:00
Guy Harris d5a2958b56 Copy over r51049 from trunk:
------------------------------------------------------------------------
  r51049 | guy | 2013-07-30 22:00:28 -0700 (Tue, 30 Jul 2013) | 5 lines

  If no target OS version was specified, default to the major version on
  which we're running, so we *always* build against an SDK.  (The "10" in
  "10.x.y" is not *really* part of the version number, so the "major
  version" includes the "10" and the major version number following it.)

svn path=/trunk/; revision=51050
2013-07-31 05:01:58 +00:00
Pascal Quantin 3e4e1448d2 Try to fix error: uninitialized const 'zeroes' is invalid in C++ [-Werror=c++-compat]
svn path=/trunk/; revision=51004
2013-07-29 07:54:24 +00:00
Guy Harris bf9ec45248 Make a never-changed pile-o-zeroes const.
svn path=/trunk/; revision=51003
2013-07-29 07:34:07 +00:00
Guy Harris 847257a27d Make a never-changed table const.
svn path=/trunk/; revision=51002
2013-07-29 07:30:34 +00:00
Guy Harris 0c2c7eac71 Make non-static a variable that doesn't need to be static.
svn path=/trunk/; revision=51001
2013-07-29 07:28:28 +00:00
Guy Harris 31731e9b91 The base_secs value should be a time_t, as it's calculated using
mktime().  That eliminates the need for casts.

It should *also* be part of a per-wtap-structure private data structure,
not a global variable; make it so.

svn path=/trunk/; revision=51000
2013-07-29 00:54:33 +00:00
Guy Harris 47c81238db Add a URL for a STANAG 4607 spec.
Fix some typoes in comments.

svn path=/trunk/; revision=50999
2013-07-29 00:34:23 +00:00
Evan Huus 851c8bb487 Use the portable g_ntohl, also add some casts.
svn path=/trunk/; revision=50997
2013-07-28 23:58:30 +00:00
Evan Huus 0b796e53cf From Linas Vepstas via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8962
Enhancement: Add STANAG 4607 file format

svn path=/trunk/; revision=50996
2013-07-28 23:41:18 +00:00
Guy Harris a4ad9e9f74 If a core Wireshark developer repeatedly can't remember that the
argument to the -F flag for pcap format is "libpcap", not "pcap", we
have a problem.  Make it "pcap", and add a backwards-compatibility hack
to support using "libpcap" as well.

Update the man pages to refer to it as pcap as well, and fix the
capitalization of "WinPcap" (see http://www.winpcap.org) while we're at
it.

Also, refer to http://www.tcpdump.org/linktypes.html for the list of
link-layer header types for pcap and pcap-ng.

svn path=/trunk/; revision=50989
2013-07-28 21:12:07 +00:00
Guy Harris 0751daed8a Don't cast away constness (except where APIs render that impossible).
svn path=/trunk/; revision=50854
2013-07-23 23:34:45 +00:00
Guy Harris 7f7733579c Don't cast away constness.
svn path=/trunk/; revision=50853
2013-07-23 23:25:04 +00:00
Guy Harris 52972f605d Handle operating systems that are anticipating the day when files should
be read in chunks > 2GB.

svn path=/trunk/; revision=50847
2013-07-23 18:34:10 +00:00
Jörg Mayer 812f308620 Use largefile detection in cmake.
Move wiretap/file_wrapper.c back to clean sources.

svn path=/trunk/; revision=50825
2013-07-23 09:41:35 +00:00
Jörg Mayer 358f334041 Move file_wrappers.c to dirty files, it has some warnings (turning errors)
when compiled with clang.

Just for documentation:

[  6%] Building C object wiretap/CMakeFiles/wiretap.dir/file_wrappers.c.o
/home/jmayer/work/wireshark/svn/trunk/wiretap/file_wrappers.c:987:28: warning: implicit
      conversion loses integer precision: 'gint64' (aka 'long long') to '__off_t'
      (aka 'long') [-Wshorten-64-to-32]
                if (ws_lseek64(file->fd, off, SEEK_SET) == -1) {
                    ~~~~~~~~~~           ^~~
/home/jmayer/work/wireshark/svn/trunk/wiretap/file_wrappers.c:1051:35: warning:
      implicit conversion loses integer precision: 'long long' to '__off_t' (aka 'long')
      [-Wshorten-64-to-32]
                if (ws_lseek64(file->fd, offset - file->have, SEEK_CUR) == -1) {
                    ~~~~~~~~~~           ~~~~~~~^~~~~~~~~~~~
/home/jmayer/work/wireshark/svn/trunk/wiretap/file_wrappers.c:1076:34: warning:
      implicit conversion loses integer precision: 'gint64' (aka 'long long') to
      '__off_t' (aka 'long') [-Wshorten-64-to-32]
                if (ws_lseek64(file->fd, file->start, SEEK_SET) == -1) {
                    ~~~~~~~~~~           ~~~~~~^~~~~
3 warnings generated.

svn path=/trunk/; revision=50798
2013-07-22 21:23:00 +00:00
Guy Harris 421e9ad4a0 The new frame-based tvbuff code found that the DOS Sniffer code for
compressed sniffer files failed if the very first read involves seeking
past the first blob; fix that.

svn path=/trunk/; revision=50679
2013-07-16 20:59:02 +00:00
Chris Maynard bd0dbc23ca Make camins_read_packet static.
svn path=/trunk/; revision=50671
2013-07-16 16:24:28 +00:00
Guy Harris ff868427ef Include merge.h, so it shows up in the distribution tarball.
svn path=/trunk/; revision=50662
2013-07-16 04:10:25 +00:00
Jeff Morriss 0a669967fa Move merge.{h,c} into wiretap: these modules use wiretap to merge files.
svn path=/trunk/; revision=50656
2013-07-16 02:35:33 +00:00
Guy Harris 3e8b8f0b1a Explain that we don't have to worry about fixed-length buffers whose
size is based on the snapshot length.

svn path=/trunk/; revision=50647
2013-07-16 00:18:55 +00:00
Evan Huus a39e5b9b4a On the suggestion of Cal Turney, via
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8937

Don't warn if a file has packets larger than the global snapshot length.

svn path=/trunk/; revision=50646
2013-07-15 23:58:47 +00:00
Jeff Morriss fae759b793 Avoid building ascend.h and ascend.c in parallel (2 bison's running at the same time sometimes results in corrupted output).
svn path=/trunk/; revision=50524
2013-07-12 03:35:44 +00:00
Pascal Quantin b5187b496b Use newly assigned DLT for PDU export functionality
svn path=/trunk/; revision=50212
2013-06-28 13:05:12 +00:00
Guy Harris f13ba97806 Fix some pointer-signedness (well, signedness of what the pointer points
to) warnings.

svn path=/trunk/; revision=50104
2013-06-21 02:59:54 +00:00
Guy Harris 52e9ee89fd Clarify (a V1.0 file might have a single zero byte at the end of the
page, which doesn't look like an "unused space" record because there
aren't two bytes of record type, just one byte).

svn path=/trunk/; revision=50027
2013-06-19 00:02:22 +00:00
Guy Harris 953d1bfd72 Slight stylistic cleanup - most routines, when defined, have no space
between the routine name and the opening parenthesis, so remove it from
the definition of the seek-read routine.

svn path=/trunk/; revision=50026
2013-06-18 23:47:50 +00:00
Guy Harris 81b9276b24 Note that NetScaler trace files are page-oriented, with records not
split across page boundaries, rather than being a byte stream, and that
the last page may be short.

Fix some comments.

svn path=/trunk/; revision=50025
2013-06-18 23:37:30 +00:00
Evan Huus 3f1f630570 Don't limit the on-the-wire length of packets to 64KB, there are larger packets
out there (especially over USB) and we should be able to load them as long as
they are snapped to a sane length.

Also validate that packets do not specify a snapshot length larger than the one
in the file header, though only make it a warning, as this is not necessarily a
fatally corrupt packet.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8808

svn path=/trunk/; revision=49999
2013-06-18 01:02:26 +00:00
Guy Harris d7380efa6d Put the code to fill in the struct wtap_pkthdr and to read the packet
data into a common routine, and use it in both the read and seek-read
routines.

svn path=/trunk/; revision=49996
2013-06-17 23:43:55 +00:00
Guy Harris 9fb168b2cc Merge more of the read and seek-read code paths.
svn path=/trunk/; revision=49990
2013-06-17 22:18:24 +00:00
Guy Harris 32b95570df Merge "read record header" and "read packet data" routines into a single
routine, used both by read and seek-read routines.

svn path=/trunk/; revision=49988
2013-06-17 21:18:47 +00:00
Guy Harris ca0f8ee6da Make the libwiretap Buffer routines usable from C++, and fix the C++ UI
code to handle the API changes for the seek-read routines.

svn path=/trunk/; revision=49950
2013-06-16 01:40:04 +00:00
Guy Harris 8c9edf1280 Have the seek-read routines take a Buffer rather than a guint8 pointer
as the "where to put the packet data" argument.

This lets more of the libwiretap code be common between the read and
seek-read code paths, and also allows for more flexibility in the "fill
in the data" path - we can expand the buffer as needed in both cases.

svn path=/trunk/; revision=49949
2013-06-16 00:20:00 +00:00
Guy Harris 2b3891fa3b Pull some of the code to set the struct wtap_pkthdr into
parse_netscreen_hex_dump().

svn path=/trunk/; revision=49944
2013-06-15 09:05:04 +00:00
Guy Harris 2b5344666a Fill in at least some of the struct wtap_pkthdr in both the read and
seek-read routines.

svn path=/trunk/; revision=49943
2013-06-15 01:51:21 +00:00
Guy Harris 25d9d55cef Rename radcom_process_rec_header() to radcom_process_rec_header() and
move the code to file in a struct wtap_pkthdr there.

svn path=/trunk/; revision=49942
2013-06-14 23:59:04 +00:00
Anders Broman 878e89885b Allign the error messages.
svn path=/trunk/; revision=49870
2013-06-10 17:13:49 +00:00
Guy Harris f4f4e024bc libwireshark's add_new_ipv4() and add_new_ipv6() now silently ignore
requests to add an entry with a zero-length name; we don't have to
ignore them ourselves.

svn path=/trunk/; revision=49854
2013-06-09 06:44:47 +00:00
Guy Harris 9f1f58745c Don't treat zero-length names in the NRB as errors, just silently ignore
them.

Works around the problem reported in bug 8763.

svn path=/trunk/; revision=49851
2013-06-09 02:32:30 +00:00
Guy Harris f86c7712a3 Use g_try_malloc() for some memory allocations, and return an "out of
memory" indication if it fails.

Further fixes bug 8752.

Also, clean up indentation.

svn path=/trunk/; revision=49834
2013-06-07 08:34:44 +00:00
Guy Harris 2429df9c51 Prevent attempts to allocate huge amounts of memory by imposing an
artificial 16MB limit on blocks.

Do some sanity checks when reading options, to make sure we don't read
past the end of the block.

Make some variables unsigned so as not to get inappropriate
sign-extension (which, in practice, should never happen due to the 16MB
block size limit, although if the limit is raised above 2^31-1, the
limit won't protect you).

Fixes bug 8752.

svn path=/trunk/; revision=49833
2013-06-07 08:19:40 +00:00
Pascal Quantin 506b417907 From Mark C. Brown via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8777 :
Add support for 10Gbe HP-UX drivers IOCXGBE and IQXGBE

svn path=/trunk/; revision=49820
2013-06-06 20:55:00 +00:00
Guy Harris 57eb433a0b Pull all the code that reads and processes the packet header into
visual_process_packet_header() and call it in both the read and
seek-read routines.

Pull the post-processing code that guesses the encapsulation based on
the first few bytes in the packet into
visual_fill_in_chdlc_encapsulation() and call it in both the read and
seek-routines.  Add some length checks.

svn path=/trunk/; revision=49812
2013-06-06 18:57:22 +00:00
Guy Harris 59c3ab9cc9 Pull the code for setting the struct wtap_pkthdr into a
snoop_process_record_header() routine, and call it in both the read and
seek-read routines.

svn path=/trunk/; revision=49803
2013-06-06 08:14:44 +00:00
Guy Harris 311c8d346d Set the entire struct wtap_pkthdr, not just the pseudo-header, in the
seek-read routine.  Pull the code to do that into
netxray_set_pseudo_header(), and rename it netxray_set_phdr().

svn path=/trunk/; revision=49800
2013-06-06 00:10:36 +00:00
Guy Harris a58b141062 The check for network_size < 4 is necessary only for those packets where
we're lopping 4 bytes off of the network_size.

Add a comment discussing the aformentioned lopping-off.

svn path=/trunk/; revision=49782
2013-06-05 08:12:06 +00:00
Guy Harris 1f2231da07 Move the code that fills in the struct wtap_pkthdr (other than the
pseudo-header) into a process_packet_header() routine, and call it in
both the read and seek-read routines.

svn path=/trunk/; revision=49779
2013-06-05 00:36:57 +00:00
Anders Broman 4cdb591e46 From Anthony Coddington:
ERF wiretap export multiple extension header fix.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8765

svn path=/trunk/; revision=49749
2013-06-04 04:00:59 +00:00
Jeff Morriss d8558f06fd Fix an unintialized-value-used warning that Valgrind detected in the capture
file attached to https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8760 :

When searching for a signature, don't search past the end of the record.

svn path=/trunk/; revision=49742
2013-06-04 01:31:56 +00:00
Jeff Morriss 9f95423783 Get rid of trailing white space and a few tabs.
svn path=/trunk/; revision=49741
2013-06-04 00:58:40 +00:00
Jeff Morriss 0eecced808 Fix the wiretap fuzz failure reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8760 :
Check that the record length we got out of the file is at least as big as
stats block trailer; if not, declare the file bad.

svn path=/trunk/; revision=49739
2013-06-04 00:50:05 +00:00
Guy Harris e4d65e993f file_skip() only needs to return a Boolean; if anybody cares what the
seek offset is after calling it, they can use file_tell().  (Some
routines were already assuming it returned a gboolean.)

svn path=/trunk/; revision=49733
2013-06-03 23:07:42 +00:00
Pascal Quantin 8c32b5db74 Initialize the whole hdr_info structure to please gcc 4.3.2
svn path=/trunk/; revision=49710
2013-06-03 07:48:59 +00:00
Guy Harris 8c112f9223 Put back a fix that earlier checkins lost.
svn path=/trunk/; revision=49709
2013-06-03 06:36:55 +00:00
Evan Huus 45ed7d6aa3 Initialize some variables that GCC 4.7 complains about. I'm not 100% sure
that the complaints are valid, or that simply zeroing them is the right fix
if they are, but at least it builds now. Should we be erroring if we don't
see a sliceLength header?

svn path=/trunk/; revision=49705
2013-06-03 01:07:26 +00:00
Guy Harris c20b5d96a8 When reading sequentially, skip past any ignored data at the end of the
packet.

svn path=/trunk/; revision=49704
2013-06-03 00:26:16 +00:00
Guy Harris c3c6f93f5c Pass the read_rec_data routines a wtap_pkthdr pointer, and have them
fill in that structure, so that it's filled in by both the read and
seek-read routines.

svn path=/trunk/; revision=49703
2013-06-02 23:32:17 +00:00
Guy Harris 761ab82280 Pull the code to Fill in the wtap_pkthdr structure into a common
routine, and use it in both the read and seek-read routines.

svn path=/trunk/; revision=49702
2013-06-02 23:23:47 +00:00
Guy Harris f7f029c255 Move code to fill in the wtap_pkthdr into peektagged_process_header(),
so that it's filled in by both the read and seek-read routines.

svn path=/trunk/; revision=49701
2013-06-02 23:20:11 +00:00
Guy Harris bc97838985 Pull code to read and process packet headers into
peekclassic_process_record_header_() routines, used in both the read and
seek-read routines.

svn path=/trunk/; revision=49700
2013-06-02 23:12:58 +00:00
Guy Harris fb2cb6c9a8 Pull code to read process packet headers into a
packetlogger_process_header() routine, used in both the read and
seek-read routines.

svn path=/trunk/; revision=49699
2013-06-02 22:17:37 +00:00
Guy Harris 3922276de4 Initialize the frame_table_size field of the private data to 0 and the
frame_table field to NULL before trying to allocate the frame table, so
that if we fail before we allocate the frame table, the attempt to free
the private data doesn't crash due to the frame_table field containing a
bogus pointer.

svn path=/trunk/; revision=49697
2013-06-02 18:09:13 +00:00
Guy Harris 6b4c30b69d When allocating the frame table for a NetMon file, use g_try_malloc(),
and fail with ENOMEM if that fails (and the frame table is not empty -
g_try_malloc() will return NULL if you ask it to allocate zero bytes).

Have an error message for ENOMEM on an open that attempts to tell the
user what the problem is without making their head explode.

svn path=/trunk/; revision=49673
2013-06-01 06:48:37 +00:00
Guy Harris 6e336d74a1 Move the record header processing code into a common routine, and read
that header in both the read and seek-read routines.

svn path=/trunk/; revision=49671
2013-06-01 02:58:58 +00:00
Pascal Quantin 55da3a2254 From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8644 :
SEL RTAC (Real Time Automation Controller) EIA-232 Serial-Line Dissection

svn path=/trunk/; revision=49635
2013-05-30 20:51:18 +00:00
Jörg Mayer d9dd3f3e4e Fix "set but not used" compile warning turning error
svn path=/trunk/; revision=49405
2013-05-18 08:13:51 +00:00
Guy Harris 82f74c35fc Fill in the struct wtap_pkthdr in the seek-read routine.
svn path=/trunk/; revision=49404
2013-05-18 03:42:06 +00:00
Guy Harris 3fc0506b41 In libpcap_process_header(), fill in what phdr points to, not wth->phdr.
svn path=/trunk/; revision=49403
2013-05-18 03:15:06 +00:00
Guy Harris 4097d6e676 Fill in the struct wtap_pkthdr in the seek-read routine.
svn path=/trunk/; revision=49402
2013-05-18 03:02:04 +00:00
Guy Harris 33e1232f23 In the pcapng seek-read routine, *don't* fill in wth->phdr; seek-read
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-05-18 02:36:00 +00:00
Guy Harris 055ff08c2f Use g_array_index() to get at elements of the encapsulation table array;
this avoids some compiler warnings from clang about alignment.

svn path=/trunk/; revision=49398
2013-05-18 00:41:30 +00:00
Guy Harris 288e81e40f Put the code to read trace record headers into a common routine used by
both the read and the seek-read routines.  Have the read routine return
the offset of the record header as the record's offset, so that the
seek-read routine can read that header.

svn path=/trunk/; revision=49397
2013-05-18 00:08:43 +00:00
Guy Harris ed76ed8c88 Don't pass globals as arguments to k12text_set_headers(), just use the
globals directly.  If we ever manage to make them *not* globals (which
might only be possible with newer versions of Flex), then we can do
better.

Get rid of an unused variable.

Squelch a 64-bit-to-32-bit conversion warning.

svn path=/trunk/; revision=49396
2013-05-17 23:53:44 +00:00
Guy Harris 4c679fb01a Rename k12text_set_pseudo_header() to k12text_set_headers() and have it
fill in the entire struct wtap_pkthdr.

svn path=/trunk/; revision=49388
2013-05-17 21:55:33 +00:00
Pascal Quantin 5c56d95afe Prevent "'len' may be used uninitialized in this function" error when compiling with gcc 4.3.2
svn path=/trunk/; revision=49378
2013-05-17 13:37:36 +00:00
Guy Harris 08889b5e75 Pull some functions that fill in a struct wtap_pkthdr into common code,
and use it in both the read and seek-read routines.

svn path=/trunk/; revision=49377
2013-05-17 10:13:12 +00:00
Guy Harris 4dd1504036 Have iseries_parse_packet() fill in a struct wtap_pkthdr; that means it
doesn't need to return the number of bytes of captured packet data (it
can just stuff that into the struct wtap_pkthdr), so have it return a
Boolean success/failure indication.

svn path=/trunk/; revision=49376
2013-05-17 09:48:19 +00:00
Guy Harris adb9282b0e If iseries_seek_next_packet() hits the EOF, *err will be set to 0; just
have it return -1 for errors or EOF, and have iseries_read() check for a
negative return value and return FALSE.  That simplifies it a bit, and
handles the "no more records in the file" case
(iseries_seek_next_packet() will hit EOF and return -1 with *err set to
0, which is what the callers of a read routine expect at EOF).

Get rid of duplicate (and incorrect before the change) comment.

svn path=/trunk/; revision=49375
2013-05-17 09:37:02 +00:00
Guy Harris 13694fde7b Get rid of duplicate code.
svn path=/trunk/; revision=49374
2013-05-17 08:56:43 +00:00
Guy Harris ab74872031 Pull the reading of record data and ATM post-processing into another
common routine.

svn path=/trunk/; revision=49373
2013-05-17 08:53:04 +00:00
Guy Harris 54d630d8c5 Add iptrace_process_rec_header_ routines to read record headers and fill
in a wtap_pkthdr, as well as skipping FDDI padding, etc..

svn path=/trunk/; revision=49372
2013-05-17 08:19:51 +00:00
Guy Harris 7634be8b27 IPFIX records have a time stamp (and, according to RFC 5101, it's UNIX
time, i.e. seconds since January 1, 1970, 00:00:00 UTC).

svn path=/trunk/; revision=49370
2013-05-17 07:45:36 +00:00
Guy Harris 04d33bca00 We need ipfix_read_message_header() for the open routine; have
ipfix_read_and_process_message_header() call it and then fill in the
wtap_pkthdr structure, and use the latter routine in the read and
seek-read routines.

Expand a comment, and fix indentation.

svn path=/trunk/; revision=49369
2013-05-17 07:28:34 +00:00
Guy Harris 4b1623d619 Pull the code that fills in a wtap_pkthdr structure into
ipfix_read_message_header() and rename it
ipfix_process_message_header().  Use it in the read and seek-read
routines.

svn path=/trunk/; revision=49368
2013-05-17 06:41:20 +00:00
Guy Harris 2c07003e67 Pull the record header processing code into i4b_read_rec_header(),
renaming it to i4b_process_rec_header(), so that it's used in the read
and the seek-read routines.

svn path=/trunk/; revision=49367
2013-05-17 06:08:40 +00:00
Guy Harris a335cd8d87 Pull code to fill in a wtap_pkthdr into a hcidump_process_header()
routine, and use it in both the read and seek-read routines.

svn path=/trunk/; revision=49365
2013-05-17 05:31:21 +00:00
Guy Harris 26a909d980 Fill in the wtap_pkthdr in dct3trace_get_packet().
svn path=/trunk/; revision=49360
2013-05-17 00:21:16 +00:00
Guy Harris 7532c175b6 Set *data_offset early in the read process, to emphasize that it's the
offset of the entire packet, not the offset of the data.

Pull the setting of the FCS length into a common routine.

svn path=/trunk/; revision=49359
2013-05-17 00:15:58 +00:00
Guy Harris a6d35a28dd Pass parse_dbs_etherwatch_packet() a pointer to a struct wtap_pkthdr,
not a wtap *, and have it fill in the specified struct wtap_pkthdr. 
That makes the seek-read routine do the right thing.

svn path=/trunk/; revision=49358
2013-05-17 00:07:42 +00:00
Guy Harris b5561ed4f0 Move the header-processing code into a common daintree_sna_scan_header()
routine.

Rename daintree_sna_hex_char() to daintree_sna_process_hex_data() (to
more clearly indicate what it does - it doesn't process a single
character, it processes a whole bunch of them), and have it do some
error checking and fill in the length field in the wtap_pkthdr.

svn path=/trunk/; revision=49356
2013-05-17 00:00:13 +00:00
Guy Harris 754ccf4f7f Pull code to read and process the packet header, and to read and process
the packet data, into common routines.

svn path=/trunk/; revision=49355
2013-05-16 23:42:10 +00:00
Guy Harris 99aee757d4 Fill in the presence flags in parse_cosine_rec_hdr(), so it's done at
the same point at which the rest of the wtap_pkthdr is filled in (so
it's done in seek-read routines).

parse_cosine_hex_dump()'s return value is used as the return value of
read routines, so it should be Boolean.  Make it so (and have it stuff
the actual length of packet data read into a wtap_pkthdr, which also
ensure that this is done in seek-read routines).

svn path=/trunk/; revision=49352
2013-05-16 23:34:12 +00:00
Guy Harris 384e4bc54e Pull up the code to read the packet data and check for errors into a
common routine.

svn path=/trunk/; revision=49351
2013-05-16 23:23:08 +00:00
Guy Harris e53fb07cae Move the code to read the CommView record header, check for an unhandled
encapsulation, and to process it into a
commview_read_and_process_header() routine.

svn path=/trunk/; revision=49350
2013-05-16 23:14:17 +00:00
Guy Harris 5e1da6c1a6 Pull code to fill in the wtap_pkthdr into a btsnoop_read_record_header()
routine, for use both by the seek and read routines, and move some
common code there.

Make the delta between Symbian and UNIX time a static value.

Make the prefix for all routine names "btsnoop" rather than "snoop".

svn path=/trunk/; revision=49348
2013-05-16 22:14:11 +00:00
Guy Harris 13262726bc Pull the code to set the wtap_pkthdr into a common routine, so it's done
for read and seek-read.

Clarify a comment.  (wtap_open_offline() only rewinds the file before
calling each open routine; once one of those routines has decided the
file belongs to it, the seek offset belongs to it, so it needs to do all
the seeking necessary - files with a file header *don't* want a rewind,
they want to leave the seek offset positioned *past* the file header so
it can read the records that follow the file header.)

svn path=/trunk/; revision=49347
2013-05-16 22:01:44 +00:00
Guy Harris 609dac2f9e Move some packet-header handling code into aethra_read_rec_header(), so
it's done in both the read and seek-read routines.

svn path=/trunk/; revision=49346
2013-05-16 21:40:04 +00:00
Guy Harris 11a01e50bf Pull the code to set the struct wtap_pkthdr into _5views_read_header(),
so it's done by both the read and seek-read routines.

svn path=/trunk/; revision=49345
2013-05-16 21:19:53 +00:00
Guy Harris 887c604334 Hoist a bunch of common code between ascend_read() and
ascend_seek_read() into parse_ascend().

Adjust the buffer size *before* attempting to fill it up.

svn path=/trunk/; revision=49343
2013-05-16 21:04:41 +00:00
Guy Harris 78ee09dfeb Get rid of unused global variable.
svn path=/trunk/; revision=49341
2013-05-16 20:25:44 +00:00
Guy Harris e6e5aa7fa4 wth->priv is always set in the open routine; no need to check that it's
non-null.

svn path=/trunk/; revision=49338
2013-05-16 18:30:24 +00:00
Guy Harris d9d8174f12 Pull all the post-processing for a parsed line into a common routine,
used in both the seek and seek_read routines.

(And, yes, the time stamp *is* supposed to be filled in by seek_read
routines.)

Pull some now-used-only-once routines into the new routine.

svn path=/trunk/; revision=49335
2013-05-16 18:27:27 +00:00
Pascal Quantin ba4cb4bad7 From Weston Schmidt via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8689:
csids wiretap heuristic overriding mp2t

svn path=/trunk/; revision=49334
2013-05-16 18:27:03 +00:00
Evan Huus 930d0c1ed6 From Ravi Kondamuru via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8637
Add support for version 2.6 of netscaler capture format.

svn path=/trunk/; revision=49250
2013-05-11 18:43:53 +00:00
Jörg Mayer 7e51c9713b dumpabi: This would create the directories in the sourcedir instead
of the binary dir. Fixed that.
  NOTE: It fails with and without this patch for out of tree builds:

jmayer@egg:~/work/wireshark/svn/build/qt-gtk3> make dumpabi
[  1%] Built target wsutil
[  1%] Generating libwsutil.abi.tar.gz
ERROR: can't find modules
cp: cannot stat `abi_dumps/libwsutil/libwsutil_*': No such file or directory
make[3]: *** [wsutil/libwsutil.abi.tar.gz] Error 1
make[2]: *** [wsutil/CMakeFiles/dumpabi-libwsutil.dir/all] Error 2
make[1]: *** [CMakeFiles/dumpabi.dir/rule] Error 2
make: *** [dumpabi] Error 2
jmayer@egg:~/work/wireshark/svn/build/qt-gtk3>


svn path=/trunk/; revision=49014
2013-04-24 12:57:56 +00:00
Gerald Combs ea19c7f952 1.9.3 → 1.11.0.
svn path=/trunk/; revision=48972
2013-04-22 17:59:38 +00:00
Pascal Quantin 6910f9428f From Tomasz Mon via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8503 :
Add USBPcap support

svn path=/trunk/; revision=48847
2013-04-14 16:00:34 +00:00
Guy Harris c5d1d8d80e From Anthony Coddington: don't check for MPEG-2 Transport before
checking for ERF.

From me: note some heuristic checkers that are in the "magic number" set.

#BACKPORT 1.8

svn path=/trunk/; revision=48724
2013-04-04 04:35:09 +00:00
Guy Harris d517ab3698 In the Lua dumper code, don't bother checking whether the encapsulation
is supported before trying to open for writing - the attempt to open for
writing will do the check for you.  Instead, check for specific errors
if the attempt to open for writing fails, and use somewhat more specific
error messages for certain error codes.  (We should perhaps check for
even more error codes in those cases.)

That gets rid of all external calls to wtap_dump_can_write_encap(), so
remove it from wtap.h and make it static.

svn path=/trunk/; revision=48691
2013-04-01 21:39:28 +00:00
Guy Harris b1ecd8d217 Add a wtap_dump_can_write() routine that indicates whether Wiretap
supports writing files with a given set of encapsulations and comment
types.  Use it, rather than asking for a list of file formats that
support the given set of encapsulation and comment types and checking
whether we got back such a list, or duplicating its logic.

Having file.c use it means that nobody's using
wtap_dump_can_write_encaps() any more; get rid of it.  Instead, have a
private routine that checks whether a given file format supports a given
set of encapsulations *and* comment types, and use that internally.

svn path=/trunk/; revision=48690
2013-04-01 21:17:50 +00:00
Guy Harris 82a602d697 Define a collection of bits for different types of capture file comments.
For each capture file type, have a bitset of comment types supported by
that capture file type.

Add a Wiretap routine that, for a given file type, returns the bitset of
comment types it supports.

Have wtap_get_savable_file_types() take a bitset of comment types that
need to be supported by the file types it returns.

Replace cf_has_comments() with a routine that returns a bitset of
capture file comment types in the capture file.

Use those routines in the capture file dialogs; don't wire in the notion
that pcap-NG supports all comment types and no other file formats
support any comment types.  (That's currently true, but we don't want to
wire that in as being forever true.)

svn path=/trunk/; revision=48689
2013-04-01 20:36:42 +00:00
Martin Kaiser 7a2bdedff6 wiretap support for the CAM Inspector file format
svn path=/trunk/; revision=48647
2013-03-30 09:56:57 +00:00
Gerald Combs b60e41b984 1.9.2 → 1.9.3.
svn path=/trunk/; revision=48627
2013-03-28 18:13:22 +00:00
Evan Huus 202680971d Wiretap file open routines should not free wth->priv on error, since that
leads to a double-free in wtap_close. Fix all the instances I found via
manual code review, and add a brief comment to the list of open routines in
file_access.c

Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8518

svn path=/trunk/; revision=48552
2013-03-25 22:04:15 +00:00
Evan Huus b8ae49755d From Prafulla Harpanhalli via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8513
Add support for encapsulation 136, Juniper service PIC cookie.

svn path=/trunk/; revision=48494
2013-03-23 02:42:12 +00:00
Anders Broman 089dfcd108 From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48424
2013-03-19 19:02:25 +00:00
Gerald Combs 4c87778b7a 1.9.1 → 1.9.2.
svn path=/trunk/; revision=48406
2013-03-18 22:18:52 +00:00
Anders Broman 05a8c94ddf From beroset:
implemented wtap_dump_file_seek() and _tell()

implemented the previously declared but unimplemented wtap_dump_file_seek() and wtap_dump_file_tell() functions and used them in the seven files that had previously used a plain ftell or fseek and added error checking as appropriate.  I also added a new error WTAP_ERR_CANT_SEEK_COMPRESSED and put it next to WTAP_ERR_CANT_SEEK causing renumbering of two of the existing error codes.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48348
2013-03-17 09:20:13 +00:00
Jaap Keuter 827eb58b04 From David Arnold:
Replace use of INCLUDES with AM_CPPFLAGS in all Makefiles to placate recent autotools.

svn path=/trunk/; revision=48261
2013-03-12 06:53:39 +00:00
Bill Meier db6243a180 Use consistent indentation (4 spaces);
Reformat  long single line comments for readability;
Add editor modelines.

svn path=/trunk/; revision=48086
2013-03-05 15:28:10 +00:00
Anders Broman 85973068cc From beroset:
remove C++ incompatibilities

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48038
2013-03-03 17:14:19 +00:00
Pascal Quantin fc9156a8a0 Try to fix LNK4217 (locally defined symbol imported in function) and C4273 (inconsistent DLL linkage) warnings when compiling for Windows
svn path=/trunk/; revision=48021
2013-03-02 22:19:33 +00:00
Balint Reczey 1ebdb2e521 Export libwireshark symbols using WS_DLL_PUBLIC define
Also remove old WS_VAR_IMPORT define and related Makefile magic
everywhere in the project.

svn path=/trunk/; revision=47992
2013-03-01 23:53:11 +00:00
Balint Reczey 4cf12b41be Revert "Fix MSVC build errors related to symbol visibility"
This reverts commit r47952.
The problem was different from what I originally thought, thus
the commit was obsolete.

svn path=/trunk/; revision=47954
2013-02-28 22:17:06 +00:00
Balint Reczey 383d73be05 Add -DWS_BUILD_DLL to wiretap Windows builds
It fixes symbol exporting from DLLs.

svn path=/trunk/; revision=47953
2013-02-28 21:42:23 +00:00
Balint Reczey ccc76ff07f Fix MSVC build errors related to symbol visibility
svn path=/trunk/; revision=47952
2013-02-28 21:11:32 +00:00
Balint Reczey aa659985a5 Export libwiretap symbols using WS_DLL_PUBLIC define
TODO: hide flex-generated functions

svn path=/trunk/; revision=47948
2013-02-28 19:35:59 +00:00
Bill Meier 96a24cc79f Fix spelling/typos found using a list of commonly misspelled words.
The misspellings were mostly in comments but some were
in text strings visible to the user.


svn path=/trunk/; revision=47899
2013-02-26 04:42:26 +00:00
Bill Meier 722b4985f1 its ==> it's
svn path=/trunk/; revision=47895
2013-02-26 01:50:44 +00:00
Balint Reczey 82843905c5 ABI dumps don't have to depend on config.h directly
They depend on libs which need config.h already.

svn path=/trunk/; revision=47883
2013-02-25 21:27:07 +00:00
Balint Reczey d2e0724afc Add dumpabi targets to CMake builds
Also update automake generated targets to match CMake generated ones

svn path=/trunk/; revision=47879
2013-02-25 18:12:20 +00:00
Balint Reczey e1d24fdb49 Generate abi-descriptor.xml-s in CMake builds
svn path=/trunk/; revision=47865
2013-02-24 21:14:17 +00:00
Balint Reczey 7f0ee327ca Set library versions in CMake builds
svn path=/trunk/; revision=47848
2013-02-23 22:54:36 +00:00
Martin Mathieson cf15301cbf Add support for reading/writing 'sprint' lines from test scripts.
svn path=/trunk/; revision=47686
2013-02-15 23:43:30 +00:00
Guy Harris ebacca89a7 Add %option noinput to a bunch of Flex files, as we aren't using the
input() routine and thus don't need to have it generated - and as it
produces warnings of a routine defined but not used, we don't want to
have it generated.

Squelch a casting-const-away warning.

svn path=/trunk/; revision=47613
2013-02-10 19:13:07 +00:00
Guy Harris b2fd895135 Clean up white space.
Define the PNG magic number as a mixture of hex and ASCII, to make it a
bit clearer what's going on.

svn path=/trunk/; revision=47378
2013-01-30 22:55:32 +00:00
Michael Mann d6901da1d1 Wiretap: Add support for files contain GIF, PNG images
From Michal Labedzki, bug 8278 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8278)

svn path=/trunk/; revision=47368
2013-01-30 19:26:05 +00:00
Gerald Combs ec880b7db3 Use readlink instead of ls.
svn path=/trunk/; revision=47338
2013-01-29 01:06:24 +00:00
Balint Reczey c6f9d4c131 make dumpabi target build with multiple digits in library version numbers
svn path=/trunk/; revision=47329
2013-01-28 21:45:44 +00:00
Gilbert Ramirez 10dd94fa0b Add support for HFI and infiniband interfaces in AIX iptrace files.
svn path=/trunk/; revision=47258
2013-01-24 18:08:25 +00:00
Chris Maynard 231bd8ab50 Fix Coverity CID 762007: Logically dead code.
svn path=/trunk/; revision=47067
2013-01-14 16:06:20 +00:00
Anders Broman f6d8712284 Use const char in wtap_register_encap_type() just as in proto_register_protocol().
svn path=/trunk/; revision=46990
2013-01-07 21:02:56 +00:00
Guy Harris 544f8eb69d When writing an ERF record, the case where the encapsulation type is
"ERF record" is very different from, and much simpler than, the case
where it's not; tweak the code to more clearly separate the "we're being
handed ERF records" case from the "we're being handed packets" case.

svn path=/trunk/; revision=46984
2013-01-06 20:44:49 +00:00
Guy Harris 073e2aa45a Make some Boolean flags gbooleans, rename one of them to more clearly
indicate what it means, and use an enum for the compression types.

Note that file_getc() returns a byte, not a character.

svn path=/trunk/; revision=46983
2013-01-06 20:36:33 +00:00
Guy Harris 40a5e8b991 Clean up comment alignment.
Get rid of unnecessary pointer cast.

svn path=/trunk/; revision=46982
2013-01-06 20:20:35 +00:00
Alexis La Goutte b763df41d8 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=46980
2013-01-06 19:42:03 +00:00
Alexis La Goutte 261ed08fc5 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=46979
2013-01-06 19:41:55 +00:00
Pascal Quantin deb4f08cb2 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8105 :
Allow use of huges values for localtime / ctime / gmtime with MSVC 2008 or later

svn path=/trunk/; revision=46930
2013-01-04 14:56:27 +00:00
Michael Mann 86d690880f replace "unsigned" datatype with "guint". Some mpeg files needed "unsigned int" instead.
bugs 7825-7827 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7825)

svn path=/trunk/; revision=46928
2013-01-04 05:22:43 +00:00
Guy Harris 844ee8059a Update TODO list - the first two items are done, and with stuff added to
support pcap-NG we might have a better way of doing the third item (more
stuff is needed, but that stuff belongs there for pcap-NG, too).

When parsing hex dump lines, skip leading white space, and skip lines
that have nothing but white space, rather than guessing where the hex
dump information ends based on the line length.  Parse the hex bytes
manually.

svn path=/trunk/; revision=46905
2013-01-02 22:56:24 +00:00
Guy Harris 8be92d6af2 Give some more details, as per the Web page cited as a reference.
svn path=/trunk/; revision=46852
2012-12-29 21:59:27 +00:00
Guy Harris b2f58e4e4d Oops, one instance of "airopeekv9" that wasn't supposed to have been
changed was changed.

svn path=/trunk/; revision=46851
2012-12-29 21:46:59 +00:00
Guy Harris c6ede6cf55 Use the "if (file_gets(...) == NULL) { fail }" style, as used elsewhere.
svn path=/trunk/; revision=46822
2012-12-28 09:10:59 +00:00
Guy Harris 41e6e0f7e6 Always check the return value of read_new_line().
svn path=/trunk/; revision=46821
2012-12-28 09:10:18 +00:00
Guy Harris d8b37bafb7 Errors take precedence over EOF; use file_error() after operations that
return an "EOF or error" indication - an EOF without an error will
return 0.

In iseries_seek_next_packet(), return an error code of WTAP_ERR_BAD_FILE
and an appropriate error message if we don't find a packet header within
the next ISERIES_MAX_TRACE_LEN lines, don't just return -1 and leave the
error information unchanged.

Setting an argument variable before returning has no effect, so don't do
it (so that we don't leave the mistaken impression that it *is* doing
something).

Clean up indentation.

svn path=/trunk/; revision=46819
2012-12-27 22:59:39 +00:00
Guy Harris db0c2de004 OK, fine, how about 4 characters initializing a 4-character array?
svn path=/trunk/; revision=46804
2012-12-27 12:41:24 +00:00
Guy Harris 88e9d1c1e5 Do not call wtap_file_read_unknown_bytes() or
wtap_file_read_expected_bytes() from an open routine - open routines are
supposed to return -1 on error, 0 if the file doesn't appear to be a
file of the specified type, or 1 if the file does appear to be a file of
the specified type, but those macros will cause the caller to return
FALSE on errors (so that, even if there's an I/O error, it reports "the
file isn't a file of the specified type" rather than "we got an error
trying to read the file").

When doing reads in an open routine before we've concluded that the file
is probably of the right type, return 0, rather than -1, if we get
WTAP_ERR_SHORT_READ - if we don't have enough data to check whether a
file is of a given type, we should keep trying other types, not give up.
For reads done *after* we've concluded the file is probably of the right
type, if a read doesn't return the number of bytes we asked for, but
returns an error of 0, return WTAP_ERR_SHORT_READ - the file is
apparently cut short.

For NetMon and NetXRay/Windows Sniffer files, use a #define for the
magic number size, and use that for both magic numbers.

svn path=/trunk/; revision=46803
2012-12-27 12:19:25 +00:00
Guy Harris b467ecfc8b If the attempt to read the record header fails because we hit the EOF,
treat that as "this isn't a CommView file" rather than "this is a bad
file".

svn path=/trunk/; revision=46774
2012-12-26 12:01:14 +00:00
Guy Harris 1825519526 On I/O errors when opening a file, use wtap_close() to clean up, to make
sure we clean up everything.

svn path=/trunk/; revision=46773
2012-12-26 11:59:47 +00:00
Guy Harris 6d678c20d6 OK, does *this* convince the compiler that the loop isn't ever going to
be infinite?

svn path=/trunk/; revision=46757
2012-12-26 06:56:17 +00:00
Guy Harris 44d7a093e8 Widen an argument to match its (theoretical) widest possible width. See
if that squelches a loop-optimization warning.

svn path=/trunk/; revision=46752
2012-12-26 06:14:44 +00:00
Guy Harris 07350b2b53 Squelch a (Y2.038K) warning.
svn path=/trunk/; revision=46751
2012-12-26 06:10:25 +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 ef0282ee9c Fix syntax error showing up when using debug ouput.
svn path=/trunk/; revision=46713
2012-12-23 08:59:30 +00:00
Michael Tüxen 6af6ce5ee0 Add support for writing the packet block flags for pcapng.
While there, do some minor cleanup.

svn path=/trunk/; revision=46699
2012-12-22 20:38:08 +00:00
Michael Tüxen 40c0a21bee Whitespace changes.
svn path=/trunk/; revision=46694
2012-12-22 14:06:50 +00:00