From 69e7002c8975b2163e1bdf52d70fda8585f9a988 Mon Sep 17 00:00:00 2001 From: Alexey Guskov Date: Tue, 21 Jul 2015 19:41:01 +0300 Subject: [PATCH] make libnetwork compile on freebsd (again) Signed-off-by: Alexey Guskov --- sandbox/interface_freebsd.go | 4 ++++ sandbox/namespace_unsupported.go | 2 +- sandbox/neigh_freebsd.go | 4 ++++ sandbox/sandbox_freebsd.go | 23 +++++++++++++++++++++++ sandbox/sandbox_unsupported.go | 2 +- 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 sandbox/interface_freebsd.go create mode 100644 sandbox/neigh_freebsd.go create mode 100644 sandbox/sandbox_freebsd.go diff --git a/sandbox/interface_freebsd.go b/sandbox/interface_freebsd.go new file mode 100644 index 0000000..115290d --- /dev/null +++ b/sandbox/interface_freebsd.go @@ -0,0 +1,4 @@ +package sandbox + +// IfaceOption is a function option type to set interface options +type IfaceOption func() diff --git a/sandbox/namespace_unsupported.go b/sandbox/namespace_unsupported.go index 247f4fb..9d38206 100644 --- a/sandbox/namespace_unsupported.go +++ b/sandbox/namespace_unsupported.go @@ -1,4 +1,4 @@ -// +build !linux,!windows +// +build !linux,!windows,!freebsd package sandbox diff --git a/sandbox/neigh_freebsd.go b/sandbox/neigh_freebsd.go new file mode 100644 index 0000000..58b3058 --- /dev/null +++ b/sandbox/neigh_freebsd.go @@ -0,0 +1,4 @@ +package sandbox + +// NeighOption is a function option type to set neighbor options +type NeighOption func() diff --git a/sandbox/sandbox_freebsd.go b/sandbox/sandbox_freebsd.go new file mode 100644 index 0000000..4aa7787 --- /dev/null +++ b/sandbox/sandbox_freebsd.go @@ -0,0 +1,23 @@ +package sandbox + +// GenerateKey generates a sandbox key based on the passed +// container id. +func GenerateKey(containerID string) string { + maxLen := 12 + if len(containerID) < maxLen { + maxLen = len(containerID) + } + + return containerID[:maxLen] +} + +// NewSandbox provides a new sandbox instance created in an os specific way +// provided a key which uniquely identifies the sandbox +func NewSandbox(key string, osCreate bool) (Sandbox, error) { + return nil, nil +} + +// GC triggers garbage collection of namespace path right away +// and waits for it. +func GC() { +} diff --git a/sandbox/sandbox_unsupported.go b/sandbox/sandbox_unsupported.go index efda42a..4ed3c9f 100644 --- a/sandbox/sandbox_unsupported.go +++ b/sandbox/sandbox_unsupported.go @@ -1,4 +1,4 @@ -// +build !linux,!windows +// +build !linux,!windows,!freebsd package sandbox