openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/libnl/1_3.4.0-r0/libnl-3.4.0/lib/route/qdisc/tbf.c
void rtnl_qdisc_tbf_set_rate(struct rtnl_qdisc* qdisc, int rate, int bucket,
                             int cell)
{
    struct rtnl_tbf* tbf;
    int cell_log;

    if (!(tbf = rtnl_tc_data(TC_CAST(qdisc))))
        BUG();

    if (!cell)
        cell_log = UINT8_MAX;
    else
        cell_log = rtnl_tc_calc_cell_log(cell);

    tbf->qt_rate.rs_rate = rate;
    tbf->qt_rate_bucket = bucket;
    tbf->qt_rate.rs_cell_log = cell_log;
    tbf->qt_rate_txtime = nl_us2ticks(rtnl_tc_calc_txtime(bucket, rate));
    tbf->qt_mask |= TBF_ATTR_RATE;
}
/**
 * Set rate of TBF qdisc.
 * @arg qdisc		TBF qdisc to be modified.
 * @arg rate		New rate in bytes per second.
 * @arg bucket		Size of bucket in bytes.
 * @arg cell		Size of a rate cell or 0 to get default value.
 * @return 0 on success or a negative error code.
 */
Set rate of TBF qdisc.
@arg qdisc           TBF qdisc to be modified.
@arg rate            New rate in bytes per second.
@arg bucket          Size of bucket in bytes.
@arg cell            Size of a rate cell or 0 to get default value.
@return 0 on success or a negative error code.
Set rate of TBF qdisc . @arg qdisc TBF qdisc to be modified . @arg rate New rate in bytes per second . @arg bucket Size of bucket in bytes . @arg cell Size of a rate cell or 0 to get default value . @return 0 on success or a negative error code .
void rtnl_qdisc_tbf_set_rate(struct rtnl_qdisc* qdisc, int rate, int bucket,
                             int cell)
{
    struct rtnl_tbf* tbf;
    int cell_log;
    if (!(tbf = rtnl_tc_data(TC_CAST(qdisc))))
        BUG();
    if (!cell)
        cell_log = UINT8_MAX;
    else
        cell_log = rtnl_tc_calc_cell_log(cell);
    tbf->qt_rate.rs_rate = rate;
    tbf->qt_rate_bucket = bucket;
    tbf->qt_rate.rs_cell_log = cell_log;
    tbf->qt_rate_txtime = nl_us2ticks(rtnl_tc_calc_txtime(bucket, rate));
    tbf->qt_mask |= TBF_ATTR_RATE;
}
void rtnl_qdisc_tbf_set_rate ( struct rtnl_qdisc * qdisc , int rate , int bucket , int cell ) { struct rtnl_tbf * tbf ; int cell_log ; if ( ! ( tbf = rtnl_tc_data ( TC_CAST ( qdisc ) ) ) ) BUG ( ) ; if ( ! cell ) cell_log = UINT8_MAX ; else cell_log = rtnl_tc_calc_cell_log ( cell ) ; tbf -> qt_rate . rs_rate = rate ; tbf -> qt_rate_bucket = bucket ; tbf -> qt_rate . rs_cell_log = cell_log ; tbf -> qt_rate_txtime = nl_us2ticks ( rtnl_tc_calc_txtime ( bucket , rate ) ) ; tbf -> qt_mask |= TBF_ATTR_RATE ; }
Set rate of TBF qdisc.
Set rate of TBF qdisc .