linuxcalls

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package linuxcalls contains wrappers over Netlink APIs related to Linux VETH interfaces or Linux interfaces in general.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddInterfaceIP

func AddInterfaceIP(log logging.Logger, ifName string, addr *net.IPNet, timeLog measure.StopWatchEntry) error

AddInterfaceIP calls AddrAdd Netlink API.

func AddVethInterfacePair added in v1.4.0

func AddVethInterfacePair(ifName, peerIfName string, log logging.Logger, timeLog measure.StopWatchEntry) error

AddVethInterfacePair calls LinkAdd Netlink API for the Netlink.Veth interface type.

func DelInterfaceIP

func DelInterfaceIP(ifName string, addr *net.IPNet, timeLog measure.StopWatchEntry) error

DelInterfaceIP calls AddrDel Netlink API.

func DelVethInterfacePair added in v1.4.0

func DelVethInterfacePair(ifName, peerIfName string, log logging.Logger, timeLog measure.StopWatchEntry) error

DelVethInterfacePair calls LinkDel Netlink API for the Netlink.Veth interface type.

func GetInterfaceType

func GetInterfaceType(ifName string, timeLog measure.StopWatchEntry) (string, error)

GetInterfaceType returns the type (string representation) of a given interface.

func GetVethPeerName

func GetVethPeerName(ifName string, timeLog measure.StopWatchEntry) (string, error)

GetVethPeerName return the peer name for a given VETH interface.

func InterfaceAdminDown

func InterfaceAdminDown(ifName string, timeLog measure.StopWatchEntry) error

InterfaceAdminDown calls Netlink API LinkSetDown.

func InterfaceAdminUp

func InterfaceAdminUp(ifName string, timeLog measure.StopWatchEntry) error

InterfaceAdminUp calls Netlink API LinkSetUp.

func InterfaceExists

func InterfaceExists(ifName string, timeLog measure.StopWatchEntry) (bool, error)

InterfaceExists checks if interface with a given name exists.

func RenameInterface added in v1.4.0

func RenameInterface(ifName string, newName string, timeLog measure.StopWatchEntry) error

RenameInterface changes the name of the interface <ifName> to <newName>.

func SetInterfaceMTU

func SetInterfaceMTU(ifName string, mtu int, timeLog measure.StopWatchEntry) error

SetInterfaceMTU calls LinkSetMTU Netlink API.

func SetInterfaceMac

func SetInterfaceMac(ifName string, macAddress string, timeLog measure.StopWatchEntry) error

SetInterfaceMac calls LinkSetHardwareAddr netlink API.

Types

This section is empty.

Jump to

Keyboard shortcuts

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