{"modulePath":"github.com/ligato/vpp-agent","version":"v1.0.6","isLatest":false,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package linuxcalls\n\nPackage linuxcalls contains wrappers over Netlink APIs related to Linux VETH interfaces or to Linux interfaces in general.\n\n## Functions\n\n```go\nfunc AddInterfaceIP(ifName string, addr *net.IPNet, timeLog measure.StopWatchEntry) error\n```\nAddInterfaceIP calls AddrAdd Netlink API\n\n```go\nfunc AddVethInterface(ifName, peerIfName string, log logging.Logger, timeLog measure.StopWatchEntry) error\n```\nAddVethInterface calls LinkAdd Netlink API for the Netlink.Veth interface type.\n\n```go\nfunc CompareNamespaces(ns1 *intf.LinuxInterfaces_Interface_Namespace, ns2 *intf.LinuxInterfaces_Interface_Namespace) int\n```\nCompareNamespaces is a comparison function for \"intf.Interfaces\\_Interface\\_Namespace\" type.\n\n```go\nfunc CreateNamedNetNs(namespace string, log logging.Logger) (netns.NsHandle, *intf.LinuxInterfaces_Interface_Namespace, error)\n```\nCreateNamedNetNs creates a new named Linux network namespace. It does exactly the same thing as the command \"ip netns add NAMESPACE\" .\n\n```go\nfunc DelInterfaceIP(ifName string, addr *net.IPNet, timeLog measure.StopWatchEntry) error\n```\nDelInterfaceIP calls AddrDel Netlink API\n\n```go\nfunc DelVethInterface(ifName, peerIfName string, log logging.Logger, timeLog measure.StopWatchEntry) error\n```\nDelVethInterface calls LinkDel Netlink API for the Netlink.Veth interface type.\n\n```go\nfunc DeleteNamedNetNs(namespace string, log logging.Logger) error\n```\nDeleteNamedNetNs deletes an existing named Linux network namespace. It does exactly the same thing as the command \"ip netns del NAMESPACE\" .\n\n```go\nfunc GetDefaultNamespace() *intf.LinuxInterfaces_Interface_Namespace\n```\nGetDefaultNamespace returns an instance of the proto message referencing default namespace.\n\n```go\nfunc GetInterfaceType(ifName string, timeLog measure.StopWatchEntry) (string, error)\n```\nGetInterfaceType returns the type (string representation) of a given interface.\n\n```go\nfunc GetOrCreateNs(namespace *intf.LinuxInterfaces_Interface_Namespace, log logging.Logger) (netns.NsHandle, error)\n```\nGetOrCreateNs returns an existing Linux network namespace or creates a new one if it doesn't exist yet. It is, however, only possible to create \"named\" namespaces. For PID-based namespaces, process with the given PID must exists, otherwise the function returns an error.\n\n```go\nfunc GetVethPeerName(ifName string, timeLog measure.StopWatchEntry) (string, error)\n```\nGetVethPeerName return the peer name for a given VETH interface.\n\n```go\nfunc InterfaceAdminDown(ifName string, timeLog measure.StopWatchEntry) error\n```\nInterfaceAdminDown calls Netlink API LinkSetDown\n\n```go\nfunc InterfaceAdminUp(ifName string, timeLog measure.StopWatchEntry) error\n```\nInterfaceAdminUp calls Netlink API LinkSetUp\n\n```go\nfunc InterfaceExists(ifName string, timeLog measure.StopWatchEntry) (bool, error)\n```\nInterfaceExists checks if interface with a given name exists.\n\n```go\nfunc NamedNetNsExists(namespace string, log logging.Logger) (bool, error)\n```\nNamedNetNsExists checks whether namespace exists.\n\n```go\nfunc NamespaceToStr(namespace *intf.LinuxInterfaces_Interface_Namespace) string\n```\nNamespaceToStr returns a string representation of a namespace suitable for logging purposes.\n\n```go\nfunc SetInterfaceMTU(ifName string, mtu int, timeLog measure.StopWatchEntry) error\n```\nSetInterfaceMTU calls LinkSetMTU Netlink API\n\n```go\nfunc SetInterfaceMac(ifName string, macAddress string, timeLog measure.StopWatchEntry) error\n```\nSetInterfaceMac calls LinkSetHardwareAddr netlink API\n\n```go\nfunc SetInterfaceNamespace(ctx *NamespaceMgmtCtx, ifName string, namespace *intf.LinuxInterfaces_Interface_Namespace,\n\tlog logging.Logger, stopwatch *measure.Stopwatch) error\n```\nSetInterfaceNamespace moves a given Linux interface into a specified namespace.\n\n```go\nfunc SwitchNamespace(ctx *NamespaceMgmtCtx, namespace *intf.LinuxInterfaces_Interface_Namespace, log logging.Logger) (revert func(), err error)\n```\nSwitchNamespace switches the network namespace of the current thread. Caller should eventually call the returned \"revert\" function in order to get back to the original network namespace (for example using \"defer revert()\").\n\n## Types\n\n```go\ntype NamespaceMgmtCtx struct {\n\t// contains filtered or unexported fields\n}\n```\nNamespaceMgmtCtx represents context of an ongoing management of Linux namespaces. The same context should not be used concurrently.\n\n```go\nfunc NewNamespaceMgmtCtx() *NamespaceMgmtCtx\n```\nNewNamespaceMgmtCtx creates and returns a new context for management of Linux namespaces.\n\n","path":"github.com/ligato/vpp-agent/plugins/linuxplugin/linuxcalls","name":"linuxcalls","synopsis":"Package linuxcalls contains wrappers over Netlink APIs related to Linux VETH interfaces or to Linux interfaces in general.","isRedistributable":true}
