diff mbox series

[1/2] monitor: print contents of beacon head/tail, and probe attributes

Message ID 20230223181417.1384624-1-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/2] monitor: print contents of beacon head/tail, and probe attributes | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-alpine-ci-fetch success Fetch PR
prestwoj/iwd-ci-gitlint success GitLint
prestwoj/iwd-ci-fetch success Fetch PR
prestwoj/iwd-alpine-ci-makedistcheck success Make Distcheck
prestwoj/iwd-alpine-ci-build success Build - Configure
prestwoj/iwd-ci-build success Build - Configure
prestwoj/iwd-alpine-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-alpine-ci-makecheck success Make Check
prestwoj/iwd-alpine-ci-incremental_build success Incremental Build with patches
prestwoj/iwd-ci-clang success clang PASS
prestwoj/iwd-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-ci-makecheck success Make Check
prestwoj/iwd-ci-incremental_build success Incremental Build with patches
prestwoj/iwd-ci-makedistcheck success Make Distcheck
prestwoj/iwd-ci-testrunner success test-runner PASS

Commit Message

James Prestwood Feb. 23, 2023, 6:14 p.m. UTC
---
 monitor/nlmon.c | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

Comments

Denis Kenzior Feb. 27, 2023, 4:25 p.m. UTC | #1
Hi James,

On 2/23/23 12:14, James Prestwood wrote:
> ---
>   monitor/nlmon.c | 23 +++++++++++++++++++----
>   1 file changed, 19 insertions(+), 4 deletions(-)

Both applied, thanks.

Regards,
-Denis
diff mbox series

Patch

diff --git a/monitor/nlmon.c b/monitor/nlmon.c
index 25a15154..a7ce2412 100644
--- a/monitor/nlmon.c
+++ b/monitor/nlmon.c
@@ -5068,6 +5068,16 @@  static void print_probe_response(unsigned int level,
 			(const uint8_t *) mmpdu + len - resp->ies);
 }
 
+static void print_beacon(unsigned int level,
+				const struct mmpdu_header *mmpdu, size_t len)
+{
+	const struct mmpdu_beacon *beacon = mmpdu_body(mmpdu);
+
+	print_attr(level, "Subtype: Beacon");
+	print_ie(level + 1, "Beacon IEs", beacon->ies,
+			(const uint8_t *) mmpdu + len - beacon->ies);
+}
+
 static void print_frame_type(unsigned int level, const char *label,
 					const void *data, uint16_t size)
 {
@@ -5122,7 +5132,10 @@  static void print_frame_type(unsigned int level, const char *label,
 		str = "Timing Advertisement";
 		break;
 	case 0x08:
-		str = "Beacon";
+		if (mpdu)
+			print_beacon(level + 1, mpdu, size);
+		else
+			str = "Beacon";
 		break;
 	case 0x09:
 		str = "ATIM";
@@ -6240,9 +6253,10 @@  static const struct attr_entry attr_table[] = {
 	{ NL80211_ATTR_DTIM_PERIOD,
 			"DTIM Period", ATTR_U32 },
 	{ NL80211_ATTR_BEACON_HEAD,
-			"Beacon Head", ATTR_BINARY },
+			"Beacon Head",  ATTR_CUSTOM, { .function = print_frame } },
 	{ NL80211_ATTR_BEACON_TAIL,
-			"Beacon Tail", ATTR_BINARY },
+			"Beacon Tail", ATTR_CUSTOM,
+				{ .function = print_management_ies } },
 	{ NL80211_ATTR_STA_AID,
 			"Station AID", ATTR_U16 },
 	{ NL80211_ATTR_STA_FLAGS,
@@ -6520,7 +6534,8 @@  static const struct attr_entry attr_table[] = {
 	{ NL80211_ATTR_PROBE_RESP_OFFLOAD,
 			"Probe Response Offload" },
 	{ NL80211_ATTR_PROBE_RESP,
-			"Probe Response" },
+			"Probe Response", ATTR_CUSTOM,
+					{ .function = print_frame} },
 	{ NL80211_ATTR_DFS_REGION,
 			"DFS Region", ATTR_U8 },
 	{ NL80211_ATTR_DISABLE_HT,