57#include "nl-default.h"
59#include <netlink/netlink.h>
60#include <netlink/utils.h>
61#include <netlink/route/qdisc/plug.h>
70static int plug_msg_fill(
struct rtnl_tc *tc,
void *data,
struct nl_msg *msg)
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);
101 plug->action = TCQ_PLUG_BUFFER;
118 plug->action = TCQ_PLUG_RELEASE_ONE;
135 plug->action = TCQ_PLUG_RELEASE_INDEFINITE;
152 plug->action = TCQ_PLUG_LIMIT;
160static struct rtnl_tc_ops plug_ops = {
162 .to_type = RTNL_TC_TYPE_QDISC,
164 .to_msg_fill = plug_msg_fill,
167static void _nl_init plug_init(
void)
172static void _nl_exit plug_exit(
void)
int nlmsg_append(struct nl_msg *n, void *data, size_t len, int pad)
Append data to tail of a netlink message.
int rtnl_qdisc_plug_release_indefinite(struct rtnl_qdisc *qdisc)
Indefinitely unplug the qdisc, releasing all packets.
int rtnl_qdisc_plug_release_one(struct rtnl_qdisc *qdisc)
Unplug the qdisc, releasing packets from queue head to the last complete buffer, while new traffic co...
int rtnl_qdisc_plug_buffer(struct rtnl_qdisc *qdisc)
Insert a plug into the qdisc and buffer any incoming network traffic.
int rtnl_qdisc_plug_set_limit(struct rtnl_qdisc *qdisc, int limit)
Set limit of PLUG qdisc.
#define TC_CAST(ptr)
Macro to cast qdisc/class/classifier to tc object.
void * rtnl_tc_data(struct rtnl_tc *)
Return pointer to private data of traffic control object.
int rtnl_tc_register(struct rtnl_tc_ops *)
Register a traffic control module.
void rtnl_tc_unregister(struct rtnl_tc_ops *)
Unregister a traffic control module.