summaryrefslogtreecommitdiff
path: root/lib/tc.h
diff options
context:
space:
mode:
authorPaul Blakey <paulb@mellanox.com>2017-06-13 18:03:24 +0300
committerSimon Horman <simon.horman@netronome.com>2017-06-14 10:02:04 +0200
commitc1c5c7234060bde0591745dda8227f1f71af5884 (patch)
treeb5bc788ea604a49e439d2ff99d432862b997b85e /lib/tc.h
parent7874bdff0d14a4dae18a7922b92fcca80e2c88bd (diff)
downloadopenvswitch-c1c5c7234060bde0591745dda8227f1f71af5884.tar.gz
tc: Introduce tc module
Add tc module to expose tc operations to be used by other modules. Move some tc related functions from netdev-linux.c to tc.c This patch doesn't change any functionality. Signed-off-by: Paul Blakey <paulb@mellanox.com> Co-authored-by: Roi Dayan <roid@mellanox.com> Signed-off-by: Roi Dayan <roid@mellanox.com> Acked-by: Joe Stringer <joe@ovn.org> Acked-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Simon Horman <simon.horman@netronome.com>
Diffstat (limited to 'lib/tc.h')
-rw-r--r--lib/tc.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/tc.h b/lib/tc.h
new file mode 100644
index 000000000..420cdf805
--- /dev/null
+++ b/lib/tc.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TC_H
+#define TC_H 1
+
+#include <linux/pkt_cls.h>
+#include <linux/pkt_sched.h>
+#include <linux/rtnetlink.h>
+#include "openvswitch/ofpbuf.h"
+
+unsigned int tc_make_handle(unsigned int major, unsigned int minor);
+unsigned int tc_get_major(unsigned int handle);
+unsigned int tc_get_minor(unsigned int handle);
+struct tcmsg *tc_make_request(int ifindex, int type,
+ unsigned int flags, struct ofpbuf *);
+int tc_transact(struct ofpbuf *request, struct ofpbuf **replyp);
+int tc_add_del_ingress_qdisc(int ifindex, bool add);
+
+#endif /* tc.h */