Commit Graph

69 Commits

Author SHA1 Message Date
Div Arora
2cbcf73e3d Add a test for Vlan filtering support for bridges. 2018-07-23 11:15:57 -07:00
semicomplete
ee06b1df73 add vti6 support
Signed-off-by: semicomplete <example@example.com>
2018-06-19 08:48:34 -07:00
Peter Morjan
985ab95d37 Add support for link flag allmulticast
Equivalent to: ip link set <link> allmulticast <on|off>

Signed-off-by: Peter Morjan <peter.morjan@de.ibm.com>
2018-05-09 08:41:37 -07:00
Reinier Schoof
55d3a806a2 Added tests for Gretap/Gretun devices
fixed parsing IKey/OKey parameters for Gretun
fixed parsing Local/Remote parameters for Gretap and Gretun
removed irrelevant PMtuDisc parameter from IPv6 Gretaptest
2018-05-04 07:32:54 -04:00
eriknordmark
5f5d5cddcf Add a 'ListExisting' option to get the existing entries in the
route/addr/link tables as part of RouteSubscribeWithOptions,
AddrSubscribeWithOptions, and LinkSubscribeWithOptions.
2018-01-23 14:25:48 -08: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
phob0s
54ad9e3a4c Two new functions: LinkSetBondSlave and VethPeerIndex 2017-12-14 09:34:45 -08:00
Alessandro Boch
a5d066db6e Fix LinkAdd for sit tunnel on 3.10 kernel
Signed-off-by: Alessandro Boch <aboch@tetrationanalytics.com>
2017-11-27 17:43:54 -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
Alessandro Boch
a47a543cef Allow to skip tests based on min kernel version required
Signed-off-by: Alessandro Boch <aboch@tetrationanalytics.com>
2017-11-08 03:30:16 -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
Ian Bishop
0e3b74dbe2 replace syscall with golang.org/x/sys/unix 2017-10-26 09:45:08 -07:00
Manohar Castelino
b7fbf1f529 Allow index specification at link creation time
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>
2017-10-26 09:40:18 -07:00
Vincent Bernat
c684918a4f Add more variant with options to subscribe functions
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).
2017-09-24 11:01:49 -07:00
Zvi "CtrlZvi" Effron
933b978eae Add support for loading XDP programs with flags 2017-09-05 23:17:00 -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
Dan Winship
8a610f1e24 Add LinkSetTxQLen 2017-09-05 23:13:55 -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
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
Stuart McLaren
40e43c1d63 Ensure bond settings are populated correctly
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.
2017-04-12 10:36:44 -07:00
David McClure
6c782366d2 Add LinkSetARPOff and LinkSetARPOn
Signed-off-by: Jay Dunkelberger <ldunkelberger@pivotal.io>
2017-03-21 02:39:47 -07:00
Aithal
dedc638a06 Fix compilation errors for non linux platforms.
The go get command and make both fail when executed on
non-linux platforms. Modified it so that there are no
compilation errors when developing in such an
environment.
2017-02-20 12:00:54 -08:00
Sebastien Boving
dbc72376c8 Properly skip tests which require root.
All these tests currently fail with 'Operation not permitted' when run as
non-root.
2017-02-06 09:09:57 -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
JC Martin
9438c6ff27 Add support for VTI and IPIP 2016-11-22 17:06:50 -08:00
Brenden Blanco
fadc1088f6 Add support for xdp set/get of a bpf program (#156)
* Add netlink definitions for extra IFLAs
  The relevant IFLA_* are defined in the kernel but not in the syscall
  package.
* Parameterize the return value of loadSimpleBpf
  Allow the return value of the bpf program created by loadSimpleBpf to
  be specified by the caller. Before this, the value was hardcoded to 1.
* Add support for a new IFLA that enables using a bpf program as a
  filter early in the driver path of some NICs.
* Add a test for set/get of an xdp program. Since currently, the XDP
  IFLA is optional, check that the hardware supports it before trying to
  set the field.

Signed-off-by: Brenden Blanco <bblanco@plumgrid.com>
2016-08-25 11:08:23 -07:00
Evan Farrar
e73bad418f Changes GBP field to set a value of NULL when set. (#145)
Signed-off-by: Jay Dunkelberger <ldunkelberger@pivotal.io>
2016-06-29 12:57:46 -05:00
Alessandro Boch
fea1da6ef5 Allow to subscribe to events on a specfic netns (#142)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-29 11:11:35 -05:00
Manohar Castelino
fb4e4d39b4 fix macvtap interface mode setup (#137)
The mode on macvtap interfaces was not being set correctly.
Due to this the mode on macvtap is always set to default.

Set the mode correctly and add unit tests to check the same

This fixes issue https://github.com/vishvananda/netlink/issues/136

Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
2016-06-14 22:01:11 -07:00
Alessandro Boch
339261d114 Parse link statistics (#118)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-05-12 10:53:32 -07:00
Vishvananda Ishaya
adb0f53af6 Cleanup from golint and go vet 2016-03-19 17:12:26 -07:00
Vishvananda Ishaya
bfd70f5564 make the gre test pass 2015-12-18 12:14:58 -08:00
Vishvananda Ishaya
2e77ee0835 try a longer wait 2015-12-18 12:08:42 -08:00
Vishvananda Ishaya
d2daa64e4b fix and skip tests for travis 2015-12-18 12:05:30 -08:00
Vishvananda Ishaya
97b2064346 Update veth test for newer kernels 2015-12-18 11:32:28 -08:00
Manohar Castelino
3e9cd37dc3 Added support for setting all gretap parameters 2015-12-10 10:57:59 -08:00
Manohar Castelino
4dbdaec42d Merge remote-tracking branch 'krhubert_netlink/fixBond' 2015-12-10 09:44:36 -08:00
Manohar Castelino
40ccc37ce5 Resolved upstream merge conflicts 2015-12-10 09:36:26 -08:00
Hubert Krauze
066d9e83e8 Fix tests 2015-12-10 11:09:24 +01:00
Vish Ishaya
8c46a90072 Merge pull request #78 from marek-polewski/bond
add bond interface support
2015-12-09 21:21:57 -08:00
marek-polewski
656c395788 add bond interface support 2015-12-09 13:33:45 +01:00
Hubert Krauze
ec75580958 Add test for adding non existing master, use new api - LinkSetNoMaster 2015-12-09 12:26:37 +01:00
Manohar Castelino
f8776950ce Added support for creating gretap.
Equivalent to ip link add <name> type gretap local <localIP> remote <remoteIP> key <key>
2015-12-08 16:37:03 -08:00
Manohar Castelino
4c5782b0e9 Add support for alias set and retrieve interface by alias 2015-11-30 11:57:00 -08:00
Vish Ishaya
ecf47fd573 Merge pull request #46 from bboreham/subscribe
Async updates on links and routes
2015-09-15 10:05:05 -07:00
Bryan Boreham
88f55bc25d Unit tests for LinkSubscribe and RouteSubscribe 2015-08-19 16:31:39 +01:00