Documentation
¶
Overview ¶
Package api provides koko's connector funcitionlity as API.
Index ¶
- func AddMacVLanInterface(macvlan MacVLan, devName string) error
- func AddVLanInterface(vlan VLan, devName string) error
- func AddVxLanInterface(vxlan VxLan, devName string) error
- func GetDockerContainerNS(containerID string) (namespace string, err error)
- func GetVethPair(name1 string, name2 string) (link1 netlink.Link, link2 netlink.Link, err error)
- func MakeMacVLan(veth1 VEth, macvlan MacVLan)
- func MakeVLan(veth1 VEth, vlan VLan)
- func MakeVeth(veth1 VEth, veth2 VEth)
- func MakeVethPair(name, peer string, mtu int) (netlink.Link, error)
- func MakeVxLan(veth1 VEth, vxlan VxLan)
- type MacVLan
- type VEth
- type VLan
- type VxLan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMacVLanInterface ¶
AddMacVLanInterface creates MacVLan interface by given macvlan object
func AddVLanInterface ¶
AddVLanInterface creates VLan interface by given vlan object
func AddVxLanInterface ¶
AddVxLanInterface creates VxLan interface by given vxlan object
func GetDockerContainerNS ¶
GetDockerContainerNS retrieves container's network namespace from docker container id, given as containerID.
func GetVethPair ¶
GetVethPair takes two link names and create a veth pair and return both links.
func MakeMacVLan ¶
MakeMacVLan makes macvlan interface
func MakeVeth ¶
MakeVeth is top-level handler to create veth links given two VEth data objects: veth1 and veth2.
func MakeVethPair ¶
MakeVethPair makes veth pair and returns its link.
Types ¶
type MacVLan ¶
type MacVLan struct {
ParentIF string // parent interface name
Mode netlink.MacvlanMode // MacVlan mode
}
MacVLan is a structure to descrive vlan endpoint.
type VEth ¶
type VEth struct {
NsName string // What's the network namespace?
LinkName string // And what will we call the link.
IPAddr []net.IPNet // Slice of IPv4/v6 address.
}
VEth is a structure to descrive veth interfaces.
func (*VEth) RemoveVethLink ¶
RemoveVethLink is low-level handler to get interface handle in container/netns namespace and remove it.