24 Commits

Author SHA1 Message Date
Paweł Zmarzły
03775388c0
Fix invalid LinkMessage family (#144)
Signed-off-by: Pawel Zmarzly <pzmarzly@fb.com>
2022-07-20 20:25:37 +02:00
Matt Layher
93da338047
rtnetlink: Go 1.17 build tags, fix example build tags (#128)
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2021-10-22 21:23:32 +02:00
Matt Layher
af39de65d6
rtnetlink: make AddressMessage.Attributes optional via pointer (#124)
Signed-off-by: Matt Layher <mdlayher@gmail.com>
2021-07-14 15:52:44 +02:00
Julian Kornberger
bde56ed163
Cleanup (#94)
* Clean up code and remove code duplication
* Apply gofmt

Signed-off-by: Julian Kornberger <jk+github@digineo.de>
2020-12-16 14:43:43 +01:00
Seán C. McCord
8a8c0ddd67
feat: support multiple matching routes (#100)
* feat: support multiple matching routes

Adds support for returning multiple matching routes for rtnl.

Fixes #99

Signed-off-by: Seán C McCord <ulexus@gmail.com>

* Fixing style errors.

Co-authored-by: stickler-ci <support@stickler-ci.com>
2020-12-06 12:37:23 +01:00
Pablo Mazzini
014bdad0d6 Merge branch 'master' into route
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
2020-11-04 16:51:25 +00:00
Pablo Mazzini
6693401ca1 [rtnl] add RouteGet method
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
2020-11-04 08:10:46 +00:00
Spencer Smith
7cf95b6356
[rtnl] support functional args for routes (#86)
This PR will add the ability to use functional args for route
add/replace with rtnl. Currently, two functions are supported,
`WithRouteSrc` and `WithRouteAttrs`. This allows the consolidation of
the route methods, as well as adding the ability to BYO-Attributes for a
given route. This layout can of course be extended to add other
route-specific args, as well as a starting point for options and args for other parts of the
rtnl package as time goes on.

Note that this removes the `RouteAddSrc` and `RouteReplaceSrc`
functions.

Signed-off-by: Spencer Smith <robertspencersmith@gmail.com>
2020-10-22 10:05:59 +02:00
Davydov Denis
154ecd4176 - added methods for replace route
Signed-off-by: Davydov Denis <dadmoscow@gmail.com>
2020-04-13 15:44:53 +03:00
Jeroen Simonetti
f846d4f6c1
Use github actions (#70)
Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
2020-01-17 13:37:17 +01:00
Jeroen Simonetti
3b195764a9
Fix rtnl for macos (#71)
Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
2020-01-17 13:13:10 +01:00
Brad Beam
1b9462860a fix: Adjust route scope decision (#67)
Change route scope decision to be based on gateway. This should
make more sense because a link without a gateway should reside
on the same subnet.

Signed-off-by: Brad Beam <brad.beam@talos-systems.com>
2019-12-23 09:40:07 +01:00
Timo Beckers
228b24473a rtnl - set 'host' scope when adding loopback addresses (#66)
Signed-off-by: Timo Beckers <timo@incline.eu>
2019-12-03 19:33:23 +01:00
Timo Beckers
5d027701a5 rtnl.(Must)ParseAddr and documentation fixes (#65)
* rtnl: add ParseAddr and MustParseAddr helpers, add usage examples

Signed-off-by: Timo Beckers <timo@incline.eu>

* addr_*_test - test ParseAddr and MustParseAddr

Signed-off-by: Timo Beckers <timo@incline.eu>

* Examples: use first ParseCIDR return value as IP address

Signed-off-by: Timo Beckers <timo@incline.eu>
2019-12-03 01:13:55 +01:00
Brad Beam
3784a6c7c5 feat(rtnl): Add better handling for route scope decisions (#58)
Signed-off-by: Brad Beam <brad.beam@talos-systems.com>
2019-08-30 11:01:07 +01:00
Yaroslav Kolomiiets
6e7d6532fc rtnl: extend integration tests to include Neighbours()
Signed-off-by: Yaroslav Kolomiiets <yarikos@gmail.com>
2019-06-06 15:25:42 +01:00
Yaroslav Kolomiiets
f03390fac9 rtnl: only skip TestLiveAddrAddDel if EPERM, fail otherwise
Signed-off-by: Yaroslav Kolomiiets <yarikos@gmail.com>
2019-05-02 12:26:50 +01:00
Yaroslav Kolomiiets
f505b733d0 rtnl: AddrAdd: ensure v4 address format is used for AF_INET
Signed-off-by: Yaroslav Kolomiiets <yarikos@gmail.com>
2019-05-01 13:07:41 +01:00
Yaroslav Kolomiiets
cc931d0061 rtnl: fix bad IPMask returned in Addrs()
Signed-off-by: Yaroslav Kolomiiets <yarikos@gmail.com>
2019-05-01 13:07:31 +01:00
Yaroslav Kolomiiets
317cffa967 rtnl: add Addr* integration tests
Signed-off-by: Yaroslav Kolomiiets <yarikos@gmail.com>
2019-04-29 17:22:13 +01:00
insomniac
b8fe779e51
[rtnl] Remove unnecessary parameters from RouteDel (#50)
As discussed on https://github.com/jsimonetti/rtnetlink/pull/47

Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2019-04-27 15:41:53 +01:00
Andrea Barberio
c1c593ef5f [rtnl] Add RouteDel and RouteAddSrc
Added `RouteDel` to support route deletion.
Also added `RouteAddSrc` to support adding routes with a source parameter.

Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2019-04-26 19:52:23 +01:00
Yaroslav Kolomiiets
690b790d9c rtnl: do not drop error on Close() but leave to caller
Signed-off-by: Yaroslav Kolomiiets <yarikos@gmail.com>
2019-04-26 17:43:25 +01:00
Yaroslav Kolomiiets
ac4930ec47 add rtnl, the new high-level wrapper package
Signed-off-by: Yaroslav Kolomiiets <yarikos@gmail.com>
2019-04-26 15:44:14 +01:00