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>
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>
* 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>
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>