libnl 3.7.0
class.h
1/* SPDX-License-Identifier: LGPL-2.1-only */
2/*
3 * Copyright (c) 2003-2011 Thomas Graf <tgraf@suug.ch>
4 */
5
6#ifndef NETLINK_CLASS_H_
7#define NETLINK_CLASS_H_
8
9#include <netlink/netlink.h>
10#include <netlink/route/tc.h>
11#include <netlink/route/qdisc.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17struct rtnl_class;
18
19extern struct rtnl_class *
20 rtnl_class_alloc(void);
21extern void rtnl_class_put(struct rtnl_class *);
22
23extern int rtnl_class_alloc_cache(struct nl_sock *, int,
24 struct nl_cache **);
25extern struct rtnl_class *
26 rtnl_class_get(struct nl_cache *, int, uint32_t);
27
28extern struct rtnl_class *
29 rtnl_class_get_by_parent(struct nl_cache *, int, uint32_t);
30
31extern struct rtnl_qdisc *
32 rtnl_class_leaf_qdisc(struct rtnl_class *,
33 struct nl_cache *);
34
35extern int rtnl_class_build_add_request(struct rtnl_class *, int,
36 struct nl_msg **);
37extern int rtnl_class_add(struct nl_sock *, struct rtnl_class *,
38 int);
39
40extern int rtnl_class_build_delete_request(struct rtnl_class *,
41 struct nl_msg **);
42extern int rtnl_class_delete(struct nl_sock *,
43 struct rtnl_class *);
44
45/* deprecated functions */
46extern void rtnl_class_foreach_child(struct rtnl_class *,
47 struct nl_cache *,
48 void (*cb)(struct nl_object *,
49 void *),
50 void *)
51 __attribute__((deprecated));
52extern void rtnl_class_foreach_cls(struct rtnl_class *,
53 struct nl_cache *,
54 void (*cb)(struct nl_object *,
55 void *),
56 void *)
57 __attribute__((deprecated));
58
59#ifdef __cplusplus
60}
61#endif
62
63#endif
struct rtnl_qdisc * rtnl_class_leaf_qdisc(struct rtnl_class *, struct nl_cache *)
Lookup the leaf qdisc of a traffic class.
Definition: class.c:271
int rtnl_class_add(struct nl_sock *, struct rtnl_class *, int)
Add/Update traffic class.
Definition: class.c:165
int rtnl_class_build_delete_request(struct rtnl_class *, struct nl_msg **)
Build netlink message requesting the deletion of a traffic class.
Definition: class.c:189
struct rtnl_class * rtnl_class_get_by_parent(struct nl_cache *, int, uint32_t)
Search class by interface index and parent.
Definition: class.c:378
int rtnl_class_build_add_request(struct rtnl_class *, int, struct nl_msg **)
Build a netlink message requesting the addition of a traffic class.
Definition: class.c:123
struct rtnl_class * rtnl_class_get(struct nl_cache *, int, uint32_t)
Search traffic class by interface index and handle.
Definition: class.c:347
void rtnl_class_foreach_cls(struct rtnl_class *, struct nl_cache *, void(*cb)(struct nl_object *, void *), void *) __attribute__((deprecated))
Call a callback for each classifier attached to the class.
Definition: class.c:432
int rtnl_class_delete(struct nl_sock *, struct rtnl_class *)
Delete traffic class.
Definition: class.c:246
int rtnl_class_alloc_cache(struct nl_sock *, int, struct nl_cache **)
Allocate a cache and fill it with all configured traffic classes.
Definition: class.c:306
void rtnl_class_foreach_child(struct rtnl_class *, struct nl_cache *, void(*cb)(struct nl_object *, void *), void *) __attribute__((deprecated))
Call a callback for each child of a class.
Definition: class.c:409