mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Get libnetwork to build on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>
This commit is contained in:
parent
2a60c9f3d4
commit
c7684b5ff7
7 changed files with 97 additions and 1 deletions
7
libnetwork/default_gateway_solaris.go
Normal file
7
libnetwork/default_gateway_solaris.go
Normal file
|
@ -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")
|
||||
}
|
5
libnetwork/drivers_solaris.go
Normal file
5
libnetwork/drivers_solaris.go
Normal file
|
@ -0,0 +1,5 @@
|
|||
package libnetwork
|
||||
|
||||
func getInitializers() []initializer {
|
||||
return []initializer{}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// +build linux freebsd
|
||||
// +build linux freebsd solaris
|
||||
|
||||
package builtin
|
||||
|
||||
|
|
31
libnetwork/ipamutils/utils_solaris.go
Normal file
31
libnetwork/ipamutils/utils_solaris.go
Normal file
|
@ -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
|
||||
}
|
4
libnetwork/osl/interface_solaris.go
Normal file
4
libnetwork/osl/interface_solaris.go
Normal file
|
@ -0,0 +1,4 @@
|
|||
package osl
|
||||
|
||||
// IfaceOption is a function option type to set interface options
|
||||
type IfaceOption func()
|
4
libnetwork/osl/neigh_solaris.go
Normal file
4
libnetwork/osl/neigh_solaris.go
Normal file
|
@ -0,0 +1,4 @@
|
|||
package osl
|
||||
|
||||
// NeighOption is a function option type to set interface options
|
||||
type NeighOption func()
|
45
libnetwork/sandbox_externalkey_solaris.go
Normal file
45
libnetwork/sandbox_externalkey_solaris.go
Normal file
|
@ -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 a new issue