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>
Add support for setting InfiniBand Node and Port GUID address
configuration of a VF when InfiniBand HCA are used with SR-IOV mode.
Signed-off-by: Parav Pandit <parav@mellanox.com>
The IFLA_* constants in in x/sys/unix were updated to Linux 4.15 in
golang/sys@88d2dcc510, so use these instead of locally duplicating
them.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Allow the caller to specify the desired link index at link creation.
This is equivalent to
ip link add link eth0 name testmacvtap index 1000 type macvtap
ip link add dummy1 index 1001 type dummy
Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
For link, address, route, add a `WithOptions` variant to the
`*Subscribe()` function to specify a namespace and an error
callback. Those options can be extended in the future without adding
more functions. For example, it could be possible to subscribe only
for a given family by adding a `Family` member to the appropriate
struct.
As a minor change, the private function is always suffixed by `At`,
since it was the case for route and raw netlink functions (but not for
address and link).
When a fatal error happens in a `*Subscribe*()` function, the error
was not available to the user. We add a callback function that will be
invoked when such an error happens.
This also modifies the behavior of `AddrSubscribe*()` function to turn
parse errors into fatal errors, as it happens with the other functions.
On newer linux kernels (4.12), netlink rejects a request to set an XDP
program with flags set to 0. Instead, flags need to not be specified if they
are 0.
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>
Corrected function signature to have correct name LinkSetVfTrust
instead of LinkSetTrust.
This aligns with code comment and rest of the other VF functions.
Signed-off-by: Parav Pandit <parav@mellanox.com>
Add support for setting trust state of a VF. This allows restricting
certain operations on VF when its untrusted such as disabling
promiscuous mode.
Signed-off-by: Parav Pandit <parav@mellanox.com>
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.
A new error type LinkNotFoundError is returned instead
of the default error type to facilitate better error
handling by downstream consumers of this package
* 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>
Bridge ports can be set to use the proxy arp features by calling
either LinkSetBrProxyArp() or LinkSetBrProxyArpWiFi().
Signed-off-by: David Wilder <wilder@us.ibm.com>
Currently a LinkByName("bondX") doesn't return the bond specific attributes.
parseBondData needs to update the link that is passed in in order for
the bond's Mode, Miimon etc to be populated correctly.