summaryrefslogtreecommitdiff
path: root/print-802_11.c
Commit message (Collapse)AuthorAgeFilesLines
* IEEE 802.11: Remove trailing "_if" from protocol namesFrancois-Xavier Le Bail2020-08-021-4/+4
|
* IEEE 802.11: Update the link-layer header length in two steps (PRISM)Francois-Xavier Le Bail2020-08-021-1/+2
| | | | | This way, even if we longjmped out of the code because trucation, the prism header length is subtracted for -x/-X print.
* IEEE 802.11: Update the link-layer dissectors to void functionsFrancois-Xavier Le Bail2020-08-021-13/+19
|
* IEEE 802.11: Fix signedness of the flags parameters of print_chaninfo()Francois-Xavier Le Bail2020-07-011-1/+1
| | | | | | | | | | uint32_t for flags, because there are calls with uint16_t and uint32_t. This change avoids (for presentflags): print-802_11.c:2795:41: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 2147502191 (32-bit, unsigned) to type 'int' changed the value to -2147465105 (32-bit, signed) #0 0x815e130 in print_radiotap_field ./print-802_11.c:2795:41
* IEEE 802.11: Add a missing comma to separate two string literalsFrancois-Xavier Le Bail2020-05-251-1/+1
| | | | Should fix Coverity CID 1463833.
* Merge pull request #773 from Mister-X-/fix-reason-codesGuy Harris2020-05-241-28/+72
|\ | | | | Fix and update 802.11 reason codes
| * Fixed missing spaceMister X2019-06-201-1/+1
| |
| * Fixed missing double quoteMister X2019-06-201-1/+1
| |
| * Fixed and updated reason codes from 802.11-2016Mister X2019-06-081-28/+72
| |
* | Merge pull request #772 from Mister-X-/fix-status-codesGuy Harris2020-05-241-48/+142
|\ \ | | | | | | Fix and update 802.11 status codes
| * | Fixed and updated status codes from 802.11-2016Mister X2019-06-081-48/+142
| |/
* | More bounds checking when fetching addresses and converting to strings.Guy Harris2020-01-191-36/+36
|/ | | | | | | | | | | | | | Replace more calls to ipaddr_string()/ip6addr_string() with calls to GET_IPADDR_STRING()/GET_IP6ADDR_STRING() macros performing bounds checking. Add similar bounds-checking inline functions and macros to wrap linkaddr_string(), etheraddr_string(), and isonsap_string() and convert calls to them to use the macros as well. Shuffle the inline functions in addrtoname.h around a bit, so that the inline functions, external declarations, and macros are all in the same order.
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-47/+47
| | | | | | | The exceptions are currently: Some EXTRACT_ in print-juniper.c, not used on packet buffer pointer. An EXTRACT_BE_U_3 in addrtoname.c, not always used on packet buffer pointer.
* Add the ndo parameter to some functionsFrancois-Xavier Le Bail2019-03-261-42/+42
| | | | This parameter will be needed at the next step.
* IEEE 802.11: Replace some ND_TTEST_*() calls with ND_TCHECK_*() callsFrancois-Xavier Le Bail2019-02-241-51/+59
| | | | | Moreover: Use 'goto trunc' in some length tests.
* Clean up whitespaces/indentationFrancois-Xavier Le Bail2019-02-241-99/+99
|
* Fix small misspellingsAntonin Décimo2019-01-231-2/+2
|
* Fix printing of Linux cooked captures with monitor-mode packets.Guy Harris2018-11-121-1/+1
| | | | | | | | Apparently, if you have an interface in monitor mode, capturing on the "any" device can get packets that have a SLL hatype of 803, which is the ARPHRD_ value for radiotap, and with the payload containing a radiotap header, followed by an 802.11 header, followed by the 802.11 payload. Handle that.
* Fix spacesFrancois-Xavier Le Bail2018-09-031-6/+6
|
* Explicitly check to make sure the header length isn't too short.Guy Harris2018-08-081-0/+9
|
* Make roundup2() generally available.Guy Harris2018-06-221-5/+0
|
* IEEE 802.11: Add a bounds checkFrancois-Xavier Le Bail2018-06-181-0/+4
|
* IEEE 802.11: Print the SSID with the fn_print_str() functionFrancois-Xavier Le Bail2018-05-191-1/+1
| | | | | We cannot use nd_print() because the parameter is not a pointer on the packet buffer.
* Print truncations with nd_print_trunc() instead of tstr[] stringsFrancois-Xavier Le Bail2018-05-041-22/+21
| | | | | | | | Remove the tstr[] strings. Update the output of some tests accordingly. Moreover: Add or update some ndo_protocol fields.
* Rename the fn_printX() functions to nd_printX()Francois-Xavier Le Bail2018-04-301-1/+1
| | | | | | | The functions are: nd_print, nd_printztn, nd_printn and nd_printzp. Trying to make it clearer that they currently have to be used only on part of the packet buffer. Update some comments.
* Add the ndo_protocol field in the netdissect_options structureFrancois-Xavier Le Bail2018-03-161-0/+7
| | | | | Update this field in printer entry functions. It will be used for some printings.
* Fix namingFrancois-Xavier Le Bail2018-03-141-3/+3
| | | | | | For coherency. We have: DLT_IEEE802_11_RADIO_AVS and ieee802_11_radio_avs_if_print(). Thus rename ieee802_11_avs_radio_print() to ieee802_11_radio_avs_print().
* Style updateFrancois-Xavier Le Bail2018-02-061-5/+5
| | | | Use parens around the sizeof argument, to match the style used elsewhere.
* Squelch warnings from MSVC.Guy Harris2018-01-291-154/+154
| | | | | Use float values, rather than double values, to initialize an array of floats.
* Always include <config.h> rather than "config.h".Guy Harris2018-01-211-1/+1
| | | | | | | | This can prevent bizarre failures if, for example, you've done a configuration in the top-level source directory, leaving behind one config.h file, and then do an out-of-tree build in another directory, with different configuration options. This way, we always pick up the same config.h, in the build directory.
* Use quoted include netdissect-stdinc.h instead of angle-bracketed oneFrancois-Xavier Le Bail2018-01-211-1/+1
|
* Use pcapng as the name of the file format.Guy Harris2018-01-081-1/+1
| | | | | | | | | | | | At one point, I remember a discussion resulting in the official name of the next-generation replacement for pcap format being changed to "pcapng", with no hyphen. Make tcpdump reflect that. While we're at it, uppdate to use "macOS" as the name of Apple's UNIX-for-Macs, as appropriate (don't use it for versions that were still called Mac OS X or OS X).
* Update ND_PRINT() as a variadic macroFrancois-Xavier Le Bail2018-01-071-225/+217
|
* Fix some Coccinelle warnings "a \ character appears outside of a #define"Francois-Xavier Le Bail2018-01-041-3/+3
|
* Use nd_ types, add EXTRACT_ calls, clean up signed vs. unsigned.Guy Harris2017-12-311-84/+84
|
* Replace ND_TTEST2()/ND_TCHECK2() macros by macros using pointers (1/n)Francois-Xavier Le Bail2017-12-111-21/+17
| | | | | ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l) ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
* Use more the EXTRACT_U_1() macro (55/n)Francois-Xavier Le Bail2017-12-101-1/+1
|
* Use pointer expressions like in most similar casesFrancois-Xavier Le Bail2017-12-101-1/+1
|
* Use more the EXTRACT_U_1() macro (50/n)Francois-Xavier Le Bail2017-12-091-1/+1
|
* Use more the EXTRACT_U_1() macro (42/n)Francois-Xavier Le Bail2017-12-021-1/+1
| | | | In: switch (... p[n] ...) ...
* Use more the EXTRACT_U_1() macro (39/n)Francois-Xavier Le Bail2017-12-011-5/+5
| | | | In some macros and functions call, p[n]
* Use more the EXTRACT_U_1() macro (28/n)Francois-Xavier Le Bail2017-11-261-5/+5
| | | | | | In ND_PRINT() macro call(s) (step 7). p[n] ...
* Use more ND_TCHECK_n()/ND_TTEST_n() macrosFrancois-Xavier Le Bail2017-11-241-3/+3
|
* Get rid of an unnecessary cast.Guy Harris2017-11-231-2/+2
|
* Clean up signed vs. unsigned.Guy Harris2017-11-231-6/+6
| | | | | | | | | | | | | | Have separate cpack_ routines for signed and unsigned numbers, with the signed ones using _S_ extract macros. That way, we can do more type checking. Add EXTRACT_LE_S_ macros. Use signed variables for IEEE80211_RADIOTAP_TX_ATTENUATION and IEEE80211_RADIOTAP_DB_TX_ATTENUATION, rather than using unsigned variables that we cast to int. Also, use EXTRACT_U_1() in cpack_uint8.
* Rename EXTRACT_ macrosFrancois-Xavier Le Bail2017-11-221-33/+32
| | | | | | | | | | | | | | | | Now all the macros have a name meaning a count in bytes. With _S_: signed, _U_: unsigned e.g.: EXTRACT_BE_32BITS -> EXTRACT_BE_U_4 EXTRACT_LE_32BITS -> EXTRACT_LE_U_4 ... EXTRACT_BE_INT32 -> EXTRACT_BE_S_4 and have: EXTRACT_8BITS -> EXTRACT_U_1 EXTRACT_INT8 -> EXTRACT_S_1
* Use more the EXTRACT_8BITS() macro to fetch a one-byte value (18/n)Francois-Xavier Le Bail2017-11-211-2/+2
| | | | | | Assignment, *(p op e) Partial list.
* Rename EXTRACT_nBITS() macros to EXTRACT_BE_nBITS()Francois-Xavier Le Bail2017-11-181-2/+2
| | | | | It indicates clearly that these macros are used to extract big-endian integral values.
* CVE-2017-13008/IEEE 802.11: Fix TIM bitmap copy to copy from p + offset.Guy Harris2017-09-131-13/+1
| | | | | | | | | | | | | | | offset has already been advanced to point to the bitmap; we shouldn't add the amount to advance again. This fixes a buffer over-read discovered by Brian 'geeknik' Carpenter. Add a test using the capture file supplied by the reporter(s). While we're at it, remove some redundant tests - we've already checked, before the case statement, whether we have captured the entire information element and whether the entire information element is present in the on-the-wire packet; in the cases for particular IEs, we only need to make sure we don't go past the end of the IE.
* CVE-2017-12987/IEEE 802.11: Fix processing of TIM IE.Guy Harris2017-09-131-2/+1
| | | | | | | | The arguments to memcpy() were completely wrong. This fixes a buffer over-read discovered by Kamil Frankowicz. Add a test using the capture file supplied by Brian 'geeknik' Carpenter.