configure

package
v0.0.0-...-cf22b21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddToBridgeError

type AddToBridgeError struct {
	Cause         error
	Bridge, Slave *net.Interface
}

AddToBridgeError is returned if an error occurs while adding an interface to a bridge

func (AddToBridgeError) Error

func (err AddToBridgeError) Error() string

type BridgeDetectionError

type BridgeDetectionError struct {
	Cause  error
	Name   string
	IP     net.IP
	Subnet *net.IPNet
}

BridgeDetectionError is returned if an error occurs while creating a bridge

func (BridgeDetectionError) Error

func (err BridgeDetectionError) Error() string

type ConfigureDefaultGWError

type ConfigureDefaultGWError struct {
	Cause     error
	Interface *net.Interface
	IP        net.IP
}

ConfigureDefaultGWError is returned if the default gateway cannot be updated

func (ConfigureDefaultGWError) Error

func (err ConfigureDefaultGWError) Error() string

type ConfigureLinkError

type ConfigureLinkError struct {
	Cause          error
	Role           string
	Interface      *net.Interface
	IntendedIP     net.IP
	IntendedSubnet *net.IPNet
}

ConfigureLinkError is returned if configuring a link fails

func (ConfigureLinkError) Error

func (err ConfigureLinkError) Error() string

type Container

type Container struct {
	FileOpener netns.Opener
}

func (*Container) Apply

func (c *Container) Apply(log lager.Logger, cfg kawasaki.NetworkConfig, pid int) error

type DeleteLinkError

type DeleteLinkError struct {
	Cause error
	Role  string
	Name  string
}

DeleteLinkError is returned if an interface cannot be succesfully destroyed

func (DeleteLinkError) Error

func (err DeleteLinkError) Error() string

type FindLinkError

type FindLinkError struct {
	Cause error // may be nil if no error occurred other than the link not existing
	Role  string
	Name  string
}

FindLinkError is returned if an expected interface cannot be found inside the container

func (FindLinkError) Error

func (err FindLinkError) Error() string

type Host

type Host struct {
	Veth interface {
		Create(hostIfcName, containerIfcName string) (*net.Interface, *net.Interface, error)
	}

	Link interface {
		SetUp(intf *net.Interface) error
		SetMTU(intf *net.Interface, mtu int) error
		SetNs(intf *net.Interface, fd int) error
		InterfaceByName(name string) (*net.Interface, bool, error)
	}

	Bridge interface {
		Create(bridgeName string, ip net.IP, subnet *net.IPNet) (*net.Interface, error)
		Add(bridge, slave *net.Interface) error
		Destroy(bridgeName string) error
	}

	FileOpener interface {
		Open(path string) (*os.File, error)
	}
}

func (*Host) Apply

func (c *Host) Apply(logger lager.Logger, config kawasaki.NetworkConfig, pid int) error

func (*Host) Destroy

func (c *Host) Destroy(config kawasaki.NetworkConfig) error

type LinkUpError

type LinkUpError struct {
	Cause error
	Link  *net.Interface
	Role  string
}

LinkUpError is returned if brinding an interface up fails

func (LinkUpError) Error

func (err LinkUpError) Error() string

type MTUError

type MTUError struct {
	Cause error
	Intf  *net.Interface
	MTU   int
}

MTUError is returned if setting the Mtu on an interface fails

func (MTUError) Error

func (err MTUError) Error() string

type SetNsFailedError

type SetNsFailedError struct {
	Cause error
	Intf  *net.Interface
	Netns *os.File
}

func (SetNsFailedError) Error

func (err SetNsFailedError) Error() string

type VethPairCreationError

type VethPairCreationError struct {
	Cause                         error
	HostIfcName, ContainerIfcName string
}

VethPairCreationError is returned if creating a virtual ethernet pair fails

func (VethPairCreationError) Error

func (err VethPairCreationError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL