diff --git a/netlink/netlink.go b/netlink/netlink.go new file mode 100644 index 0000000..5098b4b --- /dev/null +++ b/netlink/netlink.go @@ -0,0 +1,15 @@ +// Packet netlink provide access to low level Netlink sockets and messages. +// +// Actual implementations are in: +// netlink_linux.go +// netlink_darwin.go +package netlink + +import "net" + +// A Route is a subnet associated with the interface to reach it. +type Route struct { + *net.IPNet + Iface *net.Interface + Default bool +} diff --git a/netlink/netlink_linux.go b/netlink/netlink_linux.go index a65bdaf..ab572e3 100644 --- a/netlink/netlink_linux.go +++ b/netlink/netlink_linux.go @@ -471,13 +471,6 @@ func NetworkLinkAdd(name string, linkType string) error { return s.HandleAck(wb.Seq) } -// A Route is a subnet associated with the interface to reach it. -type Route struct { - *net.IPNet - Iface *net.Interface - Default bool -} - // Returns an array of IPNet for all the currently routed subnets on ipv4 // This is similar to the first column of "ip route" output func NetworkGetRoutes() ([]Route, error) {