include/net/tc_act/tc_mpls.h
Source file repositories/reference/linux-study-clean/include/net/tc_act/tc_mpls.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/tc_act/tc_mpls.h- Extension
.h- Size
- 1866 bytes
- Lines
- 98
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/tc_act/tc_mpls.hnet/act_api.h
Detected Declarations
struct tcf_mpls_paramsstruct tcf_mplsfunction tcf_mpls_actionfunction tcf_mpls_protofunction tcf_mpls_labelfunction tcf_mpls_tcfunction tcf_mpls_bosfunction tcf_mpls_ttl
Annotated Snippet
struct tcf_mpls_params {
int tcfm_action;
u32 tcfm_label;
int action; /* tcf_action */
u8 tcfm_tc;
u8 tcfm_ttl;
u8 tcfm_bos;
__be16 tcfm_proto;
struct rcu_head rcu;
};
#define ACT_MPLS_TC_NOT_SET 0xff
#define ACT_MPLS_BOS_NOT_SET 0xff
#define ACT_MPLS_LABEL_NOT_SET 0xffffffff
struct tcf_mpls {
struct tc_action common;
struct tcf_mpls_params __rcu *mpls_p;
};
#define to_mpls(a) ((struct tcf_mpls *)a)
static inline u32 tcf_mpls_action(const struct tc_action *a)
{
u32 tcfm_action;
rcu_read_lock();
tcfm_action = rcu_dereference(to_mpls(a)->mpls_p)->tcfm_action;
rcu_read_unlock();
return tcfm_action;
}
static inline __be16 tcf_mpls_proto(const struct tc_action *a)
{
__be16 tcfm_proto;
rcu_read_lock();
tcfm_proto = rcu_dereference(to_mpls(a)->mpls_p)->tcfm_proto;
rcu_read_unlock();
return tcfm_proto;
}
static inline u32 tcf_mpls_label(const struct tc_action *a)
{
u32 tcfm_label;
rcu_read_lock();
tcfm_label = rcu_dereference(to_mpls(a)->mpls_p)->tcfm_label;
rcu_read_unlock();
return tcfm_label;
}
static inline u8 tcf_mpls_tc(const struct tc_action *a)
{
u8 tcfm_tc;
rcu_read_lock();
tcfm_tc = rcu_dereference(to_mpls(a)->mpls_p)->tcfm_tc;
rcu_read_unlock();
return tcfm_tc;
}
static inline u8 tcf_mpls_bos(const struct tc_action *a)
{
u8 tcfm_bos;
rcu_read_lock();
tcfm_bos = rcu_dereference(to_mpls(a)->mpls_p)->tcfm_bos;
rcu_read_unlock();
return tcfm_bos;
}
static inline u8 tcf_mpls_ttl(const struct tc_action *a)
{
u8 tcfm_ttl;
rcu_read_lock();
tcfm_ttl = rcu_dereference(to_mpls(a)->mpls_p)->tcfm_ttl;
rcu_read_unlock();
return tcfm_ttl;
}
#endif /* __NET_TC_MPLS_H */
Annotation
- Immediate include surface: `linux/tc_act/tc_mpls.h`, `net/act_api.h`.
- Detected declarations: `struct tcf_mpls_params`, `struct tcf_mpls`, `function tcf_mpls_action`, `function tcf_mpls_proto`, `function tcf_mpls_label`, `function tcf_mpls_tc`, `function tcf_mpls_bos`, `function tcf_mpls_ttl`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.