libnl  3.5.0
classifier.h
1 /*
2  * netlink/route/classifier.h Classifiers
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation version 2.1
7  * of the License.
8  *
9  * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch>
10  */
11 
12 #ifndef NETLINK_CLASSIFIER_H_
13 #define NETLINK_CLASSIFIER_H_
14 
15 #include <netlink/netlink.h>
16 #include <netlink/cache.h>
17 #include <netlink/route/tc.h>
18 #include <netlink/utils.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 extern struct rtnl_cls *rtnl_cls_alloc(void);
25 extern void rtnl_cls_put(struct rtnl_cls *);
26 
27 extern int rtnl_cls_alloc_cache(struct nl_sock *, int, uint32_t,
28  struct nl_cache **);
29 
30 extern void rtnl_cls_cache_set_tc_params(struct nl_cache *, int, uint32_t);
31 
32 extern int rtnl_cls_build_add_request(struct rtnl_cls *, int,
33  struct nl_msg **);
34 extern int rtnl_cls_add(struct nl_sock *, struct rtnl_cls *, int);
35 extern int rtnl_cls_change(struct nl_sock *, struct rtnl_cls *, int);
36 
37 extern int rtnl_cls_build_change_request(struct rtnl_cls *, int,
38  struct nl_msg **);
39 extern int rtnl_cls_build_delete_request(struct rtnl_cls *, int,
40  struct nl_msg **);
41 extern int rtnl_cls_delete(struct nl_sock *, struct rtnl_cls *,
42  int);
43 
44 extern void rtnl_cls_set_prio(struct rtnl_cls *, uint16_t);
45 extern uint16_t rtnl_cls_get_prio(struct rtnl_cls *);
46 
47 extern void rtnl_cls_set_protocol(struct rtnl_cls *, uint16_t);
48 extern uint16_t rtnl_cls_get_protocol(struct rtnl_cls *);
49 
50 #ifdef __cplusplus
51 }
52 #endif
53 
54 #endif
int rtnl_cls_change(struct nl_sock *, struct rtnl_cls *, int)
Change a classifier.
Definition: cls.c:227
int rtnl_cls_alloc_cache(struct nl_sock *, int, uint32_t, struct nl_cache **)
Allocate a cache and fill it with all configured classifiers.
Definition: cls.c:328
int rtnl_cls_add(struct nl_sock *, struct rtnl_cls *, int)
Add/Update classifier.
Definition: cls.c:185
int rtnl_cls_delete(struct nl_sock *, struct rtnl_cls *, int)
Delete classifier.
Definition: cls.c:296
int rtnl_cls_build_add_request(struct rtnl_cls *, int, struct nl_msg **)
Build a netlink message requesting the addition of a classifier.
Definition: cls.c:138
void rtnl_cls_cache_set_tc_params(struct nl_cache *, int, uint32_t)
Set interface index and parent handle for classifier cache.
Definition: cls.c:360
int rtnl_cls_build_delete_request(struct rtnl_cls *, int, struct nl_msg **)
Build netlink message requesting the deletion of a classifier.
Definition: cls.c:252
int rtnl_cls_build_change_request(struct rtnl_cls *, int, struct nl_msg **)
Build a netlink message to change classifier attributes.
Definition: cls.c:209