libnl 1.1.4
class.h
1/*
2 * netlink/route/class.h Classes
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-2006 Thomas Graf <tgraf@suug.ch>
10 */
11
12#ifndef NETLINK_CLASS_H_
13#define NETLINK_CLASS_H_
14
15#include <netlink/netlink.h>
16#include <netlink/route/tc.h>
17#include <netlink/route/qdisc.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23struct rtnl_class;
24
25extern struct nl_object_ops class_obj_ops;
26
27/* General */
28extern struct rtnl_class * rtnl_class_alloc(void);
29extern void rtnl_class_put(struct rtnl_class *);
30extern struct nl_cache * rtnl_class_alloc_cache(struct nl_handle *, int);
31
32/* leaf qdisc access */
33extern struct rtnl_qdisc * rtnl_class_leaf_qdisc(struct rtnl_class *,
34 struct nl_cache *);
35
36/* class addition */
37extern struct nl_msg * rtnl_class_build_add_request(struct rtnl_class *, int);
38extern int rtnl_class_add(struct nl_handle *, struct rtnl_class *, int);
39
40/* attribute modification */
41extern void rtnl_class_set_ifindex(struct rtnl_class *, int);
42extern int rtnl_class_get_ifindex(struct rtnl_class *);
43extern void rtnl_class_set_handle(struct rtnl_class *, uint32_t);
44extern uint32_t rtnl_class_get_handle(struct rtnl_class *);
45extern void rtnl_class_set_parent(struct rtnl_class *, uint32_t);
46extern uint32_t rtnl_class_get_parent(struct rtnl_class *);
47extern void rtnl_class_set_kind(struct rtnl_class *, const char *);
48extern char * rtnl_class_get_kind(struct rtnl_class *);
49extern uint64_t rtnl_class_get_stat(struct rtnl_class *,
50 enum rtnl_tc_stats_id);
51
52/* iterators */
53extern void rtnl_class_foreach_child(struct rtnl_class *,
54 struct nl_cache *,
55 void (*cb)(struct nl_object *,
56 void *),
57 void *);
58extern void rtnl_class_foreach_cls(struct rtnl_class *,
59 struct nl_cache *,
60 void (*cb)(struct nl_object *,
61 void *),
62 void *);
63
64#ifdef __cplusplus
65}
66#endif
67
68#endif
struct rtnl_qdisc * rtnl_class_leaf_qdisc(struct rtnl_class *, struct nl_cache *)
Lookup the leaf qdisc of a class.
Definition: class_obj.c:145
void rtnl_class_foreach_cls(struct rtnl_class *, struct nl_cache *, void(*cb)(struct nl_object *, void *), void *)
Call a callback for each classifier attached to the class.
Definition: class_obj.c:202
void rtnl_class_foreach_child(struct rtnl_class *, struct nl_cache *, void(*cb)(struct nl_object *, void *), void *)
Call a callback for each child of a class.
Definition: class_obj.c:177
struct nl_cache * rtnl_class_alloc_cache(struct nl_handle *, int)
Build a class cache including all classes attached to the specified interface.
Definition: class.c:184
int rtnl_class_add(struct nl_handle *, struct rtnl_class *, int)
Add a new class.
Definition: class.c:148
struct nl_msg * rtnl_class_build_add_request(struct rtnl_class *, int)
Build a netlink message to add a new class.
Definition: class.c:128
rtnl_tc_stats_id
TC statistics identifiers.
Definition: tc.h:27
Object Operations.
Definition: object-api.h:255