ipam

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByMask

type ByMask []Route

ByMask is used to sort an array of routes by mask, narrow first.

func (ByMask) Len

func (a ByMask) Len() int

func (ByMask) Less

func (a ByMask) Less(i, j int) bool

func (ByMask) Swap

func (a ByMask) Swap(i, j int)

type IPAMConfig

type IPAMConfig struct {
	IPAMConfig     hb.IPAMConfig
	IPv6Allocator  *ipallocator.Range
	IPv4Allocator  *ipallocator.Range
	AllocatorMutex sync.RWMutex
}

IPAMConfig is the IPAM configuration used for a particular IPAM type.

type IPAMConfigRep

type IPAMConfigRep struct {
	RequestPoolResponse *lnAPI.RequestPoolResponse `json:",omitempty"`
	IPAMConfig          *IPAMRep                   `json:",omitempty"`
}

IPAMConfigRep is used for IPAM configuration reply messages.

type IPAMRep

type IPAMRep struct {
	// IPv6 configuration.
	IP6 *IPConfig
	// IPv4 configuration.
	IP4 *IPConfig
}

IPAMRep contains both IPv4 and IPv6 IPAM configuration.

type IPAMReq

type IPAMReq struct {
	ContainerID           string                       `json:",omitempty"`
	IP                    *net.IP                      `json:",omitempty"`
	RequestPoolRequest    *lnAPI.RequestPoolRequest    `json:",omitempty"`
	RequestAddressRequest *lnAPI.RequestAddressRequest `json:",omitempty"`
	ReleaseAddressRequest *lnAPI.ReleaseAddressRequest `json:",omitempty"`
}

IPAMReq is used for IPAM request operation.

type IPAMType

type IPAMType string

type IPConfig

type IPConfig struct {
	// Gateway for this IP configuration.
	Gateway net.IP
	// IP of the configuration.
	IP net.IPNet
	// Routes for this IP configuration.
	Routes []Route
}

IPConfig is our network representation of an IP configuration.

type Route

type Route struct {
	Destination net.IPNet
	NextHop     net.IP
	Type        int
}

Route is the routing representation of an IPConfig. It can be a L2 or L3 route depending if NextHop is nil or not.

func NewRoute

func NewRoute(dst net.IPNet, nextHop net.IP) *Route

NewRoute returns a Route from dst and nextHop with the proper libnetwork type based on NextHop being nil or not.

func (*Route) IsL2

func (r *Route) IsL2() bool

IsL2 returns true if the route represents a L2 route and false otherwise.

Jump to

Keyboard shortcuts

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