X-Git-Url: http://git.onelab.eu/?p=iproute2.git;a=blobdiff_plain;f=tc%2Fm_estimator.c;fp=tc%2Fm_estimator.c;h=0000000000000000000000000000000000000000;hp=78eda7a8a074333f739a9f79da675983f0bc2768;hb=3331a68859fd71047bb1f309048960b48eab2d83;hpb=2bd4a72f2100be7ad7d9518cb1d49bb2a5b71994 diff --git a/tc/m_estimator.c b/tc/m_estimator.c deleted file mode 100644 index 78eda7a..0000000 --- a/tc/m_estimator.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * m_estimator.c Parse/print estimator module options. - * - * This program is free software; you can u32istribute 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 "utils.h" -#include "tc_util.h" - -static void est_help(void); - -static void est_help(void) -{ - fprintf(stderr, "Usage: ... estimator INTERVAL TIME-CONST\n"); - fprintf(stderr, " INTERVAL is interval between measurements\n"); - fprintf(stderr, " TIME-CONST is averaging time constant\n"); - fprintf(stderr, "Example: ... est 1sec 8sec\n"); - return; -} - -int parse_estimator(int *p_argc, char ***p_argv, struct tc_estimator *est) -{ - int argc = *p_argc; - char **argv = *p_argv; - unsigned A, time_const; - - NEXT_ARG(); - if (est->ewma_log) - duparg("estimator", *argv); - if (matches(*argv, "help") == 0) - est_help(); - if (get_usecs(&A, *argv)) - invarg("estimator", "invalid estimator interval"); - NEXT_ARG(); - if (matches(*argv, "help") == 0) - est_help(); - if (get_usecs(&time_const, *argv)) - invarg("estimator", "invalid estimator time constant"); - if (tc_setup_estimator(A, time_const, est) < 0) { - fprintf(stderr, "Error: estimator parameters are out of range.\n"); - return -1; - } - if (show_raw) - fprintf(stderr, "[estimator i=%u e=%u]\n", est->interval, est->ewma_log); - *p_argc = argc; - *p_argv = argv; - return 0; -}