[PATCH] fix linux/pkt_act.h inclusion

Cong Wang xiyou.wangcong at gmail.com
Mon Nov 11 18:17:49 EST 2013


We should copy and use the kernel header linux/tc_act/tc_mirred.h.

Signed-off-by: Cong Wang <xiyou.wangcong at gmail.com>
---
 include/Makefile.am                |  1 +
 include/linux/pkt_act.h            | 32 --------------------------------
 include/linux/tc_act/tc_mirred.h   | 27 +++++++++++++++++++++++++++
 include/netlink-private/types.h    |  6 ++++++
 include/netlink/route/act/mirred.h |  1 +
 include/netlink/route/action.h     |  1 -
 6 files changed, 35 insertions(+), 33 deletions(-)
 delete mode 100644 include/linux/pkt_act.h
 create mode 100644 include/linux/tc_act/tc_mirred.h

diff --git a/include/Makefile.am b/include/Makefile.am
index c6d3324..8cf5179 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -130,6 +130,7 @@ noinst_HEADERS = \
 	linux/netfilter/nfnetlink_queue.h \
 	linux/netlink.h \
 	linux/pkt_cls.h \
+	linux/tc_act/tc_mirred.h \
 	linux/pkt_sched.h \
 	linux/rtnetlink.h \
 	linux/snmp.h \
diff --git a/include/linux/pkt_act.h b/include/linux/pkt_act.h
deleted file mode 100644
index ba8c860..0000000
--- a/include/linux/pkt_act.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef __LINUX_PKT_ACT_H
-#define __LINUX_PKT_ACT_H
-
-#include <linux/types.h>
-#include <linux/pkt_cls.h>
-
-#define TCA_ACT_MIRRED 8
-#define TCA_EGRESS_REDIR 1  /* packet redirect to EGRESS*/
-#define TCA_EGRESS_MIRROR 2 /* mirror packet to EGRESS */
-#define TCA_INGRESS_REDIR 3  /* packet redirect to INGRESS*/
-#define TCA_INGRESS_MIRROR 4 /* mirror packet to INGRESS */
-
-struct tc_mirred {
-	tc_gen;
-	int                     eaction;   /* one of IN/EGRESS_MIRROR/REDIR */
-	__u32                   ifindex;  /* ifindex of egress port */
-};
-
-enum {
-	TCA_MIRRED_UNSPEC,
-	TCA_MIRRED_TM,
-	TCA_MIRRED_PARMS,
-	__TCA_MIRRED_MAX
-};
-#define TCA_MIRRED_MAX (__TCA_MIRRED_MAX - 1)
-
-struct rtnl_mirred
-{
-	struct tc_mirred m_parm;
-};
-
-#endif
diff --git a/include/linux/tc_act/tc_mirred.h b/include/linux/tc_act/tc_mirred.h
new file mode 100644
index 0000000..7561750
--- /dev/null
+++ b/include/linux/tc_act/tc_mirred.h
@@ -0,0 +1,27 @@
+#ifndef __LINUX_TC_MIR_H
+#define __LINUX_TC_MIR_H
+
+#include <linux/types.h>
+#include <linux/pkt_cls.h>
+
+#define TCA_ACT_MIRRED 8
+#define TCA_EGRESS_REDIR 1  /* packet redirect to EGRESS*/
+#define TCA_EGRESS_MIRROR 2 /* mirror packet to EGRESS */
+#define TCA_INGRESS_REDIR 3  /* packet redirect to INGRESS*/
+#define TCA_INGRESS_MIRROR 4 /* mirror packet to INGRESS */
+                                                                                
+struct tc_mirred {
+	tc_gen;
+	int                     eaction;   /* one of IN/EGRESS_MIRROR/REDIR */
+	__u32                   ifindex;  /* ifindex of egress port */
+};
+                                                                                
+enum {
+	TCA_MIRRED_UNSPEC,
+	TCA_MIRRED_TM,
+	TCA_MIRRED_PARMS,
+	__TCA_MIRRED_MAX
+};
+#define TCA_MIRRED_MAX (__TCA_MIRRED_MAX - 1)
+                                                                                
+#endif
diff --git a/include/netlink-private/types.h b/include/netlink-private/types.h
index 99fea27..4d997cd 100644
--- a/include/netlink-private/types.h
+++ b/include/netlink-private/types.h
@@ -21,6 +21,7 @@
 #include <netlink/idiag/idiagnl.h>
 #include <netlink/netfilter/ct.h>
 #include <netlink-private/route/tc-api.h>
+#include <linux/tc_act/tc_mirred.h>
 
 #define NL_SOCK_BUFSIZE_SET	(1<<0)
 #define NL_SOCK_PASSCRED	(1<<1)
@@ -514,6 +515,11 @@ struct rtnl_act
 	struct rtnl_act *	a_next;
 };
 
+struct rtnl_mirred
+{
+	struct tc_mirred m_parm;
+};
+
 struct rtnl_u32
 {
 	uint32_t		cu_divisor;
diff --git a/include/netlink/route/act/mirred.h b/include/netlink/route/act/mirred.h
index 20a777c..0f9adf1 100644
--- a/include/netlink/route/act/mirred.h
+++ b/include/netlink/route/act/mirred.h
@@ -15,6 +15,7 @@
 #include <netlink/netlink.h>
 #include <netlink/cache.h>
 #include <netlink/route/action.h>
+#include <linux/tc_act/tc_mirred.h>
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/include/netlink/route/action.h b/include/netlink/route/action.h
index 8e265ea..be52767 100644
--- a/include/netlink/route/action.h
+++ b/include/netlink/route/action.h
@@ -16,7 +16,6 @@
 #include <netlink/cache.h>
 #include <netlink/route/tc.h>
 #include <netlink/utils.h>
-#include <linux/pkt_act.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
1.7.11.7




More information about the libnl mailing list