]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/blobdiff - tc/tc_util.c
netem: add support for 4 state and GE loss model
[lisovros/iproute2_canprio.git] / tc / tc_util.c
index fe2c7eb53e6bb0d4d4deecc84ef8357130b78e66..5829d61383c9f8fe3626ef7c95fb59ff2c19ed50 100644 (file)
@@ -352,33 +352,6 @@ char * sprint_size(__u32 size, char *buf)
        return buf;
 }
 
-static const double max_percent_value = 0xffffffff;
-
-int get_percent(__u32 *percent, const char *str)
-{
-       char *p;
-       double per = strtod(str, &p) / 100.;
-
-       if (per > 1. || per < 0)
-               return -1;
-       if (*p && strcmp(p, "%"))
-               return -1;
-
-       *percent = (unsigned) rint(per * max_percent_value);
-       return 0;
-}
-
-void print_percent(char *buf, int len, __u32 per)
-{
-       snprintf(buf, len, "%g%%", 100. * (double) per / max_percent_value);
-}
-
-char * sprint_percent(__u32 per, char *buf)
-{
-       print_percent(buf, SPRINT_BSIZE-1, per);
-       return buf;
-}
-
 void print_qdisc_handle(char *buf, int len, __u32 h)
 {
        snprintf(buf, len, "%x:", TC_H_MAJ(h)>>16);