~ubuntu-branches/ubuntu/precise/iproute/precise

« back to all changes in this revision

Viewing changes to tc/tc_util.c

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Wirt, Andreas Henriksson, Ben Finney, Justin Pryzby, Daniel Silverstone, Alexander Wirt
  • Date: 2007-12-16 14:30:31 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071216143031-cbd111kybw3o9mpv
Tags: 20071016-1
[ Andreas Henriksson ]
* New upstream release (v2.6.23 aka snapshot 071016) (Closes: #445944)
  - time2tick overflow patch applied upstream (Closes: #175462)
  - tc ematch cmp/nbyte help patch applied upstream (Closes: #438653)
  - mpath support dropped upstream (Closes: #428440, #428442)
  - new manpages included upstream (Closes: #438994)
  - linux header files updated to v2.6.23 (Closes: #409047)
* Drop patches which has been applied upstream or deprecated by
  upstream changes.
  - debian/patches/lartc applied upstream.
  - debian/patches/netbug_fix deprecated, upstream dropped netbug script.
  - debian/patches/empty_linkname.dpatch deprecated, fixed upstream.
* Add .dpatch suffix to wrr-qdisc patch to make dpatch-edit-patch work.
* Update patches to apply:
  - wrr-qdisc, moo, ip_route_usage
* Don't install removed netbug script.
* Fix corruption when using batch files with comments and broken
  lines. (cherry-picked from upstream. Closes: #398912)
* Update build-dependencies:
  - libdb4.3-dev -> libdb-dev. (Closes: #442653)
  - linux-kernel-headers -> linux-libc-dev.
* Drop debian/patches/ip_address_flush_loop.dpatch,
  instead we'll use Daniel Silverstones patch imported from Ubuntu.
* Add Homepage and Vcs-{Browser,Git} fields to debian/control.
* Remove dead/leftover code from tc/q_htb.c, include/linux/pkt_sched.h
* Remove outdated README.Debian.
* Drop our own (buggy) RTAX_INITCWND support, in favor of upstreams.
* fix dotted-quad support patch to work on big-endian.
  (upstream applied a broken patch, which we cherry-picked for #357172)

[ Ben Finney ]
* Add dh_md5sums to generate md5sums control file (Closes: #439439)

[ Justin Pryzby ]
* ss(8) manpage formatting breaks EXAMPLE (Closes: #443071)

[ Daniel Silverstone ]
* Avoid infinite loop in ip addr flush.

[ Alexander Wirt ]
* Add Andreas Henriksson to uploaders
* Bump standards version
* Support dotted-quad netmasks in iproute (Closes: #357172) (Cherry picked
  from upstream)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include "utils.h"
25
25
#include "tc_util.h"
26
26
 
 
27
const char *get_tc_lib(void)
 
28
{
 
29
        const char *lib_dir;
 
30
 
 
31
        lib_dir = getenv("TC_LIB_DIR");
 
32
        if (!lib_dir)
 
33
                lib_dir = "/usr/lib/tc";
 
34
 
 
35
        return lib_dir;
 
36
}
 
37
 
27
38
int get_qdisc_handle(__u32 *h, const char *str)
28
39
{
29
40
        __u32 maj;
228
239
                else if (strcasecmp(p, "us") == 0 || strcasecmp(p, "usec")==0 ||
229
240
                         strcasecmp(p, "usecs") == 0)
230
241
                        t *= TIME_UNITS_PER_SEC/1000000;
231
 
                else if (strcasecmp(p, "ns") == 0 || strcasecmp(p, "nsec")==0 ||
232
 
                         strcasecmp(p, "nsecs") == 0)
233
 
                        t *= TIME_UNITS_PER_SEC/1000000000;
234
242
                else
235
243
                        return -1;
236
244
        }
248
256
                snprintf(buf, len, "%.1fs", tmp/TIME_UNITS_PER_SEC);
249
257
        else if (tmp >= TIME_UNITS_PER_SEC/1000)
250
258
                snprintf(buf, len, "%.1fms", tmp/(TIME_UNITS_PER_SEC/1000));
251
 
        else if (tmp >= TIME_UNITS_PER_SEC/1000000)
252
 
                snprintf(buf, len, "%.1fus", tmp/(TIME_UNITS_PER_SEC/1000000));
253
259
        else
254
 
                snprintf(buf, len, "%uns", time);
 
260
                snprintf(buf, len, "%uus", time);
255
261
}
256
262
 
257
263
char * sprint_time(__u32 time, char *buf)