Get libnetwork to build on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
This commit is contained in:
parent
680d335332
commit
1882f69175
|
@ -0,0 +1,7 @@
|
||||||
|
package libnetwork
|
||||||
|
|
||||||
|
import "github.com/docker/libnetwork/types"
|
||||||
|
|
||||||
|
func (c *controller) createGWNetwork() (Network, error) {
|
||||||
|
return nil, types.NotImplementedErrorf("default gateway functionality is not implemented in solaris")
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
package libnetwork
|
||||||
|
|
||||||
|
func getInitializers() []initializer {
|
||||||
|
return []initializer{}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
// +build linux freebsd
|
// +build linux freebsd solaris
|
||||||
|
|
||||||
package builtin
|
package builtin
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
// Package ipamutils provides utililty functions for ipam management
|
||||||
|
package ipamutils
|
||||||
|
|
||||||
|
// Solaris: TODO
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ElectInterfaceAddresses looks for an interface on the OS with the specified name
|
||||||
|
// and returns its IPv4 and IPv6 addresses in CIDR form. If the interface does not exist,
|
||||||
|
// it chooses from a predifined list the first IPv4 address which does not conflict
|
||||||
|
// with other interfaces on the system.
|
||||||
|
func ElectInterfaceAddresses(name string) (*net.IPNet, []*net.IPNet, error) {
|
||||||
|
var (
|
||||||
|
v4Net *net.IPNet
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
|
||||||
|
v4Net, err = FindAvailableNetwork(PredefinedBroadNetworks)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
return v4Net, nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// FindAvailableNetwork returns a network from the passed list which does not
|
||||||
|
// overlap with existing interfaces in the system
|
||||||
|
func FindAvailableNetwork(list []*net.IPNet) (*net.IPNet, error) {
|
||||||
|
return list[0], nil
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
package osl
|
||||||
|
|
||||||
|
// IfaceOption is a function option type to set interface options
|
||||||
|
type IfaceOption func()
|
|
@ -0,0 +1,4 @@
|
||||||
|
package osl
|
||||||
|
|
||||||
|
// NeighOption is a function option type to set interface options
|
||||||
|
type NeighOption func()
|
|
@ -0,0 +1,45 @@
|
||||||
|
// +build solaris
|
||||||
|
|
||||||
|
package libnetwork
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"net"
|
||||||
|
|
||||||
|
"github.com/docker/libnetwork/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
// processSetKeyReexec is a private function that must be called only on an reexec path
|
||||||
|
// It expects 3 args { [0] = "libnetwork-setkey", [1] = <container-id>, [2] = <controller-id> }
|
||||||
|
// It also expects libcontainer.State as a json string in <stdin>
|
||||||
|
// Refer to https://github.com/opencontainers/runc/pull/160/ for more information
|
||||||
|
func processSetKeyReexec() {
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetExternalKey provides a convenient way to set an External key to a sandbox
|
||||||
|
func SetExternalKey(controllerID string, containerID string, key string) error {
|
||||||
|
return types.NotImplementedErrorf("SetExternalKey isn't supported on non linux systems")
|
||||||
|
}
|
||||||
|
|
||||||
|
func sendKey(c net.Conn, data setKeyData) error {
|
||||||
|
return types.NotImplementedErrorf("sendKey isn't supported on non linux systems")
|
||||||
|
}
|
||||||
|
|
||||||
|
func processReturn(r io.Reader) error {
|
||||||
|
return types.NotImplementedErrorf("processReturn isn't supported on non linux systems")
|
||||||
|
}
|
||||||
|
|
||||||
|
// no-op on non linux systems
|
||||||
|
func (c *controller) startExternalKeyListener() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *controller) acceptClientConnections(sock string, l net.Listener) {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *controller) processExternalKey(conn net.Conn) error {
|
||||||
|
return types.NotImplementedErrorf("processExternalKey isn't supported on non linux systems")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *controller) stopExternalKeyListener() {
|
||||||
|
}
|
Loading…
Reference in New Issue