Commit Graph

51 Commits

Author SHA1 Message Date
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
Vishvananda Ishaya
687e6f0b07 add link ifb and fix macvtap 2015-08-18 14:06:35 -07:00
Vish Ishaya
cee28b0a8d Merge pull request #42 from ppalucki/master
macvtap support
2015-08-15 10:13:37 -07:00
Thomas Graf
c24b290c8f Support for IFLA_VXLAN_GBP flag
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2015-07-31 13:48:03 +02:00
Pawel Palucki
828e2240d3 macvtap support 2015-07-27 17:48:59 +02:00
Alexander Morozov
72a1f403a3 Add LinkAttrs constructor NewLinkAttrs
It looks little awkward, but should be enough for people who care about
defaults from kernel.

Fix #26

Also fixed bug with setting TxQLen for main device. It was never set
before.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-13 20:49:51 -07:00
Eugene Yakubovich
ae3e7dba57 added support for MACVLAN mode 2015-02-26 13:21:26 -08:00
Alexander Morozov
bf7b359ebd Fix comments mistakes
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-02-12 11:12:05 -08:00
Alexander Morozov
e29807a4d5 Fix go vet errors
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-02-12 11:00:59 -08:00
Alexander Morozov
d710fe886a IPVlan support
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-02-11 14:18:57 -08:00
Eugene Yakubovich
a59b20a402 honor MTU in LinkAdd 2015-02-06 18:30:52 -08:00
Dave Tucker
f9a4246807 Add LinkSetHardwareAddr
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2015-01-31 22:44:21 +00:00
Dave Tucker
085dc47dcc Add LinkSetName
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2015-01-31 22:44:01 +00:00
Alexander Morozov
7bedf70b9b Test for TxQLen
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2014-12-04 18:25:38 -08:00
Vishvananda Ishaya
dfb90f83f1 skips for root priveleges 2014-10-31 12:21:39 -07:00
Eugene Yakubovich
ffab401087 gofmt: style violations have crept up 2014-10-28 17:22:52 -07:00
Eugene Yakubovich
cc912bac14 avoid dumping all interfaces to look up one 2014-10-13 18:07:39 -07:00
Eugene Yakubovich
33e8718673 arp and vxlan support added 2014-10-13 11:04:09 -07:00
Vishvananda Ishaya
f87c54f846 Make links have different types 2014-09-24 16:32:16 -07:00