From 5a270896243692b2ce61771da7d40a3b4364dae1 Mon Sep 17 00:00:00 2001 From: Johan Euphrosine Date: Fri, 17 Jan 2014 13:12:08 -0800 Subject: [PATCH] netlink: move Route type to common arch file Docker-DCO-1.1-Signed-off-by: Johan Euphrosine (github: proppy) Upstream-commit: dadd54dba395f68c492a8ce5e2bf9488f9db0830 Component: engine --- components/engine/pkg/netlink/netlink.go | 15 +++++++++++++++ components/engine/pkg/netlink/netlink_linux.go | 7 ------- 2 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 components/engine/pkg/netlink/netlink.go diff --git a/components/engine/pkg/netlink/netlink.go b/components/engine/pkg/netlink/netlink.go new file mode 100644 index 0000000000..5098b4b816 --- /dev/null +++ b/components/engine/pkg/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/components/engine/pkg/netlink/netlink_linux.go b/components/engine/pkg/netlink/netlink_linux.go index a65bdaf5e9..ab572e397a 100644 --- a/components/engine/pkg/netlink/netlink_linux.go +++ b/components/engine/pkg/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) {