net/mac80211/tests/mfp.c
Source file repositories/reference/linux-study-clean/net/mac80211/tests/mfp.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/tests/mfp.c- Extension
.c- Size
- 7361 bytes
- Lines
- 287
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
kunit/test.hkunit/skbuff.h../ieee80211_i.h../sta_info.h
Detected Declarations
function accept_mfp
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* KUnit tests for management frame acceptance
*
* Copyright (C) 2023 Intel Corporation
*/
#include <kunit/test.h>
#include <kunit/skbuff.h>
#include "../ieee80211_i.h"
#include "../sta_info.h"
MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING");
static const struct mfp_test_case {
const char *desc;
bool sta, mfp, decrypted, unicast, assoc;
u8 category;
u8 stype;
u8 action;
ieee80211_rx_result result;
} accept_mfp_cases[] = {
/* regular public action */
{
.desc = "public action: accept unicast from unknown peer",
.stype = IEEE80211_STYPE_ACTION,
.category = WLAN_CATEGORY_PUBLIC,
.action = WLAN_PUB_ACTION_DSE_ENABLEMENT,
.unicast = true,
.result = RX_CONTINUE,
},
{
.desc = "public action: accept multicast from unknown peer",
.stype = IEEE80211_STYPE_ACTION,
.category = WLAN_CATEGORY_PUBLIC,
.action = WLAN_PUB_ACTION_DSE_ENABLEMENT,
.unicast = false,
.result = RX_CONTINUE,
},
{
.desc = "public action: accept unicast without MFP",
.stype = IEEE80211_STYPE_ACTION,
.category = WLAN_CATEGORY_PUBLIC,
.action = WLAN_PUB_ACTION_DSE_ENABLEMENT,
.unicast = true,
.sta = true,
.result = RX_CONTINUE,
},
{
.desc = "public action: accept multicast without MFP",
.stype = IEEE80211_STYPE_ACTION,
.category = WLAN_CATEGORY_PUBLIC,
.action = WLAN_PUB_ACTION_DSE_ENABLEMENT,
.unicast = false,
.sta = true,
.result = RX_CONTINUE,
},
{
.desc = "public action: drop unicast with MFP",
.stype = IEEE80211_STYPE_ACTION,
.category = WLAN_CATEGORY_PUBLIC,
.action = WLAN_PUB_ACTION_DSE_ENABLEMENT,
.unicast = true,
.sta = true,
.mfp = true,
.result = RX_DROP_U_UNPROT_UNICAST_PUB_ACTION,
},
{
.desc = "public action: accept multicast with MFP",
.stype = IEEE80211_STYPE_ACTION,
.category = WLAN_CATEGORY_PUBLIC,
.action = WLAN_PUB_ACTION_DSE_ENABLEMENT,
.unicast = false,
.sta = true,
.mfp = true,
.result = RX_CONTINUE,
},
/* protected dual of public action */
{
.desc = "protected dual: drop unicast from unknown peer",
.stype = IEEE80211_STYPE_ACTION,
.category = WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION,
.action = WLAN_PUB_ACTION_DSE_ENABLEMENT,
.unicast = true,
.result = RX_DROP_U_UNPROT_DUAL,
},
{
.desc = "protected dual: drop multicast from unknown peer",
.stype = IEEE80211_STYPE_ACTION,
.category = WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION,
.action = WLAN_PUB_ACTION_DSE_ENABLEMENT,
Annotation
- Immediate include surface: `kunit/test.h`, `kunit/skbuff.h`, `../ieee80211_i.h`, `../sta_info.h`.
- Detected declarations: `function accept_mfp`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.