libnl: /data/src/libnl3/lib/route/qdisc/ingress.c Source File

libnl 3.7.0

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