Lines Matching refs:rate
28 fprintf(stderr, "Usage: ... tbf limit BYTES burst BYTES[/BYTES] rate KBPS [ mtu BYTES[/BYTES] ]\n");
112 } else if (strcmp(*argv, "rate") == 0) {
114 if (opt.rate.rate) {
115 fprintf(stderr, "Double \"rate\" spec\n");
118 if (get_rate(&opt.rate.rate, *argv)) {
119 explain1("rate");
125 if (opt.peakrate.rate) {
129 if (get_rate(&opt.peakrate.rate, *argv)) {
164 if (opt.rate.rate == 0 || !buffer) {
165 fprintf(stderr, "Both \"rate\" and \"burst\" are required.\n");
168 if (opt.peakrate.rate) {
181 double lim = opt.rate.rate*(double)latency/TIME_UNITS_PER_SEC + buffer;
182 if (opt.peakrate.rate) {
183 double lim2 = opt.peakrate.rate*(double)latency/TIME_UNITS_PER_SEC + mtu;
190 opt.rate.mpu = mpu;
191 opt.rate.overhead = overhead;
192 if (tc_calc_rtable(&opt.rate, rtab, Rcell_log, mtu, linklayer) < 0) {
193 fprintf(stderr, "TBF: failed to calculate rate table.\n");
196 opt.buffer = tc_calc_xmittime(opt.rate.rate, buffer);
198 if (opt.peakrate.rate) {
202 fprintf(stderr, "TBF: failed to calculate peak rate table.\n");
205 opt.mtu = tc_calc_xmittime(opt.peakrate.rate, mtu);
212 if (opt.peakrate.rate)
238 fprintf(f, "rate %s ", sprint_rate(qopt->rate.rate, b1));
239 buffer = tc_calc_xmitsize(qopt->rate.rate, qopt->buffer);
242 1<<qopt->rate.cell_log, sprint_size(qopt->rate.mpu, b2));
248 if (qopt->peakrate.rate) {
249 fprintf(f, "peakrate %s ", sprint_rate(qopt->peakrate.rate, b1));
251 mtu = tc_calc_xmitsize(qopt->peakrate.rate, qopt->mtu);
266 latency = TIME_UNITS_PER_SEC*(qopt->limit/(double)qopt->rate.rate) - tc_core_tick2time(qopt->buffer);
267 if (qopt->peakrate.rate) {
268 double lat2 = TIME_UNITS_PER_SEC*(qopt->limit/(double)qopt->peakrate.rate) - tc_core_tick2time(qopt->mtu);
274 if (qopt->rate.overhead) {
275 fprintf(f, "overhead %d", qopt->rate.overhead);