63 #include <netlink-private/netlink.h>
64 #include <netlink-private/tc.h>
65 #include <netlink/netlink.h>
66 #include <netlink/utils.h>
67 #include <netlink-private/route/tc-api.h>
68 #include <netlink/route/qdisc/plug.h>
70 static int plug_msg_fill(
struct rtnl_tc *tc,
void *data,
struct nl_msg *msg)
72 struct rtnl_plug *plug = data;
73 struct tc_plug_qopt opts;
78 opts.action = plug->action;
79 opts.limit = plug->limit;
81 return nlmsg_append(msg, &opts,
sizeof(opts), NL_DONTPAD);
96 struct rtnl_plug *plug;
101 plug->action = TCQ_PLUG_BUFFER;
113 struct rtnl_plug *plug;
118 plug->action = TCQ_PLUG_RELEASE_ONE;
130 struct rtnl_plug *plug;
135 plug->action = TCQ_PLUG_RELEASE_INDEFINITE;
147 struct rtnl_plug *plug;
152 plug->action = TCQ_PLUG_LIMIT;
160 static struct rtnl_tc_ops plug_ops = {
162 .to_type = RTNL_TC_TYPE_QDISC,
163 .to_size =
sizeof(
struct rtnl_plug),
164 .to_msg_fill = plug_msg_fill,
167 static void __init plug_init(
void)
172 static void __exit plug_exit(
void)