net/shaper/shaper_nl_gen.c
Source file repositories/reference/linux-study-clean/net/shaper/shaper_nl_gen.c
File Facts
- System
- Linux kernel
- Corpus path
net/shaper/shaper_nl_gen.c- Extension
.c- Size
- 5685 bytes
- Lines
- 161
- 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
net/netlink.hnet/genetlink.hshaper_nl_gen.huapi/linux/net_shaper.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
// SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
/* Do not edit directly, auto-generated from: */
/* Documentation/netlink/specs/net_shaper.yaml */
/* YNL-GEN kernel source */
/* To regenerate run: tools/net/ynl/ynl-regen.sh */
#include <net/netlink.h>
#include <net/genetlink.h>
#include "shaper_nl_gen.h"
#include <uapi/linux/net_shaper.h>
/* Integer value ranges */
static const struct netlink_range_validation net_shaper_a_handle_id_range = {
.max = NET_SHAPER_MAX_HANDLE_ID,
};
/* Common nested types */
const struct nla_policy net_shaper_handle_nl_policy[NET_SHAPER_A_HANDLE_ID + 1] = {
[NET_SHAPER_A_HANDLE_SCOPE] = NLA_POLICY_MAX(NLA_U32, 3),
[NET_SHAPER_A_HANDLE_ID] = NLA_POLICY_FULL_RANGE(NLA_U32, &net_shaper_a_handle_id_range),
};
const struct nla_policy net_shaper_leaf_info_nl_policy[NET_SHAPER_A_WEIGHT + 1] = {
[NET_SHAPER_A_HANDLE] = NLA_POLICY_NESTED(net_shaper_handle_nl_policy),
[NET_SHAPER_A_PRIORITY] = { .type = NLA_U32, },
[NET_SHAPER_A_WEIGHT] = { .type = NLA_U32, },
};
/* NET_SHAPER_CMD_GET - do */
static const struct nla_policy net_shaper_get_do_nl_policy[NET_SHAPER_A_IFINDEX + 1] = {
[NET_SHAPER_A_IFINDEX] = { .type = NLA_U32, },
[NET_SHAPER_A_HANDLE] = NLA_POLICY_NESTED(net_shaper_handle_nl_policy),
};
/* NET_SHAPER_CMD_GET - dump */
static const struct nla_policy net_shaper_get_dump_nl_policy[NET_SHAPER_A_IFINDEX + 1] = {
[NET_SHAPER_A_IFINDEX] = { .type = NLA_U32, },
};
/* NET_SHAPER_CMD_SET - do */
static const struct nla_policy net_shaper_set_nl_policy[NET_SHAPER_A_IFINDEX + 1] = {
[NET_SHAPER_A_IFINDEX] = { .type = NLA_U32, },
[NET_SHAPER_A_HANDLE] = NLA_POLICY_NESTED(net_shaper_handle_nl_policy),
[NET_SHAPER_A_METRIC] = NLA_POLICY_MAX(NLA_U32, 1),
[NET_SHAPER_A_BW_MIN] = { .type = NLA_UINT, },
[NET_SHAPER_A_BW_MAX] = { .type = NLA_UINT, },
[NET_SHAPER_A_BURST] = { .type = NLA_UINT, },
[NET_SHAPER_A_PRIORITY] = { .type = NLA_U32, },
[NET_SHAPER_A_WEIGHT] = { .type = NLA_U32, },
};
/* NET_SHAPER_CMD_DELETE - do */
static const struct nla_policy net_shaper_delete_nl_policy[NET_SHAPER_A_IFINDEX + 1] = {
[NET_SHAPER_A_IFINDEX] = { .type = NLA_U32, },
[NET_SHAPER_A_HANDLE] = NLA_POLICY_NESTED(net_shaper_handle_nl_policy),
};
/* NET_SHAPER_CMD_GROUP - do */
static const struct nla_policy net_shaper_group_nl_policy[NET_SHAPER_A_LEAVES + 1] = {
[NET_SHAPER_A_IFINDEX] = { .type = NLA_U32, },
[NET_SHAPER_A_PARENT] = NLA_POLICY_NESTED(net_shaper_handle_nl_policy),
[NET_SHAPER_A_HANDLE] = NLA_POLICY_NESTED(net_shaper_handle_nl_policy),
[NET_SHAPER_A_METRIC] = NLA_POLICY_MAX(NLA_U32, 1),
[NET_SHAPER_A_BW_MIN] = { .type = NLA_UINT, },
[NET_SHAPER_A_BW_MAX] = { .type = NLA_UINT, },
[NET_SHAPER_A_BURST] = { .type = NLA_UINT, },
[NET_SHAPER_A_PRIORITY] = { .type = NLA_U32, },
[NET_SHAPER_A_WEIGHT] = { .type = NLA_U32, },
[NET_SHAPER_A_LEAVES] = NLA_POLICY_NESTED(net_shaper_leaf_info_nl_policy),
};
/* NET_SHAPER_CMD_CAP_GET - do */
static const struct nla_policy net_shaper_cap_get_do_nl_policy[NET_SHAPER_A_CAPS_SCOPE + 1] = {
[NET_SHAPER_A_CAPS_IFINDEX] = { .type = NLA_U32, },
[NET_SHAPER_A_CAPS_SCOPE] = NLA_POLICY_MAX(NLA_U32, 3),
};
/* NET_SHAPER_CMD_CAP_GET - dump */
static const struct nla_policy net_shaper_cap_get_dump_nl_policy[NET_SHAPER_A_CAPS_IFINDEX + 1] = {
[NET_SHAPER_A_CAPS_IFINDEX] = { .type = NLA_U32, },
};
/* Ops table for net_shaper */
static const struct genl_split_ops net_shaper_nl_ops[] = {
{
.cmd = NET_SHAPER_CMD_GET,
.pre_doit = net_shaper_nl_pre_doit,
.doit = net_shaper_nl_get_doit,
Annotation
- Immediate include surface: `net/netlink.h`, `net/genetlink.h`, `shaper_nl_gen.h`, `uapi/linux/net_shaper.h`.
- 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.