kernel

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package kernel contains funcs that interact with the kernel (sycalls, netlink).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interfaces added in v0.2.0

type Interfaces struct{}

Interfaces contains methods for modifying networking interfaces.

func (*Interfaces) AddrSubscribe added in v0.2.0

func (k *Interfaces) AddrSubscribe(ch chan<- netlink.AddrUpdate, done <-chan struct{}) error

AddrSubscribe subscribes to address changes for all interfaces.

func (*Interfaces) CreateTAP added in v0.2.0

func (k *Interfaces) CreateTAP(name string) (int, error)

CreateTAP creates kernel TAP interface.

func (*Interfaces) DeleteIP added in v0.2.0

func (k *Interfaces) DeleteIP(name string, ip string, prefixLen int) error

DeleteIP delete an IP addresses from a network interface.

func (*Interfaces) GetAll added in v0.2.0

func (k *Interfaces) GetAll() ([]net.Interface, error)

GetAll returns all interfaces.

func (*Interfaces) GetByName added in v0.2.0

func (k *Interfaces) GetByName(name string) (*net.Interface, error)

GetByName returns all interfaces.

func (*Interfaces) LinkSubscribe added in v0.2.0

func (k *Interfaces) LinkSubscribe(ch chan<- netlink.LinkUpdate, done <-chan struct{}) error

LinkSubscribe subscribes to link status for all interfaces.

func (*Interfaces) NeighSubscribe added in v0.2.0

func (k *Interfaces) NeighSubscribe(ch chan<- netlink.NeighUpdate, done <-chan struct{}) error

NeighSubscribe subscribes to neighbor table updates.

func (*Interfaces) ReplaceIP added in v0.2.0

func (k *Interfaces) ReplaceIP(name string, ip string, prefixLen int) error

ReplaceIP sets the IP addresses of a network interface.

func (*Interfaces) SetHWAddr added in v0.2.0

func (k *Interfaces) SetHWAddr(name string, addr string) error

SetHWAddr sets the MAC address of a network interface.

func (*Interfaces) SetState added in v0.2.0

func (k *Interfaces) SetState(name string, up bool) error

SetState sets a links up or down.

Directories

Path Synopsis
package kerneltest contains fake implemetation of structs in kernel package
package kerneltest contains fake implemetation of structs in kernel package

Jump to

Keyboard shortcuts

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