summaryrefslogtreecommitdiff
path: root/wiretap
AgeCommit message (Collapse)AuthorFilesLines
2017-06-22Add WTAP_ENCAP_3MB_ETHERNET for Xerox 3MB Ethernet.Guy Harris3-0/+5
It needed to be done: https://github.com/shirriff/pup-wireshark (And, yes, there really *is* a DLT_/LINKTYPE_ for it! The original DLT_ values were ARP hardware types, and 3MB Ethernet was assigned an ARP hardware type of 2.) Change-Id: I60d96c28e67854adcb28c7e3579ae5dd1f07df4b Reviewed-on: https://code.wireshark.org/review/22336 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-19Put the definition of BIT_SWAPPED_MAC_ADDRS in the file where it's used.Guy Harris2-5/+12
In change 18a3b0659c209a2e0121eacd640b75e6c1c3b87d, I moved the table that uses it, but not the actual definition, from libpcap.c to pcap-common.c; they both should have been moved. Make it so. Change-Id: I266fce455df3848b873cdfadb12cecdbf9c8d4d3 Reviewed-on: https://code.wireshark.org/review/22216 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-15Make the short names for USB encspsulation types more regular.Guy Harris1-2/+2
Have them all be "usb-XXX", where XXX indicates the type of header. Change-Id: I7f1bfea7e264b17c57f94c484d64d1cce91b9b78 Reviewed-on: https://code.wireshark.org/review/22147 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-15Better names for various USB headers.Guy Harris1-2/+2
Change-Id: Iec2126fa1b71d9923ef0fb9ca2a027f7752d71f3 Reviewed-on: https://code.wireshark.org/review/22144 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-15Miscellaneous texual corrections and additionJaap Keuter2-3/+3
Correct some symbolic references in source file comments and add a note about the CMake configuration options. Change-Id: Idb670a2c798c2a52cdce142340ce8fc5a2022508 Reviewed-on: https://code.wireshark.org/review/22138 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-09Add URL for link specifying D-Bus maximum message length.Guy Harris1-1/+6
Change-Id: I5797407a18fda674b2c9b2cc1c192c211c91c496 Reviewed-on: https://code.wireshark.org/review/22052 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-05Allow bigger snapshot lengths for D-Bus captures.Guy Harris53-150/+200
Use WTAP_MAX_PACKET_SIZE_STANDARD, set to 256KB, for everything except for D-Bus captures. Use WTAP_MAX_PACKET_SIZE_DBUS, set to 128MB, for them, because that's the largest possible D-Bus message size. See https://bugs.freedesktop.org/show_bug.cgi?id=100220 for an example of the problems caused by limiting the snapshot length to 256KB for D-Bus. Have a snapshot length of 0 in a capture_file structure mean "there is no snapshot length for the file"; we don't need the has_snap field in that case, a value of 0 mean "no, we don't have a snapshot length". In dumpcap, start out with a pipe buffer size of 2KB, and grow it as necessary. When checking for a too-big packet from a pipe, check against the appropriate maximum - 128MB for DLT_DBUS, 256KB for everything else. Change-Id: Ib2ce7a0cf37b971fbc0318024fd011e18add8b20 Reviewed-on: https://code.wireshark.org/review/21952 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-03LoRaTap DLT and dissectorErik de Jong3-0/+7
Add support for handling LoRaTap (https://github.com/eriknl/LoRaTap) DLT in wiretap and add dissector for LoRaTap headers. Exposes Syncword for subdissectors to dissect frame payload. Change-Id: Ie4ba2189964376938f45eb3da93f2c3376042e85 Reviewed-on: https://code.wireshark.org/review/21915 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-06-03Don't keep the pcap/pcapng link-layer header type as interface data.Guy Harris7-25/+12
Either 1) it can be determined from the libwiretap encapsulation type, in which case it's redundant information or 2) there *is* no pcap/pcapng link-layer header type for that encapsulation type, in which case you need to check for the attempt to determine it failing and handle that failure appropriately. Change-Id: Ie9557b513365c1fc8c6df74b9c8239e29aad46bc Reviewed-on: https://code.wireshark.org/review/21924 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-09Set nss and rate_mcs_index in more arms of the Series II PLCP switch.Guy Harris1-2/+4
For HT mixed, set it the same way it's set for HT greenfield. For pre-HT, set it to 0. Also, for the "unknown" case, set rate_mcs_index to 0. This should obviate the need to initialize either of those variables, don't initialize them, so that failing to set them in an arm of the switch statement shows up as an error if the compiler's dataflow analysis actually bothers to check this. Change-Id: I92703770dd5000a579b53609fb93a2085fd9fca3 Reviewed-on: https://code.wireshark.org/review/21573 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-09vwr (wiretap): fix Assigned value is garbage or undefined Warning found by ↵Alexis La Goutte1-1/+1
Clang Analyzer Change-Id: I45766c7e89a009176ae56fe9e9f5a8dd63b2995b Reviewed-on: https://code.wireshark.org/review/21567 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-05-08Note that the HT MCS index macros can't return all possible MCS values.Guy Harris1-1/+11
I don't know whether this is a bug in the software or a lack of support in the hardware. This at least notes the issue in CID 1405905. Change-Id: I481454bc38842a0f877cb8b52b73e1156fd362b5 Reviewed-on: https://code.wireshark.org/review/21558 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-07Fix handling of 20 MHz VHT with MCS = 9.Guy Harris1-10/+18
That's valid only for 3 or 6 spatial streams; return 0 as the bitrate for all other values. Also, handle the 6 spatial streams case. Give the conversion tables explicit sizes, to make it clear what subscripts are valid. Return 0 for an MCS > 9, for consistency with the other error return, and to mark it as clearly wrong. Fixes CID 1405908. Change-Id: Icbf655c63c0e88fd6cec7c66bae85fd887a3bd9c Reviewed-on: https://code.wireshark.org/review/21557 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-06Set some variables in the "RF only" code path.Guy Harris1-2/+5
That should remove the need to initialize them, make it clearer what values are being used in the "RF only" case, and catch any cases where they don't get set in the "not just RF" case in the future. Change-Id: I10c3ecef608ed2f481111fb7bc32bb8494b68d27 Reviewed-on: https://code.wireshark.org/review/21536 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-05vwr.c: Initialize some local variablesMichael Mann1-2/+2
Prevents some compiler warnings Change-Id: I9d62d0f3e6b7794c5ed43f37d52f86d81344a33c Reviewed-on: https://code.wireshark.org/review/21531 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-05Small cleanups.Guy Harris1-4/+2
Add some parentheses to make an expression clearer to people who haven't memorized the table of C operator precedences. Don't fiddle the nss variable in place; explicitly combine it with the IS_TX value when we put it in the header, to make it clearer what's in that header byte. Change-Id: I870b892fb9dab2bc210956f923e0183f4e147989 Reviewed-on: https://code.wireshark.org/review/21530 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-05Assume the Series II does the same with NSS for VHT that the Series III does.Guy Harris1-3/+1
The packet-ixveriwave.c dissector appears to do so. Change-Id: Ie02c4611ef18e83abcd3b625bbc40014080ffca1 Reviewed-on: https://code.wireshark.org/review/21525 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-05NSS != (MCS / 8) + 1 for MCS >= 32.Guy Harris1-26/+73
Do the MCS -> NSS mapping for HT by a table lookup. For VHT with Series II, do it the old way for now, under the assumption that the MCS index and NSS are bit fields, but note that the MCS index and NSS bit fields would overlap. Change-Id: Ibc89590faf15900171b2a1b4ac1e50793ed70c32 Reviewed-on: https://code.wireshark.org/review/21523 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-05Series I only handles pre-HT, so rename and remove variables.Guy Harris1-10/+8
Change-Id: Id9f086983544647267854446932a3ffe2ec2cc55 Reviewed-on: https://code.wireshark.org/review/21522 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-05Have separate routines for calculating pre-HT/HT/VHT data rates.Guy Harris1-98/+149
That maeks the code a little clearer. It also makes it clearer that the "MCS index" is, for pre-HT, a rate index, so rename some variables and macros. Change-Id: I64b7bca073df0f837e5d968682345187000207fc Reviewed-on: https://code.wireshark.org/review/21521 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-04Another comment explaining why a packet size check isn't necessary.Guy Harris1-0/+8
Change-Id: Id7494823f9af69c6185b41983ca78ead2dae24dd Reviewed-on: https://code.wireshark.org/review/21492 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-04Do packet length checks iff they're necessary.Guy Harris1-18/+20
They're not necessary for most hardware; remove the unnecessary checks, and add comments indicating why they're not necessary (or fix the "maximum value of actual_octets is" part of the comment). They *are* necessary for Series III hardware; put in the check. Change-Id: Idd64a74099d5cf7398a2ddb850442e53c9206724 Reviewed-on: https://code.wireshark.org/review/21491 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-04Add a comment.Guy Harris1-0/+3
Change-Id: Ia60a0cdac3d70862aa5941487af142bd26ab2b80 Reviewed-on: https://code.wireshark.org/review/21489 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-04Clean up whitespace and a #define.Guy Harris1-80/+83
Add some additional blank lines, remove some extra, blank lines, fix indentation. Make vVW510024_E_IS_VLAN 32-bits, to match the other flags. Change-Id: Id1cd63ff2b75764907a44e9f8525b1537666fde1 Reviewed-on: https://code.wireshark.org/review/21488 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-04Update comments.Guy Harris1-9/+0
There's only a 17-byte PLCP header with the Series III hardware. Change-Id: Ice8dfbbc5daa0578ee4eb6588fc8a8b597806d0d Reviewed-on: https://code.wireshark.org/review/21487 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-04Use a #define for the PLCP type.Guy Harris1-1/+1
That makes it clearer that the Series I hardware doesn't do HT or VHT. Change-Id: Ibeccfcba997555bef06098828f01951dc32a6d2c Reviewed-on: https://code.wireshark.org/review/21486 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-04Remove an unnecessary comment, fix another comment.Guy Harris1-2/+1
Change-Id: Id20517c99663c624b6bfd58d7475284db450e003 Reviewed-on: https://code.wireshark.org/review/21485 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-04Remove trailing white space.Guy Harris1-1/+1
Change-Id: I8cdbde058c7ebb9aaaac4739e9a5c206e0d2c919 Reviewed-on: https://code.wireshark.org/review/21484 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-04More description of stats headers.Guy Harris1-0/+8
Change-Id: I21ee8b39b96dd58ea1dfeb502e8734b33aa298c1 Reviewed-on: https://code.wireshark.org/review/21483 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-04Fix some comments, shuffle some code, change a constant in an assignment.Guy Harris1-12/+21
Fix "VHTPPDU" to be "VHT PPDU". Move the code that processes the RSSI values before the code that processes the next two bytes of the header, so it's done in order; that makes it a bit easier to see the layout of that header (although 2 bytes of it are processed below). Fix the comment describing what the first 16 bytes of the record data after the stats are. Don't use vVW510021_W_STATS_HEADER_LEN - that's for the Series II hardware. Fix some indentation. Change-Id: If47c4a44fd5e72971a28daf6af88d5e19c53abbe Reviewed-on: https://code.wireshark.org/review/21482 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-01For S3, yes, the PLCP type can be vVW510021_W_PLCP_LEGACY.Guy Harris1-2/+0
(The dissector checks for it.) Change-Id: Ic1456b263f3cbda2a630259a2b71b1f1015b5e3e Reviewed-on: https://code.wireshark.org/review/21442 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-05-01Make the record-length checks take the RF information into account.Guy Harris1-39/+47
Include the RF information length if there's RF information. While we're at it: Rename the variable holding the offset of the stats information from "j" to "stats_offset", to make it clearer what it is. Clean up whitespace. Get rid of comments that no longer apply. Improve the comment explaining the MPDU_OFF value for Series III. Change-Id: I49e2926a80aa8bb11f87d97fdc628bcc9f1220e0 Reviewed-on: https://code.wireshark.org/review/21439 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-30Do all the command-type analysis of decode_msg() in the switch statement.Guy Harris1-59/+33
Add #defines for the remaining command types, based on some other Get rid of the HEADER_IS_xxx #defines; they're the same for all hardware, and the switch statement doesn't distinguish between different hardware. Set *IS_TX in the switch statement cases. While we're at it, set v_size and *v_type in the default case; add a VT_UNKNOWN value for that case. Change-Id: Ib17d1e435c99fcb746144b4735c160a5f22b7544 Reviewed-on: https://code.wireshark.org/review/21438 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-30Use some #defines.Guy Harris1-3/+3
Change-Id: I9cafd3b745eb0fec39c0a9b5f529249584107971 Reviewed-on: https://code.wireshark.org/review/21435 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-30Fix a comment to reflect reality.Guy Harris1-1/+1
There aren't any "4 Management bytes for OCTO version FPGA" in that header. Change-Id: I57f673dad5bc10b888fae22c2fb1a45af57ff493 Reviewed-on: https://code.wireshark.org/review/21434 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-30packet-ieee80211-radio.c: Minor refactor and whitespace cleanupSimon Barber1-9/+11
Change-Id: Idad8f7eeed968eeed9f553fef98d58453f328afb Reviewed-on: https://code.wireshark.org/review/21421 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net> Tested-by: Michael Mann <mmann78@netscape.net>
2017-04-30Some cleanup.Guy Harris1-27/+70
Whitespace, remove now-irrelevant comments, add more comments, expand some comments, make an if chain more straightforward. Change-Id: I9772022247e2f0fdbfc676db9f0031bad7f8884d Reviewed-on: https://code.wireshark.org/review/21423 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-30Boolean bitfields don't need a mask, just a bit.Guy Harris1-3/+2
You don't have to and the bitfield container with a mask and compare it against the bit, you can just test the bit, which is a pretty standard C idiom. Change-Id: I87b3d84f802114199fb93357358412c623199ca2 Reviewed-on: https://code.wireshark.org/review/21422 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-30Series III packets appear to have an FCS at the end.Guy Harris1-17/+18
Change-Id: I9c4ba78cba4cb32a1473c6b8573880f2b56f1fde Reviewed-on: https://code.wireshark.org/review/21417 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-30Get rid of duplicate #defines, and shuffle some comments and #defines.Guy Harris1-22/+25
This makes stuff a bit clearer. Also, add some comments, remove some redundant comments, fix some comments, and use some #defines instead of hardcoded constants and expressions. And get rid of an unnecessary setting of *err to WTAP_ERR_SHORT_READ - either it's a short read, in which case it was already set to WTAP_ERR_SHORT_READ, or it's *not* a short read, in which case *err was set to the appropriate error code, and we should leave it alone. Change-Id: I657f505915854ac4a6b85e87b4021961b1a1c507 Reviewed-on: https://code.wireshark.org/review/21415 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-30Remove Series III code from vwr_read_s2_W_rec().Guy Harris1-104/+136
It's only called if vwr->FPGA_VERSION is S2_W_FPGA, so any code that's run only if it's *not* S2_W_FPGA is dead code. Remove it, for clarity. While we're at it, add some new comments, fix some comments, and get rid of an unused argument to vwr_read_s2_W_rec(). Change-Id: I3e4bd5d7a79f36d8354a0bbf875ee87eeaf60d43 Reviewed-on: https://code.wireshark.org/review/21414 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-29Eliminate some double-frees.Guy Harris1-0/+2
The cfile_ error-reporting routines free err_info; the caller doesn't have to and, in fact, mustn't do so themselves. While we're at it, make sure wtap_seek_read() always zeroes out *err and nulls out *err_info, so the latter either points to a freshly-allocated string or is null. Change-Id: Idfe05a3ba2fbf2647ba14e483187617ee53e3c69 Reviewed-on: https://code.wireshark.org/review/21407 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-29Improve ixveriwave dissectorMichael Mann2-195/+921
Bug: 13652 Bug: 12535 Change-Id: Ie4c140acbe983a585776bc1430cf407cdcd6e07a Reviewed-on: https://code.wireshark.org/review/21356 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-27Add/expand comments, add/shuffle #defines.Guy Harris1-26/+81
Attempt to make the various metadata headers, and the code that constructs them, a bit clearer. (Also, it's VeriWave; be consistent.) Change-Id: I0bb7d70f547d492c4947ceb313888991f2d374f2 Reviewed-on: https://code.wireshark.org/review/21360 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-20Take the error message generation out of the merge_files routines.Guy Harris2-215/+63
Have them just return the information needed for the caller to produce an error message, and have the callers use the new cfile_ routines for reporting errors. This requires that the "write failure alert box" routine take the *input* file name as an argument, so that, on a merge, if the problem is that a record from a given input file can't be written out to the type of output file we're generating, the input file name can be given, along with the record number in that file. Change-Id: If5a5e00539e7e652008a523dec92c0b359a48e71 Reviewed-on: https://code.wireshark.org/review/21257 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-18No need to close a descriptor that didn't get duped-to in the first place.Guy Harris1-1/+0
Addresses CID 1398217. Change-Id: I387c4a9f1df739724b80ccaad173de2d9095b101 Reviewed-on: https://code.wireshark.org/review/21179 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-18More checks for localtime() failing.Guy Harris1-9/+15
Addresses CIDs 1398222 and 1398221. Fix the previous fix while we're at it. Change-Id: I6fe54e6ad115ac05154291b76de316426db72139 Reviewed-on: https://code.wireshark.org/review/21176 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-18Just say "pcap" in the short names of all pcap variants.Guy Harris1-9/+22
That's more consistent. Handle the "libpcap" names for backwards compatibility. Change-Id: I819404d69bddd733b7ee38e23d3ddc71110c0faf Reviewed-on: https://code.wireshark.org/review/21172 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-18Eliminate an unneded member of a wtap_dumper.Guy Harris5-61/+15
The only place the time stamp precision is used is in the libpcap code, where it determines whether to write out microsecond-precision or nanosecond-precision time stamps; we can determine that by looking at the type/subtype field, which is also part of that structure, so do that. We weren't setting it consistently - we were only setting it in libpcap and a few other capture file writers, and not in other capture file writers - and none of the writers other than libpcap used it. Change-Id: If53779cf4823ca936b8bf3e8a7dbcfea5850e652 Reviewed-on: https://code.wireshark.org/review/21171 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-17Don't assume gmtime() or localtime() succeed.Guy Harris1-4/+22
The chances that they won't, in this case, are slim to none, as the time is after the Epoch, but this squelches CID 1398223. We'll change the master branch to require an err_info string for WTAP_ERR_INTERNAL and to display it in a future commit. Change-Id: Ifb51076b25117efc53ba3ad8b434e36c71f7600f Reviewed-on: https://code.wireshark.org/review/21169 Reviewed-by: Guy Harris <guy@alum.mit.edu>