aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/net/sch_generic.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2018-07-23 09:23:07 +0200
committerDavid S. Miller <davem@davemloft.net>2018-07-23 20:44:12 -0700
commit9f407f1768d3e1a5ddd7bd49fa4d1f5a26e10ed2 (patch)
treead23d347b78709aa4cfa1af62a9046dd760d32ec /include/net/sch_generic.h
parentnet: sched: introduce chain object to uapi (diff)
downloadwireguard-linux-9f407f1768d3e1a5ddd7bd49fa4d1f5a26e10ed2.tar.xz
wireguard-linux-9f407f1768d3e1a5ddd7bd49fa4d1f5a26e10ed2.zip
net: sched: introduce chain templates
Allow user to set a template for newly created chains. Template lock down the chain for particular classifier type/options combinations. The classifier needs to support templates, otherwise kernel would reply with error. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r--include/net/sch_generic.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 81ec8276db9c..085c509c8674 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -238,6 +238,8 @@ struct tcf_result {
};
};
+struct tcf_chain;
+
struct tcf_proto_ops {
struct list_head head;
char kind[IFNAMSIZ];
@@ -263,10 +265,18 @@ struct tcf_proto_ops {
tc_setup_cb_t *cb, void *cb_priv,
struct netlink_ext_ack *extack);
void (*bind_class)(void *, u32, unsigned long);
+ void * (*tmplt_create)(struct net *net,
+ struct tcf_chain *chain,
+ struct nlattr **tca,
+ struct netlink_ext_ack *extack);
+ void (*tmplt_destroy)(void *tmplt_priv);
/* rtnetlink specific */
int (*dump)(struct net*, struct tcf_proto*, void *,
struct sk_buff *skb, struct tcmsg*);
+ int (*tmplt_dump)(struct sk_buff *skb,
+ struct net *net,
+ void *tmplt_priv);
struct module *owner;
};
@@ -305,6 +315,8 @@ struct tcf_chain {
u32 index; /* chain index */
unsigned int refcnt;
bool explicitly_created;
+ const struct tcf_proto_ops *tmplt_ops;
+ void *tmplt_priv;
};
struct tcf_block {