api

package
v0.0.0-...-728c027 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package api provides koko's connector funcitionlity as API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMacVLanInterface

func AddMacVLanInterface(macvlan MacVLan, devName string) error

AddMacVLanInterface creates MacVLan interface by given macvlan object

func AddVLanInterface

func AddVLanInterface(vlan VLan, devName string) error

AddVLanInterface creates VLan interface by given vlan object

func AddVxLanInterface

func AddVxLanInterface(vxlan VxLan, devName string) error

AddVxLanInterface creates VxLan interface by given vxlan object

func GetDockerContainerNS

func GetDockerContainerNS(containerID string) (namespace string, err error)

GetDockerContainerNS retrieves container's network namespace from docker container id, given as containerID.

func GetVethPair

func GetVethPair(name1 string, name2 string) (link1 netlink.Link,
	link2 netlink.Link, err error)

GetVethPair takes two link names and create a veth pair and return both links.

func MakeMacVLan

func MakeMacVLan(veth1 VEth, macvlan MacVLan)

MakeMacVLan makes macvlan interface

func MakeVLan

func MakeVLan(veth1 VEth, vlan VLan)

MakeVLan makes vlan interface

func MakeVeth

func MakeVeth(veth1 VEth, veth2 VEth)

MakeVeth is top-level handler to create veth links given two VEth data objects: veth1 and veth2.

func MakeVethPair

func MakeVethPair(name, peer string, mtu int) (netlink.Link, error)

MakeVethPair makes veth pair and returns its link.

func MakeVxLan

func MakeVxLan(veth1 VEth, vxlan VxLan)

MakeVxLan makes vxlan interface and put it into container namespace

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 *VEth) RemoveVethLink() (err error)

RemoveVethLink is low-level handler to get interface handle in container/netns namespace and remove it.

func (veth *VEth) SetVethLink(link netlink.Link) (err error)

SetVethLink is low-level handler to set IP address onveth links given a single VEth data object. ...primarily used privately by makeVeth().

type VLan

type VLan struct {
	ParentIF string // parent interface name
	ID       int    // VLan ID
}

VLan is a structure to descrive vlan endpoint.

type VxLan

type VxLan struct {
	ParentIF string // parent interface name
	ID       int    // VxLan ID
	IPAddr   net.IP // VxLan destination address
}

VxLan is a structure to descrive vxlan endpoint.

Jump to

Keyboard shortcuts

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