diff options
Diffstat (limited to 'include/netlink/route/cls')
-rw-r--r-- | include/netlink/route/cls/basic.h | 33 | ||||
-rw-r--r-- | include/netlink/route/cls/cgroup.h | 31 | ||||
-rw-r--r-- | include/netlink/route/cls/ematch.h | 73 | ||||
-rw-r--r-- | include/netlink/route/cls/ematch/cmp.h | 31 |
4 files changed, 168 insertions, 0 deletions
diff --git a/include/netlink/route/cls/basic.h b/include/netlink/route/cls/basic.h new file mode 100644 index 00000000..7003124e --- /dev/null +++ b/include/netlink/route/cls/basic.h @@ -0,0 +1,33 @@ +/* + * netlink/route/cls/basic.h Basic 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) 2008-2009 Thomas Graf <tgraf@suug.ch> + */ + +#ifndef NETLINK_BASIC_H_ +#define NETLINK_BASIC_H_ + +#include <netlink/netlink.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern struct rtnl_cls_ops *rtnl_basic_get_ops(void); +extern int rtnl_basic_set_classid(struct rtnl_cls *, uint32_t); +extern uint32_t rtnl_basic_get_classid(struct rtnl_cls *); +extern int rtnl_basic_set_ematch(struct rtnl_cls *, + struct rtnl_ematch_tree *); +extern struct rtnl_ematch_tree * + rtnl_basic_get_ematch(struct rtnl_cls *); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/netlink/route/cls/cgroup.h b/include/netlink/route/cls/cgroup.h new file mode 100644 index 00000000..7b0e3d3a --- /dev/null +++ b/include/netlink/route/cls/cgroup.h @@ -0,0 +1,31 @@ +/* + * netlink/route/cls/cgroup.h Control Groups 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) 2009 Thomas Graf <tgraf@suug.ch> + */ + +#ifndef NETLINK_CLS_CGROUP_H_ +#define NETLINK_CLS_CGROUP_H_ + +#include <netlink/netlink.h> +#include <netlink/cache.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern int rtnl_cgroup_set_ematch(struct rtnl_cls *, + struct rtnl_ematch_tree *); +extern struct rtnl_ematch_tree * + rtnl_cgroup_get_ematch(struct rtnl_cls *); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/netlink/route/cls/ematch.h b/include/netlink/route/cls/ematch.h new file mode 100644 index 00000000..c4292bfa --- /dev/null +++ b/include/netlink/route/cls/ematch.h @@ -0,0 +1,73 @@ +/* + * netlink/route/cls/ematch.h Extended Matches + * + * 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) 2008 Thomas Graf <tgraf@suug.ch> + */ + +#ifndef NETLINK_CLS_EMATCH_H_ +#define NETLINK_CLS_EMATCH_H_ + +#include <netlink/netlink.h> +#include <netlink/route/classifier.h> +#include <linux/pkt_cls.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct rtnl_ematch; +struct rtnl_ematch_tree; + +struct rtnl_ematch_ops +{ + int eo_kind; + const char * eo_name; + size_t eo_datalen; + + int (*eo_parse)(struct rtnl_ematch *, + void *, size_t); + void (*eo_dump)(struct rtnl_ematch *, + struct nl_dump_params *); + struct nl_list_head eo_list; +}; + +extern int rtnl_ematch_register(struct rtnl_ematch_ops *); +extern int rtnl_ematch_unregister(struct rtnl_ematch_ops *); + +extern struct rtnl_ematch_ops * + rtnl_ematch_lookup_ops(int); +extern struct rtnl_ematch_ops * + rtnl_ematch_lookup_ops_name(const char *); + +extern struct rtnl_ematch * + rtnl_ematch_alloc(struct rtnl_ematch_ops *); +extern void rtnl_ematch_add_child(struct rtnl_ematch *, + struct rtnl_ematch *); +extern void rtnl_ematch_unlink(struct rtnl_ematch *); +extern void rtnl_ematch_free(struct rtnl_ematch *); + +extern void * rtnl_ematch_data(struct rtnl_ematch *); +extern void rtnl_ematch_set_flags(struct rtnl_ematch *, uint16_t); +extern void rtnl_ematch_unset_flags(struct rtnl_ematch *, uint16_t); +extern uint16_t rtnl_ematch_get_flags(struct rtnl_ematch *); + +extern struct rtnl_ematch_tree * + rtnl_ematch_tree_alloc(uint16_t); +extern void rtnl_ematch_tree_free(struct rtnl_ematch_tree *); + +extern int rtnl_ematch_parse(struct nlattr *, struct rtnl_ematch_tree **); +extern void rtnl_ematch_tree_add_tail(struct rtnl_ematch_tree *, + struct rtnl_ematch *); +extern void rtnl_ematch_tree_dump(struct rtnl_ematch_tree *, + struct nl_dump_params *); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/netlink/route/cls/ematch/cmp.h b/include/netlink/route/cls/ematch/cmp.h new file mode 100644 index 00000000..b4ad03a5 --- /dev/null +++ b/include/netlink/route/cls/ematch/cmp.h @@ -0,0 +1,31 @@ +/* + * netlink/route/cls/ematch/cmp.h Simple Comparison + * + * 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) 2008 Thomas Graf <tgraf@suug.ch> + */ + +#ifndef NETLINK_CLS_EMATCH_CMP_H_ +#define NETLINK_CLS_EMATCH_CMP_H_ + +#include <netlink/netlink.h> +#include <netlink/route/cls/ematch.h> + +#ifdef __cplusplus +extern "C" { +#endif + +extern void rtnl_ematch_cmp_set(struct rtnl_ematch *, + struct tcf_em_cmp *); +extern struct tcf_em_cmp * + rtnl_ematch_cmp_get(struct rtnl_ematch *); + +#ifdef __cplusplus +} +#endif + +#endif |