net/openvswitch/flow.h
Source file repositories/reference/linux-study-clean/net/openvswitch/flow.h
File Facts
- System
- Linux kernel
- Corpus path
net/openvswitch/flow.h- Extension
.h- Size
- 8861 bytes
- Lines
- 299
- 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/cache.hlinux/kernel.hlinux/netlink.hlinux/openvswitch.hlinux/spinlock.hlinux/types.hlinux/rcupdate.hlinux/if_ether.hlinux/in6.hlinux/jiffies.hlinux/time.hlinux/cpumask.hnet/inet_ecn.hnet/ip_tunnels.hnet/dst_metadata.hnet/nsh.h
Detected Declarations
struct sk_buffstruct ovs_tunnel_infostruct vlan_headstruct ovs_key_nshstruct sw_flow_keystruct sw_flow_key_rangestruct sw_flow_maskstruct sw_flow_matchstruct sw_flow_idstruct sw_flow_actionsstruct sw_flow_statsstruct sw_flowstruct arp_eth_headerenum sw_flow_mac_protoenum ofp12_ipv6exthdr_flagsfunction sw_flow_key_is_ndfunction ovs_key_mac_protofunction __ovs_mac_header_lenfunction ovs_mac_header_lenfunction ovs_identifier_is_ufidfunction ovs_identifier_is_key
Annotated Snippet
struct ovs_tunnel_info {
struct metadata_dst *tun_dst;
};
struct vlan_head {
__be16 tpid; /* Vlan type. Generally 802.1q or 802.1ad.*/
__be16 tci; /* 0 if no VLAN, VLAN_CFI_MASK set otherwise. */
};
#define OVS_SW_FLOW_KEY_METADATA_SIZE \
(offsetof(struct sw_flow_key, recirc_id) + \
sizeof_field(struct sw_flow_key, recirc_id))
struct ovs_key_nsh {
struct ovs_nsh_key_base base;
__be32 context[NSH_MD1_CONTEXT_SIZE];
};
struct sw_flow_key {
u8 tun_opts[IP_TUNNEL_OPTS_MAX];
u8 tun_opts_len;
struct ip_tunnel_key tun_key; /* Encapsulating tunnel key. */
struct {
u32 priority; /* Packet QoS priority. */
u32 skb_mark; /* SKB mark. */
u16 in_port; /* Input switch port (or DP_MAX_PORTS). */
} __packed phy; /* Safe when right after 'tun_key'. */
u8 mac_proto; /* MAC layer protocol (e.g. Ethernet). */
u8 tun_proto; /* Protocol of encapsulating tunnel. */
u32 ovs_flow_hash; /* Datapath computed hash value. */
u32 recirc_id; /* Recirculation ID. */
struct {
u8 src[ETH_ALEN]; /* Ethernet source address. */
u8 dst[ETH_ALEN]; /* Ethernet destination address. */
struct vlan_head vlan;
struct vlan_head cvlan;
__be16 type; /* Ethernet frame type. */
} eth;
/* Filling a hole of two bytes. */
u8 ct_state;
u8 ct_orig_proto; /* CT original direction tuple IP
* protocol.
*/
union {
struct {
u8 proto; /* IP protocol or lower 8 bits of ARP opcode. */
u8 tos; /* IP ToS. */
u8 ttl; /* IP TTL/hop limit. */
u8 frag; /* One of OVS_FRAG_TYPE_*. */
} ip;
};
u16 ct_zone; /* Conntrack zone. */
struct {
__be16 src; /* TCP/UDP/SCTP source port. */
__be16 dst; /* TCP/UDP/SCTP destination port. */
__be16 flags; /* TCP flags. */
} tp;
union {
struct {
struct {
__be32 src; /* IP source address. */
__be32 dst; /* IP destination address. */
} addr;
union {
struct {
__be32 src;
__be32 dst;
} ct_orig; /* Conntrack original direction fields. */
struct {
u8 sha[ETH_ALEN]; /* ARP source hardware address. */
u8 tha[ETH_ALEN]; /* ARP target hardware address. */
} arp;
};
} ipv4;
struct {
struct {
struct in6_addr src; /* IPv6 source address. */
struct in6_addr dst; /* IPv6 destination address. */
} addr;
__be32 label; /* IPv6 flow label. */
u16 exthdrs; /* IPv6 extension header flags */
union {
struct {
struct in6_addr src;
struct in6_addr dst;
} ct_orig; /* Conntrack original direction fields. */
struct {
struct in6_addr target; /* ND target address. */
u8 sll[ETH_ALEN]; /* ND source link layer address. */
u8 tll[ETH_ALEN]; /* ND target link layer address. */
Annotation
- Immediate include surface: `linux/cache.h`, `linux/kernel.h`, `linux/netlink.h`, `linux/openvswitch.h`, `linux/spinlock.h`, `linux/types.h`, `linux/rcupdate.h`, `linux/if_ether.h`.
- Detected declarations: `struct sk_buff`, `struct ovs_tunnel_info`, `struct vlan_head`, `struct ovs_key_nsh`, `struct sw_flow_key`, `struct sw_flow_key_range`, `struct sw_flow_mask`, `struct sw_flow_match`, `struct sw_flow_id`, `struct sw_flow_actions`.
- 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.