summaryrefslogtreecommitdiffstats
path: root/include/netlink/route/rule.h
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2007-09-14 23:28:01 (GMT)
committerThomas Graf <tgraf@suug.ch>2007-09-14 23:28:01 (GMT)
commit44d362409d5469aed47d19e7908d19bd194493a4 (patch)
tree5d1e739a4566f3af796273e5c3f78ca53d234df6 /include/netlink/route/rule.h
downloadlibnl-44d362409d5469aed47d19e7908d19bd194493a4.zip
libnl-44d362409d5469aed47d19e7908d19bd194493a4.tar.gz
libnl-44d362409d5469aed47d19e7908d19bd194493a4.tar.bz2
Initial import
Diffstat (limited to 'include/netlink/route/rule.h')
-rw-r--r--include/netlink/route/rule.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/include/netlink/route/rule.h b/include/netlink/route/rule.h
new file mode 100644
index 0000000..d295b0d
--- /dev/null
+++ b/include/netlink/route/rule.h
@@ -0,0 +1,79 @@
+/*
+ * netlink/route/rule.h Rules
+ *
+ * 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 <tgraf@suug.ch>
+ */
+
+#ifndef NETLINK_RULE_H_
+#define NETLINK_RULE_H_
+
+#include <netlink/netlink.h>
+#include <netlink/cache.h>
+#include <netlink/addr.h>
+#include <netlink/route/route.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct rtnl_rule;
+
+/* General */
+extern struct rtnl_rule * rtnl_rule_alloc(void);
+extern void rtnl_rule_put(struct rtnl_rule *);
+
+extern struct nl_cache * rtnl_rule_alloc_cache(struct nl_handle *);
+extern struct nl_cache * rtnl_rule_alloc_cache_by_family(struct nl_handle *,
+ int);
+extern void rtnl_rule_dump(struct rtnl_rule *, FILE *, struct nl_dump_params *);
+
+extern struct nl_msg * rtnl_rule_build_add_request(struct rtnl_rule *, int);
+extern int rtnl_rule_add(struct nl_handle *, struct rtnl_rule *, int);
+extern struct nl_msg * rtnl_rule_build_delete_request(struct rtnl_rule *, int);
+extern int rtnl_rule_delete(struct nl_handle *, struct rtnl_rule *, int);
+
+
+/* attribute modification */
+extern void rtnl_rule_set_family(struct rtnl_rule *, int);
+extern int rtnl_rule_get_family(struct rtnl_rule *);
+extern void rtnl_rule_set_prio(struct rtnl_rule *, int);
+extern int rtnl_rule_get_prio(struct rtnl_rule *);
+#define rtnl_rule_set_fwmark(ptr, n) rtnl_rule_set_mark(ptr, n)
+extern void rtnl_rule_set_mark(struct rtnl_rule *, uint64_t);
+#define rtnl_rule_get_fwmark(ptr) rtnl_rule_get_mark(ptr)
+extern uint64_t rtnl_rule_get_mark(struct rtnl_rule *);
+extern void rtnl_rule_set_table(struct rtnl_rule *, int);
+extern int rtnl_rule_get_table(struct rtnl_rule *);
+extern void rtnl_rule_set_dsfield(struct rtnl_rule *, int);
+extern int rtnl_rule_get_dsfield(struct rtnl_rule *);
+extern int rtnl_rule_set_src(struct rtnl_rule *, struct nl_addr *);
+extern struct nl_addr * rtnl_rule_get_src(struct rtnl_rule *);
+extern int rtnl_rule_set_dst(struct rtnl_rule *, struct nl_addr *);
+extern struct nl_addr * rtnl_rule_get_dst(struct rtnl_rule *);
+extern void rtnl_rule_set_src_len(struct rtnl_rule *, int);
+extern int rtnl_rule_get_src_len(struct rtnl_rule *);
+extern void rtnl_rule_set_dst_len(struct rtnl_rule *, int);
+extern int rtnl_rule_get_dst_len(struct rtnl_rule *);
+
+extern void rtnl_rule_set_action(struct rtnl_rule *, int);
+extern int rtnl_rule_get_action(struct rtnl_rule *);
+
+extern int rtnl_rule_set_iif(struct rtnl_rule *, const char *);
+extern char * rtnl_rule_get_iif(struct rtnl_rule *);
+
+extern void rtnl_rule_set_classid(struct rtnl_rule *, uint32_t);
+extern uint32_t rtnl_rule_get_classid(struct rtnl_rule *);
+
+extern void rtnl_rule_set_realms(struct rtnl_rule *, realm_t);
+extern realm_t rtnl_rule_get_realms(struct rtnl_rule *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif