libnl 3.5.0

ingress.c
1 /*
2 * lib/route/qdisc/ingress.c ingress
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) 2013 Cong Wang <xiyou.wangcong@gmail.com>
10 */
11
12 /**
13 * @ingroup qdisc
14 * @defgroup qdisc_ingress Ingress qdisc
15 *
16 * @{
17 */
18
19 #include <netlink-private/netlink.h>
20 #include <netlink-private/tc.h>
21 #include <netlink/netlink.h>
22 #include <netlink-private/route/tc-api.h>
23 #include <netlink/route/qdisc.h>
24 #include <netlink/utils.h>
25
26 struct dumb {
27 uint32_t foo;
28 };
29
30 static int dumb_msg_parser(struct rtnl_tc *tc, void *data)
31 {
32 return 0;
33 }
34
35 static void dumb_dump_line(struct rtnl_tc *tc, void *data,
36 struct nl_dump_params *p)
37 {
38 }
39
40 static int dumb_msg_fill(struct rtnl_tc *tc, void *data, struct nl_msg *msg)
41 {
42 return 0;
43 }
44
45 static struct rtnl_tc_ops ingress_ops = {
46 .to_kind = "ingress",
47 .to_type = RTNL_TC_TYPE_QDISC,
48 .to_size = sizeof(struct dumb),
49 .to_msg_parser = dumb_msg_parser,
50 .to_dump[NL_DUMP_LINE] = dumb_dump_line,
51 .to_msg_fill = dumb_msg_fill,
52 };
53
54 static void __init ingress_init(void)
55 {
56 rtnl_tc_register(&ingress_ops);
57 }
58
59 static void __exit ingress_exit(void)
60 {
61 rtnl_tc_unregister(&ingress_ops);
62 }
63
64 /** @} */
NL_DUMP_LINE
Dump object briefly on one line.
Definition: types.h:22
rtnl_tc_register
int rtnl_tc_register(struct rtnl_tc_ops *ops)
Register a traffic control module.
Definition: tc.c:1021
dumb
Definition: ingress.c:26
rtnl_tc_unregister
void rtnl_tc_unregister(struct rtnl_tc_ops *ops)
Unregister a traffic control module.
Definition: tc.c:1055
nl_dump_params
Dumping parameters.
Definition: types.h:33