]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/log
lisovros/iproute2_canprio.git
16 years agoiproute2: revert syntax help text mistake.
Andreas Henriksson [Wed, 2 Jan 2008 23:47:30 +0000 (00:47 +0100)]
iproute2: revert syntax help text mistake.

Sorry. The pref and prio options are actually synonyms.
This reverts part of commit 576c63ee59de3f18bec4ebd8181a5a395f268d03.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
16 years agoadd include/netinet/tcp.h
Stephen Hemminger [Mon, 31 Dec 2007 20:56:08 +0000 (12:56 -0800)]
add include/netinet/tcp.h

ss.c needs lastest version of netinet/tcp.h which probably isn't
on most distro's yet.

Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
16 years agoiptables compatiablity
Denys Fedoryshchenko [Mon, 24 Dec 2007 16:51:11 +0000 (11:51 -0500)]
iptables compatiablity

New iptables 1.4.0 has some library names changed from libipt to libxt.
It is prefferable also to open libxt_ first, as newer "style".

Signed-off-by: Denys Fedoryshchenko <nuclearcat@nuclearcat.com>
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
16 years agoChange the rate table calc of transmit cost to use upper bound value.
Jesper Dangaard Brouer [Wed, 5 Sep 2007 13:24:51 +0000 (15:24 +0200)]
Change the rate table calc of transmit cost to use upper bound value.

Patrick McHardy, Cite: 'its better to overestimate than underestimate
to stay in control of the queue'.

Illustrating the rate table array:
 Legend description
   rtab[x]   : Array index x of rtab[x]
   xmit_sz   : Transmit size contained in rtab[x] (normally transmit time)
   maps[a-b] : Packet sizes from a to b, will map into rtab[x]

Current/old rate table mapping (cell_log:3):
 rtab[0]:=xmit_sz:0  maps[0-7]
 rtab[1]:=xmit_sz:8  maps[8-15]
 rtab[2]:=xmit_sz:16 maps[16-23]
 rtab[3]:=xmit_sz:24 maps[24-31]
 rtab[4]:=xmit_sz:32 maps[32-39]
 rtab[5]:=xmit_sz:40 maps[40-47]
 rtab[6]:=xmit_sz:48 maps[48-55]

New rate table mapping, with kernel cell_align support.
 rtab[0]:=xmit_sz:8  maps[0-8]
 rtab[1]:=xmit_sz:16 maps[9-16]
 rtab[2]:=xmit_sz:24 maps[17-24]
 rtab[3]:=xmit_sz:32 maps[25-32]
 rtab[4]:=xmit_sz:40 maps[33-40]
 rtab[5]:=xmit_sz:48 maps[41-48]
 rtab[6]:=xmit_sz:56 maps[49-56]

New TC util on a kernel WITHOUT support for cell_align
 rtab[0]:=xmit_sz:8 maps[0-7]
 rtab[1]:=xmit_sz:16 maps[8-15]
 rtab[2]:=xmit_sz:24 maps[16-23]
 rtab[3]:=xmit_sz:32 maps[24-31]
 rtab[4]:=xmit_sz:40 maps[32-39]
 rtab[5]:=xmit_sz:48 maps[40-47]
 rtab[6]:=xmit_sz:56 maps[48-55]

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
16 years agoCleanup: tc_calc_rtable().
Jesper Dangaard Brouer [Wed, 5 Sep 2007 08:47:47 +0000 (10:47 +0200)]
Cleanup: tc_calc_rtable().

Change tc_calc_rtable() to take a tc_ratespec struct as an
argument. (cell_log still needs to be passed on as a parameter,
because -1 indicate that the cell_log needs to be computed by the
function.).

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
16 years agoOverhead calculation is now done in the kernel.
Jesper Dangaard Brouer [Tue, 11 Sep 2007 14:59:58 +0000 (16:59 +0200)]
Overhead calculation is now done in the kernel.

The only current user is HTB. HTB overhead argument is now passed on
to the kernel (in the struct tc_ratespec). Also correct the data
types.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
16 years agoUse netinet/tcp.h (with correction) rather than kernel headers
Stephen Hemminger [Mon, 31 Dec 2007 18:41:18 +0000 (10:41 -0800)]
Use netinet/tcp.h (with correction) rather than kernel headers

Fix the userspace header file rather than importing more
kernel headers.

Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
16 years agosnapshot 31 Dec 2007
Stephen Hemminger [Mon, 31 Dec 2007 18:30:40 +0000 (10:30 -0800)]
snapshot 31 Dec 2007

Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
16 years agoadd decode of match rules
Stephen Hemminger [Mon, 31 Dec 2007 18:29:52 +0000 (10:29 -0800)]
add decode of match rules

Show ip address etc when decoding output of tc filter show

Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
16 years agoManual page fixes
Stephen Hemminger [Mon, 31 Dec 2007 18:15:03 +0000 (10:15 -0800)]
Manual page fixes

These are from debian sid.

Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
16 years agoveth.h move to linux/
Stephen Hemminger [Tue, 25 Dec 2007 20:38:08 +0000 (12:38 -0800)]
veth.h move to linux/

Move veth.h to linux/ since it is an API.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agosnapshot target
Stephen Hemminger [Fri, 21 Dec 2007 17:53:45 +0000 (09:53 -0800)]
snapshot target

Add Makefile target to create snapshot file.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoveth: use kernel header file
Stephen Hemminger [Fri, 21 Dec 2007 17:37:30 +0000 (09:37 -0800)]
veth: use kernel header file

Use santized kernel header for veth.h and put in correct place
to prevent possible future problems with API.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoveth device link management
Vitaliy Gusev [Tue, 18 Dec 2007 12:15:38 +0000 (15:15 +0300)]
veth device link management

Signed-off-by: Vitaliy Gusev <vgusev@openvz.org>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoiplink_parse() routine
Pavel Emelyanov [Thu, 19 Jul 2007 09:32:31 +0000 (13:32 +0400)]
iplink_parse() routine

This routine parses CLI attributes, describing generic link
parameters such as name, address, etc.

This is mostly copy-pasted from iplink_modify().

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoFix lost export-dynamic
Vitaliy Gusev [Mon, 17 Dec 2007 13:06:38 +0000 (16:06 +0300)]
Fix lost export-dynamic

get_link_kind() fails for statically linked modules (vlan, veth, etc.) if "ip"
was linked without "export-dynamic".

Signed-off-by: Vitaliy Gusev <vgusev@openvz.org>
--
Thank,
Vitaliy Gusev
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agorto_min value display overflow
YOSHIFUJI Hideaki / 吉藤英明 [Fri, 21 Dec 2007 13:58:04 +0000 (22:58 +0900)]
rto_min value display overflow

Reported by: Satoru SATOH <satoru.satoh@gmail.com>
"ip route show" does not print correct value when larger rto_min is
set (e.g. 3sec).

This problem is because of overflow in print_route() and
the patch below is a workaround fix for that.

[root test]# ./iproute2.git.org/ip/ip route show dev eth1
192.168.140.0/24  proto kernel  scope link  src 192.168.140.130
169.254.0.0/16  scope link
[root test]# ./iproute2.git.org/ip/ip route change 192.168.140.0/24
dev eth1 rto_min 3s
[root test]# ./iproute2.git.org/ip/ip route show dev eth1
192.168.140.0/24  scope link  rto_min lock 2ms     <-- wrong
169.254.0.0/16  scope link
[root test]# ./iproute2.git/ip/ip route show dev eth1  # patched version
192.168.140.0/24  scope link  rto_min lock 3000ms  <-- correct
169.254.0.0/16  scope link

This is a simpler fix.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoFix dotted quad for bit order
Stephen Hemminger [Tue, 11 Dec 2007 18:03:28 +0000 (10:03 -0800)]
Fix dotted quad for bit order

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoiproute2: support dotted-quad netmask notation.
Andreas Henriksson [Fri, 7 Dec 2007 23:41:34 +0000 (00:41 +0100)]
iproute2: support dotted-quad netmask notation.

On tor, 2007-12-06 at 11:53 -0800, Stephen Hemminger wrote:
> On Tue, 4 Dec 2007 14:58:18 +0100
> Andreas Henriksson <andreas@fatal.se> wrote:
>
> > Suggested patch for allowing netmask to be specified in dotted quad format.
> > See http://bugs.debian.org/357172
> >
> > (Known problem: this will not prevent some invalid syntaxes,
> > ie. "255.0.255.0" will be treated as "255.255.255.0")
> >
> > Comments? Suggestions? Improvements?
>
> Fix the bug you mentioned?
>
> [... snip example code ...]

Updated patch, added your netmask validation code but without the check
that made 0.0.0.0 (default) and 255.255.255.255 (one address) invalid
netmasks as they are permitted in CIDR format.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agotc mask patch
François Delawarde [Mon, 26 Nov 2007 17:13:24 +0000 (18:13 +0100)]
tc mask patch

Hello Stephen,

As the current maintainer of iproute2 package, you could be interested
in including the attached patch that allow using masks in the fw filter
of the tc utility (very useful at least for me). AFAK, it works at least
from iproute2 version 2.6.20-?. Feel free to make the appropriate
cleaning changes if necessary, or contact me if you see any trouble.

Best regards,
François Delawarde.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoCorrect documentation regarding PROMISC and ALLMULTI.
Tomas Janousek [Tue, 20 Nov 2007 14:38:21 +0000 (15:38 +0100)]
Correct documentation regarding PROMISC and ALLMULTI.

The ip util would happily change these flags, it's just not recommended.
Reflect that in the doc.

The behaviour of ifconfig is exactly the same as of ip, delete the note about
it.

Signed-off-by: Tomas Janousek <tjanouse@redhat.com>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoAdd NAT action
Herbert Xu [Fri, 12 Oct 2007 09:08:40 +0000 (17:08 +0800)]
Add NAT action

Here's a patch to add support for the nat action which is now
in the kernel.

Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoAdd NAT action
Herbert Xu [Fri, 12 Oct 2007 09:08:40 +0000 (17:08 +0800)]
Add NAT action

Here's a patch to add support for the nat action which is now
in the kernel.

Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoFix off by one in nested attribute management.
Stephen Hemminger [Mon, 10 Dec 2007 19:34:40 +0000 (11:34 -0800)]
Fix off by one in nested attribute management.

Fixes segv in:
  tc qdisc show dev eth1
due to uninitialized attribute table.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years ago2.6.24-rc3 headers
Stephen Hemminger [Thu, 29 Nov 2007 21:56:15 +0000 (13:56 -0800)]
2.6.24-rc3 headers

Resync santized headers with 2.6.24-rc3

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoiproute 2.6.23 incompatibility
Patrick McHardy [Thu, 25 Oct 2007 17:46:29 +0000 (19:46 +0200)]
iproute 2.6.23 incompatibility

Arkadiusz Miskiewicz wrote:
> People are reporting that
>> ip link set multicast on dev eth0 (Invalid argument)
>> no longer works when using iproute 2.6.23 on kernel 2.6.21.
>>
>> On my testing machine it also fails:
>> # ./ip link set eth0 multicast on
>> RTNETLINK answers: Invalid argument

It seems it fails to properly detect that your kernel is missing
RTM_NEWLINK support. Apparently the reason is that the kernels
I tested with return a different error in this situation.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoFix typo in tunnel code (o_key vs. i_key).
Herbert Xu [Fri, 12 Oct 2007 08:56:40 +0000 (10:56 +0200)]
Fix typo in tunnel code (o_key vs. i_key).

If a dotted quad ikey is specified for GRE tunnels, it gets set as the
okey instead.  This patch fixes it. (http://bugs.debian.org/200714)

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoFix corruption when using batch files with comments and broken lines.
Andreas Henriksson [Fri, 12 Oct 2007 08:56:42 +0000 (10:56 +0200)]
Fix corruption when using batch files with comments and broken lines.
The problem was that length of allocation changed but caller not told.

Anyway, the patch fixes a problem resulting in a double free
that occurs when using batch files that contains a special combination
of broken up lines and comments as reported in:
http://bugs.debian.org/398912

Thanks to Michal Pokrywka <mpokrywka@hoga.pl> for testcase and information
on which conditions problem could be reproduced under.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoRemove bogus reference to tc-filters(8) from tc(8) manpage.
Andreas Barth [Fri, 12 Oct 2007 08:56:41 +0000 (10:56 +0200)]
Remove bogus reference to tc-filters(8) from tc(8) manpage.

Spotted by Aleš Kozumplík <al_es@seznam.cz>
(http://bugs.debian.org/289225)

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoAdd parameters to usage help text.
Alexander Wirt [Fri, 12 Oct 2007 08:56:37 +0000 (10:56 +0200)]
Add parameters to usage help text.

Add src option to route help text (http://bugs.debian.org/226142).
Add prio option to rule prio help text (http://bugs.debian.org/213673).

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoFix various typos and nitpicks
Alexander Wirt [Fri, 12 Oct 2007 08:56:36 +0000 (10:56 +0200)]
Fix various typos and nitpicks

Fix typo in ss manpage.
Make the backslash visible in ip manpage (http://bugs.debian.org/285507).
Strict syntax for ip addr advice in error message.
Fix typo in libnetlink(3) manpage (writen -> written).
Fix typos in tc-prio(8) manpage.
Fix typo in tc-htb(8) manpage (mininum -> minimum).
Fix typo in tc-cbq-details(8) manpage (occured -> occurred).

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoadd q_rr to tc Makefile
Stephen Hemminger [Tue, 16 Oct 2007 21:27:42 +0000 (14:27 -0700)]
add q_rr to tc Makefile

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoUpdate snapshot for release
Stephen Hemminger [Tue, 16 Oct 2007 21:26:51 +0000 (14:26 -0700)]
Update snapshot for release

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoAlso do tc_core_time2big argument (long->unsigned).
Andreas Henriksson [Fri, 12 Oct 2007 12:37:09 +0000 (14:37 +0200)]
Also do tc_core_time2big argument (long->unsigned).

tc_core_time2big only used in tc/q_netem.c where it gets passed an unsigned.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoSwitch helpers tc_core_{time2ktime,ktime2time} from long to unsigned as well.
Andreas Henriksson [Fri, 12 Oct 2007 11:49:49 +0000 (13:49 +0200)]
Switch helpers tc_core_{time2ktime,ktime2time} from long to unsigned as well.

Follow up patch to "Fix overflow in time2tick / tick2time." which switches
the remaining two helper functions from long to unsigned as well.
These functions are only used in "tc/q_hfsc.c" where both the passed argument
and the place the return value is stored are unsigned/u32 variables, so this
change should be safe to make but hasn't been tested as extensively as the
time2tick patch.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoPrevent renaming interfaces to empty string.
Patrick McHardy [Fri, 12 Oct 2007 12:01:13 +0000 (14:01 +0200)]
Prevent renaming interfaces to empty string.

Andreas Henriksson wrote:
> From: Alexander Wirt <formorer@debian.org>
>
>
> Signed-off-by: Andreas Henriksson <andreas@fatal.se>
> ---
>  ip/iplink.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/ip/iplink.c b/ip/iplink.c
> index 4060845..da1f64e 100644
> --- a/ip/iplink.c
> +++ b/ip/iplink.c
> @@ -670,6 +670,10 @@ static int do_set(int argc, char **argv)
>   }
>
>   if (newname && strcmp(dev, newname)) {
> + if (strlen(newname) == 0) {
> +     printf("\"\" is not valid device identifier\n");
> +     return -1;
> + }

Indentation fixed, same change for the non-ioctl case, use invarg.
While I'm at it I also fixed the error message for "name too long",
*argv is NULL at this point.

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoRevert "don't allow "" for device name"
Stephen Hemminger [Fri, 12 Oct 2007 22:44:44 +0000 (15:44 -0700)]
Revert "don't allow "" for device name"

Use Patrick's instead

This reverts commit ba371d989038e0dda803528c194e12e5177f7008.

16 years agoRevert "Remove bogus reference to tc-filters(8) from tc(8) manpage."
Stephen Hemminger [Fri, 12 Oct 2007 22:44:07 +0000 (15:44 -0700)]
Revert "Remove bogus reference to tc-filters(8) from tc(8) manpage."

This reverts commit 1bacc7ce752f795df3b1b3710245c4cd8c1bc396.

16 years agoDrop bogus reference to tc-filters and add lartc.org link to manpage.
Alexander Wirt [Fri, 12 Oct 2007 08:56:47 +0000 (10:56 +0200)]
Drop bogus reference to tc-filters and add lartc.org link to manpage.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoFix overflow in time2tick / tick2time.
Andreas Henriksson [Fri, 12 Oct 2007 08:56:46 +0000 (10:56 +0200)]
Fix overflow in time2tick / tick2time.

The helper functions gets passed an unsigned int, which gets cast to long
and overflows. See http://bugs.debian.org/175462

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoAdd new rtacct/nstat manpages and additional symlinks.
Andreas Henriksson [Fri, 12 Oct 2007 08:56:44 +0000 (10:56 +0200)]
Add new rtacct/nstat manpages and additional symlinks.

Symlink rtstat(8) and ctstat(8) to lnstat(8).
Add rtacct/nstat manpage based on doc/nstat.sgml as rtacct(8).
Symlink nstat(8) to rtacct(8).
Add arpd(8) symlink based on doc/arpd.sgml.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoFix ematch cmp and nbyte syntax help text.
Lionel Elie Mamane [Fri, 12 Oct 2007 08:56:43 +0000 (10:56 +0200)]
Fix ematch cmp and nbyte syntax help text.

The help/usage screen of ematch cmp and nbyte say recognised symbolic
values for "layer FOO" are link, header and next-header, but the code
does _not_ implement that: it will recognise "next-header" as what is
supposed to be "header" and will not recognise "header". The right
symbolic values seem to be link, network, transport. Here is a patch
that changes the help/usage screen to match the code.
(http://bugs.debian.org/438653)

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoRemove bogus reference to tc-filters(8) from tc(8) manpage.
Andreas Barth [Fri, 12 Oct 2007 08:56:41 +0000 (10:56 +0200)]
Remove bogus reference to tc-filters(8) from tc(8) manpage.

Spotted by Aleš Kozumplík <al_es@seznam.cz>
(http://bugs.debian.org/289225)

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agodon't allow "" for device name
Stephen Hemminger [Fri, 12 Oct 2007 21:43:03 +0000 (14:43 -0700)]
don't allow "" for device name

If a zero-length string is given, it is not rejected by
netlink in kernel so catch it at command line.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoremove support for IP multipath
Stephen Hemminger [Fri, 12 Oct 2007 21:38:30 +0000 (14:38 -0700)]
remove support for IP multipath

IP multipath routing was so buggy that it was dropped from the
current kernel.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoremove outdated netbug script.
Stephen Hemminger [Fri, 12 Oct 2007 20:50:43 +0000 (13:50 -0700)]
remove outdated netbug script.

Haven't received a bug from this script in years.
And it has several race conditions, etc.

See http://bugs.debian.org/289541, http://bugs.debian.org/313540,
http://bugs.debian.org/313541, and http://bugs.debian.org/313544.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoIPROUTE2: Support IPv4/IPv6 Tunnel
YOSHIFUJI Hideaki / 吉藤英明 [Fri, 12 Oct 2007 07:51:22 +0000 (16:51 +0900)]
IPROUTE2: Support IPv4/IPv6 Tunnel

Based on patch from Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp>.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agorto support for ip command
Rick Jones [Thu, 11 Oct 2007 20:04:11 +0000 (13:04 -0700)]
rto support for ip command

Enable users of ip to specify the times for rtt, rttvar and rto_min
in human-friendly terms a la "tc" while maintaining backwards
compatability with the previous "raw" mechanism.  Builds upon
David Miller's uncommited patch to set rto_min.

Signed-off-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agodon't make veth a shared library
Stephen Hemminger [Thu, 11 Oct 2007 20:01:42 +0000 (13:01 -0700)]
don't make veth a shared library

Making veth a shared library for ip caused build problems (not PIC)
and is unneeded.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoMerge 192.168.0.5:src/iproute2
Stephen Hemminger [Thu, 11 Oct 2007 19:43:27 +0000 (12:43 -0700)]
Merge 192.168.0.5:src/iproute2

16 years agolnstat : force a flush before sleep
Eric Dumazet [Thu, 27 Sep 2007 12:26:09 +0000 (14:26 +0200)]
lnstat : force a flush before sleep

Hi Stephen

This small patch allows to use lnstat/rtstat with a pipe output, without a full bufferisation.

Thank you
Eric

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years ago2.6.23 kernel headers
Stephen Hemminger [Thu, 11 Oct 2007 19:39:12 +0000 (12:39 -0700)]
2.6.23 kernel headers

Update headers to sanitized versions of 2.6.23 final

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoUpdate kernel headers to 2.6.23-rc5
Stephen Hemminger [Wed, 5 Sep 2007 12:05:21 +0000 (13:05 +0100)]
Update kernel headers to 2.6.23-rc5

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoip: xfrm: Fix flush message.
Masahide NAKAMURA [Fri, 24 Aug 2007 02:05:24 +0000 (11:05 +0900)]
ip: xfrm: Fix flush message.

Fix xfrm state or policy flush message.
And minor updates are included:
o Use static buffer to show unknown value as string.
o Show policy type (ptype) only when kernel specified it.
o Clean-up xfrm_monitor.

Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoip: xfrm: Fix policy and state flags.
Masahide NAKAMURA [Fri, 24 Aug 2007 02:05:18 +0000 (11:05 +0900)]
ip: xfrm: Fix policy and state flags.

o Support policy flag with string format.
  Note that kernel defines only one name "localok" for the flag
  and it has not had any effect currently.
o Support state flag value XFRM_STATE_NOPMTUDISC.
o Fix to show detailed flags value when "-s" option is used.
o Fix minor typo.

Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoip: xfrm: Clean-up for internal mask to filter.
Masahide NAKAMURA [Fri, 24 Aug 2007 02:05:07 +0000 (11:05 +0900)]
ip: xfrm: Clean-up for internal mask to filter.

Remove unused or redundant usage for xfrm_filter.

Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoModule for ip utility to support veth device (v.2.1)
Pavel Emelianov [Wed, 11 Jul 2007 09:33:55 +0000 (13:33 +0400)]
Module for ip utility to support veth device (v.2.1)

The usage is
# ip link add [name] type veth [peer <name>] [mac <mac>] [peer_mac <mac>]

This version doesn't include the fix for ip/iplink.c as Patrick
said that he had included it into his patches already.

Signed-off-by: Pavel Emelianov <xemul@openvz.org>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agovlan support
Patrick McHardy [Sat, 1 Sep 2007 16:47:19 +0000 (18:47 +0200)]
vlan support

This is a resend of the iproute VLAN patch with the if_link.h changes
edited out since the headers are already synced.

[IPROUTE]: VLAN support

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoFix modes of test files
Stephen Hemminger [Wed, 5 Sep 2007 11:00:01 +0000 (12:00 +0100)]
Fix modes of test files

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoRevert "Make ip utility veth driver aware"
Stephen Hemminger [Wed, 5 Sep 2007 10:51:10 +0000 (11:51 +0100)]
Revert "Make ip utility veth driver aware"

This reverts commit 4ed390ce43d1ec7c881721f312260df901d8390d.
Newer version doesn't use genetlink.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoFix bug in display of ipv6 cloned/cached routes
Sridhar Samudrala [Wed, 22 Aug 2007 17:55:47 +0000 (10:55 -0700)]
Fix bug  in display of ipv6 cloned/cached routes

This patch fixes a bug in the 'ip' command to display
IPv6 cloned routes.
  ip -6 route ls cache
returns empty even when there are cloned routes because of
of a missing else in print_route() routine.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
16 years agoFix meta ematch usage of 0 values
Patrick McHardy [Wed, 11 Jul 2007 12:48:12 +0000 (14:48 +0200)]
Fix meta ematch usage of 0 values

em_meta doesn't send 0 values to the kernel. breaking matching on them and
resulting in "Missing value TLV" messages on dump.

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoiplink: use netlink for link configuration
Patrick McHardy [Wed, 22 Aug 2007 17:49:01 +0000 (10:49 -0700)]
iplink: use netlink for link configuration

Add support for using netlink for link configuration. Kernel-support is
probed, when not available it falls back to using ioctls.

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoFix m_ipt build
Stephen Hemminger [Wed, 22 Aug 2007 17:33:33 +0000 (10:33 -0700)]
Fix m_ipt build

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoMake ip utility veth driver aware
Pavel Emelianov [Wed, 2 May 2007 10:57:57 +0000 (14:57 +0400)]
Make ip utility veth driver aware

The new command is called "veth" with the following syntax:
* ip veth add <dev1> <dev2>
  creates interconnected pair of veth devices.
* ip veth del <dev>
  destroys the pair of veth devices, where <dev> is either
  <dev1> or <dev2> used to create the pair.

One question that is to be solved is whether or not to create
a hard-coded netlink family for veth driver. Without it the
family resolution code has to be moved to general place in ip
utility (by now it is copy-paste-ed from one file to another
till final decision).

Signed-off-by: Pavel Emelianov <xemul@openvz.org>
16 years agoUse FRA_* attributes for routing rules
Patrick McHardy [Wed, 22 Aug 2007 17:26:12 +0000 (10:26 -0700)]
Use FRA_* attributes for routing rules

Use the FRA attributes for routing rules, with exception of RTA_GATEWAY
(used for route-NAT) which isn't supported by current kernels anymore
and thus doesn't exist as FRA attribute.

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agosanitized headers update to 2.6.23-rc3
Stephen Hemminger [Wed, 22 Aug 2007 17:19:53 +0000 (10:19 -0700)]
sanitized headers update to 2.6.23-rc3

Update headers

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoiproute2: sch_rr support in tc
PJ Waskiewicz [Tue, 14 Aug 2007 18:21:24 +0000 (11:21 -0700)]
iproute2: sch_rr support in tc

This patch applies on top of Patrick McHardy's RTNETLINK
patches to add nested compat attributes.  This is needed to maintain
ABI for sch_{rr|prio} in the kernel with respect to tc.  A new option,
namely multiqueue, was added to sch_prio and sch_rr.  This will allow
a user to turn multiqueue support on for sch_prio or sch_rr at loadtime.
Also, tc qdisc ls will display whether or not multiqueue is enabled on
that qdisc.  When in multiqueue mode, a user can specify a value of 0 for
bands, and the number of bands will be created to match the number of
queues on the device.

This patch is to support the new sch_rr (round-robin) qdisc being proposed
in NET for multiqueue network device support in the Linux network stack.
It uses q_prio.c as the template, since the qdiscs are nearly identical,
outside of the ->dequeue() routine.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
16 years agoIPROUTE2: RTNETLINK nested attributes
Patrick McHardy [Tue, 14 Aug 2007 18:21:19 +0000 (11:21 -0700)]
IPROUTE2: RTNETLINK nested attributes

This adds capability for iproute2 to send nested attributes to the
kernel, while maintaining backwards compatibility.

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoshow multicast groups
Johannes Berg [Thu, 19 Jul 2007 09:13:18 +0000 (11:13 +0200)]
show multicast groups

Update the included version of the genetlink.h header to the multicast
group API and make the generic netlink controller part show multicast
groups where applicable. Also fix two typos.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
16 years agoBug fix tc action drop
Patrick McHardy [Wed, 18 Jul 2007 10:46:20 +0000 (12:46 +0200)]
Bug fix tc action drop

>>That command is from a script that used to work with iproute2-ss020116
>>(2002!), which had the following in tc/m_police.c:
>>
>>210     } else if (strcmp(*argv, "action") == 0) {
>>211             NEXT_ARG();
>>212             if (get_police_result(&p.action, &presult, *argv)) {
>>
>>I don't know when that bit was dropped, but it used to be there. :-)
>
>
>
> Indeed, I missed that. I'll fix up the patch ..

OK this patch fixes parsing of "action ...". I've removed
the erroring on unknown arguments again since in that case
the caller should continue parsing.

16 years agoTC action parsing bug fix
Patrick McHardy [Wed, 18 Jul 2007 09:49:55 +0000 (11:49 +0200)]
TC action parsing bug fix

>
> Is it a bug that:
>
>   # tc filter add dev eth0 parent 1: protocol ip prio 0 handle 0xfffffff
>     fw police rate 1 burst 1 mpu 0 mtu 1 action drop
>                                          ^^^^^^^^^^^
> creates a filter that looks like:
>
>   # tc filter ls dev eth0
>   filter parent 1: protocol ip pref 49152 fw
>   filter parent 1: protocol ip pref 49152 fw handle 0xfffffff police 0x1
>   rate 0bit burst 0b mtu 1b action reclassify
>                             ^^^^^^^^^^^^^^^^^
>   ref -543190236 bind 4
>
> (which reclassifies and thus lets 0xfffffff-marked packets through).
>
> I'm pretty sure this used to work under 2.4.x (though I no longer have a
> 2.4 box to test with), but it hasn't worked on any of the 2.6.x kernels
> I've tried (with both iproute2-ss060323 and 070710).

Good catch. It seems this is merely a parsing error, iproute doesn't
have an "action" parameter and aborts parsing, so it uses the default
value of "RECLASSIFY". It never had this parameter, so this patch
removes it from the help text and makes it return an error.

16 years agoFix ss to handle partial records.
Stephen Hemminger [Wed, 18 Jul 2007 14:31:29 +0000 (15:31 +0100)]
Fix ss to handle partial records.

Output from /proc may include partial records, so rather than
trying to be sexy and do own parsing, just use stdio.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agov2.6.22-070710
Stephen Hemminger [Wed, 11 Jul 2007 01:34:14 +0000 (18:34 -0700)]
v2.6.22-070710

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoip/routef lifesaver
Mike Frysinger [Sat, 15 Jul 2006 07:31:48 +0000 (03:31 -0400)]
ip/routef lifesaver

keep people from screwing their systems with routef

minor patch here ... if you run `routef --help`,
it'll turn around and flush your routing tables anyways :)

so patch will have routef output usage if any arguments are given,
otherwise it'll flush the tables ... idea is from Lars Strojny

16 years agoss: fix issues with signed inodes
Stephen Hemminger [Wed, 11 Jul 2007 01:26:54 +0000 (18:26 -0700)]
ss: fix issues with signed inodes

Some parts of ss were incorrectly assuming inode number was int
not unsigned.

16 years agoSnapshot update for 2.6.22
Stephen Hemminger [Mon, 25 Jun 2007 16:42:30 +0000 (09:42 -0700)]
Snapshot update for 2.6.22

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoAdd TC_LIB_DIR environment variable.
Stephen Hemminger [Wed, 20 Jun 2007 22:27:22 +0000 (15:27 -0700)]
Add TC_LIB_DIR environment variable.

Don't hardcode /usr/lib/tc as a path

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agonetem: static
Stephen Hemminger [Wed, 20 Jun 2007 22:20:22 +0000 (15:20 -0700)]
netem: static

Make netem static rather than shared library. It saves problems
on 64 bit platforms.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agofix build warnings
Stephen Hemminger [Wed, 20 Jun 2007 17:55:18 +0000 (10:55 -0700)]
fix build warnings

Fix problems from recent if.h related changes.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years ago[Fwd: Re: more iproute2 issues (not critical)]
Patrick McHardy [Tue, 19 Jun 2007 23:37:53 +0000 (01:37 +0200)]
[Fwd: Re: more iproute2 issues (not critical)]

This one also makes sense for the release I guess.

-------- Original Message --------
Subject:  Re: more iproute2 issues (not critical)
Date:  Sat, 31 Mar 2007 16:16:56 +0200
From:  Patrick McHardy <kaber@trash.net>
To:  Denys <denys@visp.net.lb>
CC: Stephen Hemminger <shemminger@linux-foundation.org>,
netdev@vger.kernel.org
References:  <20070321175951.M73913@visp.net.lb>
<46026717.9060909@trash.net> <20070322124533.M79867@visp.net.lb>
<46027FF2.6020001@trash.net> <20070322101224.3e6bb899@freekitty>
<20070331021401.M17326@visp.net.lb> <20070331023011.M8101@visp.net.lb>

Denys wrote:
> Ooops, sorry, it seems my fault, no library exist on this system.
> But i guess it must not coredump in this case? Is it possible to check if
> library not exist and just print some nice message?
> It is trivial i guess.

The problem is that lib_dir is NULL when calling get_target_names.
This patch fixes it.

[IPROUTE]: m_ipt: fix crash when dumping rules

lib_dir is NULL when calling get_target_name, causing a NULL pointer
dereference in the strlen call.

Signed-off-by: Patrick McHardy <kaber@trash.net>
16 years agoiproute2: Support IFF_LOWER_UP and IFF_DORMANT
Thomas Graf [Tue, 19 Jun 2007 23:40:40 +0000 (16:40 -0700)]
iproute2: Support IFF_LOWER_UP and IFF_DORMANT

In order to support these new flags add current
linux/if.h into the directory with the local copies.
This caused troubles with outdated redefinitions from net/if.h
so I've removed the dependency on it.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoFix symbolic link to tc-bfifo.8
Yasuyuki KOZAKAI [Mon, 18 Jun 2007 02:16:42 +0000 (11:16 +0900)]
Fix symbolic link to tc-bfifo.8

tc-pbfifo.8 does not exist because it was moved to tc-bfifo.8.

Signed-off-by: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoiproute2: Format IPv6 tunnels endpoints nicely.
David Lamparter [Sat, 9 Jun 2007 13:53:58 +0000 (15:53 +0200)]
iproute2: Format IPv6 tunnels endpoints nicely.

Change formatting of IPv6 tunnel endpoints from hex chain to standard IPv6
representation.

Signed-off-by: David Lamparter <equinox@diac24.net>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agofix last change
Stephen Hemminger [Tue, 19 Jun 2007 23:24:08 +0000 (16:24 -0700)]
fix last change

Need to use correct XFRMA_ constants.
Get rid of bogus casts. Fix case where no attribute returned.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agosee SPD info
jamal [Thu, 3 May 2007 23:20:29 +0000 (19:20 -0400)]
see SPD info

and heres the SPD version ...

cheers,
jamal

[XFRM] see SPD info

i.e instead of something like ip xfrm policy ls | grep -i src | wc -l
do:

ip xfrm policy count
And you get the count; you can also pass -s or -s -s to see more
details

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agosee SAD info
jamal [Thu, 3 May 2007 23:09:41 +0000 (19:09 -0400)]
see SAD info

Stephen,
Use this patch instead of the one i sent yesterday.
As before, you will need to pull include/linux/xfrm.h from
net-2.6 once Dave applies the kernel patch.

cheers,
jamal

[XFRM] see SAD info

i.e instead of something like ip xfrm state ls | grep -i src | wc -l
do:

ip xfrm state count
And you get the count; you can also pass -s to the command line and
get the hash info.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoip: add support for displaying link types 802 and 803
Pavel Roskin [Wed, 28 Mar 2007 13:43:49 +0000 (09:43 -0400)]
ip: add support for displaying link types 802 and 803

802 is 802.11 with prism headers.  803 is 802.11 with radiotap headers.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoiproute2: support for goto/nop action and detached flag
Thomas Graf [Tue, 27 Mar 2007 00:04:10 +0000 (02:04 +0200)]
iproute2: support for goto/nop action and detached flag

Stephen,

Patch to support the new fib rules features I just posted
on netdev.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
16 years agoheaders update to 2.6.22
Stephen Hemminger [Tue, 19 Jun 2007 22:55:46 +0000 (15:55 -0700)]
headers update to 2.6.22

Update to sanitized version of 2.6.22-rc5 headers.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
17 years agoincorrect initialization
Stephen Hemminger [Fri, 11 May 2007 02:33:21 +0000 (19:33 -0700)]
incorrect initialization

Fix initialization in libnetlink.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
17 years agoAdd xt_tcpudp.h
Stephen Hemminger [Fri, 16 Mar 2007 18:47:42 +0000 (11:47 -0700)]
Add xt_tcpudp.h

Needed for cross/backwards compiles.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
17 years agoRevert "Increase internal clock resolution to nsec"
Stephen Hemminger [Wed, 14 Mar 2007 17:14:07 +0000 (10:14 -0700)]
Revert "Increase internal clock resolution to nsec"

This reverts fd784ccaf649128965be016f857708669e798479 commit.

Thanks Stephen, but actually I think the last patch (increase clock
resolution) shouldn't go in yet. I'm not done yet looking at all
the compatibility issues and it does change the range of valid
values for everything dealing with times. Most places I looked
at still accept reasonable ranges, but I would feel more comfortable
to make sure everything is fine first.

17 years agoIproute2 v2.6.20-070313
Stephen Hemminger [Tue, 13 Mar 2007 21:50:56 +0000 (14:50 -0700)]
Iproute2 v2.6.20-070313

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
17 years agoOld bug on tc
jamal [Thu, 8 Mar 2007 01:40:25 +0000 (20:40 -0500)]
Old bug on tc

> It is in current git tree.

A small fix attached after some testing.
Please dont forget to apply my other patches. When you have them let me
know so i can do some more testing.

cheers,
jamal

[TC] Get iptables path selection to set correct path

A small tweak on top of Stephens patch

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
17 years agoIncrease internal clock resolution to nsec
Patrick McHardy [Sun, 4 Mar 2007 19:15:04 +0000 (20:15 +0100)]
Increase internal clock resolution to nsec

[IPROUTE]: Increase internal clock resolution to nsec

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
17 years agoHandle different kernel clock resolutions
Patrick McHardy [Sun, 4 Mar 2007 19:15:03 +0000 (20:15 +0100)]
Handle different kernel clock resolutions

[IPROUTE]: Handle different kernel clock resolutions

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
17 years agoAdd sprint_ticks() function and use in CBQ
Patrick McHardy [Sun, 4 Mar 2007 19:15:01 +0000 (20:15 +0100)]
Add sprint_ticks() function and use in CBQ

[IPROUTE]: Add sprint_ticks() function and use in CBQ

Add helper function to print ticks to avoid assumptions about clock
resolution in CBQ.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
17 years agoReplace "usec" by "time" in function names
Patrick McHardy [Sun, 4 Mar 2007 19:15:00 +0000 (20:15 +0100)]
Replace "usec" by "time" in function names

[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>
17 years agoIntroduce TIME_UNITS_PER_SEC to represent internal clock resolution
Patrick McHardy [Sun, 4 Mar 2007 19:14:59 +0000 (20:14 +0100)]
Introduce TIME_UNITS_PER_SEC to represent internal clock resolution

[IPROUTE]: Introduce TIME_UNITS_PER_SEC to represent internal clock resolution

Introduce TIME_UNITS_PER_SEC and conversion functions between internal
resolution and resolution expected by the kernel (currently implemented as
NOPs, only needed by HFSC, which currently always uses microseconds).

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>