summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorCong Wang <xiyou.wangcong@gmail.com>2013-11-08 18:47:49 (GMT)
committerThomas Graf <tgraf@suug.ch>2013-11-09 00:12:45 (GMT)
commitd6cfd04799d69e9c8eea6c5823007bf626c4b90c (patch)
tree4085a84d0176d15ed0a22a97810d60a4be4dc5d2 /include
parent4f075a4fd1a1d6cbbe81f02f25063a8197fef746 (diff)
downloadlibnl-d6cfd04799d69e9c8eea6c5823007bf626c4b90c.zip
libnl-d6cfd04799d69e9c8eea6c5823007bf626c4b90c.tar.gz
libnl-d6cfd04799d69e9c8eea6c5823007bf626c4b90c.tar.bz2
add initial tc action support
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am1
-rw-r--r--include/netlink-private/types.h6
-rw-r--r--include/netlink/route/action.h48
-rw-r--r--include/netlink/route/tc.h1
4 files changed, 56 insertions, 0 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index eb61484..d39998c 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -31,6 +31,7 @@ nobase_libnlinclude_HEADERS = \
netlink/netlink-kernel.h \
netlink/netlink.h \
netlink/object.h \
+ netlink/route/action.h \
netlink/route/cls/ematch/cmp.h \
netlink/route/cls/ematch/meta.h \
netlink/route/cls/ematch/nbyte.h \
diff --git a/include/netlink-private/types.h b/include/netlink-private/types.h
index 3635e0f..6d38c1a 100644
--- a/include/netlink-private/types.h
+++ b/include/netlink-private/types.h
@@ -508,6 +508,12 @@ struct rtnl_cls
uint16_t c_protocol;
};
+struct rtnl_act
+{
+ NL_TC_GENERIC(c);
+ struct rtnl_act * a_next;
+};
+
struct rtnl_u32
{
uint32_t cu_divisor;
diff --git a/include/netlink/route/action.h b/include/netlink/route/action.h
new file mode 100644
index 0000000..be52767
--- /dev/null
+++ b/include/netlink/route/action.h
@@ -0,0 +1,48 @@
+/*
+ * netlink/route/action.h Actions
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation version 2.1
+ * of the License.
+ *
+ * Copyright (c) 2013 Cong Wang <xiyou.wangcong@gmail.com>
+ */
+
+#ifndef NETLINK_ACTION_H_
+#define NETLINK_ACTION_H_
+
+#include <netlink/netlink.h>
+#include <netlink/cache.h>
+#include <netlink/route/tc.h>
+#include <netlink/utils.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct rtnl_act *rtnl_act_alloc(void);
+extern void rtnl_act_put(struct rtnl_act *);
+
+extern int rtnl_act_alloc_cache(struct nl_sock *, int, uint32_t,
+ struct nl_cache **);
+
+extern int rtnl_act_build_add_request(struct rtnl_act *, int,
+ struct nl_msg **);
+extern int rtnl_act_add(struct nl_sock *, struct rtnl_act *, int);
+
+extern int rtnl_act_build_change_request(struct rtnl_act *, int,
+ struct nl_msg **);
+extern int rtnl_act_build_delete_request(struct rtnl_act *, int,
+ struct nl_msg **);
+extern int rtnl_act_delete(struct nl_sock *, struct rtnl_act *,
+ int);
+extern int rtnl_act_append(struct rtnl_act **, struct rtnl_act *);
+extern int rtnl_act_fill(struct nl_msg *, int, struct rtnl_act *);
+extern void rtnl_act_put_all(struct rtnl_act **);
+extern int rtnl_act_parse(struct rtnl_act **, struct nlattr *);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/netlink/route/tc.h b/include/netlink/route/tc.h
index 836f7b1..870c1f2 100644
--- a/include/netlink/route/tc.h
+++ b/include/netlink/route/tc.h
@@ -27,6 +27,7 @@ enum rtnl_tc_type {
RTNL_TC_TYPE_QDISC,
RTNL_TC_TYPE_CLASS,
RTNL_TC_TYPE_CLS,
+ RTNL_TC_TYPE_ACT,
__RTNL_TC_TYPE_MAX,
};