libnl  1.1
blackhole.c
1 /*
2  * lib/route/sch/blackhole.c Blackhole Qdisc
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 /**
13  * @ingroup qdisc_api
14  * @defgroup blackhole Blackhole
15  * @{
16  */
17 
18 #include <netlink-local.h>
19 #include <netlink-tc.h>
20 #include <netlink/netlink.h>
21 #include <netlink/route/qdisc.h>
22 #include <netlink/route/qdisc-modules.h>
23 
24 static struct rtnl_qdisc_ops blackhole_ops = {
25  .qo_kind = "blackhole",
26 };
27 
28 static void __init blackhole_init(void)
29 {
30  rtnl_qdisc_register(&blackhole_ops);
31 }
32 
33 static void __exit blackhole_exit(void)
34 {
35  rtnl_qdisc_unregister(&blackhole_ops);
36 }
37 
38 /** @} */
char qo_kind[32]
Kind/Name of Qdisc.
Definition: qdisc-modules.h:30
int rtnl_qdisc_unregister(struct rtnl_qdisc_ops *qops)
Unregister a qdisc module.
Definition: qdisc_api.c:61
int rtnl_qdisc_register(struct rtnl_qdisc_ops *qops)
Register a qdisc module.
Definition: qdisc_api.c:40
Qdisc Operations.
Definition: qdisc-modules.h:25