3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-13 23:49:23 +01:00
Commit Graph

245 Commits

Author SHA1 Message Date
Marcel Holtmann
5d9278913f monitor: Fix includes for using with -std=c99 compiler option 2018-11-01 22:19:11 +01:00
Marcel Holtmann
72a64fa7fb build: Adjust to the latest ELL signal API changes 2018-11-01 22:09:19 +01:00
Marcel Holtmann
a9c2d71874 monitor: Use l_get_be16 and l_put_be16 instead of open coding it 2018-11-01 21:28:55 +01:00
Marcel Holtmann
0689877858 monitor: Use l_main_run_with_signal instead of open coding it 2018-11-01 20:02:53 +01:00
Denis Kenzior
ec365e52eb monitor: Fix valgrind warning
==24195== Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
==24195==    at 0x4F3DBEF: sendto (in /lib64/libc-2.26.so)
==24195==    by 0x13A453: can_write_data (netlink.c:119)
==24195==    by 0x13866B: io_callback (io.c:149)
==24195==    by 0x137365: l_main_iterate (main.c:389)
==24195==    by 0x1374A3: l_main_run (main.c:436)
==24195==    by 0x113524: main (main.c:832)
==24195==  Address 0x5205f99 is 57 bytes inside a block of size 88 alloc'd
==24195==    at 0x4C2D0AF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==24195==    by 0x133931: l_malloc (util.c:62)
==24195==    by 0x13AEF3: l_netlink_send (netlink.c:411)
==24195==    by 0x112351: rtm_interface_send_message (main.c:276)
==24195==    by 0x1126F3: iwmon_interface_lookup (main.c:405)
==24195==    by 0x11351F: main (main.c:830)
==24195==  Uninitialised value was created by a heap allocation
==24195==    at 0x4C2D0AF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==24195==    by 0x133931: l_malloc (util.c:62)
==24195==    by 0x11217B: rtm_interface_send_message (main.c:234)
==24195==    by 0x1126F3: iwmon_interface_lookup (main.c:405)
==24195==    by 0x11351F: main (main.c:830)
2018-10-30 17:52:24 -05:00
Denis Kenzior
76c8fd9a2f monitor: Fix invalid use of l_free
==23290== Invalid read of size 4
==23290==    at 0x12D334: timeout_destroy (timeout.c:61)
==23290==    by 0x12CDD1: l_main_exit (main.c:466)
==23290==    by 0x111F3B: main (main.c:835)
==23290==  Address 0x5211d80 is 0 bytes inside a block of size 32 free'd
==23290==    at 0x4C2E1BB: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23290==    by 0x111F36: main (main.c:833)
==23290==  Block was alloc'd at
==23290==    at 0x4C2CF8F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23290==    by 0x12A74D: l_malloc (util.c:62)
==23290==    by 0x12D40F: timeout_create_with_nanoseconds (timeout.c:135)
==23290==    by 0x112A31: signal_handler (main.c:661)
==23290==    by 0x12D03A: signal_callback (signal.c:82)
==23290==    by 0x12CC6D: l_main_iterate (main.c:387)
==23290==    by 0x12CD3B: l_main_run (main.c:434)
==23290==    by 0x1121F2: main (main.c:821)
==23290==
==23290== Invalid read of size 8
==23290==    at 0x12D33B: timeout_destroy (timeout.c:64)
==23290==    by 0x12CDD1: l_main_exit (main.c:466)
==23290==    by 0x111F3B: main (main.c:835)
==23290==  Address 0x5211d90 is 16 bytes inside a block of size 32 free'd
==23290==    at 0x4C2E1BB: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23290==    by 0x111F36: main (main.c:833)
==23290==  Block was alloc'd at
==23290==    at 0x4C2CF8F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23290==    by 0x12A74D: l_malloc (util.c:62)
==23290==    by 0x12D40F: timeout_create_with_nanoseconds (timeout.c:135)
==23290==    by 0x112A31: signal_handler (main.c:661)
==23290==    by 0x12D03A: signal_callback (signal.c:82)
==23290==    by 0x12CC6D: l_main_iterate (main.c:387)
==23290==    by 0x12CD3B: l_main_run (main.c:434)
==23290==    by 0x1121F2: main (main.c:821)
==23290==
==23290== Invalid write of size 4
==23290==    at 0x12D33F: timeout_destroy (timeout.c:62)
==23290==    by 0x12CDD1: l_main_exit (main.c:466)
==23290==    by 0x111F3B: main (main.c:835)
==23290==  Address 0x5211d80 is 0 bytes inside a block of size 32 free'd
==23290==    at 0x4C2E1BB: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23290==    by 0x111F36: main (main.c:833)
==23290==  Block was alloc'd at
==23290==    at 0x4C2CF8F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23290==    by 0x12A74D: l_malloc (util.c:62)
==23290==    by 0x12D40F: timeout_create_with_nanoseconds (timeout.c:135)
==23290==    by 0x112A31: signal_handler (main.c:661)
==23290==    by 0x12D03A: signal_callback (signal.c:82)
==23290==    by 0x12CC6D: l_main_iterate (main.c:387)
==23290==    by 0x12CD3B: l_main_run (main.c:434)
==23290==    by 0x1121F2: main (main.c:821)
2018-10-30 15:47:57 -05:00
Andreas Henriksson
d4064ea1b6 monitor: Fix spelling errors spotted by lintian
The debian package checking tool lintian spotted a bunch
of spelling errors in the built binaries.
2018-08-06 12:28:57 -05:00
John Zimmermann
37173350e2 monitor: move inclusion of linux headers after libc ones
to fix compilation against MUSL libc.
The struct ethhdr does exists in netinet/if_ether.h and linux/if_ether.h
so including the linux headers after the libc headers lets libc_compat.h
work as intended.
2018-05-17 17:34:08 -05:00
James Prestwood
5c5bfbb423 monitor: added scan/wiphy flags
Specifying --noscan will filter out any scan related packets
Specifying --nowiphy will filter out any "new wiphy" packets
2018-05-15 19:42:46 -05:00
Andrew Zaborowski
b55e080b21 nlmon: Update Auth Algorithm switch statement 2017-09-22 12:18:10 -05:00
Marcel Holtmann
af22a75fbb monitor: Include OUI value for AVM 2017-09-06 03:50:30 -07:00
Marcel Holtmann
fa98cee942 monitor: Fix minor typo 2017-09-06 03:15:46 -07:00
Andrew Zaborowski
76dd86d816 monitor: Use new mpdu.h structs
This may also fix displaying authentication and deauthentication frames.
2017-08-31 15:12:49 -05:00
Marcel Holtmann
1db66dbe51 monitor: Use extra unsigned variable to make NLMSG_OK macro happy 2017-08-30 22:56:23 +02:00
Tim Kourt
4d626d6576 monitor: Fix casting error
Fix for the cros-compilation with Chromium OS’s toolchain
that uses GCC 4.9
2017-08-23 16:26:05 -05:00
Andrew Zaborowski
e6765c1e9b monitor: Actually print management frame subtype
The subtype was only printed if mpdu_validate had returned an error for
the frame, i.e. would not be printed for well formed frames.  This was
probably an intent to avoid printing the frame subtype after all the
conents of the body frame had been printed already, but iwmon only
supports printing of Authentication and Deauthentication frames so far.
2017-08-15 15:18:40 -05:00
Marcel Holtmann
60bc0ecf22 monitor: Use temporary variable for RTA_PAYLOAD 2017-08-07 23:48:22 -07:00
Andrew Zaborowski
a01e57d1b2 monitor: Receive Preauthentication frames and log them
Use the same packet filter as in eapol.c
2017-04-18 11:43:59 -05:00
Mat Martineau
0e108f9727 monitor: Remove GENL_ID_GENERATE
Kernel v4.10 and later no longer export GENL_ID_GENERATE (which was
defined as 0). iwd was using this symbol to check for unmodified local
values rather than to ask for a dynamically generated netlink ID anyway,
so it makes sense to use the value 0 directly. This will work with
kernels before and after the GENL_ID_GENERATE change.
2017-04-14 15:52:11 -05:00
Denis Kenzior
303490261f monitor: Add nortnl option to help output 2017-03-24 10:51:01 -05:00
Marcel Holtmann
43efaf0163 monitor: Cast bytes_read to incl_len type from PCAP packet 2017-03-07 21:52:25 +01:00
Marcel Holtmann
25a2ec7c11 monitor: Use PRIu64 for format modifier of uint64_t 2017-03-07 21:44:49 +01:00
Denis Kenzior
e5f12bd133 monitor: Pretty print WSC OS Version 2016-09-15 10:55:22 -05:00
Denis Kenzior
1ebf21de0b monitor: Pretty print various bytestream attributes 2016-09-15 10:55:04 -05:00
Denis Kenzior
fe7751ac43 monitor: Pretty print WSC Encryption Type Flags 2016-09-15 10:54:43 -05:00
Denis Kenzior
a175375cc5 monitor: Pretty print WSC Connection Type Flags 2016-09-15 10:54:16 -05:00
Denis Kenzior
4d7c98fa22 monitor: Pretty print WSC Authenticator 2016-09-15 10:53:52 -05:00
Denis Kenzior
260a666b4b monitor: Pretty print WSC authentication type flags 2016-09-15 10:53:29 -05:00
Denis Kenzior
1d9741bedc monitor: Pretty print WSC MAC Address 2016-09-14 22:15:23 -05:00
Denis Kenzior
2d80f03faf monitor: pretty print WSC Message Type 2016-09-14 22:07:52 -05:00
Denis Kenzior
1447c7fe03 monitor: pretty-print eap-wsc packets 2016-09-14 21:56:18 -05:00
Andrew Zaborowski
4a00c25241 iwmon: RX dBm is a signed integer 2016-09-05 22:46:53 -05:00
Andrew Zaborowski
a1f1046dcb iwmon: Fix PMKID display
Use unsigned to prevent the PMKID bytes being sign-extended.
2016-09-05 22:43:53 -05:00
Andrew Zaborowski
755605fddf iwmon: Fix RSN capability bit positions
The numbers displayed for other bits are 0-based.
2016-09-05 22:40:07 -05:00
Denis Kenzior
296eda2ee8 monitor: Print EAPoL packet headers
Previously we only printed EAPoL packets that were of type 'Key'.  With
this change, iwmon now prints all EAPoL packet headers.
2016-08-06 10:47:13 -05:00
Denis Kenzior
6ffbfeb897 monitor: Dump WSC IEs in association response 2016-08-05 16:51:25 -05:00
Denis Kenzior
d6a9b0f85a monitor: Add option to not print rtnl output 2016-07-13 10:14:28 -05:00
Denis Kenzior
6de565db05 monitor: Update to new l_main api 2016-06-09 09:39:03 -05:00
Andrew Zaborowski
ef9b6f41ce eapol: Separate EAPOL header from struct eapol_key
This is needed so we can better handle sending and receiving EAPoL
packets other than EAPoL-Key.
2015-11-02 21:40:21 -06:00
Denis Kenzior
7f52c8ec9d monitor: Fix unused variable error 2015-10-06 15:25:30 -05:00
Denis Kenzior
9be930442c monitor: Dump WIPHY_BANDS attribute 2015-10-06 14:33:18 -05:00
Denis Kenzior
e055460709 wsc: Rename wsc.[ch] to wscutil.[ch] 2015-09-10 23:07:34 -05:00
Denis Kenzior
3e927ea6c9 nlmon: Fix up bitwise logic
The flags in question contain multiple set bits.  So we should only
print the relevant details if all bits are set, not just one of the
bits.
2015-09-09 08:52:49 -05:00
Denis Kenzior
913bf61447 nlmon: print NetworkKeyShareable, RequestToEnroll 2015-09-07 09:36:42 -05:00
Denis Kenzior
7cb5a83732 monitor: Print WSC WFA extended attributes
Introduced in Version 2.0 of the spec
2015-09-07 09:34:53 -05:00
Denis Kenzior
410d74f772 nlmon: Pretty print WSC_ATTR_CONFIGURATION_ERROR 2015-09-02 13:37:50 -05:00
Denis Kenzior
312ff46f88 nlmon: Pretty-print WSC_ATTR_ASSOCIATION_STATE 2015-09-01 17:19:42 -05:00
Denis Kenzior
0496a79eea nlmon: Print WSC_ATTR_REQUEST_TYPE 2015-09-01 17:10:41 -05:00
Denis Kenzior
a6a26cfe7f nlmon: Print WSC frames in other IE elements
Trigger Scan Event, Trigger Scan Requests, etc.
2015-09-01 16:58:41 -05:00
Denis Kenzior
add4458a32 nlmon: Print human-readable reason-code 2015-09-01 16:48:50 -05:00
Denis Kenzior
f912e63df5 nlmon: decode RF_BANDS attributes 2015-07-24 21:23:29 -05:00
Denis Kenzior
bbb892da26 nlmon: decode CONFIGURATION_METHODS attributes 2015-07-24 21:23:29 -05:00
Denis Kenzior
084e69dadb nlmon: decode DEVICE_NAME attributes 2015-07-24 21:23:29 -05:00
Denis Kenzior
a07813dff1 nlmon: decode PRIMARY_DEVICE_TYPE attributes 2015-07-24 21:23:26 -05:00
Denis Kenzior
8cc4ee923a nlmon: decode SERIAL_NUMBER attributes 2015-07-24 17:09:23 -05:00
Denis Kenzior
47b995d119 nlmon: decode MODEL_NUMBER attributes 2015-07-24 17:07:51 -05:00
Denis Kenzior
f22c931b93 nlmon: decode MODEL_NAME attributes 2015-07-24 17:06:10 -05:00
Denis Kenzior
7fe9a3cebe nlmon: decode MANUFACTURER attributes 2015-07-24 16:58:13 -05:00
Denis Kenzior
c9c440be3c nlmon: decode UUID-E and UUID-R attributes 2015-07-24 16:41:00 -05:00
Denis Kenzior
6e6ae9fe32 nlmon: decode RESPONSE_TYPE attributes 2015-07-24 16:32:22 -05:00
Denis Kenzior
9682d561e7 nlmon: decode DEVICE_PASSWORD_ID attributes 2015-07-24 16:28:56 -05:00
Denis Kenzior
8760e56278 nlmon: decode WSC_STATE attributes 2015-07-24 16:19:08 -05:00
Denis Kenzior
d9b2d8151a nlmon: Add basic WSC pretty-printing capability 2015-07-23 20:49:29 -05:00
Denis Kenzior
a76918e15c monitor: Refactor print_ie_vendor
To support addition WFA tags
2015-07-09 11:58:29 -05:00
Denis Kenzior
15c9bc7933 monitor: dump IE_TYPE_RM_ENABLED_CAPABILITIES 2015-06-11 19:29:12 -05:00
Denis Kenzior
b86dcab024 monitor: Decode more ATTR_BSS nested elements 2015-06-11 18:27:37 -05:00
Denis Kenzior
eee6e7db29 monitor: Fix mandatory calculation in ie_rate
The high-order bit should be checked, not the 3rd bit.
2015-06-10 11:33:51 -05:00
Denis Kenzior
47508db472 monitor: Add decoder for tx_bitrate and rx_bitrate 2015-06-08 22:53:47 -05:00
Denis Kenzior
a7e92e300a monitor: Signal strength in sta_info is signed
Signal strength is expressed in negative dBm, so the value extracted is
a signed 8-bit value, not unsigned.
2015-06-08 22:52:00 -05:00
Denis Kenzior
fa8c673137 monitor: Print Key ID field in the case of WPA 2015-05-18 12:50:50 -05:00
Denis Kenzior
4f5013515d monitor: Shorten up printed strings
HT Operation Information strings wrap on 80 character terminals, so
shorten up the printed string to avoid that in most cases
2015-05-18 12:50:50 -05:00
Denis Kenzior
96d0703eb3 monitor: Add decoder for HT Capabilities field 2015-05-07 21:33:07 -05:00
Denis Kenzior
2948f2d933 monitor: Pretty-print Extended Capabilities IE 2015-05-06 21:57:53 -05:00
Denis Kenzior
9ac2e109e3 monitor: Reflow formatting of ie_entry 2015-05-06 21:55:55 -05:00
Denis Kenzior
0239c6f09e monitor: Add decoder for NL80211_ATTR_EXT_CAPA 2015-05-06 21:50:30 -05:00
Denis Kenzior
6f7a07e012 monitor: Add additional nl80211 command names 2015-05-06 15:29:28 -05:00
Denis Kenzior
c3abaf8181 monitor: Pretty-print commands supported by phy 2015-05-06 15:23:57 -05:00
Denis Kenzior
7744c38ec1 monitor: Add Beacon Loss Event entry 2015-04-30 17:47:23 -05:00
Denis Kenzior
c8fc79c611 monitor: Print AKM suites 2015-04-17 12:49:54 -05:00
Denis Kenzior
835ae605d9 monitor: Make sure to print attribute type 2015-04-17 12:49:51 -05:00
Denis Kenzior
90c922f2ca monitor: Fix buffer overrun
When printing New Address events, the extra_str buffer is overrun,
resulting in weird stuff happening.

> RTNL: Error (0x02) len 20				> 5.252075
   Flags: 0 (0x000)
   Sequence number: 189 (0x000000bd)
   Port ID: 2116
    ACK: 0
==4080== Invalid read of size 1
==4080==    at 0x4E8000E: vfprintf (in /lib64/libc-2.20.so)
==4080==    by 0x4EA8A24: vsnprintf (in /lib64/libc-2.20.so)
==4080==    by 0x4E86011: snprintf (in /lib64/libc-2.20.so)
==4080==    by 0x403B64: print_packet (nlmon.c:238)
==4080==    by 0x40C8FD: print_nlmsghdr (nlmon.c:3197)
==4080==    by 0x40CD9E: print_rtnl_msg (nlmon.c:3266)
==4080==    by 0x40CE4F: nlmon_print_rtnl (nlmon.c:3298)
==4080==    by 0x40D1CD: nlmon_receive (nlmon.c:3390)
2015-04-12 12:25:55 -05:00
Jukka Rissanen
02a2515f3d monitor: Pretty print LinkMode value
LinkMode tells whether kernel (0) or user space (1) is controlling
the link.
2015-03-27 13:31:41 -05:00
Jukka Rissanen
f4f5afdd50 monitor: Pretty print OperState value
Instead of plain number, decode the value for human consumption.
2015-03-27 13:31:41 -05:00
Jukka Rissanen
2c3c96f322 monitor: Print OperState instead of Openstate for operational state flag 2015-03-27 13:31:41 -05:00
Denis Kenzior
d277456852 monitor: Always hexdump the raw PAE frame 2015-03-20 13:48:49 -05:00
Denis Kenzior
9318414f22 monitor: Fix Capabilities Field dump
The capabilities field was not decoded from the appropriate place in the
data file.  This resulted in bogus values being printed.
2015-03-20 13:47:47 -05:00
Denis Kenzior
a2bc325b3b monitor: Fix typo 2015-03-20 11:34:21 -05:00
Patrik Flykt
2129becac8 monitor: Print HT Operation IE
As well as the therein contained MCS field
2015-03-20 11:29:42 -05:00
Ravi kumar Veeramally
8e6bd7d613 monitor: Fix encrypted key data pretty printing
If key data is encrypted then print only hexdump. If not pass it to
print_ie (key data may contains other IE elements).
2015-03-18 09:04:20 -05:00
Ravi kumar Veeramally
7eac75fa69 monitor: Print EAPoL key details
e.g.

< PAE: len 123
    Interface Index: 9
    EAPoL: len 123
        Version: 2 (802.11X-2004)
        Type: 3 (Key)
        Lenth: 119
        Descriptor Type: 2
        Key MIC: true
        Secure: false
        Error: false
        Request: false
        Encrypted Ket Data: false
        SMK Message: false
        Key Descriptor Version: 1 (01)
        Ket Type: true
        Install: false
        Key ACK: false
        Key Length: 0
        Key Replay Counter: 4
        Key NONCE
            af 38 0d 3a 24 1a f7 09 3e ad b9 6e e6 33 02 8b  .8.:$...>..n.3..
            fa 00 f6 40 71 38 e9 d5 d1 e3 ca 3b c2 16 83 d9  ...@q8.....;....
        Key IV
            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        Key RSC
            00 00 00 00 00 00 00 00                          ........
        Key MIC Data
            86 b7 54 45 7c 37 45 c1 31 e7 65 4b 70 c8 43 c0  ..TE|7E.1.eKp.C.
        Key Data: len 24
            dd 16 00 50 f2 01 01 00 00 50 f2 02 01 00 00 50  ...P.....P.....P
            f2 02 01 00 00 50 f2 02                          .....P..
        Vendor Specific: len 22
            Microsoft (00:50:f2)
                WPA:
                    Type: 1
                    Version: 1(0001)
                    Group Data Cipher Suite: len 4
                        TKIP (00:50:f2) suite  02
                    Pairwise Cipher Suite: len 4
                        TKIP (00:50:f2) suite  02
                    AKM Suite: len 4
                        PSK; RSNA PSK (00:50:f2) suite  02
2015-03-16 11:56:43 -05:00
Ravi kumar Veeramally
b8cc01eedc monitor: Print vendor specific data with more details
Currently it supports Microsoft specific data which has type
and vesion value 1.

e.g.
Vendor specific: len 22
    Microsoft (00:50:f2)
        WPA:
            Type: 1
            Version: 1(0001)
            Group Data Cipher Suite: len 4
                TKIP (00:50:f2) suite  02
            Pairwise Cipher Suite: len 4
                TKIP (00:50:f2) suite  02
            AKM Suite: len 4
                IEEE 802.1X/PMKSA; RSNA/PMKSA caching (00:50:f2) suite  01
2015-03-12 11:29:37 -05:00
Patrik Flykt
6d652fb743 monitor: Support arbitrarily long bitfields
Support arbitrarily long bitfields by providing field and mask values
as arrays with their length measured in bytes. Some of the IE fields
easily reach 80 bits or more, thus easily overrunning any integer sizes
used by the OS architecture.
2015-03-06 13:11:03 -06:00
Jukka Rissanen
7a16f0a263 monitor: RTNL IFLA flags were printed incorrectly
If flags was 0, then an uninitialized buffer was printed. Changed
this so that if flags == 0, then just the value is printed.
If flags != 0, then print flags values to a buffer that is big
enough to hold all the sub-strings.
2015-02-26 09:49:32 -06:00
Jukka Rissanen
42f8adbab9 nlmon: String buffer overflow
The buffer that is allocated for the filename is too short and
as sprintf() was used it overflowed the buffer easily when longer
interface name was used.
2015-02-25 10:31:48 -06:00
Denis Kenzior
62bfb6f8c8 iwmon: Remove unneeded casts 2015-02-23 12:39:20 -06:00
Patrik Flykt
56a0b6de60 nlmon: Pretty-print RSN IE
Pretty-print RSN cipher suites, bit fields and PMKIDs if any. Reuse
existing functionality for printing netlink message ciphers.
2015-02-23 12:33:11 -06:00
Denis Kenzior
17dcd420c2 monitor: Fix up minor style issue 2015-02-04 20:49:38 -06:00
Denis Kenzior
44aaaa74ee monitor: Fix some whitespace corruption 2015-02-04 20:47:23 -06:00
Ravi kumar Veeramally
ea39ea3e00 monitor: Filter wlan related messages from RTNL traffic
Filter wlan related messages from all netlink routing messages.
2015-02-04 20:43:00 -06:00
Ravi kumar Veeramally
e79ab9d622 monitor: Print Netlink Rekey nested attributes 2015-02-04 11:15:28 -06:00