#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <linux/export.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/if_vlan.h>
#include <linux/filter.h>
#include <net/dsa.h>
#include <net/dst_metadata.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/gre.h>
#include <net/pptp.h>
#include <net/tipc.h>
#include <linux/igmp.h>
#include <linux/icmp.h>
#include <linux/sctp.h>
#include <linux/dccp.h>
#include <linux/if_tunnel.h>
#include <linux/if_pppox.h>
#include <linux/ppp_defs.h>
#include <linux/stddef.h>
#include <linux/if_ether.h>
#include <linux/if_hsr.h>
#include <linux/mpls.h>
#include <linux/tcp.h>
#include <linux/ptp_classify.h>
#include <net/flow_dissector.h>
#include <net/pkt_cls.h>
#include <scsi/fc/fc_fcoe.h>
#include <uapi/linux/batadv_packet.h>
#include <linux/bpf.h>
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
#include <net/netfilter/nf_conntrack_core.h>
#include <net/netfilter/nf_conntrack_labels.h>
#endif
#include <linux/bpf-netns.h>
static void dissector_set_key(struct flow_dissector *flow_dissector,
enum flow_dissector_key_id key_id)
{ … }
void skb_flow_dissector_init(struct flow_dissector *flow_dissector,
const struct flow_dissector_key *key,
unsigned int key_count)
{ … }
EXPORT_SYMBOL(…);
#ifdef CONFIG_BPF_SYSCALL
int flow_dissector_bpf_prog_attach_check(struct net *net,
struct bpf_prog *prog)
{ … }
#endif
__be32 __skb_flow_get_ports(const struct sk_buff *skb, int thoff, u8 ip_proto,
const void *data, int hlen)
{ … }
EXPORT_SYMBOL(…);
static bool icmp_has_id(u8 type)
{ … }
void skb_flow_get_icmp_tci(const struct sk_buff *skb,
struct flow_dissector_key_icmp *key_icmp,
const void *data, int thoff, int hlen)
{ … }
EXPORT_SYMBOL(…);
static void __skb_flow_dissect_icmp(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container, const void *data,
int thoff, int hlen)
{ … }
static void __skb_flow_dissect_ah(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container, const void *data,
int nhoff, int hlen)
{ … }
static void __skb_flow_dissect_esp(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container, const void *data,
int nhoff, int hlen)
{ … }
static void __skb_flow_dissect_l2tpv3(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container, const void *data,
int nhoff, int hlen)
{ … }
void skb_flow_dissect_meta(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container)
{ … }
EXPORT_SYMBOL(…);
static void
skb_flow_dissect_set_enc_control(enum flow_dissector_key_id type,
u32 ctrl_flags,
struct flow_dissector *flow_dissector,
void *target_container)
{ … }
void
skb_flow_dissect_ct(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container, u16 *ctinfo_map,
size_t mapsize, bool post_ct, u16 zone)
{ … }
EXPORT_SYMBOL(…);
void
skb_flow_dissect_tunnel_info(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container)
{ … }
EXPORT_SYMBOL(…);
void skb_flow_dissect_hash(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container)
{ … }
EXPORT_SYMBOL(…);
static enum flow_dissect_ret
__skb_flow_dissect_mpls(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container, const void *data, int nhoff,
int hlen, int lse_index, bool *entropy_label)
{ … }
static enum flow_dissect_ret
__skb_flow_dissect_arp(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container, const void *data,
int nhoff, int hlen)
{ … }
static enum flow_dissect_ret
__skb_flow_dissect_cfm(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container, const void *data,
int nhoff, int hlen)
{ … }
static enum flow_dissect_ret
__skb_flow_dissect_gre(const struct sk_buff *skb,
struct flow_dissector_key_control *key_control,
struct flow_dissector *flow_dissector,
void *target_container, const void *data,
__be16 *p_proto, int *p_nhoff, int *p_hlen,
unsigned int flags)
{ … }
static enum flow_dissect_ret
__skb_flow_dissect_batadv(const struct sk_buff *skb,
struct flow_dissector_key_control *key_control,
const void *data, __be16 *p_proto, int *p_nhoff,
int hlen, unsigned int flags)
{ … }
static void
__skb_flow_dissect_tcp(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container, const void *data,
int thoff, int hlen)
{ … }
static void
__skb_flow_dissect_ports(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container, const void *data,
int nhoff, u8 ip_proto, int hlen)
{ … }
static void
__skb_flow_dissect_ipv4(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container, const void *data,
const struct iphdr *iph)
{ … }
static void
__skb_flow_dissect_ipv6(const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container, const void *data,
const struct ipv6hdr *iph)
{ … }
#define MAX_FLOW_DISSECT_HDRS …
static bool skb_flow_dissect_allowed(int *num_hdrs)
{ … }
static void __skb_flow_bpf_to_target(const struct bpf_flow_keys *flow_keys,
struct flow_dissector *flow_dissector,
void *target_container)
{ … }
u32 bpf_flow_dissect(struct bpf_prog *prog, struct bpf_flow_dissector *ctx,
__be16 proto, int nhoff, int hlen, unsigned int flags)
{ … }
static bool is_pppoe_ses_hdr_valid(const struct pppoe_hdr *hdr)
{ … }
bool __skb_flow_dissect(const struct net *net,
const struct sk_buff *skb,
struct flow_dissector *flow_dissector,
void *target_container, const void *data,
__be16 proto, int nhoff, int hlen, unsigned int flags)
{ … }
EXPORT_SYMBOL(…);
static siphash_aligned_key_t hashrnd;
static __always_inline void __flow_hash_secret_init(void)
{ … }
static const void *flow_keys_hash_start(const struct flow_keys *flow)
{ … }
static inline size_t flow_keys_hash_length(const struct flow_keys *flow)
{ … }
__be32 flow_get_u32_src(const struct flow_keys *flow)
{ … }
EXPORT_SYMBOL(…);
__be32 flow_get_u32_dst(const struct flow_keys *flow)
{ … }
EXPORT_SYMBOL(…);
static inline void __flow_hash_consistentify(struct flow_keys *keys)
{ … }
static inline u32 __flow_hash_from_keys(struct flow_keys *keys,
const siphash_key_t *keyval)
{ … }
u32 flow_hash_from_keys(struct flow_keys *keys)
{ … }
EXPORT_SYMBOL(…);
u32 flow_hash_from_keys_seed(struct flow_keys *keys,
const siphash_key_t *keyval)
{ … }
EXPORT_SYMBOL(…);
static inline u32 ___skb_get_hash(const struct sk_buff *skb,
struct flow_keys *keys,
const siphash_key_t *keyval)
{ … }
struct _flow_keys_digest_data { … };
void make_flow_keys_digest(struct flow_keys_digest *digest,
const struct flow_keys *flow)
{ … }
EXPORT_SYMBOL(…);
static struct flow_dissector flow_keys_dissector_symmetric __read_mostly;
u32 __skb_get_hash_symmetric_net(const struct net *net, const struct sk_buff *skb)
{ … }
EXPORT_SYMBOL_GPL(…);
void __skb_get_hash_net(const struct net *net, struct sk_buff *skb)
{ … }
EXPORT_SYMBOL(…);
__u32 skb_get_hash_perturb(const struct sk_buff *skb,
const siphash_key_t *perturb)
{ … }
EXPORT_SYMBOL(…);
u32 __skb_get_poff(const struct sk_buff *skb, const void *data,
const struct flow_keys_basic *keys, int hlen)
{ … }
u32 skb_get_poff(const struct sk_buff *skb)
{ … }
__u32 __get_hash_from_flowi6(const struct flowi6 *fl6, struct flow_keys *keys)
{ … }
EXPORT_SYMBOL(…);
static const struct flow_dissector_key flow_keys_dissector_keys[] = …;
static const struct flow_dissector_key flow_keys_dissector_symmetric_keys[] = …;
static const struct flow_dissector_key flow_keys_basic_dissector_keys[] = …;
struct flow_dissector flow_keys_dissector __read_mostly;
EXPORT_SYMBOL(…);
struct flow_dissector flow_keys_basic_dissector __read_mostly;
EXPORT_SYMBOL(…);
static int __init init_default_flow_dissectors(void)
{ … }
core_initcall(init_default_flow_dissectors);