driver

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MTU = 1500
)

Variables

View Source
var (
	LINK_IP = &net.IPNet{
		IP:   net.IPv4(169, 254, 1, 1),
		Mask: net.CIDRMask(32, 32),
	}
)

Functions

func SetupVethPair

func SetupVethPair(contVethName, pairName string, mtu int, hostNS ns.NetNS) (net.Interface, net.Interface, error)

Types

type NetnsDriver

type NetnsDriver interface {
	Setup(hostVeth string,
		containerVeth string,
		ipv4Addr *net.IPNet,
		gateway net.IP,
		extraRoutes []*types.Route,
		deviceId int,
		ingress uint64,
		egress uint64,
		netNS ns.NetNS) error
	Teardown(hostVeth string, containerVeth string, netNS ns.NetNS) error
}

NetnsDriver to config container netns interface and routes

var NicDriver NetnsDriver = &rawNicDriver{}
var VethDriver NetnsDriver = &vethDriver{}

Jump to

Keyboard shortcuts

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