netlink

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Packet netlink provide access to low level Netlink sockets and messages.

Actual implementations are in: netlink_linux.go netlink_darwin.go

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWrongSockType   = errors.New("Wrong socket type")
	ErrShortResponse   = errors.New("Got short response from netlink")
	ErrInterfaceExists = errors.New("Network interface already exists")
)
View Source
var (
	ErrNotImplemented = errors.New("not implemented")
)

Functions

func AddDefaultGw

func AddDefaultGw(ip, device string) error

func AddRoute

func AddRoute(destination, source, gateway, device string) error

func AddToBridge

func AddToBridge(iface, master *net.Interface) error

func CreateBridge

func CreateBridge(name string, setMacAddr bool) error

func DeleteBridge

func DeleteBridge(name string) error

func NetworkChangeName

func NetworkChangeName(iface *net.Interface, newName string) error

func NetworkCreateVethPair

func NetworkCreateVethPair(name1, name2 string, txQueueLen int) error

func NetworkLinkAdd

func NetworkLinkAdd(name string, linkType string) error

func NetworkLinkAddIp

func NetworkLinkAddIp(iface *net.Interface, ip net.IP, ipNet *net.IPNet) error

func NetworkLinkDel

func NetworkLinkDel(name string) error

func NetworkLinkDelIp

func NetworkLinkDelIp(iface *net.Interface, ip net.IP, ipNet *net.IPNet) error

func NetworkLinkDown

func NetworkLinkDown(iface *net.Interface) error

func NetworkLinkUp

func NetworkLinkUp(iface *net.Interface) error

func NetworkSetMTU

func NetworkSetMTU(iface *net.Interface, mtu int) error

func NetworkSetMaster

func NetworkSetMaster(iface, master *net.Interface) error

func NetworkSetNsFd

func NetworkSetNsFd(iface *net.Interface, fd int) error

func NetworkSetNsPid

func NetworkSetNsPid(iface *net.Interface, nspid int) error

func NetworkSetTxQueueLen

func NetworkSetTxQueueLen(iface *net.Interface, txQueueLen int) error

Types

type IfAddr

type IfAddr struct {
	Iface *net.Interface
	IP    net.IP
	IPNet *net.IPNet
}

An IfAddr defines IP network settings for a given network interface

type Route

type Route struct {
	*net.IPNet
	Iface   *net.Interface
	Default bool
}

A Route is a subnet associated with the interface to reach it.

func NetworkGetRoutes

func NetworkGetRoutes() ([]Route, error)

Jump to

Keyboard shortcuts

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