libnl  3.2.24-rc1
Token Bucket Filter (TBF)

Attribute Access

void rtnl_qdisc_tbf_set_limit (struct rtnl_qdisc *qdisc, int limit)
 Set limit of TBF qdisc. More...
 
int rtnl_qdisc_tbf_set_limit_by_latency (struct rtnl_qdisc *qdisc, int latency)
 Set limit of TBF qdisc by latency. More...
 
int rtnl_qdisc_tbf_get_limit (struct rtnl_qdisc *qdisc)
 Get limit of TBF qdisc. More...
 
void rtnl_qdisc_tbf_set_rate (struct rtnl_qdisc *qdisc, int rate, int bucket, int cell)
 Set rate of TBF qdisc. More...
 
int rtnl_qdisc_tbf_get_rate (struct rtnl_qdisc *qdisc)
 Get rate of TBF qdisc. More...
 
int rtnl_qdisc_tbf_get_rate_bucket (struct rtnl_qdisc *qdisc)
 Get rate bucket size of TBF qdisc. More...
 
int rtnl_qdisc_tbf_get_rate_cell (struct rtnl_qdisc *qdisc)
 Get rate cell size of TBF qdisc. More...
 
int rtnl_qdisc_tbf_set_peakrate (struct rtnl_qdisc *qdisc, int rate, int bucket, int cell)
 Set peak rate of TBF qdisc. More...
 
int rtnl_qdisc_tbf_get_peakrate (struct rtnl_qdisc *qdisc)
 Get peak rate of TBF qdisc. More...
 
int rtnl_qdisc_tbf_get_peakrate_bucket (struct rtnl_qdisc *qdisc)
 Get peak rate bucket size of TBF qdisc. More...
 
int rtnl_qdisc_tbf_get_peakrate_cell (struct rtnl_qdisc *qdisc)
 Get peak rate cell size of TBF qdisc. More...
 

Detailed Description

Function Documentation

void rtnl_qdisc_tbf_set_limit ( struct rtnl_qdisc *  qdisc,
int  limit 
)

Set limit of TBF qdisc.

Parameters
qdiscTBF qdisc to be modified.
limitNew limit in bytes.
Returns
0 on success or a negative error code.

Definition at line 178 of file tbf.c.

References rtnl_tc_data(), and TC_CAST.

Referenced by rtnl_qdisc_tbf_set_limit_by_latency().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int rtnl_qdisc_tbf_set_limit_by_latency ( struct rtnl_qdisc *  qdisc,
int  latency 
)

Set limit of TBF qdisc by latency.

Parameters
qdiscTBF qdisc to be modified.
latencyLatency in micro seconds.

Calculates and sets the limit based on the desired latency and the configured rate and peak rate. In order for this operation to succeed, the rate and if required the peak rate must have been set in advance.

\[ limit_n = \frac{{rate_n} \times {latency}}{10^6}+{bucketsize}_n \]

\[ limit = min(limit_{rate},limit_{peak}) \]

Returns
0 on success or a negative error code.

Definition at line 218 of file tbf.c.

References rtnl_qdisc_tbf_set_limit(), rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function:

int rtnl_qdisc_tbf_get_limit ( struct rtnl_qdisc *  qdisc)

Get limit of TBF qdisc.

Parameters
qdiscTBF qdisc.
Returns
Limit in bytes or a negative error code.

Definition at line 249 of file tbf.c.

References rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function:

void rtnl_qdisc_tbf_set_rate ( struct rtnl_qdisc *  qdisc,
int  rate,
int  bucket,
int  cell 
)

Set rate of TBF qdisc.

Parameters
qdiscTBF qdisc to be modified.
rateNew rate in bytes per second.
bucketSize of bucket in bytes.
cellSize of a rate cell or 0 to get default value.
Returns
0 on success or a negative error code.

Definition at line 276 of file tbf.c.

References nl_us2ticks(), rtnl_tc_calc_cell_log(), rtnl_tc_calc_txtime(), rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function:

int rtnl_qdisc_tbf_get_rate ( struct rtnl_qdisc *  qdisc)

Get rate of TBF qdisc.

Parameters
qdiscTBF qdisc.
Returns
Rate in bytes per seconds or a negative error code.

Definition at line 302 of file tbf.c.

References rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function:

int rtnl_qdisc_tbf_get_rate_bucket ( struct rtnl_qdisc *  qdisc)

Get rate bucket size of TBF qdisc.

Parameters
qdiscTBF qdisc.
Returns
Size of rate bucket or a negative error code.

Definition at line 320 of file tbf.c.

References rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function:

int rtnl_qdisc_tbf_get_rate_cell ( struct rtnl_qdisc *  qdisc)

Get rate cell size of TBF qdisc.

Parameters
qdiscTBF qdisc.
Returns
Size of rate cell in bytes or a negative error code.

Definition at line 338 of file tbf.c.

References rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function:

int rtnl_qdisc_tbf_set_peakrate ( struct rtnl_qdisc *  qdisc,
int  rate,
int  bucket,
int  cell 
)

Set peak rate of TBF qdisc.

Parameters
qdiscTBF qdisc to be modified.
rateNew peak rate in bytes per second.
bucketSize of peakrate bucket.
cellSize of a peakrate cell or 0 to get default value.
Returns
0 on success or a negative error code.

Definition at line 359 of file tbf.c.

References nl_us2ticks(), rtnl_tc_calc_txtime(), rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function:

int rtnl_qdisc_tbf_get_peakrate ( struct rtnl_qdisc *  qdisc)

Get peak rate of TBF qdisc.

Parameters
qdiscTBF qdisc.
Returns
Peak rate in bytes per seconds or a negative error code.

Definition at line 387 of file tbf.c.

References rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function:

int rtnl_qdisc_tbf_get_peakrate_bucket ( struct rtnl_qdisc *  qdisc)

Get peak rate bucket size of TBF qdisc.

Parameters
qdiscTBF qdisc.
Returns
Size of peak rate bucket or a negative error code.

Definition at line 405 of file tbf.c.

References rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function:

int rtnl_qdisc_tbf_get_peakrate_cell ( struct rtnl_qdisc *  qdisc)

Get peak rate cell size of TBF qdisc.

Parameters
qdiscTBF qdisc.
Returns
Size of peak rate cell in bytes or a negative error code.

Definition at line 423 of file tbf.c.

References rtnl_tc_data(), and TC_CAST.

+ Here is the call graph for this function: