Documentation ¶
Overview ¶
Package kernel contains funcs that interact with the kernel (sycalls, netlink).
Index ¶
- type Interfaces
- func (k *Interfaces) AddrSubscribe(ch chan<- netlink.AddrUpdate, done <-chan struct{}) error
- func (k *Interfaces) CreateTAP(name string) (int, error)
- func (k *Interfaces) DeleteIP(name string, ip string, prefixLen int) error
- func (k *Interfaces) LinkAdd(link netlink.Link) error
- func (k *Interfaces) LinkByIndex(idx int) (netlink.Link, error)
- func (k *Interfaces) LinkByName(name string) (netlink.Link, error)
- func (k *Interfaces) LinkList() ([]netlink.Link, error)
- func (k *Interfaces) LinkModify(link netlink.Link) error
- func (k *Interfaces) LinkSetDown(link netlink.Link) error
- func (k *Interfaces) LinkSetMaster(member netlink.Link, link netlink.Link) error
- func (k *Interfaces) LinkSetNoMaster(link netlink.Link) error
- func (k *Interfaces) LinkSetUp(link netlink.Link) error
- func (k *Interfaces) LinkSubscribe(ch chan<- netlink.LinkUpdate, done <-chan struct{}) error
- func (k *Interfaces) NeighSubscribe(ch chan<- netlink.NeighUpdate, done <-chan struct{}) error
- func (k *Interfaces) ReplaceIP(name string, ip string, prefixLen int) error
- func (k *Interfaces) SetHWAddr(name string, addr string) error
- func (k *Interfaces) SetState(name string, up bool) error
- type PacketMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interfaces ¶
type Interfaces struct{}
Interfaces contains methods for modifying networking interfaces.
func (*Interfaces) AddrSubscribe ¶
func (k *Interfaces) AddrSubscribe(ch chan<- netlink.AddrUpdate, done <-chan struct{}) error
AddrSubscribe subscribes to address changes for all interfaces.
func (*Interfaces) CreateTAP ¶
func (k *Interfaces) CreateTAP(name string) (int, error)
CreateTAP creates kernel TAP interface.
func (*Interfaces) DeleteIP ¶
func (k *Interfaces) DeleteIP(name string, ip string, prefixLen int) error
DeleteIP delete an IP addresses from a network interface.
func (*Interfaces) LinkAdd ¶
func (k *Interfaces) LinkAdd(link netlink.Link) error
LinkAdd adds a new network interface.
func (*Interfaces) LinkByIndex ¶
func (k *Interfaces) LinkByIndex(idx int) (netlink.Link, error)
LinkByIndex finds a link by its index.
func (*Interfaces) LinkByName ¶
func (k *Interfaces) LinkByName(name string) (netlink.Link, error)
LinkByName returns a network interface by name.
func (*Interfaces) LinkList ¶
func (k *Interfaces) LinkList() ([]netlink.Link, error)
LinkList lists all Linux network interfaces.
func (*Interfaces) LinkModify ¶
func (k *Interfaces) LinkModify(link netlink.Link) error
LinkModify modifies the link.
func (*Interfaces) LinkSetDown ¶
func (k *Interfaces) LinkSetDown(link netlink.Link) error
LinkSetDown sets the admin state to down.
func (*Interfaces) LinkSetMaster ¶
LinkSetMaster sets the member link's master to the other link.
func (*Interfaces) LinkSetNoMaster ¶
func (k *Interfaces) LinkSetNoMaster(link netlink.Link) error
LinkSetNoMaster removes the master from the link.
func (*Interfaces) LinkSetUp ¶
func (k *Interfaces) LinkSetUp(link netlink.Link) error
LinkSetDown sets the admin state to up.
func (*Interfaces) LinkSubscribe ¶
func (k *Interfaces) LinkSubscribe(ch chan<- netlink.LinkUpdate, done <-chan struct{}) error
LinkSubscribe subscribes to link status for all interfaces.
func (*Interfaces) NeighSubscribe ¶
func (k *Interfaces) NeighSubscribe(ch chan<- netlink.NeighUpdate, done <-chan struct{}) error
NeighSubscribe subscribes to neighbor table updates.
func (*Interfaces) ReplaceIP ¶
func (k *Interfaces) ReplaceIP(name string, ip string, prefixLen int) error
ReplaceIP sets the IP addresses of a network interface.
type PacketMetadata ¶
Directories ¶
Path | Synopsis |
---|---|
package kerneltest contains fake implemetation of structs in kernel package
|
package kerneltest contains fake implemetation of structs in kernel package |