#include <linux/module.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/percpu.h>
#include <linux/rtnetlink.h>
#include <linux/skbuff.h>
#include <linux/bitmap.h>
#include <linux/netdevice.h>
#include <linux/hash.h>
#include <net/netlink.h>
#include <net/act_api.h>
#include <net/pkt_cls.h>
#include <linux/idr.h>
#include <net/tc_wrapper.h>
struct tc_u_knode { … };
struct tc_u_hnode { … };
struct tc_u_common { … };
static inline unsigned int u32_hash_fold(__be32 key,
const struct tc_u32_sel *sel,
u8 fshift)
{ … }
TC_INDIRECT_SCOPE int u32_classify(struct sk_buff *skb,
const struct tcf_proto *tp,
struct tcf_result *res)
{ … }
static struct tc_u_hnode *u32_lookup_ht(struct tc_u_common *tp_c, u32 handle)
{ … }
static struct tc_u_knode *u32_lookup_key(struct tc_u_hnode *ht, u32 handle)
{ … }
static void *u32_get(struct tcf_proto *tp, u32 handle)
{ … }
static u32 gen_new_htid(struct tc_u_common *tp_c, struct tc_u_hnode *ptr)
{ … }
static struct hlist_head *tc_u_common_hash;
#define U32_HASH_SHIFT …
#define U32_HASH_SIZE …
static void *tc_u_common_ptr(const struct tcf_proto *tp)
{ … }
static struct hlist_head *tc_u_hash(void *key)
{ … }
static struct tc_u_common *tc_u_common_find(void *key)
{ … }
static int u32_init(struct tcf_proto *tp)
{ … }
static void __u32_destroy_key(struct tc_u_knode *n)
{ … }
static void u32_destroy_key(struct tc_u_knode *n, bool free_pf)
{ … }
static void u32_delete_key_work(struct work_struct *work)
{ … }
static void u32_delete_key_freepf_work(struct work_struct *work)
{ … }
static int u32_delete_key(struct tcf_proto *tp, struct tc_u_knode *key)
{ … }
static void u32_clear_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
struct netlink_ext_ack *extack)
{ … }
static int u32_replace_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
u32 flags, struct netlink_ext_ack *extack)
{ … }
static void u32_remove_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
struct netlink_ext_ack *extack)
{ … }
static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
u32 flags, struct netlink_ext_ack *extack)
{ … }
static void u32_clear_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
struct netlink_ext_ack *extack)
{ … }
static int u32_destroy_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
struct netlink_ext_ack *extack)
{ … }
static void u32_destroy(struct tcf_proto *tp, bool rtnl_held,
struct netlink_ext_ack *extack)
{ … }
static int u32_delete(struct tcf_proto *tp, void *arg, bool *last,
bool rtnl_held, struct netlink_ext_ack *extack)
{ … }
static u32 gen_new_kid(struct tc_u_hnode *ht, u32 htid)
{ … }
static const struct nla_policy u32_policy[TCA_U32_MAX + 1] = …;
static void u32_unbind_filter(struct tcf_proto *tp, struct tc_u_knode *n,
struct nlattr **tb)
{ … }
static void u32_bind_filter(struct tcf_proto *tp, struct tc_u_knode *n,
unsigned long base, struct nlattr **tb)
{ … }
static int u32_set_parms(struct net *net, struct tcf_proto *tp,
struct tc_u_knode *n, struct nlattr **tb,
struct nlattr *est, u32 flags, u32 fl_flags,
struct netlink_ext_ack *extack)
{ … }
static void u32_replace_knode(struct tcf_proto *tp, struct tc_u_common *tp_c,
struct tc_u_knode *n)
{ … }
static struct tc_u_knode *u32_init_knode(struct net *net, struct tcf_proto *tp,
struct tc_u_knode *n)
{ … }
static int u32_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 void u32_walk(struct tcf_proto *tp, struct tcf_walker *arg,
bool rtnl_held)
{ … }
static int u32_reoffload_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
bool add, flow_setup_cb_t *cb, void *cb_priv,
struct netlink_ext_ack *extack)
{ … }
static int u32_reoffload_knode(struct tcf_proto *tp, struct tc_u_knode *n,
bool add, flow_setup_cb_t *cb, void *cb_priv,
struct netlink_ext_ack *extack)
{ … }
static int u32_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
void *cb_priv, struct netlink_ext_ack *extack)
{ … }
static void u32_bind_class(void *fh, u32 classid, unsigned long cl, void *q,
unsigned long base)
{ … }
static int u32_dump(struct net *net, struct tcf_proto *tp, void *fh,
struct sk_buff *skb, struct tcmsg *t, bool rtnl_held)
{ … }
static struct tcf_proto_ops cls_u32_ops __read_mostly = …;
MODULE_ALIAS_NET_CLS(…) …;
static int __init init_u32(void)
{ … }
static void __exit exit_u32(void)
{ … }
module_init(…) …
module_exit(…)
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;