net/mac80211/tests/elems.c
Source file repositories/reference/linux-study-clean/net/mac80211/tests/elems.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/tests/elems.c- Extension
.c- Size
- 8527 bytes
- Lines
- 387
- 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.h../ieee80211_i.h
Detected Declarations
function mle_defragfunction mesh_preq_parsefunction mesh_prep_parsefunction mesh_perr_parse
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* KUnit tests for element parsing
*
* Copyright (C) 2023-2025 Intel Corporation
*/
#include <kunit/test.h>
#include "../ieee80211_i.h"
MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING");
static const struct mesh_preq_parse_test_case {
const char *desc;
u8 len;
bool ae_enabled;
u8 target_count;
bool result;
} mesh_preq_parse_cases[] = {
{
.desc = "shorter than header",
.len = 16,
.ae_enabled = false,
.target_count = 1,
.result = false,
},
{
.desc = "too short non AE, target count is not included",
.len = 29,
.ae_enabled = false,
.target_count = 1,
.result = false,
},
{
.desc = "too short non AE, target count is 1",
.len = 36,
.ae_enabled = false,
.target_count = 1,
.result = false,
},
{
.desc = "too short AE, target count is not included",
.len = 35,
.ae_enabled = true,
.target_count = 1,
.result = false,
},
{
.desc = "too short AE, target count is 1",
.len = 42,
.ae_enabled = true,
.target_count = 1,
.result = false,
},
{
.desc = "target count is zero",
.len = 26,
.ae_enabled = false,
.target_count = 0,
.result = false,
},
{
.desc = "target count is 21",
.len = 255,
.ae_enabled = false,
.target_count = 21,
.result = false,
},
{
.desc = "non AE, target count is 1",
.len = 37,
.ae_enabled = false,
.target_count = 1,
.result = true,
},
{
.desc = "non AE, target count is 20",
.len = 246,
.ae_enabled = false,
.target_count = 20,
.result = true,
},
{
.desc = "AE, target count is 1",
.len = 43,
.ae_enabled = true,
.target_count = 1,
.result = true,
},
{
.desc = "AE, target count is 20",
Annotation
- Immediate include surface: `kunit/test.h`, `../ieee80211_i.h`.
- Detected declarations: `function mle_defrag`, `function mesh_preq_parse`, `function mesh_prep_parse`, `function mesh_perr_parse`.
- 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.