Logo Search packages:      
Sourcecode: libnl2 version File versions  Download package

int rtnl_tc_calc_txtime ( int  bufsize,
int  rate 
)

Calculate time required to transmit buffer at a specific rate

  • bufsize Size of buffer to be transmited in bytes.
  • rate Transmit rate in bytes per second.
Calculates the number of micro seconds required to transmit a specific buffer at a specific transmit rate.

\[ txtime=\frac{bufsize}{rate}10^6 \]

Returns:
Required transmit time in micro seconds.

Definition at line 375 of file tc.c.

Referenced by rtnl_qdisc_tbf_set_peakrate(), rtnl_qdisc_tbf_set_rate(), and rtnl_tc_build_rate_table().

{
      double tx_time_secs;
      
      tx_time_secs = (double) bufsize / (double) rate;

      return tx_time_secs * 1000000.;
}


Generated by  Doxygen 1.6.0   Back to index