Commit Graph

82 Commits

Author SHA1 Message Date
bersoare
7992ad9959 add support for bareudp link type 2021-09-17 10:14:18 -07:00
Dennis Afanasev
21f2c55a77 Add PHYS_SWITCH_ID attribute to LinkAttrs 2021-07-03 11:55:58 +02:00
dennisafa
d1e684a60b Ability to set multicast attribute on a link 2021-05-30 12:51:51 +02:00
Riccardo Manfrin
af1e63ea7b Adds vrf slave link slave data parse 2021-05-10 07:22:18 -07:00
Bjorn Svensson
6063cc66d7 Add allmulti to link attributes
Provide the status of the allmulticast option via the highlevel
link attributes instead of requiring raw flag handling.

Avoid comparing all rawflags before and after in tests due to that
the IFF_RUNNING flag might change independenly.

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
2021-05-08 09:10:00 -07:00
Wei Yang
aa68aabe05 Add ipvtap link support
ipvtap is a similar link type as ipvlan with tap interface.

This patch enables it just like macvtap.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
2021-05-08 08:48:48 -07:00
Riccardo Manfrin
ec93726159 Adds strings translation methods
RTPROT_KEEPALIVED is commented to interop with earlier go versions (1.13, 1.14)
2021-03-04 14:52:04 -08:00
Stephen Hassard
d185ffdb62 Add Geneve link support
Heavily based on the existing Gretap support
2020-11-21 23:35:49 -08:00
lmbsog0
c7261bd9e0 add support for CAN 2020-11-20 12:42:29 -08:00
Riccardo Manfrin
8b655377ac Allows direct usage of String() method 2020-11-19 09:59:55 -08:00
root
e30b76407c VF stats struct and deserialization method added. VfStats now reported in the VfInfo struct
Co-authored-by: PatrickKutch <patrick.kutch@gmail.com>
2020-10-19 15:29:26 -04:00
Konstantin Baranov
337442361b Allow placing veth peer into a namespace
Creating a veth pair across namespaces now is a multistep process.
Doing it in one shot with this change is clearer as current
namespace never sees peer IF. Also, moving peer into a namespace
may be rather slow, so better avoided.
2020-09-14 10:57:23 -04:00
Dennis Marttinen
9690c54307 Add support for configuring bridge ageing time
Signed-off-by: Dennis Marttinen <dennis@weave.works>
2020-09-14 10:49:43 -04:00
Julian Kornberger
01e0a49c1f Add additional fields to link.Ip6tnl
and optimize aligment of Sittun fields
2020-09-14 10:42:05 -04:00
Sylvain Baubeau
fe26ba2db0 Set default values for link attributes
When deserializing a link related netlink message, if no network namespace id
attribute is specified, we need to set it to -1 otherwise it defaults to 0
which is a valid id. Using NewLinkAttrs sets the default values and allows
the user to distinguish an empty value from a missing value
2020-09-14 10:41:08 -04:00
Dmitrii Okunev
dc0e1b988c feature: Add wireguard link type
Added type "Wireguard" which implements link type "wireguard".

See also https://www.wireguard.com/

Signed-off-by: Dmitrii Okunev <xaionaro@fb.com>
2020-06-04 09:01:02 -07:00
Konstantin Belyalov
b2372689b9 Save XDP attach mode into LinkXdp. 2020-01-27 15:47:19 -08:00
Oleg Senin
6b3a223c53 Add ip6tnl support 2019-09-24 13:56:29 -07:00
Takushi Fujiwara
205a160d2e Add bond slave information
This PR refers to PR@lebauce and add some changes.
- Added some tests to retrieve bond slave information.
- Link.BondSlave is changed to LinkSlave interface.
- BondSlaveState.String() returns UPPER case. (same as iproute2)
- BondSlaveMiiStatus.String() returns UPPER case. (same as iproute2)
2019-09-16 08:52:39 -07:00
Adrian Chiris
46ae81cf70 Add support for IPoIB interfaces
- Add a new Link type, IPoIB, that exposes the following IPoIB attributes:
    * IFLA_IPOIB_PKEY
    * IFLA_IPOIB_MODE
    * IFLA_IPOIB_UMCAST
- Suppport Deserialize for IPoIB link attributes in LinkDeserialize()
- Support IPoIB attributes in LinkAdd()
2019-08-12 04:46:40 -07:00
Adrian Chiris
28720742a4 Add support for IFLA_VF_RATE
Today netlink package supports Get/Set of a VF's max TX rate
via IFLA_VF_TX_RATE netlink attribute.

This patch add support to Get/Set of a VFs min and max TX rate
via IFLA_VF_RATE netlink attribute.

- Add support to set min/max tx rate for VF via IFLA_VF_RATE
- Added IFLA_VF_RATE min/max tx rate attributes to netlink.VfInfo
  including parsing support in netlink.parseVfInfo()

NOTE: According to [1] IFLA_VF_RATE takes precedence over
      IFLA_VF_TX_RATE. Dealing with the co-existance of these
      netlink attributes is left for the user to handle.

[1]https://lists.openwall.net/netdev/2014/05/22/42
2019-07-25 03:38:53 +02:00
bingshen.wbs
14bd2e6fd2 support ipvlan flag
Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
2019-07-25 03:37:08 +02:00
Anton Aksola
df01369528 add support for link groups (IFLA_GROUP) 2019-07-13 20:34:27 -07:00
Martynas Pumputis
99a56c251a veth: Set peer hardware addr when creating
This commit extends LinkAdd function for Veth by allowing to specify
peer hardware addr.

Signed-off-by: Martynas Pumputis <m@lambda.lt>
2019-06-18 07:33:17 -07:00
Archana Shinde
db99c040b9 tuntap: Return TunTapLink instead of GenericLink
For tuntap interfaces, return a TunTap Interface instead of
a Generic link when retrieving the interface.
Use netlink extended attributes to populate the Link attributes
for the tuntap link.
In case of older tun driver which does not provide these
attributes, use sysfs to retrieve these attributes.

This commit also adds Owner and Group attributes for the TunTap
Link.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-06-03 12:01:21 -07:00
soyking
fafc1e7b60 support vlan protocol 2019-05-03 14:23:34 -07:00
Andrei Vagin
adb577d4a4 Add support for IFLA_GSO_*
IFLA_GSO_MAX_SIZE - maximum GSO segment size
IFLA_GSO_MAX_SEGS - maximum number of GSO segments

Signed-off-by: Andrei Vagin <avagin@google.com>
2019-03-17 17:31:49 -07:00
Matt Ellison
1e2e7ab670 Add Support for Virtual XFRM Interfaces
XFRM interfaces are available in Linux Kernel 4.19+

When an IF_ID is applied to a XFRM policy and state, the corresponding
traffic will be sent through the virtual interface with the same IF_ID.
2019-01-05 11:40:40 -08:00
Div Arora
0bbc55bea9 Initial support for vlan aware bridges. 2018-07-23 11:15:57 -07:00
Ralph Schmieder
d85e18ed5b Allow Tuntap non-persist, allow empty tuntap name
chg: addtl comment and made minor logic optimization as disscussed in PR #296
chg: flipped Persist to NonPersist
chg: comments, only unpersist tuntap if flag is set
chg: tuntap persist optional, allow empty intfc name
chg: added conditional build
Signed-off-by: Ralph Schmieder <ralph.schmieder@gmail.com>
2018-07-16 09:40:17 -07:00
semicomplete
ee06b1df73 add vti6 support
Signed-off-by: semicomplete <example@example.com>
2018-06-19 08:48:34 -07:00
Piotr Skamruk
5f662e0500 Add info about VFs on link 2018-05-10 08:45:05 -07:00
Alessandro Boch
5a988e882d Support IPv6 GRE Tun and Tap
Signed-off-by: Alessandro Boch <aboch@tetrationanalytics.com>
2018-01-19 09:48:20 -08:00
Luke Granger-Brown
016ba6f67a Add support for managing source MACVLANs 2017-11-27 22:19:10 -08:00
Manohar Castelino
c2a3de3b38 tuntap: Add multiqueue support
Add multi queue support to tuntap without breaking legacy users
of tuntap.

Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
2017-11-13 20:19:46 -08:00
Tomofumi Hayashi
e104583c52 Support num{tx,rx}queues and udp6zerocsum{tx,rx}
Add IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES in link attribute and
IFLA_VXLAN_UDP_ZERO_CSUM6_TX and IFLA_VXLAN_UDP_ZERO_CSUM6_RX in VXLAN
attribute.
2017-11-13 20:19:27 -08:00
Reinier Schoof
c29ba20204 added encapsulation attributes to Iptun
added encapsulation attributes to Gretun
implemented Sittun struct for supporting SIT tunnels
2017-10-26 09:48:08 -07:00
Sylvain Afchain
b2de5d10e3 Add netnsid to link attrs 2017-10-20 10:18:20 -07:00
Manohar Castelino
7d0c00f02e gre tunnel: Add support for gre tunnels
Add support for creating and managing gre tunnels.
This is equivalent to

Point to Point:
ip tunnel add tun4 mode gre local 192.0.2.1 remote 203.0.113.6 key 123

Point to Multipoint:
ip tunnel add tun8 mode gre local 192.0.2.1 key 1234

Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
2017-09-05 23:15:55 -07:00
Tobias Klauser
8c5a115d79 Add support for IFLA_XDP_PROG_ID
Allow to get IFLA_XDP_PROG_ID which will be part of Linux kernel 4.13+.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2017-07-09 20:04:06 -07:00
Thomas Graf
4e28683688 link: Add support for IFLA_*_COLLECT_METADATA
- Implemented for VXLAN and GRE via a flag `FlowBased`
- Added unit tests to verify ability

Signed-off-by: Thomas Graf <tgraf@tgraf.ch>
2017-06-13 11:05:35 -07:00
Stuart McLaren
7bd45e5974 Add extra bond parameters
Add bond parameters corresponding to:

* IFLA_BOND_AD_ACTOR_SYS_PRIO
* IFLA_BOND_AD_USER_PORT_KEY
* IFLA_BOND_AD_ACTOR_SYSTEM
* IFLA_BOND_TLB_DYNAMIC_LB

These are available in new(ish) kernels.
2017-05-31 12:03:01 -07:00
Anirudh Aithal
99091d8440 add a named error when links are not found
A new error type LinkNotFoundError is returned instead
of the default error type to facilitate better error
handling by downstream consumers of this package
2017-05-24 13:54:39 -07:00
Wataru Ishida
58c32ae2d7 Add support for GPRS Tunnelling Protocol(GTP)
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2017-05-06 23:07:19 -07:00
Tobias Klauser
90380e4b76 Add support for IFLA_XDP_FLAGS
Allow to get/set IFLA_XDP_FLAGS which is part of Linux kernel >= 4.10.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2017-05-06 23:05:39 -07:00
Craig Furman
2632e243fb Can set some bridge flags
* Multicast snooping and hello time are the only ones supported at the
  moment
* Only pass values to kernel when user sets them, otherwise let kernel
  decide default
* Can set multicast snooping on existing bridges
* Tests disabled on Travis CI as the kernel version is too old
* All bridge flags copied from Kernel code, but only the two mentioned
  above work
  (5a7ad1146c/include/uapi/linux/if_link.h (L232-L281))

Signed-off-by: Petar Petrov <pppepito86@gmail.com>
Signed-off-by: Ed King <eking@pivotal.io>
Signed-off-by: Konstantinos Karampogias <konstantinos.karampogias@swisscom.com>
Signed-off-by: Will Martin <wmartin@pivotal.io>
2017-04-25 08:25:47 -07:00
Alessandro Boch
ebdfb74020 Return 64 bits link statistics
Signed-off-by: Alessandro Boch <aboch@docker.com>
2017-01-17 08:21:17 -08:00
kishiguro
ade05d5c8f Add support for VRF. With this change we can create VRF interface.
$ sudo ip link add vrf1 type vrf table 1
2017-01-05 13:05:17 -08:00
Shaun Crampton
7a823e360e Parse the IFLA_OPERSTATE flag and recort in the link attributes. (#180)
The operstate gives the best picture of whether the interface is really up.
2016-12-09 14:08:27 -08:00
Martynas Pumputis
266f02d3a8 Parse IFLA_PROTINFO in LinkDeserialize
Extract and parse IFLA_PROTINFO fields from RTM_NEWLINK AF_BRIDGE
netlink messages.
2016-12-02 16:05:43 -08:00