Skip to contentSkip to conversation

Add tcindex classifier

PATCH New Rui T. Matos 1 participant 1 message Apr 22, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/1 Add tcindex classifier

In reply to a message not in the archive

From: Rui Tiago Cação Matos <[email protected]>

---
 include/netlink-types.h             |   10 ++
 include/netlink/route/cls/tcindex.h |   33 ++++
 lib/route/cls/tcindex.c             |  305 +++++++++++++++++++++++++++++++++++
 3 files changed, 348 insertions(+), 0 deletions(-)
 create mode 100644 include/netlink/route/cls/tcindex.h
 create mode 100644 lib/route/cls/tcindex.c
include/netlink-types.h +10 -0
index a690cb2..821108f 100644
@@ -518,6 +518,16 @@ struct rtnl_fw
 	int			cf_mask;
 };
 
+struct rtnl_tcindex
+{
+        uint32_t                ci_hash;
+        uint16_t                ci_filter_mask;
+        uint32_t                ci_shift;
+        uint32_t                ci_fall_through;
+        uint32_t                ci_classid;
+        int                     ci_mask;
+};
+
 struct rtnl_dsmark_qdisc
 {
 	uint16_t	qdm_indices;
include/netlink/route/cls/tcindex.h new file +33 -0
new file mode 100644
index 0000000..cba6059
@@ -0,0 +1,33 @@
+/*
+ * netlink/route/cls/tcindex.h	tcindex classifier
+ *
+ *	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) 2003-2006 Thomas Graf <[email protected]>
+ * Copyright (c) 2008 Rui Matos <[email protected]>
+ */
+
+#ifndef NETLINK_TCINDEX_H_
+#define NETLINK_TCINDEX_H_
+
+#include <netlink/netlink.h>
+#include <netlink/cache.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int rtnl_tcindex_set_hash                (struct rtnl_cls *, uint32_t);
+extern int rtnl_tcindex_set_mask                (struct rtnl_cls *, uint16_t);
+extern int rtnl_tcindex_set_shift               (struct rtnl_cls *, uint32_t);
+extern int rtnl_tcindex_set_fall_through        (struct rtnl_cls *, uint32_t);
+extern int rtnl_tcindex_set_classid             (struct rtnl_cls *, uint32_t);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
lib/route/cls/tcindex.c new file +305 -0

305 lines not on this page · raw message

Signature · 1 line
1.5.4.1