Commit Graph

1893 Commits

Author SHA1 Message Date
Guy Harris a59e931733 If xml_get_int() fails, bail immediately; don't use the variable it
would have filled in had it not failed.  (Thanks and a tip of the Hatlo
hat to the Clang static analyzer for complaining about this.)

svn path=/trunk/; revision=42306
2012-04-28 03:07:04 +00:00
Guy Harris d6e5b20bf2 Get rid of some unnecessary assignments, to remove warnings from the
Clang static analyzer.

svn path=/trunk/; revision=42304
2012-04-28 02:01:40 +00:00
Guy Harris 781891bd7b Remove duplicate comment.
svn path=/trunk/; revision=42270
2012-04-26 16:30:33 +00:00
Guy Harris c0cdd900fc Add a pcoreytohll() macro to extract "Corey-endian" 64-bit quantities,
and use it.

Fix some comments.

svn path=/trunk/; revision=42269
2012-04-26 16:27:03 +00:00
Guy Harris a3ce72529c Use the pletohXX macros when fetching little-endian values.
svn path=/trunk/; revision=42256
2012-04-26 08:57:33 +00:00
Guy Harris c7575ff095 Put the pseudo-header information for Veriwave packets into the buffer
in little-endian byte order, as that's what the dissector expects.  Add
a pletohl() macro for that purpose.

Fix comments (the Veriwave code is *not* writing data to a file!) and
clean up indentation.

svn path=/trunk/; revision=42255
2012-04-26 08:45:48 +00:00
Guy Harris d4d080e1a1 Use pntohs(), pntoh24(), and pntohl() to fetch big-endian data from the
headers.

Fix some indentation.

svn path=/trunk/; revision=42252
2012-04-26 05:07:53 +00:00
Guy Harris 1e6eaee16c Global variables considered harmful. Move all the per-capture-file
global variables into a structure that's attached to the wtap_t as
private data, and make all the per-*packet* global variables local
variables.

svn path=/trunk/; revision=42251
2012-04-26 04:26:03 +00:00
Guy Harris 28175cbf9a Put pcapng_open() right after libpcap_open(); pcap and pcap-ng are our
native file formats, so try them first.

Move eyesdn_open() to the section for open routines for file formats
that have a magic number - EyeSDN traces all start with "EyeSDN".

svn path=/trunk/; revision=42250
2012-04-26 03:21:29 +00:00
Guy Harris 51633791a9 If you get an I/O error when looking for the FPGA version, return -1, so
we know we had a real problem with the file.  If we just get a short
read, return 0, as it means the file is probably not a VWR file.

If we get an invalid message length when reading packets (rather than
when looking for the FPGA version), return WTAP_ERR_BAD_FILE and an
"Invalid message record length" indication, not a generic fallback
"can't read the file" error.

For file_tell() errors, fetch the error code with file_error().

For file_seek() errors, use the error file_seek returned.

svn path=/trunk/; revision=42249
2012-04-26 03:06:35 +00:00
Martin Mathieson e74d2fd9db Return 0 if doesn't match signature of vwr files.
Pointed out by Martin Kaiser in bug 7196.

svn path=/trunk/; revision=42248
2012-04-25 22:54:45 +00:00
Anders Broman 71780ae952 Add wtap_dump_fdopen_ng
svn path=/trunk/; revision=42231
2012-04-25 14:00:23 +00:00
Anders Broman 102991bf0f Handle wtap_dump_fdopen() as wtap_dump_open() eg call
wtap_dump_fdopen_ng() and add a dummy IDB to be able to write pcapng files.
Solves https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6969
mergecap: Can't open or create <FILENAME>: Internal error.

We might want to add a SHB comment from mergecap giving the merged filenames or something like that, Merging of pcapng files
is a different issue, idealy we should probably start using several SHB:s in that case.

svn path=/trunk/; revision=42230
2012-04-25 12:33:23 +00:00
Martin Mathieson 56add1934d Remove some unnecessary includes and fix some indentation.
svn path=/trunk/; revision=42227
2012-04-25 00:28:19 +00:00
Bill Meier 9c8aba73d7 Fix a buildbot compile warning.
svn path=/trunk/; revision=42197
2012-04-22 19:14:19 +00:00
Bill Meier ee89329b9a Various minor cleanup:
- fix a few small memory leaks;
 - fix some indentation to match style used (gnu);
 - remove trailing whitespace;
 - ...

svn path=/trunk/; revision=42196
2012-04-22 18:44:10 +00:00
Guy Harris 7dc39930a6 Global variables considered harmful (and unnecessary).
svn path=/trunk/; revision=42189
2012-04-22 02:03:29 +00:00
Martin Mathieson dae0b453f0 Lose some more unused variables reported by clang.
svn path=/trunk/; revision=42173
2012-04-21 02:43:11 +00:00
Martin Mathieson 048833b933 Try to fix up some clang warnings. Will look at other modules I added
recently later.

svn path=/trunk/; revision=42167
2012-04-20 18:09:50 +00:00
Martin Mathieson d74383ed1c Add a couple of casts to try to make the Windows-7-x64 buildbot happy.
svn path=/trunk/; revision=42159
2012-04-20 12:44:19 +00:00
Martin Mathieson b227c024fe Missed file from previous commit.
svn path=/trunk/; revision=42156
2012-04-20 12:09:16 +00:00
Martin Mathieson 45252c84e3 Patch for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5048
From Tom Cook and Tom Alexander.

1. A VWR encapsulation that reads VeriWave capture files (*.vwr)
generated from
WaveTest test hardware
2. Dissectors that display the VeriWave tap headers (both 802.11 and
Ethernet)
3. A dissector for the WaveAgent protocol.  The WaveAgent dissector is
heuristic and parses the WaveAgent packet (a UDP payload).

The WaveAgent dissector has been Fuzz tested.

The VWR ENCAP and dissectors have been used extensively by VeriWave
customers in a special version of WireSark compiled by VeriWave.

svn path=/trunk/; revision=42155
2012-04-20 12:08:31 +00:00
Guy Harris bb36edf54e Fix more indentation.
svn path=/trunk/; revision=42147
2012-04-20 01:44:49 +00:00
Guy Harris 5a1b276845 Use consistent 2-space indentation, and don't use tabs.
svn path=/trunk/; revision=42146
2012-04-20 01:43:12 +00:00
Guy Harris 33fc4a29bc Fix typo.
svn path=/trunk/; revision=42145
2012-04-19 23:58:53 +00:00
Guy Harris 13592b9b57 Don't byte-swap bytes that aren't there.
svn path=/trunk/; revision=42144
2012-04-19 23:19:10 +00:00
Anders Broman ec0c5baf4f From Rolf Fiedler:
patch to fix mp2t.c to reject more byte streams that are not MPEG2.

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

svn path=/trunk/; revision=42127
2012-04-18 08:32:12 +00:00
Anders Broman be31ffaeb0 Get the Windows build going again. The Netxray "fix" cast to guint8 may not be OK.
svn path=/trunk/; revision=42125
2012-04-18 08:15:32 +00:00
Alexis La Goutte 6aedbbaf35 From Colus Tang via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7134
Unable to display the correct IEEE802.11 MCS data rates due to header definition

The problem is due to the ieee_802_11_phdr.data_rate is defined as guint8,
since this variable is counting number of 0.5Mbps units, any datarates which is
higher than 255Mbps would get wrapped up.  In the above example, only the lower
8bit value will be put into the ieee_802_11_phdr which is 0x04 and result in
the incorrect 2Mbps display.

There are 802.11n WLAN product is capable to transmit @450Mbps, we should fix
this data_rate from guint8 to guint16.

#BACKPORT

svn path=/trunk/; revision=42123
2012-04-18 07:22:12 +00:00
Guy Harris 477185a387 If we see a 5View time-stamped header with a bad key, make sure we
return the right error code and information string.

InfoVista bought Accellent Group, and, at least according to the
InfoVista Web site, it's "5View", not "5Views".

svn path=/trunk/; revision=42119
2012-04-18 02:48:23 +00:00
Guy Harris 81209da65b Fix some indentation errors from the previous change.
svn path=/trunk/; revision=42118
2012-04-18 00:54:11 +00:00
Guy Harris e3053e0105 Get rid of tabs, so we don't have to worry about 4-space vs. 8-space tabs.
svn path=/trunk/; revision=42117
2012-04-18 00:51:18 +00:00
Michael Tüxen bacf81ff06 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7048
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-15 11:11:36 +00:00
Michael Tüxen 587e0213eb Whitespace cleanup (done while debugging).
svn path=/trunk/; revision=42079
2012-04-15 11:08:40 +00:00
Martin Mathieson 722c68ec90 Fix a typo (just clearing my client out before I start doing diffs).
svn path=/trunk/; revision=42077
2012-04-15 01:38:12 +00:00
Guy Harris f3c2e6087e More double-free fixes - destroy_k12_file_data() frees its argument, so
calling g_free() on that argument after calling destroy_k12_file_data()
is always an error.

svn path=/trunk/; revision=42067
2012-04-14 17:20:22 +00:00
Anders Broman f4c5e276c5 From From Evan Huus: Potential double-free while importing k12xx *.rf5 files https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7084
svn path=/trunk/; revision=42062
2012-04-14 07:53:22 +00:00
Jakub Zawadzki 8a1dc57c03 Remove doubled semicolons and semicolons outside function.
svn path=/trunk/; revision=42053
2012-04-13 20:22:31 +00:00
Guy Harris 4a8f46a5ac Call LAPD-with-Linux-pseudoheader "linux-lapd", and fix its description
to indicate the Linux pseudo-header.

Fix the description of LAPD-without-Linux-pseudoheader to be just
"LAPD".

svn path=/trunk/; revision=42018
2012-04-10 23:32:16 +00:00
Guy Harris 51e76d89eb Fix tpo.
svn path=/trunk/; revision=42017
2012-04-10 23:28:17 +00:00
Guy Harris 4db2d3443a It's "X.25", not "X25".
svn path=/trunk/; revision=42016
2012-04-10 23:27:39 +00:00
Jakub Zawadzki ac5c40e6c5 Mark some function static.
svn path=/trunk/; revision=41999
2012-04-09 19:43:19 +00:00
Gerald Combs e5cd6c087e 1.7.1 → 1.7.2.
svn path=/trunk/; revision=41971
2012-04-06 17:27:20 +00:00
Guy Harris 154c0f37dd Indicate where BACnet MS/TP is specified.
Add a new WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR encapsulation type, for use
by the EyeSDN file reader; unlike the pcap-encapsulated MS/TP, it
includes a direction indicator.  Don't treat WTAP_ENCAP_BACNET_MS_TP as
if it has a direction indicator, as it doesn't; instead, do that for
WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR.

Add some missing entries to encap_table_base for WTAP_ENCAP_ values that
didn't get entries added.

svn path=/trunk/; revision=41969
2012-04-06 03:42:32 +00:00
Guy Harris ae62dc3bdb Use tabs more uniformly.
svn path=/trunk/; revision=41966
2012-04-05 21:24:10 +00:00
Guy Harris a98336862a WTAP_ENCAP_MTP2 is for MTP2 *without* a pseudo-header giving direction
or other information; WTAP_ENCAP_MTP2_WITH_PHDR is for MTP2 *with* such
a pseudo-header.  Use WTAP_ENCAP_MTP2_WITH_PHDR for the EyeSDN captures,
and don't assume there's a pseudo-header if you have WTAP_ENCAP_MTP2.

svn path=/trunk/; revision=41962
2012-04-05 20:25:26 +00:00
Jakub Zawadzki c67d24077e Allow loading xml files (file MUST start with <?xml).
I needed it for testing (bug #7028)
if you feel like it's stupid idea give me nfo :)

svn path=/trunk/; revision=41944
2012-04-04 20:52:52 +00:00
Jeff Morriss 75c3c92f19 Add a "-build" argument to checkAPIs.pl. Use that argument when building
from makefiles (and thus from the buildbot).

The intention is to be able to tell when a human is running the tool so we
can provide more code-review guidance.

As a starter, enable the "too many proto_tree_add_text() calls" check when
a human is running the tool.

svn path=/trunk/; revision=41943
2012-04-04 20:46:49 +00:00
Anders Broman 77b67c7456 From Rolf Fiedler:
Patch to add V5.2 tracing capability on E1 links using EyeSDN probes.

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

Removed preference related stufff as it's not needed.

svn path=/trunk/; revision=41915
2012-04-04 07:33:39 +00:00
Martin Mathieson f0798dabd1 Set up table to help with ascii-hex -> hex conversion in advance to
avoid testing static for every conversion.

svn path=/trunk/; revision=41900
2012-04-03 01:49:27 +00:00
Jakub Zawadzki bb8afe3f68 Add initial support for dissecting packets encapsulated in Netfilter LOG (DLT_NFLOG=239).
svn path=/trunk/; revision=41872
2012-03-31 17:29:41 +00:00
Jeff Morriss a572670849 From Martin Kaiser via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6984 :
The attached patch extends the mpeg2 ts format detection to take into account
that trailing bytes might be added to each packet.

Once it finds no sync after 188 bytes, it checks an additional 40 bytes for the
next sync byte and adjusts the packet size accordingly.

Only the 188 bytes of the actual ts packet are passed on to wiretap, the
trailer is omitted.

svn path=/trunk/; revision=41863
2012-03-30 23:19:49 +00:00
Gerald Combs beee8db906 Print the correct block size in a debug message.
svn path=/trunk/; revision=41773
2012-03-26 19:29:33 +00:00
Jeff Morriss 9c1bf7223e Don't mark the file as unsaved unless the capture or packet comments actually changed.
svn path=/trunk/; revision=41744
2012-03-23 01:41:59 +00:00
Anders Broman efa9387886 From Krishna:
Enhancement to add more trace record fields in Citrix NetScaler capture file format.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?

svn path=/trunk/; revision=41740
2012-03-22 15:36:37 +00:00
Anders Broman 63c19bd071 Disable debug.
svn path=/trunk/; revision=41716
2012-03-21 08:58:27 +00:00
Anders Broman 456c7c2dc6 Try to make the buildbot happy.
svn path=/trunk/; revision=41684
2012-03-20 11:58:29 +00:00
Anders Broman 148c8a3a30 Write ISB:s if we have them.
svn path=/trunk/; revision=41683
2012-03-20 11:42:55 +00:00
Jeff Morriss 90df1a9d94 Set eol-style to native (just to make these files readable on *NIX).
svn path=/trunk/; revision=41654
2012-03-19 01:46:24 +00:00
Guy Harris 6c500f66f8 Fix indentation.
svn path=/trunk/; revision=41627
2012-03-17 08:46:20 +00:00
Jeff Morriss fb46cda196 When we're in a for(i=0,[...]) loop, don't reuse (and thus reset) 'i' in another for(i=0,[...]) loop. This fixes the capinfos double-free crashes that the fuzz bot has been experiencing.
svn path=/trunk/; revision=41610
2012-03-16 14:07:22 +00:00
Guy Harris 8af620acd7 Initialize the new num_stat_entries and interface_statistics members of
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-15 21:44:54 +00:00
Anders Broman fb0fec7c1c If we have one ISB, display the droped count from it.
svn path=/trunk/; revision=41561
2012-03-15 14:33:04 +00:00
Anders Broman dc674a6043 - Store ISB data.
- free IDB and ISB data when closing.

svn path=/trunk/; revision=41558
2012-03-15 13:46:42 +00:00
Jeff Morriss 603b4d4348 Don't free idb_inf in wtap_dump_open_ng(): free it in the callers. This fixes the double-free editcap crashes that the buildbot's been seeing lately.
svn path=/trunk/; revision=41542
2012-03-14 01:08:09 +00:00
Anders Broman 0e4998190f From Jose Pedro Oliveira:
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-13 15:26:36 +00:00
Anders Broman bb611755e9 Add data structure to hold information from ISB:s
svn path=/trunk/; revision=41522
2012-03-13 08:36:52 +00:00
Anders Broman 35bf2e9619 From Jose Pedro Oliveira:
Enforce the modelines in wiretap/pcapng.c

svn path=/trunk/; revision=41506
2012-03-12 15:43:59 +00:00
Anders Broman 1a8f3eddc7 From Jose Pedro Oliveira: Add Modlines
svn path=/trunk/; revision=41495
2012-03-12 06:39:45 +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 e15692be8a From Jose Pedro Oliveira: Corrects several 'wdh->bytes_dumped += ...' lines. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6718
svn path=/trunk/; revision=41443
2012-03-09 04:50:43 +00:00
Anders Broman cd2c726c8c The User & Network direction is reversed https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6656
svn path=/trunk/; revision=41402
2012-03-07 17:02:27 +00:00
Anders Broman 1b25b08a0f From Martin Kaiser: correct sorting for wiretap's file type list
svn path=/trunk/; revision=41387
2012-03-07 08:03:42 +00:00
Anders Broman 7fba54762b From Mike Wakerly: Add wiretap suport for LINKTYPE_NFC_LLCP
svn path=/trunk/; revision=41368
2012-03-06 09:02:06 +00:00
Anders Broman ddd69f4775 Use correct lenght when writing if_filter_str.
svn path=/trunk/; revision=41352
2012-03-05 09:32:21 +00:00
Anders Broman a20cfcc745 Fix calculation of pading for if_filter_str.
svn path=/trunk/; revision=41351
2012-03-05 09:21:36 +00:00
Anders Broman 995e10ef36 From Martin Kaiser:
wiretap mpeg2 ts: eof vs short read
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6909

svn path=/trunk/; revision=41350
2012-03-05 08:34:36 +00:00
Anders Broman 4db442ab90 From Martin Kaiser:
wiretap mpeg2 ts: more thorough check for sync byte.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6908

svn path=/trunk/; revision=41349
2012-03-05 08:30:39 +00:00
Guy Harris 732de9018d Squelch a can't-really-happen uninitialized reference warning.
svn path=/trunk/; revision=41342
2012-03-04 20:49:17 +00:00
Anders Broman 7348837ccd Use parentheses
svn path=/trunk/; revision=41341
2012-03-04 19:31:33 +00:00
Anders Broman 971cb84877 if_filter isn't a string per se,The first byte of the Option Data keeps a code of the filter used
svn path=/trunk/; revision=41339
2012-03-04 19:01:14 +00:00
Guy Harris aa974fda50 Make sure all names in NRB records are null-terminated; report an error
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-04 02:20:25 +00:00
Anders Broman ad6640344f From Jose Pedro Oliveira: Fix typos
svn path=/trunk/; revision=41330
2012-03-03 16:17:20 +00:00
Guy Harris b18a5f9805 Don't look at the interface_id field of the packet header if
WTAP_HAS_INTERFACE_ID isn't set in the presence flags.

svn path=/trunk/; revision=41327
2012-03-03 00:13:25 +00:00
Guy Harris 57839d9e4a Flag mp2t file as really having only relative time stamps. Put the
comment on its own line in mpeg.c as well.

svn path=/trunk/; revision=41294
2012-03-02 10:17:36 +00:00
Guy Harris 0475f29216 The additional_file_extensions member of struct file_type_info need not
and should not contain the extension in the default_file_extension
member - that's why the name starts with "additional".

svn path=/trunk/; revision=41293
2012-03-02 10:09:23 +00:00
Guy Harris 17dff5f3c4 Get rid of no-longer-needed argument to pcapng_write_section_header_block().
svn path=/trunk/; revision=41292
2012-03-02 09:38:43 +00:00
Guy Harris 10337e0ca4 Skip an intermediating wtapng_block_t in the code path to write
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-02 09:30:10 +00:00
Guy Harris 334a807e14 Simplify the code path for writing pcap-NG packets, and remove some
no-longer-needed elements from the wtapng_packet_t structure.

svn path=/trunk/; revision=41289
2012-03-02 09:03:26 +00:00
Anders Broman e82ad19e58 From Weston Schmidt: Add mpeg-ts capture file format support. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6894
svn path=/trunk/; revision=41286
2012-03-02 06:02:28 +00:00
Guy Harris 44528a6437 Fill in the wtap_pkthdr fields in pcap_read_packet_block() and
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-02 05:03:06 +00:00
Bill Meier f2c1c108f5 AFAIKT there's no reason to #include <wsutil/crc32.c>; Include crc32.h like everyone else...
Also: Do some whitespace and indentation cleanup.

svn path=/trunk/; revision=41281
2012-03-02 00:31:30 +00:00
Michael Tüxen 59dee69a95 Fix CID 1385.
svn path=/trunk/; revision=41264
2012-03-01 14:57:14 +00:00
Michael Tüxen 3bd0e0be10 Fix CID 354.
svn path=/trunk/; revision=41263
2012-03-01 14:51:26 +00:00
Anders Broman ffbba61fdf Read the complete NRB.
#Backport

svn path=/trunk/; revision=41259
2012-03-01 13:31:40 +00:00
Anders Broman cc9bcfb068 Add debuginfo
svn path=/trunk/; revision=41258
2012-03-01 10:13:02 +00:00
Anders Broman 23ec82fae9 From Reinhard Speyerer: Adding support for LINKTYPE_PPP_ETHER/DLT_PPP_ETHER
svn path=/trunk/; revision=41256
2012-03-01 07:39:54 +00:00
Anders Broman d24fad6371 - Add a LED in the statusbar to indicate that capture comments exists,
clickable to open an edit window.
- Add checks for NULL pointers.

Help with a different color LED possibly with Jeff's (c) in it apreceated.
Should the LED be placed elsewhere or the whole thing done differently?

svn path=/trunk/; revision=41242
2012-02-29 16:51:32 +00:00
Guy Harris 76652d9d4a Some more details about REC_HEADER1 and REC_V2DESC; REC_HEADER1 doesn't
appear to contain anything of use to us - too random - but REC_V2DESC
might be worth converting into a comment.

svn path=/trunk/; revision=41215
2012-02-28 01:11:11 +00:00
Anders Broman 38c69c8431 Make it possible to edit capture comments
svn path=/trunk/; revision=41193
2012-02-26 17:04:28 +00:00