Documentation ¶
Index ¶
- Constants
- Variables
- func CreateNAT(hostInterface string) error
- func RemoveNAT(hostInterface string) error
- type Daemon
- type IP
- type IPPair
- type IPTable
- func (t *IPTable) AvailableIPs() uint64
- func (t *IPTable) AvailablePairs() uint64
- func (t *IPTable) GetIP(ctx context.Context) (*IP, error)
- func (t *IPTable) GetPair(ctx context.Context) (*IPPair, error)
- func (t *IPTable) Open(ctx context.Context) error
- func (t *IPTable) ReleaseIP(ctx context.Context, ip *IP) error
- func (i *IPTable) ReleasePair(ctx context.Context, ipPair *IPPair) error
- type Namespace
Constants ¶
View Source
const ( PairMask = 30 GatewayReserved = 2 )
Variables ¶
View Source
var ( ErrNotEnoughAvailableIPsInHostCIDR = errors.New("not enough available IPs in host CIDR") ErrNotEnoughAvailableIPsInNamespaceCIDR = errors.New("not enough available IPs in namespace CIDR") ErrAllNamespacesClaimed = errors.New("all namespaces claimed") )
View Source
var (
ErrInvalidCIDRSize = errors.New("invalid cidr size")
)
Functions ¶
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
func NewDaemon ¶
func NewDaemon( hostInterface string, hostVethCIDR string, namespaceVethCIDR string, namespaceInterface string, namespaceInterfaceGateway string, namespaceInterfaceNetmask uint32, namespaceInterfaceIP string, namespaceInterfaceMAC string, namespacePrefix string, onBeforeCreateNamespace func(id string) error, onBeforeRemoveNamespace func(id string) error, ) *Daemon
func (*Daemon) ClaimNamespace ¶
func (*Daemon) ReleaseNamespace ¶
type IPPair ¶
type IPPair struct {
// contains filtered or unexported fields
}
func (*IPPair) GetFirstIP ¶
func (*IPPair) GetSecondIP ¶
type IPTable ¶
type IPTable struct {
// contains filtered or unexported fields
}
func NewIPTable ¶
func (*IPTable) AvailableIPs ¶
func (*IPTable) AvailablePairs ¶
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
func NewNamespace ¶
func NewNamespace( id string, hostInterface string, namespaceInterface string, namespaceInterfaceGateway string, namespaceInterfaceNetmask uint32, hostVethInternalIP string, hostVethExternalIP string, namespaceInterfaceIP string, namespaceVethIP string, blockedSubnet string, namespaceInterfaceMAC string, ) *Namespace
Click to show internal directories.
Click to hide internal directories.