Documentation ¶
Overview ¶
Package api provides koko's connector funcitionlity as API.
Index ¶
- Variables
- func AddMacVLanInterface(macvlan MacVLan, devName string) (err error)
- func AddVLanInterface(vlan VLan, devName string) (err error)
- func AddVxLanInterface(vxlan VxLan, devName string) (err error)
- func CloseCrioConnection(conn *grpc.ClientConn) error
- func EnableFlLog() error
- func GetCrioContainerNS(runtimeClient pb.RuntimeServiceClient, procPrefix, containerID string) (namespace string, err error)
- func GetCrioRuntimeClient() (pb.RuntimeServiceClient, *grpc.ClientConn, error)
- func GetDockerContainerNS(procPrefix, containerID string) (namespace string, err error)
- func GetMTU(ifname string) (mtu int, err error)
- func GetVethPair(name1 string, name2 string) (link1 netlink.Link, link2 netlink.Link, err error)
- func IsExistLinkInNS(nsName string, linkName string) (result bool, err error)
- func MakeMacVLan(veth1 VEth, macvlan MacVLan) (err error)
- func MakeVLan(veth1 VEth, vlan VLan) (err error)
- func MakeVeth(veth1 VEth, veth2 VEth) error
- func MakeVxLan(veth1 VEth, vxlan VxLan) (err error)
- func SetLogLevel(level string) error
- func SetMTU(ifname string, mtu int) (err error)
- type MacVLan
- type VEth
- func (veth *VEth) GetEgressTxQLen() (qlen int, err error)
- func (veth *VEth) RemoveVethLink() (err error)
- func (veth *VEth) SetEgressMirror() (err error)
- func (veth *VEth) SetEgressTxQLen(qlen int) (err error)
- func (veth *VEth) SetIngressMirror() (err error)
- func (veth *VEth) SetVethLink(link netlink.Link) (err error)
- func (veth *VEth) UnsetEgressMirror() (err error)
- func (veth *VEth) UnsetIngressMirror() (err error)
- type VLan
- type VxLan
Constants ¶
This section is empty.
Variables ¶
var ( // RuntimeEndpoint is CRI server runtime endpoint RuntimeEndpoint string // Timeout of connecting to server (default: 10s) Timeout time.Duration )
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 CloseCrioConnection ¶
func CloseCrioConnection(conn *grpc.ClientConn) error
CloseCrioConnection closes grpc connection in client
func EnableFlLog ¶
func EnableFlLog() error
func GetCrioContainerNS ¶
func GetCrioContainerNS(runtimeClient pb.RuntimeServiceClient, procPrefix, containerID string) (namespace string, err error)
GetCrioContainerNS retrieves container's network namespace from cri-o container id, given as containerID.
func GetCrioRuntimeClient ¶
func GetCrioRuntimeClient() (pb.RuntimeServiceClient, *grpc.ClientConn, error)
GetCrioRuntimeClient retrieves crio grpc client
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 IsExistLinkInNS ¶
IsExistLinkInNS finds interface name in given namespace. if foud return true. otherwise false.
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.
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 // (optional) Slice of IPv4/v6 address. MirrorEgress string // (optional) source interface for egress mirror MirrorIngress string // (optional) source interface for ingress mirror }
VEth is a structure to descrive veth interfaces.
func (*VEth) GetEgressTxQLen ¶
GetEgressTxQLen get veth's EgressIF TxQLen
func (*VEth) RemoveVethLink ¶
RemoveVethLink is low-level handler to get interface handle in container/netns namespace and remove it.
func (*VEth) SetEgressMirror ¶
SetEgressMirror sets TC to mirror egress from given port as MirrorEgress.
func (*VEth) SetEgressTxQLen ¶
SetEgressTxQLen set veth's EgressIF TxQLen
func (*VEth) SetIngressMirror ¶
SetIngressMirror sets TC to mirror ingress from given port as MirrorIngress.
func (*VEth) SetVethLink ¶
SetVethLink is low-level handler to set IP address onveth links given a single VEth data object. ...primarily used privately by makeVeth().
func (*VEth) UnsetEgressMirror ¶
UnsetEgressMirror sets TC to mirror egress from given port as MirrorEgress.
func (*VEth) UnsetIngressMirror ¶
UnsetIngressMirror sets TC to mirror ingress from given port as MirrorIngress.
type VxLan ¶
type VxLan struct { ParentIF string // parent interface name ID int // VxLan ID IPAddr net.IP // VxLan destination address MTU int // VxLan Interface MTU (with VxLan encap), used mirroring UDPPort int // VxLan UDP port (src/dest, no range, single value) }
VxLan is a structure to descrive vxlan endpoint.