include/net/tc_act/tc_gact.h
Source file repositories/reference/linux-study-clean/include/net/tc_act/tc_gact.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/tc_act/tc_gact.h- Extension
.h- Size
- 1729 bytes
- Lines
- 78
- 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
net/act_api.hlinux/tc_act/tc_gact.h
Detected Declarations
struct tcf_gactfunction __is_tcf_gact_actfunction is_tcf_gact_okfunction is_tcf_gact_shotfunction is_tcf_gact_trapfunction is_tcf_gact_goto_chainfunction tcf_gact_goto_chain_indexfunction is_tcf_gact_continuefunction is_tcf_gact_reclassifyfunction is_tcf_gact_pipe
Annotated Snippet
struct tcf_gact {
struct tc_action common;
#ifdef CONFIG_GACT_PROB
u16 tcfg_ptype;
u16 tcfg_pval;
int tcfg_paction;
atomic_t packets;
#endif
};
#define to_gact(a) ((struct tcf_gact *)a)
static inline bool __is_tcf_gact_act(const struct tc_action *a, int act,
bool is_ext)
{
#ifdef CONFIG_NET_CLS_ACT
struct tcf_gact *gact;
if (a->ops && a->ops->id != TCA_ID_GACT)
return false;
gact = to_gact(a);
if ((!is_ext && gact->tcf_action == act) ||
(is_ext && TC_ACT_EXT_CMP(gact->tcf_action, act)))
return true;
#endif
return false;
}
static inline bool is_tcf_gact_ok(const struct tc_action *a)
{
return __is_tcf_gact_act(a, TC_ACT_OK, false);
}
static inline bool is_tcf_gact_shot(const struct tc_action *a)
{
return __is_tcf_gact_act(a, TC_ACT_SHOT, false);
}
static inline bool is_tcf_gact_trap(const struct tc_action *a)
{
return __is_tcf_gact_act(a, TC_ACT_TRAP, false);
}
static inline bool is_tcf_gact_goto_chain(const struct tc_action *a)
{
return __is_tcf_gact_act(a, TC_ACT_GOTO_CHAIN, true);
}
static inline u32 tcf_gact_goto_chain_index(const struct tc_action *a)
{
return READ_ONCE(a->tcfa_action) & TC_ACT_EXT_VAL_MASK;
}
static inline bool is_tcf_gact_continue(const struct tc_action *a)
{
return __is_tcf_gact_act(a, TC_ACT_UNSPEC, false);
}
static inline bool is_tcf_gact_reclassify(const struct tc_action *a)
{
return __is_tcf_gact_act(a, TC_ACT_RECLASSIFY, false);
}
static inline bool is_tcf_gact_pipe(const struct tc_action *a)
{
return __is_tcf_gact_act(a, TC_ACT_PIPE, false);
}
#endif /* __NET_TC_GACT_H */
Annotation
- Immediate include surface: `net/act_api.h`, `linux/tc_act/tc_gact.h`.
- Detected declarations: `struct tcf_gact`, `function __is_tcf_gact_act`, `function is_tcf_gact_ok`, `function is_tcf_gact_shot`, `function is_tcf_gact_trap`, `function is_tcf_gact_goto_chain`, `function tcf_gact_goto_chain_index`, `function is_tcf_gact_continue`, `function is_tcf_gact_reclassify`, `function is_tcf_gact_pipe`.
- 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.