History log of /external/iproute2/ip/link_iptnl.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2539a407bb613484436f60bc1b14879694907cc9 17-Aug-2017 Julien Fortin <julien@cumulusnetworks.com> ip: link_iptnl.c: add json output support

Schema
{
"remote": {
"type": "string",
"attr": "IFLA_IPTUN_REMOTE"
},
"local": {
"type": "string",
"attr": "IFLA_IPTUN_LOCAL"
},
"link": {
"type": "string",
"attr": "IFLA_IPTUN_LINK",
"mutually_exclusive": {
"link_index": {
"type": "uint",
}
}
},
"ttl": {
"type": "int",
"attr": "IFLA_IPTUN_TTL"
},
"tos": {
"type": "string",
"attr": "IFLA_IPTUN_TOS"
},
"pmtudisc": {
"type": "bool",
"attr": "IFLA_IPTUN_PMTUDISC"
},
"isatap": {
"type": "bool",
"attr": "SIT_ISATAP & IFLA_IPTUN_FLAGS"
},
"6rd": {
"type": "dict",
"attr": "IFLA_IPTUN_6RD_PREFIXLEN",
"dict": {
"prefix": {
"type": "string"
},
"prefixlen": {
"type": "uint",
"attr": "IFLA_IPTUN_6RD_PREFIXLEN"
},
"relay_prefix": {
"type": "string"
},
"relay_prefixlen": {
"type": "uint",
"attr": "IFLA_IPTUN_6RD_PREFIXLEN"
}
}
},
"encap": {
"type": "dict",
"attr": "IFLA_IPTUN_ENCAP_TYPE",
"dict": {
"type": {
"type": "string",
"attr": "IFLA_IPTUN_ENCAP_TYPE"
},
"sport": {
"type": "uint",
"attr": "IFLA_IPTUN_ENCAP_SPORT"
},
"dport": {
"type": "uint",
"attr": "IFLA_IPTUN_ENCAP_DPORT"
},
"csum": {
"type": "bool",
"attr": "TUNNEL_ENCAP_FLAG_CSUM"
},
"csum6": {
"type": "bool",
"attr": "TUNNEL_ENCAP_FLAG_CSUM6"
},
"remcsum": {
"type": "bool",
"attr": "TUNNEL_ENCAP_FLAG_REMCSUM"
}
}
}
}

$ ip tunnel add tun0 mode ipip local 192.0.2.1 remote 198.51.100.3
$ ip link show
10: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group
default
link/ipip 0.0.0.0 brd 0.0.0.0
11: tun0@NONE: <POINTOPOINT,NOARP> mtu 1480 qdisc noop state DOWN mode
DEFAULT group default
link/ipip 192.0.2.1 peer 198.51.100.3
$ ip -details -json link show
[{
"ifindex": 10,
"ifname": "tunl0",
"link": null,
"flags": ["NOARP"],
"mtu": 1480,
"qdisc": "noop",
"operstate": "DOWN",
"linkmode": "DEFAULT",
"group": "default",
"link_type": "ipip",
"address": "0.0.0.0",
"broadcast": "0.0.0.0",
"promiscuity": 0,
"linkinfo": {
"info_kind": "ipip",
"info_data": {
"remote": "any",
"local": "any",
"ttl": 0,
"pmtudisc": false
}
},
"num_tx_queues": 1,
"num_rx_queues": 1,
"gso_max_size": 65536,
"gso_max_segs": 65535
},{
"ifindex": 11,
"ifname": "tun0",
"link": null,
"flags": ["POINTOPOINT","NOARP"],
"mtu": 1480,
"qdisc": "noop",
"operstate": "DOWN",
"linkmode": "DEFAULT",
"group": "default",
"link_type": "ipip",
"address": "192.0.2.1",
"link_pointtopoint": true,
"broadcast": "198.51.100.3",
"promiscuity": 0,
"linkinfo": {
"info_kind": "ipip",
"info_data": {
"remote": "198.51.100.3",
"local": "192.0.2.1",
"ttl": 0,
"pmtudisc": true
}
},
"num_tx_queues": 1,
"num_rx_queues": 1,
"gso_max_size": 65536,
"gso_max_segs": 65535
}
]

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
/external/iproute2/ip/link_iptnl.c
288c28bc114890cb043e13934e39677fd3532ff9 10-Jun-2017 Krister Johansen <kjlx@templeofstupid.com> iptunnel: add support for mpls/ip to ipip tunnels

Original-Author: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Krister Johansen <kjlx@templeofstupid.com>
/external/iproute2/ip/link_iptnl.c
f005b700cf076020e882ffadce693deb13a88488 10-Jun-2017 Krister Johansen <kjlx@templeofstupid.com> iptunnel: add support for mpls/ip to sit tunnels

Original-Author: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Krister Johansen <kjlx@templeofstupid.com>
/external/iproute2/ip/link_iptnl.c
ad4b1425c31821d3dcd3484ce75114c4be703313 21-Apr-2017 Craig Gallek <kraig@google.com> iplink: Expose IFLA_*_FWMARK attributes for supported link types

This attribute allows the administrator to adjust the packet marking
attribute of tunnels that support policy based routing.

Signed-off-by: Craig Gallek <kraig@google.com>
/external/iproute2/ip/link_iptnl.c
8b47135474cde4f0f8c9991741132b930bf3e192 28-Mar-2017 Phil Sutter <phil@nwl.cc> ip: link: Unify link type help functions a bit

Take help function in iplink_bridge.c as an example and make other link
types' help functions similar:

* Use a single fprintf() call (if possible).
* Don't state a full command line, just "... type OPTIONS".
* Put every option in it's own line, align options by column.
* List mandatory options first.

link_veth.c is intentionally left untouched because it's 'peer' option
eats all kinds of generic link options and the help text points this out
without duplicating all the options there again.

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/ip/link_iptnl.c
9f1370c0e5aad7bd7b2abc72445ff3f7f87a6368 24-Feb-2017 Stephen Hemminger <stephen@networkplumber.org> netlink route attribute cleanup

Use the new helper functions rta_getattr_u* instead of direct
cast of RTA_DATA(). Where RTA_DATA() is a structure, then remove
the unnecessary cast since RTA_DATA() is void *

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
/external/iproute2/ip/link_iptnl.c
4bfe6825367010112853d1763a51bcf20f16565c 20-Sep-2016 Alexei Starovoitov <ast@fb.com> iptnl: add support for collect_md flag in IPv4 and IPv6 tunnels

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
/external/iproute2/ip/link_iptnl.c
d17b136f7d7dd6ed7ea518e4f068d3de735e8756 18-Jul-2016 Phil Sutter <phil@nwl.cc> Use C99 style initializers everywhere

This big patch was compiled by vimgrepping for memset calls and changing
to C99 initializer if applicable. One notable exception is the
initialization of union bpf_attr in tc/tc_bpf.c: changing it would break
for older gcc versions (at least <=3.4.6).

Calls to memset for struct rtattr pointer fields for parse_rtattr*()
were just dropped since they are not needed.

The changes here allowed the compiler to discover some unused variables,
so get rid of them, too.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
/external/iproute2/ip/link_iptnl.c
a418e451643e77fe36861e53359587ba8aa41873 22-Mar-2016 Phil Sutter <phil@nwl.cc> make format_host non-reentrant by default

There are only three users which require it to be reentrant, the rest is
fine without. Instead, provide a reentrant format_host_r() for users
which need it.

Signed-off-by: Phil Sutter <phil@nwl.cc>
/external/iproute2/ip/link_iptnl.c
56f5daac98da0c405fdbc52f04afd5de82404bce 21-Mar-2016 Stephen Hemminger <stephen@networkplumber.org> ip: code cleanup

Run all the ip code through checkpatch and have it fix the obvious stuff.
/external/iproute2/ip/link_iptnl.c
c079e121a73af5eb49e003b13607e8a690331df6 27-May-2015 Stephen Hemminger <shemming@brocade.com> libnetlink: add size argument to rtnl_talk

There have been several instances where response from kernel
has overrun the stack buffer from the caller. Avoid future problems
by passing a size argument.

Also drop the unused peer and group arguments to rtnl_talk.
/external/iproute2/ip/link_iptnl.c
858dbb208e3934525674252a6b6cf7d36a9de191 29-Jan-2015 Tom Herbert <therbert@google.com> ip link: Add support for remote checksum offload to IP tunnels

This patch adds support to remote checksum checksum offload
confinguration for IPIP, SIT, and GRE tunnels. This patch
adds a [no]encap-remcsum to ip link command which applicable
when configured tunnels that use GUE.

http://tools.ietf.org/html/draft-herbert-remotecsumoffload-00

Example:

ip link add name tun1 type gre remote 192.168.1.1 local 192.168.1.2 \
ttl 225 encap fou encap-sport auto encap-dport 7777 encap-csum \
encap-remcsum

This would create an GRE tunnel in GUE encapsulation where the source
port is automatically selected (based on hash of inner packet),
checksums in the encapsulating UDP header are enabled (needed.for
remote checksum offload), and remote checksum ffload is configured to
be used on the tunnel (affects TX side).

Signed-off-by: Tom Herbert <therbert@google.com>
/external/iproute2/ip/link_iptnl.c
c1159152e1b3abeee74b2d46f67e97fb5fa53ce4 05-Nov-2014 Tom Herbert <therbert@google.com> ip link ipip: Add support to configure FOU and GUE

This patch adds support to configure foo-over-udp (FOU) and Generic
UDP Encapsulation for IPIP and sit tunnels. This configuration allows
selection of FOU or GUE for the tunnel, specification of the source and
destination ports for UDP tunnel, and enabling TX checksum. This
configuration only affects the transmit side of a tunnel.

Example:

ip link add name tun1 type ipip remote 192.168.1.1 local 192.168.1.2 \
ttl 225 encap gue encap-sport auto encap-dport 9999 encap-csum

This would create an IPIP tunnel in GUE encapsulation where the source
port is automatically selected (based on hash of inner packet) and
checksums in the encapsulating UDP header are enabled.

Signed-off-by: Tom Herbert <therbert@google.com>
/external/iproute2/ip/link_iptnl.c
561e650eff679296d3f4c12657721ae769cbc187 30-Sep-2014 vadimk <vadim4j@gmail.com> ip link: Shortify printing the usage of link type

Allow to print particular link type usage by:

ip link help [TYPE]

Currently to print usage for some link type it is needed
to use the following way:

ip link { add | del | set } type TYPE help

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
/external/iproute2/ip/link_iptnl.c
30d07e9e36a4fd1044ed10b36e91dc6a124c6c3c 26-Aug-2013 Richard Godbee <richard@godbee.net> iproute2: spelling: noptmudisc -> nopmtudisc

Signed-off-by: Richard Godbee <richard@godbee.net>
/external/iproute2/ip/link_iptnl.c
77620be89af6087c1ff63467f9ccb036db37a033 16-Jul-2013 Nicolas Dichtel <nicolas.dichtel@6wind.com> ip: allow to specify mode for sit tunnels

It's now possible to have IPv4 and IPv6 over IPv4 tunnels with the module sit.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
/external/iproute2/ip/link_iptnl.c
195f0f62d7ae3eb1f98dda46de852660503370eb 14-Dec-2012 Nicolas Dichtel <nicolas.dichtel@6wind.com> ip/link_iptnl: fix indentation Logged in as shemminger

Use tabs instead of space when possible.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
/external/iproute2/ip/link_iptnl.c
1ce2de97386e38c258ee2048a80ee28d0e8bad01 12-Dec-2012 Nicolas Dichtel <nicolas.dichtel@6wind.com> ip: add support of 'ip link type [ipip|sit]'

This patch allows to manage ip tunnels via the interface ip link.
The syntax for parameters is the same that 'ip tunnel'.

It also allows to display tunnels parameters with 'ip -details link' or
'ip -details monitor link'.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
/external/iproute2/ip/link_iptnl.c