include/net/pfcp.h
Source file repositories/reference/linux-study-clean/include/net/pfcp.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/pfcp.h- Extension
.h- Size
- 1960 bytes
- Lines
- 91
- 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
uapi/linux/if_ether.hnet/dst_metadata.hlinux/netdevice.huapi/linux/ipv6.hnet/udp_tunnel.huapi/linux/udp.huapi/linux/ip.hlinux/string.hlinux/types.hlinux/bits.h
Detected Declarations
struct pfcphdrstruct pfcphdr_nodestruct pfcphdr_sessionstruct pfcp_metadatafunction netif_is_pfcp
Annotated Snippet
struct pfcphdr {
u8 flags;
u8 message_type;
__be16 message_length;
};
/* PFCP header flags */
#define PFCP_SEID_FLAG BIT(0)
#define PFCP_MP_FLAG BIT(1)
#define PFCP_VERSION_MASK GENMASK(4, 0)
#define PFCP_HLEN (sizeof(struct udphdr) + sizeof(struct pfcphdr))
/* PFCP node related messages */
struct pfcphdr_node {
u8 seq_number[3];
u8 reserved;
};
/* PFCP session related messages */
struct pfcphdr_session {
__be64 seid;
u8 seq_number[3];
#ifdef __LITTLE_ENDIAN_BITFIELD
u8 message_priority:4,
reserved:4;
#elif defined(__BIG_ENDIAN_BITFIELD)
u8 reserved:4,
message_priority:4;
#else
#error "Please fix <asm/byteorder>"
#endif
};
struct pfcp_metadata {
u8 type;
__be64 seid;
} __packed;
enum {
PFCP_TYPE_NODE = 0,
PFCP_TYPE_SESSION = 1,
};
#define PFCP_HEADROOM (sizeof(struct iphdr) + sizeof(struct udphdr) + \
sizeof(struct pfcphdr) + sizeof(struct ethhdr))
#define PFCP6_HEADROOM (sizeof(struct ipv6hdr) + sizeof(struct udphdr) + \
sizeof(struct pfcphdr) + sizeof(struct ethhdr))
static inline struct pfcphdr *pfcp_hdr(struct sk_buff *skb)
{
return (struct pfcphdr *)(udp_hdr(skb) + 1);
}
static inline struct pfcphdr_node *pfcp_hdr_node(struct sk_buff *skb)
{
return (struct pfcphdr_node *)(pfcp_hdr(skb) + 1);
}
static inline struct pfcphdr_session *pfcp_hdr_session(struct sk_buff *skb)
{
return (struct pfcphdr_session *)(pfcp_hdr(skb) + 1);
}
static inline bool netif_is_pfcp(const struct net_device *dev)
{
return dev->rtnl_link_ops &&
!strcmp(dev->rtnl_link_ops->kind, "pfcp");
}
#endif
Annotation
- Immediate include surface: `uapi/linux/if_ether.h`, `net/dst_metadata.h`, `linux/netdevice.h`, `uapi/linux/ipv6.h`, `net/udp_tunnel.h`, `uapi/linux/udp.h`, `uapi/linux/ip.h`, `linux/string.h`.
- Detected declarations: `struct pfcphdr`, `struct pfcphdr_node`, `struct pfcphdr_session`, `struct pfcp_metadata`, `function netif_is_pfcp`.
- 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.