package network

import "github.com/dotcloud/docker/pkg/libcontainer/network"

Index

Variables

var (
	ErrNotValidStrategyType = errors.New("not a valid network strategy type")
)

Functions

func ChangeInterfaceName

func ChangeInterfaceName(old, newName string) error

func CreateVethPair

func CreateVethPair(name1, name2 string) error

func InterfaceDown

func InterfaceDown(name string) error

func InterfaceUp

func InterfaceUp(name string) error

func SetDefaultGateway

func SetDefaultGateway(ip string) error

func SetInterfaceInNamespacePid

func SetInterfaceInNamespacePid(name string, nsPid int) error

func SetInterfaceIp

func SetInterfaceIp(name string, rawIp string) error

func SetInterfaceMaster

func SetInterfaceMaster(name, master string) error

func SetMtu

func SetMtu(name string, mtu int) error

Types

type Loopback

type Loopback struct {
}

Loopback is a network strategy that provides a basic loopback device

func (*Loopback) Create

func (l *Loopback) Create(n *libcontainer.Network, nspid int, context libcontainer.Context) error

func (*Loopback) Initialize

func (l *Loopback) Initialize(config *libcontainer.Network, context libcontainer.Context) error

type NetNS

type NetNS struct {
}

crosbymichael: could make a network strategy that instead of returning veth pair names it returns a pid to an existing network namespace

func (*NetNS) Create

func (v *NetNS) Create(n *libcontainer.Network, nspid int, context libcontainer.Context) error

func (*NetNS) Initialize

func (v *NetNS) Initialize(config *libcontainer.Network, context libcontainer.Context) error

type NetworkStrategy

type NetworkStrategy interface {
	Create(*libcontainer.Network, int, libcontainer.Context) error
	Initialize(*libcontainer.Network, libcontainer.Context) error
}

NetworkStrategy represents a specific network configuration for a container's networking stack

func GetStrategy

func GetStrategy(tpe string) (NetworkStrategy, error)

GetStrategy returns the specific network strategy for the provided type. If no strategy is registered for the type an ErrNotValidStrategyType is returned.

type Veth

type Veth struct {
}

Veth is a network strategy that uses a bridge and creates a veth pair, one that stays outside on the host and the other is placed inside the container's namespace

func (*Veth) Create

func (v *Veth) Create(n *libcontainer.Network, nspid int, context libcontainer.Context) error

func (*Veth) Initialize

func (v *Veth) Initialize(config *libcontainer.Network, context libcontainer.Context) error

Source Files

loopback.go netns.go network.go strategy.go veth.go

Version
v0.10.0
Published
Apr 8, 2014
Platform
js/wasm
Imports
9 packages
Last checked
7 seconds ago

Tools for package owners.