nl

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRoute

func AddRoute(ipn *net.IPNet, gwIP string, dev string) error

AddRoute is a function for adding a route via gateway or interface. Will be deprecated in the future

func AddRouteViaGateway added in v0.4.3

func AddRouteViaGateway(ipn *net.IPNet, gwIP string, dev string) error

AddRouteViaGateway is a function for Adding a route via gateway ex: ip route add 192.0.2.128/25 via 192.0.2.1 dev eth0

func AddRouteViaInterface added in v0.4.3

func AddRouteViaInterface(ipn *net.IPNet, dev string) error

AddRouteViaInterface is a function for Adding a route via gateway ex: ip route add 192.0.2.0/25 dev eth0

func RemoveVethFromOVS

func RemoveVethFromOVS(lu netlink.LinkUpdate) bool

RemoveVethFromOVS remove the veth from the ovs. We get the veth name from the netlink.LinkUpdate and traverse all OpenvSwitches and try to remove the veth from its parent OVS return true will stop the netlink server handler

func SetupVeth

func SetupVeth(contVethName, hostVethName string, mtu int, hostNS ns.NetNS) (net.Interface, net.Interface, error)

SetupVeth sets up a pair of virtual ethernet devices. Call SetupVeth from inside the container netns. It will create both veth devices and move the host-side veth into the provided hostNS namespace. On success, SetupVeth returns (hostVeth, containerVeth, nil)

Types

type NlEventHandler

type NlEventHandler struct {
	LinkDeleteHandler []linkReceiver
	// contains filtered or unexported fields
}

NlEventHandler is the structure for netlink event handler

func New

func New() *NlEventHandler

New will return an new netlink event handler

func (*NlEventHandler) AddDeletedLinkHandler

func (nl *NlEventHandler) AddDeletedLinkHandler(handler linkReceiver)

AddDeletedLinkHandler will add DeletedLinkHandler

func (*NlEventHandler) Stop

func (nl *NlEventHandler) Stop()

Stop will stop netlink

func (nl *NlEventHandler) TrackNetlink() error

TrackNetlink will track netlink

Jump to

Keyboard shortcuts

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