#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/list.h>
#include <linux/jhash.h>
#include <linux/random.h>
#include <linux/pkt_cls.h>
#include <linux/skbuff.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/ipv6.h>
#include <linux/if_vlan.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <net/inet_sock.h>
#include <net/pkt_cls.h>
#include <net/ip.h>
#include <net/route.h>
#include <net/flow_dissector.h>
#include <net/tc_wrapper.h>
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
#include <net/netfilter/nf_conntrack.h>
#endif
struct flow_head { … };
struct flow_filter { … };
static inline u32 addr_fold(void *addr)
{ … }
static u32 flow_get_src(const struct sk_buff *skb, const struct flow_keys *flow)
{ … }
static u32 flow_get_dst(const struct sk_buff *skb, const struct flow_keys *flow)
{ … }
static u32 flow_get_proto(const struct sk_buff *skb,
const struct flow_keys *flow)
{ … }
static u32 flow_get_proto_src(const struct sk_buff *skb,
const struct flow_keys *flow)
{ … }
static u32 flow_get_proto_dst(const struct sk_buff *skb,
const struct flow_keys *flow)
{ … }
static u32 flow_get_iif(const struct sk_buff *skb)
{ … }
static u32 flow_get_priority(const struct sk_buff *skb)
{ … }
static u32 flow_get_mark(const struct sk_buff *skb)
{ … }
static u32 flow_get_nfct(const struct sk_buff *skb)
{ … }
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
#define CTTUPLE(skb, member) …
#else
#define CTTUPLE …
#endif
static u32 flow_get_nfct_src(const struct sk_buff *skb,
const struct flow_keys *flow)
{ … }
static u32 flow_get_nfct_dst(const struct sk_buff *skb,
const struct flow_keys *flow)
{ … }
static u32 flow_get_nfct_proto_src(const struct sk_buff *skb,
const struct flow_keys *flow)
{ … }
static u32 flow_get_nfct_proto_dst(const struct sk_buff *skb,
const struct flow_keys *flow)
{ … }
static u32 flow_get_rtclassid(const struct sk_buff *skb)
{ … }
static u32 flow_get_skuid(const struct sk_buff *skb)
{ … }
static u32 flow_get_skgid(const struct sk_buff *skb)
{ … }
static u32 flow_get_vlan_tag(const struct sk_buff *skb)
{ … }
static u32 flow_get_rxhash(struct sk_buff *skb)
{ … }
static u32 flow_key_get(struct sk_buff *skb, int key, struct flow_keys *flow)
{ … }
#define FLOW_KEYS_NEEDED …
TC_INDIRECT_SCOPE int flow_classify(struct sk_buff *skb,
const struct tcf_proto *tp,
struct tcf_result *res)
{ … }
static void flow_perturbation(struct timer_list *t)
{ … }
static const struct nla_policy flow_policy[TCA_FLOW_MAX + 1] = …;
static void __flow_destroy_filter(struct flow_filter *f)
{ … }
static void flow_destroy_filter_work(struct work_struct *work)
{ … }
static int flow_change(struct net *net, struct sk_buff *in_skb,
struct tcf_proto *tp, unsigned long base,
u32 handle, struct nlattr **tca,
void **arg, u32 flags,
struct netlink_ext_ack *extack)
{ … }
static int flow_delete(struct tcf_proto *tp, void *arg, bool *last,
bool rtnl_held, struct netlink_ext_ack *extack)
{ … }
static int flow_init(struct tcf_proto *tp)
{ … }
static void flow_destroy(struct tcf_proto *tp, bool rtnl_held,
struct netlink_ext_ack *extack)
{ … }
static void *flow_get(struct tcf_proto *tp, u32 handle)
{ … }
static int flow_dump(struct net *net, struct tcf_proto *tp, void *fh,
struct sk_buff *skb, struct tcmsg *t, bool rtnl_held)
{ … }
static void flow_walk(struct tcf_proto *tp, struct tcf_walker *arg,
bool rtnl_held)
{ … }
static struct tcf_proto_ops cls_flow_ops __read_mostly = …;
MODULE_ALIAS_NET_CLS(…) …;
static int __init cls_flow_init(void)
{ … }
static void __exit cls_flow_exit(void)
{ … }
module_init(…) …;
module_exit(cls_flow_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;