Documentation
¶
Index ¶
- func AddRoute(ipn *net.IPNet, gwIP string, dev string) error
- func AddRouteViaGateway(ipn *net.IPNet, gwIP string, dev string) error
- func AddRouteViaInterface(ipn *net.IPNet, dev string) error
- func RemoveVethFromOVS(lu netlink.LinkUpdate) bool
- func SetupVeth(contVethName, hostVethName string, mtu int, hostNS ns.NetNS) (net.Interface, net.Interface, error)
- type NlEventHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRoute ¶
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
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
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 (*NlEventHandler) AddDeletedLinkHandler ¶
func (nl *NlEventHandler) AddDeletedLinkHandler(handler linkReceiver)
AddDeletedLinkHandler will add DeletedLinkHandler
func (*NlEventHandler) TrackNetlink ¶
func (nl *NlEventHandler) TrackNetlink() error
TrackNetlink will track netlink