include/net/flow_dissector.h
Source file repositories/reference/linux-study-clean/include/net/flow_dissector.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/flow_dissector.h- Extension
.h- Size
- 12950 bytes
- Lines
- 489
- 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
linux/types.hlinux/in6.hlinux/siphash.hlinux/string.huapi/linux/if_ether.huapi/linux/pkt_cls.h
Detected Declarations
struct bpf_progstruct netstruct sk_buffstruct flow_dissector_key_controlstruct flow_dissector_key_basicstruct flow_dissector_key_tagsstruct flow_dissector_key_vlanstruct flow_dissector_mpls_lsestruct flow_dissector_key_mplsstruct flow_dissector_key_enc_optsstruct flow_dissector_key_keyidstruct flow_dissector_key_ipv4_addrsstruct flow_dissector_key_ipv6_addrsstruct flow_dissector_key_tipcstruct flow_dissector_key_addrsstruct flow_dissector_key_arpstruct flow_dissector_key_portsstruct flow_dissector_key_ports_rangestruct flow_dissector_key_icmpstruct flow_dissector_key_eth_addrsstruct flow_dissector_key_tcpstruct flow_dissector_key_ipstruct flow_dissector_key_metastruct flow_dissector_key_ctstruct flow_dissector_key_hashstruct flow_dissector_key_num_of_vlansstruct flow_dissector_key_pppoestruct flow_dissector_key_l2tpv3struct flow_dissector_key_ipsecstruct flow_dissector_key_cfmstruct flow_dissector_keystruct flow_dissectorstruct flow_keys_basicstruct flow_keysstruct flow_keys_digeststruct bpf_flow_dissectorenum flow_dissector_ctrl_flagsenum flow_dissect_retenum flow_dissector_key_idfunction dissector_set_mpls_lsefunction flow_keys_have_l4function dissector_uses_keyfunction flow_dissector_init_keys
Annotated Snippet
struct flow_dissector_key_control {
u16 thoff;
u16 addr_type;
u32 flags;
};
/* The control flags are kept in sync with TCA_FLOWER_KEY_FLAGS_*, as those
* flags are exposed to userspace in some error paths, ie. unsupported flags.
*/
enum flow_dissector_ctrl_flags {
FLOW_DIS_IS_FRAGMENT = TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT,
FLOW_DIS_FIRST_FRAG = TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST,
FLOW_DIS_F_TUNNEL_CSUM = TCA_FLOWER_KEY_FLAGS_TUNNEL_CSUM,
FLOW_DIS_F_TUNNEL_DONT_FRAGMENT = TCA_FLOWER_KEY_FLAGS_TUNNEL_DONT_FRAGMENT,
FLOW_DIS_F_TUNNEL_OAM = TCA_FLOWER_KEY_FLAGS_TUNNEL_OAM,
FLOW_DIS_F_TUNNEL_CRIT_OPT = TCA_FLOWER_KEY_FLAGS_TUNNEL_CRIT_OPT,
/* These flags are internal to the kernel */
FLOW_DIS_ENCAPSULATION = (TCA_FLOWER_KEY_FLAGS_MAX << 1),
};
enum flow_dissect_ret {
FLOW_DISSECT_RET_OUT_GOOD,
FLOW_DISSECT_RET_OUT_BAD,
FLOW_DISSECT_RET_PROTO_AGAIN,
FLOW_DISSECT_RET_IPPROTO_AGAIN,
FLOW_DISSECT_RET_CONTINUE,
};
/**
* struct flow_dissector_key_basic:
* @n_proto: Network header protocol (eg. IPv4/IPv6)
* @ip_proto: Transport header protocol (eg. TCP/UDP)
* @padding: Unused
*/
struct flow_dissector_key_basic {
__be16 n_proto;
u8 ip_proto;
u8 padding;
};
struct flow_dissector_key_tags {
u32 flow_label;
};
struct flow_dissector_key_vlan {
union {
struct {
u16 vlan_id:12,
vlan_dei:1,
vlan_priority:3;
};
__be16 vlan_tci;
};
__be16 vlan_tpid;
__be16 vlan_eth_type;
u16 padding;
};
struct flow_dissector_mpls_lse {
u32 mpls_ttl:8,
mpls_bos:1,
mpls_tc:3,
mpls_label:20;
};
#define FLOW_DIS_MPLS_MAX 7
struct flow_dissector_key_mpls {
struct flow_dissector_mpls_lse ls[FLOW_DIS_MPLS_MAX]; /* Label Stack */
u8 used_lses; /* One bit set for each Label Stack Entry in use */
};
static inline void dissector_set_mpls_lse(struct flow_dissector_key_mpls *mpls,
int lse_index)
{
mpls->used_lses |= 1 << lse_index;
}
#define FLOW_DIS_TUN_OPTS_MAX 255
/**
* struct flow_dissector_key_enc_opts:
* @data: tunnel option data
* @len: length of tunnel option data
* @dst_opt_type: tunnel option type
*/
struct flow_dissector_key_enc_opts {
u8 data[FLOW_DIS_TUN_OPTS_MAX]; /* Using IP_TUNNEL_OPTS_MAX is desired
* here but seems difficult to #include
*/
u8 len;
Annotation
- Immediate include surface: `linux/types.h`, `linux/in6.h`, `linux/siphash.h`, `linux/string.h`, `uapi/linux/if_ether.h`, `uapi/linux/pkt_cls.h`.
- Detected declarations: `struct bpf_prog`, `struct net`, `struct sk_buff`, `struct flow_dissector_key_control`, `struct flow_dissector_key_basic`, `struct flow_dissector_key_tags`, `struct flow_dissector_key_vlan`, `struct flow_dissector_mpls_lse`, `struct flow_dissector_key_mpls`, `struct flow_dissector_key_enc_opts`.
- 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.