]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Replace "usec" by "time" in function names
authorPatrick McHardy <kaber@trash.net>
Sun, 4 Mar 2007 19:15:00 +0000 (20:15 +0100)
committerStephen Hemminger <shemminger@linux-foundation.org>
Tue, 13 Mar 2007 21:42:17 +0000 (14:42 -0700)
[IPROUTE]: Replace "usec" by "time" in function names

Rename functions containing "usec" since they don't necessarily return
usec units anymore.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
tc/m_estimator.c
tc/q_cbq.c
tc/q_hfsc.c
tc/q_netem.c
tc/q_tbf.c
tc/tc_cbq.c
tc/tc_core.c
tc/tc_core.h
tc/tc_util.c
tc/tc_util.h

index d931551acc21664d1b2a099eb818708db5365449..a9e5dbc8e88c1a130d6f8a2d72c4dea9b801a2c0 100644 (file)
@@ -45,12 +45,12 @@ int parse_estimator(int *p_argc, char ***p_argv, struct tc_estimator *est)
                duparg("estimator", *argv);
        if (matches(*argv, "help") == 0)
                est_help();
-       if (get_usecs(&A, *argv))
+       if (get_time(&A, *argv))
                invarg("estimator", "invalid estimator interval");
        NEXT_ARG();
        if (matches(*argv, "help") == 0)
                est_help();
-       if (get_usecs(&time_const, *argv))
+       if (get_time(&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");
index 0000a563b2f965990e84f1d8d51ef9ff18c7472b..913b26a05e61a12f02c1d0b87438ea9ebc00e806 100644 (file)
@@ -500,17 +500,17 @@ static int cbq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
        if (lss && show_details) {
                fprintf(f, "\nlevel %u ewma %u avpkt %ub ", lss->level, lss->ewma_log, lss->avpkt);
                if (lss->maxidle) {
-                       fprintf(f, "maxidle %luus ", tc_core_tick2usec(lss->maxidle>>lss->ewma_log));
+                       fprintf(f, "maxidle %luus ", tc_core_tick2time(lss->maxidle>>lss->ewma_log));
                        if (show_raw)
                                fprintf(f, "[%08x] ", lss->maxidle);
                }
                if (lss->minidle!=0x7fffffff) {
-                       fprintf(f, "minidle %luus ", tc_core_tick2usec(lss->minidle>>lss->ewma_log));
+                       fprintf(f, "minidle %luus ", tc_core_tick2time(lss->minidle>>lss->ewma_log));
                        if (show_raw)
                                fprintf(f, "[%08x] ", lss->minidle);
                }
                if (lss->offtime) {
-                       fprintf(f, "offtime %luus ", tc_core_tick2usec(lss->offtime));
+                       fprintf(f, "offtime %luus ", tc_core_tick2time(lss->offtime));
                        if (show_raw)
                                fprintf(f, "[%08x] ", lss->offtime);
                }
index f7a30f26f42f62e1ba465d80a7c69aa656186d7d..b190c71118d65dd5136ecbea3b384b50cdf86f16 100644 (file)
@@ -226,7 +226,7 @@ hfsc_print_sc(FILE *f, char *name, struct tc_service_curve *sc)
 
        fprintf(f, "%s ", name);
        fprintf(f, "m1 %s ", sprint_rate(sc->m1, b1));
-       fprintf(f, "d %s ", sprint_usecs(tc_core_ktime2time(sc->d), b1));
+       fprintf(f, "d %s ", sprint_time(tc_core_ktime2time(sc->d), b1));
        fprintf(f, "m2 %s ", sprint_rate(sc->m2, b1));
 }
 
@@ -303,7 +303,7 @@ hfsc_get_sc1(int *argcp, char ***argvp, struct tc_service_curve *sc)
 
        if (matches(*argv, "d") == 0) {
                NEXT_ARG();
-               if (get_usecs(&d, *argv) < 0) {
+               if (get_time(&d, *argv) < 0) {
                        explain1("d");
                        return -1;
                }
@@ -346,7 +346,7 @@ hfsc_get_sc2(int *argcp, char ***argvp, struct tc_service_curve *sc)
 
        if (matches(*argv, "dmax") == 0) {
                NEXT_ARG();
-               if (get_usecs(&dmax, *argv) < 0) {
+               if (get_time(&dmax, *argv) < 0) {
                        explain1("dmax");
                        return -1;
                }
index cfd179956be02231c400ceace67e4da301f51a59..6035c4f00d8022a1f50eff11f80803e6d85dd3f6 100644 (file)
@@ -108,15 +108,15 @@ static int get_ticks(__u32 *ticks, const char *str)
 {
        unsigned t;
 
-       if(get_usecs(&t, str))
+       if(get_time(&t, str))
                return -1;
 
-       if (tc_core_usec2big(t)) {
-               fprintf(stderr, "Illegal %d usecs (too large)\n", t);
+       if (tc_core_time2big(t)) {
+               fprintf(stderr, "Illegal %u time (too large)\n", t);
                return -1;
        }
 
-       *ticks = tc_core_usec2tick(t);
+       *ticks = tc_core_time2tick(t);
        return 0;
 }
 
index a102696725938677ef5ed9d7985edee834eb5197..1fc05f49ff7afdfc84dc6ab10b7243d4475e58c3 100644 (file)
@@ -67,7 +67,7 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
                                fprintf(stderr, "Double \"limit/latency\" spec\n");
                                return -1;
                        }
-                       if (get_usecs(&latency, *argv)) {
+                       if (get_time(&latency, *argv)) {
                                explain1("latency");
                                return -1;
                        }
@@ -245,13 +245,13 @@ static int tbf_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
        if (show_raw)
                fprintf(f, "limit %s ", sprint_size(qopt->limit, b1));
 
-       latency = TIME_UNITS_PER_SEC*(qopt->limit/(double)qopt->rate.rate) - tc_core_tick2usec(qopt->buffer);
+       latency = TIME_UNITS_PER_SEC*(qopt->limit/(double)qopt->rate.rate) - tc_core_tick2time(qopt->buffer);
        if (qopt->peakrate.rate) {
-               double lat2 = TIME_UNITS_PER_SEC*(qopt->limit/(double)qopt->peakrate.rate) - tc_core_tick2usec(qopt->mtu);
+               double lat2 = TIME_UNITS_PER_SEC*(qopt->limit/(double)qopt->peakrate.rate) - tc_core_tick2time(qopt->mtu);
                if (lat2 > latency)
                        latency = lat2;
        }
-       fprintf(f, "lat %s ", sprint_usecs(latency, b1));
+       fprintf(f, "lat %s ", sprint_time(latency, b1));
 
        return 0;
 }
index c7b3a2da057a0130286be75e3183c6e95f10c21a..0bb262eb5b64217983f7e31744da584f0fd30810 100644 (file)
@@ -38,7 +38,7 @@ unsigned tc_cbq_calc_maxidle(unsigned bndw, unsigned rate, unsigned avpkt,
                if (vxmt > maxidle)
                        maxidle = vxmt;
        }
-       return tc_core_usec2tick(maxidle*(1<<ewma_log)*TIME_UNITS_PER_SEC);
+       return tc_core_time2tick(maxidle*(1<<ewma_log)*TIME_UNITS_PER_SEC);
 }
 
 unsigned tc_cbq_calc_offtime(unsigned bndw, unsigned rate, unsigned avpkt,
@@ -53,5 +53,5 @@ unsigned tc_cbq_calc_offtime(unsigned bndw, unsigned rate, unsigned avpkt,
                offtime *= pow(g, -(double)minburst) - 1;
        else
                offtime *= 1 + (pow(g, -(double)(minburst-1)) - 1)/(1-g);
-       return tc_core_usec2tick(offtime*TIME_UNITS_PER_SEC);
+       return tc_core_time2tick(offtime*TIME_UNITS_PER_SEC);
 }
index 07dc4ba15f79a0d88730fdc2d9083e202c70ac0e..e27254eb91143716806e40fc0594a68072d366a8 100644 (file)
@@ -27,21 +27,21 @@ static __u32 t2us=1;
 static __u32 us2t=1;
 static double tick_in_usec = 1;
 
-int tc_core_usec2big(long usec)
+int tc_core_time2big(long time)
 {
-       __u64 t = usec;
+       __u64 t = time;
 
        t *= tick_in_usec;
        return (t >> 32) != 0;
 }
 
 
-long tc_core_usec2tick(long usec)
+long tc_core_time2tick(long time)
 {
-       return usec*tick_in_usec;
+       return time*tick_in_usec;
 }
 
-long tc_core_tick2usec(long tick)
+long tc_core_tick2time(long tick)
 {
        return tick/tick_in_usec;
 }
@@ -58,12 +58,12 @@ long tc_core_ktime2time(long ktime)
 
 unsigned tc_calc_xmittime(unsigned rate, unsigned size)
 {
-       return tc_core_usec2tick(TIME_UNITS_PER_SEC*((double)size/rate));
+       return tc_core_time2tick(TIME_UNITS_PER_SEC*((double)size/rate));
 }
 
 unsigned tc_calc_xmitsize(unsigned rate, unsigned ticks)
 {
-       return ((double)rate*tc_core_tick2usec(ticks))/TIME_UNITS_PER_SEC;
+       return ((double)rate*tc_core_tick2time(ticks))/TIME_UNITS_PER_SEC;
 }
 
 /*
index b31813d8f8a9c74e63af834b541beb76d1fc0acb..a139da6f6652d37d209677aeaff60874b9c147c6 100644 (file)
@@ -6,9 +6,9 @@
 
 #define TIME_UNITS_PER_SEC     1000000
 
-int  tc_core_usec2big(long usec);
-long tc_core_usec2tick(long usec);
-long tc_core_tick2usec(long tick);
+int  tc_core_time2big(long time);
+long tc_core_time2tick(long time);
+long tc_core_tick2time(long tick);
 long tc_core_time2ktime(long time);
 long tc_core_ktime2time(long ktime);
 unsigned tc_calc_xmittime(unsigned rate, unsigned size);
index 62113fc68f498b8454cfc536dda0a48bf3c26e53..b73fae96ad209f81ede2a0bdb813ffedef1ed626 100644 (file)
@@ -209,7 +209,7 @@ char * sprint_rate(__u32 rate, char *buf)
        return buf;
 }
 
-int get_usecs(unsigned *usecs, const char *str)
+int get_time(unsigned *time, const char *str)
 {
        double t;
        char *p;
@@ -232,26 +232,26 @@ int get_usecs(unsigned *usecs, const char *str)
                        return -1;
        }
 
-       *usecs = t;
+       *time = t;
        return 0;
 }
 
 
-void print_usecs(char *buf, int len, __u32 usec)
+void print_time(char *buf, int len, __u32 time)
 {
-       double tmp = usec;
+       double tmp = time;
 
        if (tmp >= TIME_UNITS_PER_SEC)
                snprintf(buf, len, "%.1fs", tmp/TIME_UNITS_PER_SEC);
        else if (tmp >= TIME_UNITS_PER_SEC/1000)
                snprintf(buf, len, "%.1fms", tmp/(TIME_UNITS_PER_SEC/1000));
        else
-               snprintf(buf, len, "%uus", usec);
+               snprintf(buf, len, "%uus", time);
 }
 
-char * sprint_usecs(__u32 usecs, char *buf)
+char * sprint_time(__u32 time, char *buf)
 {
-       print_usecs(buf, SPRINT_BSIZE-1, usecs);
+       print_time(buf, SPRINT_BSIZE-1, time);
        return buf;
 }
 
index 0778693acf08e7151c93df59b1c47664c4706ede..b713cf14ad391bd7135cdcf03a9f350442df5099 100644 (file)
@@ -46,17 +46,17 @@ extern int get_rate(unsigned *rate, const char *str);
 extern int get_percent(unsigned *percent, const char *str);
 extern int get_size(unsigned *size, const char *str);
 extern int get_size_and_cell(unsigned *size, int *cell_log, char *str);
-extern int get_usecs(unsigned *usecs, const char *str);
+extern int get_time(unsigned *time, const char *str);
 extern void print_rate(char *buf, int len, __u32 rate);
 extern void print_size(char *buf, int len, __u32 size);
 extern void print_percent(char *buf, int len, __u32 percent);
 extern void print_qdisc_handle(char *buf, int len, __u32 h);
-extern void print_usecs(char *buf, int len, __u32 usecs);
+extern void print_time(char *buf, int len, __u32 time);
 extern char * sprint_rate(__u32 rate, char *buf);
 extern char * sprint_size(__u32 size, char *buf);
 extern char * sprint_qdisc_handle(__u32 h, char *buf);
 extern char * sprint_tc_classid(__u32 h, char *buf);
-extern char * sprint_usecs(__u32 usecs, char *buf);
+extern char * sprint_time(__u32 time, char *buf);
 extern char * sprint_percent(__u32 percent, char *buf);
 
 extern void print_tcstats_attr(FILE *fp, struct rtattr *tb[], char *prefix, struct rtattr **xstats);