X-Git-Url: http://git.onelab.eu/?p=iproute2.git;a=blobdiff_plain;f=tc%2Ftc_core.c;fp=tc%2Ftc_core.c;h=0000000000000000000000000000000000000000;hp=07cf2fa957d440396972f396199cb5a89ea3896b;hb=3331a68859fd71047bb1f309048960b48eab2d83;hpb=2bd4a72f2100be7ad7d9518cb1d49bb2a5b71994 diff --git a/tc/tc_core.c b/tc/tc_core.c deleted file mode 100644 index 07cf2fa..0000000 --- a/tc/tc_core.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * tc_core.c TC core library. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - * Authors: Alexey Kuznetsov, - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "tc_core.h" - -static __u32 t2us=1; -static __u32 us2t=1; -static double tick_in_usec = 1; - -long tc_core_usec2tick(long usec) -{ - return usec*tick_in_usec; -} - -long tc_core_tick2usec(long tick) -{ - return tick/tick_in_usec; -} - -unsigned tc_calc_xmittime(unsigned rate, unsigned size) -{ - return tc_core_usec2tick(1000000*((double)size/rate)); -} - -/* - rtab[pkt_len>>cell_log] = pkt_xmit_time - */ - -int tc_calc_rtable(unsigned bps, __u32 *rtab, int cell_log, unsigned mtu, - unsigned mpu) -{ - int i; - unsigned overhead = (mpu >> 8) & 0xFF; - mpu = mpu & 0xFF; - - if (mtu == 0) - mtu = 2047; - - if (cell_log < 0) { - cell_log = 0; - while ((mtu>>cell_log) > 255) - cell_log++; - } - for (i=0; i<256; i++) { - unsigned sz = (i<