~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/net/pfcp.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _PFCP_H_
  3 #define _PFCP_H_
  4 
  5 #include <uapi/linux/if_ether.h>
  6 #include <net/dst_metadata.h>
  7 #include <linux/netdevice.h>
  8 #include <uapi/linux/ipv6.h>
  9 #include <net/udp_tunnel.h>
 10 #include <uapi/linux/udp.h>
 11 #include <uapi/linux/ip.h>
 12 #include <linux/string.h>
 13 #include <linux/types.h>
 14 #include <linux/bits.h>
 15 
 16 #define PFCP_PORT 8805
 17 
 18 /* PFCP protocol header */
 19 struct pfcphdr {
 20         u8      flags;
 21         u8      message_type;
 22         __be16  message_length;
 23 };
 24 
 25 /* PFCP header flags */
 26 #define PFCP_SEID_FLAG          BIT(0)
 27 #define PFCP_MP_FLAG            BIT(1)
 28 
 29 #define PFCP_VERSION_MASK       GENMASK(4, 0)
 30 
 31 #define PFCP_HLEN (sizeof(struct udphdr) + sizeof(struct pfcphdr))
 32 
 33 /* PFCP node related messages */
 34 struct pfcphdr_node {
 35         u8      seq_number[3];
 36         u8      reserved;
 37 };
 38 
 39 /* PFCP session related messages */
 40 struct pfcphdr_session {
 41         __be64  seid;
 42         u8      seq_number[3];
 43 #ifdef __LITTLE_ENDIAN_BITFIELD
 44         u8      message_priority:4,
 45                 reserved:4;
 46 #elif defined(__BIG_ENDIAN_BITFIELD)
 47         u8      reserved:4,
 48                 message_priprity:4;
 49 #else
 50 #error "Please fix <asm/byteorder>"
 51 #endif
 52 };
 53 
 54 struct pfcp_metadata {
 55         u8 type;
 56         __be64 seid;
 57 } __packed;
 58 
 59 enum {
 60         PFCP_TYPE_NODE          = 0,
 61         PFCP_TYPE_SESSION       = 1,
 62 };
 63 
 64 #define PFCP_HEADROOM (sizeof(struct iphdr) + sizeof(struct udphdr) + \
 65                        sizeof(struct pfcphdr) + sizeof(struct ethhdr))
 66 #define PFCP6_HEADROOM (sizeof(struct ipv6hdr) + sizeof(struct udphdr) + \
 67                         sizeof(struct pfcphdr) + sizeof(struct ethhdr))
 68 
 69 static inline struct pfcphdr *pfcp_hdr(struct sk_buff *skb)
 70 {
 71         return (struct pfcphdr *)(udp_hdr(skb) + 1);
 72 }
 73 
 74 static inline struct pfcphdr_node *pfcp_hdr_node(struct sk_buff *skb)
 75 {
 76         return (struct pfcphdr_node *)(pfcp_hdr(skb) + 1);
 77 }
 78 
 79 static inline struct pfcphdr_session *pfcp_hdr_session(struct sk_buff *skb)
 80 {
 81         return (struct pfcphdr_session *)(pfcp_hdr(skb) + 1);
 82 }
 83 
 84 static inline bool netif_is_pfcp(const struct net_device *dev)
 85 {
 86         return dev->rtnl_link_ops &&
 87                !strcmp(dev->rtnl_link_ops->kind, "pfcp");
 88 }
 89 
 90 #endif
 91 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php