9#include <netlink/netlink.h>
10#include <netlink/cache.h>
11#include <netlink/data.h>
12#include <netlink/route/link.h>
13#include <linux/pkt_sched.h>
14#include <linux/pkt_cls.h>
28#define RTNL_TC_TYPE_MAX (__RTNL_TC_TYPE_MAX - 1)
34#define TC_HANDLE(maj, min) (TC_H_MAJ((maj) << 16) | TC_H_MIN(min))
50#define TC_CAST(ptr) ((struct rtnl_tc *) (ptr))
73#define RTNL_TC_STATS_MAX (__RTNL_TC_STATS_MAX - 1)
94extern char * rtnl_tc_stat2str(
enum rtnl_tc_stat,
char *,
size_t);
95extern int rtnl_tc_str2stat(
const char *);
104extern int rtnl_classid_generate(
const char *, uint32_t *,
int rtnl_tc_str2handle(const char *, uint32_t *)
Convert a charactering strint to a traffic control handle.
char * rtnl_tc_handle2str(uint32_t, char *, size_t)
Convert a traffic control handle to a character string (Reentrant).
int rtnl_tc_read_classid_file(void)
(Re-)read classid file
void rtnl_tc_set_mpu(struct rtnl_tc *, uint32_t)
Set the Minimum Packet Unit (MPU) of a traffic control object.
uint32_t rtnl_tc_get_parent(struct rtnl_tc *)
Return parent identifier of a traffic control object.
void rtnl_tc_set_linktype(struct rtnl_tc *, uint32_t)
Set the linktype of a traffic control object.
int rtnl_tc_set_kind(struct rtnl_tc *, const char *)
Define the type of traffic control object.
int rtnl_tc_calc_cell_log(int)
Calculate the binary logarithm for a specific cell size.
int rtnl_tc_get_chain(struct rtnl_tc *, uint32_t *)
Return chain index of traffic control object.
char * rtnl_tc_get_kind(struct rtnl_tc *)
Return kind of traffic control object.
void rtnl_tc_set_ifindex(struct rtnl_tc *, int)
Set interface index of traffic control object.
void rtnl_tc_set_overhead(struct rtnl_tc *, uint32_t)
Set per packet overhead of a traffic control object.
int rtnl_tc_calc_bufsize(int, int)
Calculate buffer size able to transmit in a specific time and rate.
uint32_t rtnl_tc_get_mtu(struct rtnl_tc *)
Return the MTU of traffic control object.
int rtnl_tc_get_ifindex(struct rtnl_tc *)
Return interface index of traffic control object.
void rtnl_tc_set_link(struct rtnl_tc *, struct rtnl_link *)
Set link of traffic control object.
uint32_t rtnl_tc_get_handle(struct rtnl_tc *)
Return identifier of a traffic control object.
uint32_t rtnl_tc_get_overhead(struct rtnl_tc *)
Return per packet overhead of a traffic control object.
void rtnl_tc_set_handle(struct rtnl_tc *, uint32_t)
Set identifier of traffic control object.
void rtnl_tc_set_parent(struct rtnl_tc *, uint32_t)
Set the parent identifier of a traffic control object.
void rtnl_tc_set_mtu(struct rtnl_tc *, uint32_t)
Set the Maximum Transmission Unit (MTU) of traffic control object.
void rtnl_tc_set_chain(struct rtnl_tc *, uint32_t)
Set the chain index of a traffic control object.
uint64_t rtnl_tc_get_stat(struct rtnl_tc *, enum rtnl_tc_stat)
Return value of a statistical counter of a traffic control object.
rtnl_tc_stat
Traffic control statistical identifier.
struct rtnl_link * rtnl_tc_get_link(struct rtnl_tc *)
Get link of traffic control object.
uint32_t rtnl_tc_get_linktype(struct rtnl_tc *)
Return the linktype of a traffic control object.
uint32_t rtnl_tc_get_mpu(struct rtnl_tc *)
Return the Minimum Packet Unit (MPU) of a traffic control object.
int rtnl_tc_calc_txtime(int, int)
Calculate time required to transmit buffer at a specific rate.
@ RTNL_TC_PACKETS
Number of packets seen.
@ RTNL_TC_BYTES
Total bytes seen.
@ RTNL_TC_QLEN
Current queue length.
@ RTNL_TC_OVERLIMITS
Total number of overlimits.
@ RTNL_TC_DROPS
Total number of packets dropped.
@ RTNL_TC_RATE_PPS
Current packet/s (rate estimator)
@ RTNL_TC_REQUEUES
Total number of requeues.
@ RTNL_TC_BACKLOG
Current backlog length.
@ RTNL_TC_RATE_BPS
Current bits/s (rate estimator)