Commit Graph

584 Commits

Author SHA1 Message Date
David McClure
6c782366d2 Add LinkSetARPOff and LinkSetARPOn
Signed-off-by: Jay Dunkelberger <ldunkelberger@pivotal.io>
2017-03-21 02:39:47 -07:00
ISHIDA Wataru
fe3b5664d2 support MPLS
$ ip -M route add 100 dev eth0
$ ip -M route add 100 as to 200/300 dev eth0
$ ip -M route add 100 nexthop dev eth0 as to 200 \
                      nexthop dev eth1 as to 300
$ ip route add 10.10.0.0/24 encap mpls 200/300 dev eth0
$ ip route add 10.0.0.0/24 nexthop encap mpls 200 dev eth0 \
                           nexthop encap mpls 300 dev eth1

Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2017-02-20 12:07:19 -08: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
Vishvananda Ishaya Abrams
a1d6c19f19 Fix build issue on linux/s390x
Fixes issue #194
2017-02-19 15:32:03 -08:00
Wataru Ishida
87909c6dad Add Flags in NexthopInfo
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2017-02-13 13:53:26 -08:00
Vishvananda Ishaya Abrams
c19091b1c6 Add support for peakrate and minburst. 2017-02-08 10:29:21 -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
Erik Dahl
e0c5e75bb2 Add RouteReplace API
Add RouteReplace

run go fmt on changes

Add test for RouteReplace
2017-02-06 09:06:54 -08:00
Sebastien Boving
a3f0be6352 Add support for tcp diags. 2017-02-04 16:48:17 -08:00
Martynas Pumputis
43948793f6 Add support of ESN 2017-02-03 08:10:37 -08:00
kishiguro
6b895203a7 Broadcast address can be specified when adding address. 2017-02-02 13:05:14 -08:00
Martynas Pumputis
3c27c1c1e3 Add XfrmAllocSpi 2017-02-02 13:02:12 -08:00
Martynas Pumputis
9a7970b3b6 Add XfrmMonitor
The implementation subscribes only to XFRMNLGRP_EXPIRE.
2017-02-02 12:58:44 -08: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
Ethan J. Jackson
90b9ee5358 Fix the RouteList() prototype on non-linux platforms
The RouteList() function prototype had become out of sync with its
Linux counterpart.  This patch updates it.
2017-01-10 14:32:23 -08:00
Vishvananda Ishaya Abrams
1890b34fa3 Fix a panic in parseTbfData.
Include all 8 bytes when generating the native Uint64 otherwise this
code may encounter an index out of range panic.
2017-01-05 15:59:13 -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
Ethan J. Jackson
9f67bd458b Update netlink_unspecified with new Addr function prototypes
At some point the function prototypes for the `AddrAdd` and `AddrDel`
functions got out of sync with addr_linix.go.  This patch fixes it.
2017-01-05 13:01:20 -08:00
Ethan J. Jackson
13fb20a978 Update link functions on non-Linux builds
The non-Linux stub implementation found in netlink_unspecified.go was
missing quite a few Link related functions.  Also, some of the
functions that were there took a `*Link` instead of a `Link`.
2016-12-19 10:14:57 -08:00
Ethan J. Jackson
e8a63ddd86 Implement handle on non-linux platforms
When developing for Linux on a non-Linux platform, it's useful to have
mock method implementations so the code can easily build locally.
This patch adds such mock implementations for the handle struct, as is
already done in netlink_unspecified.go and route_unspecified.go.
2016-12-19 10:14:29 -08:00
Vishvananda Ishaya Abrams
c750a61f18 Set rates higher than 32bit integers 2016-12-13 18:04:10 -08:00
unclejack
05458f3920 protinfo: return value of evaluated expression 2016-12-13 10:57:44 -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
Vish Ishaya
a4f22d8ad2 Change to kernel ordering of BOND_MODE (#178)
Fixes Issue #177
2016-11-22 17:07:05 -08:00
JC Martin
9438c6ff27 Add support for VTI and IPIP 2016-11-22 17:06:50 -08:00
Sylvain Baubeau
18675e4393 Expose LinkDeserialize function (#173) 2016-11-22 12:39:47 -08:00
JC Martin
916fa8422d Enable RouteListFiltered to seach default routes
The current implementation of RouteListFiltered checks for null Dst in
filter and this prevents filtering for default routes.
2016-11-22 12:30:53 -08:00
Roman Verchikov
482f7a52b7 Inconsistent AddrList() interface
The issue was noticed when building coreos/flannel on Mac. By default
the build would fail with:

    pkg/ip/iface.go:32: cannot use link (type *netlink.Device) as type
    *netlink.Link in argument to netlink.AddrList:
        *netlink.Link is pointer to interface, not interface

Resolved by making interfaces of AddList() implementations the same,
although the reason for having `netlink_unspecified.go` is not fully
clear to me and given that there's only one implementation available.
Perhaps a better idea would be to remove the "interface" altoghether.
2016-11-19 14:19:31 -08:00
Alessandro Boch
17ea11b5a1 Allow setting socket timeout on Handle
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-11-15 11:01:07 -08:00
Vishvananda Ishaya
ffec63e1f1 add support for LinkSetVfTxRate 2016-11-07 08:35:30 -08:00
Lincoln Stoll
a1f8555521 Add ipvlan l3s mode
Commit 4fbae7d83c98c30efcf0a2a2ac55fbb75ef5a1a5 added l3s mode
support to the kernel, add the value here.
2016-11-03 19:53:15 -07:00
Nicolas PLANEL
8b4e34d697 [link] add Link Encapsulation Type in LinkAttr
Retreive the link type from Netlink GetLink information.
Aim to return the same value as nl-link-list for example :

gre0 gre <noarp,up,running,lowerup> slave-of NONE group 0 ipgre : gre0
gretap0 ether <broadcast,multicast> slave-of NONE group 0 ipgre : gretap0
dummy0 ether 36:d5:87:cf:eb:35 <broadcast,noarp> group 0
tun0 none <pointopoint,multicast,noarp> group 0
tap0 ether 4e:ce:43:4a:82:c2 <broadcast,multicast> group 0

Signed-off-by: Nicolas PLANEL <nplanel@redhat.com>
2016-11-03 19:52:05 -07:00
Kojima Takanori
e1813385ef Fix bug in ruleHandle: allocate different buffers for each rtattr 2016-11-03 19:48:18 -07:00
Alessandro Boch
da7420cab5 Expose link's raw flags (#165)
- This is needed so that caller can check link's
  operational states.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-09-20 16:53:49 -07:00
Alexander Morozov
63381f39fc filter: fix recursive string call (#162)
Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2016-08-25 11:08:35 -07: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
CtrlZvi
d710fbade4 Add proxy support to the neighbor functions (#149)
- Don't require a MAC address for a neighbor proxy
- Include proxies in the list of neighbors

Signed-off-by: Zvi "CtrlZvi" Effron <viz+GitHub@flippedperspective.com>
2016-08-23 16:01:24 -07:00
Kunihiro Ishiguro
d631d40de2 Multipath route is not installed due to gwData is newly allocated in block. (#159) 2016-08-23 15:58:51 -07:00
Dmitry Shulyak
49a7353739 Add functions to turn on/off promiscuous mode for interface (#157)
Analogs for:
  ip l set dev eth0 promisc off
  ip l set dev eth0 promisc on
2016-08-13 01:45:45 -07:00
Alessandro Boch
9dee363ad4 Fix bug in xfrmStateGetOrDelete (#155)
- It fails if source address attribute
  is passed in 4 byte notation

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-29 08:59:42 -07:00
Lukas Redynk
4e67e44a40 Tuntap: support for non-default flags (#154)
* Tuntap: support for non-default flags

* Tuntap: tap device with default flags if no flags are provided
2016-07-29 08:59:01 -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
Alessandro Boch
2b8dd8b419 Add support for Authenticated Encryption with Associated Data (AEAD) (#147)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-29 11:10:41 -05:00
Vishvananda Ishaya
77483a0e69 export encode actions 2016-06-25 10:58:55 -07:00
Alessandro Boch
734d02c3e2 Allow to specify netlink families for Handle (#143)
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-20 09:25:15 -07:00
Guy Menanteau
293adec041 key len is arch dependant (ppc64 big endian build problem)
Key length used in DeserializeSerialise XfrmAlgo tests is
endianess dependant. Correction needed to have
TestXfrmAlgoDeserializeSerialize and
TestXfrmAlgoAuthDeserializeSerialize
pass ok on ppc64 arch (big endian).
2016-06-15 10:08:51 -07:00
Vish Ishaya
0bc457d244 fix darwin build by moving code (#138)
Fixes issue #135
2016-06-15 08:44:14 -07:00
Wataru Ishida
01c64f1d8a Support multipath (#134)
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-06-14 22:02:24 -07:00