Documentation ¶
Overview ¶
package kerneltest contains fake implemetation of structs in kernel package
Index ¶
- type FakeInterfaces
- func (fi *FakeInterfaces) AddrSubscribe(ch chan<- netlink.AddrUpdate, done <-chan struct{}) error
- func (fi *FakeInterfaces) CreateTAP(name string) (int, error)
- func (fi *FakeInterfaces) DeleteIP(name string, ip string, prefixLen int) error
- func (fi *FakeInterfaces) GetAll() ([]net.Interface, error)
- func (fi *FakeInterfaces) GetByName(name string) (*net.Interface, error)
- func (fi *FakeInterfaces) LinkSubscribe(ch chan<- netlink.LinkUpdate, done <-chan struct{}) error
- func (fi *FakeInterfaces) NeighSubscribe(chan<- netlink.NeighUpdate, <-chan struct{}) error
- func (fi *FakeInterfaces) ReplaceIP(name string, ip string, prefixLen int) error
- func (fi *FakeInterfaces) SetHWAddr(name string, addr string) error
- func (fi *FakeInterfaces) SetState(name string, up bool) error
- type Iface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeInterfaces ¶
FakeInterfaces contains a fake implementation methods for modifying networking interfaces.
func New ¶
func New(initialIfaces map[string]*Iface) *FakeInterfaces
New returns a new FakeInterfaces.
func (*FakeInterfaces) AddrSubscribe ¶
func (fi *FakeInterfaces) AddrSubscribe(ch chan<- netlink.AddrUpdate, done <-chan struct{}) error
AddrSubscribe subscribes to address changes for all interfaces.
func (*FakeInterfaces) CreateTAP ¶
func (fi *FakeInterfaces) CreateTAP(name string) (int, error)
CreateTAP creates kernel TAP interface.
func (*FakeInterfaces) DeleteIP ¶
func (fi *FakeInterfaces) DeleteIP(name string, ip string, prefixLen int) error
DeleteIP delete an IP addresses from a network interface.
func (*FakeInterfaces) GetAll ¶
func (fi *FakeInterfaces) GetAll() ([]net.Interface, error)
GetAll returns all interfaces.
func (*FakeInterfaces) GetByName ¶
func (fi *FakeInterfaces) GetByName(name string) (*net.Interface, error)
GetByName returns all interfaces.
func (*FakeInterfaces) LinkSubscribe ¶
func (fi *FakeInterfaces) LinkSubscribe(ch chan<- netlink.LinkUpdate, done <-chan struct{}) error
LinkSubscribe subscribes to link status for all interfaces.
func (*FakeInterfaces) NeighSubscribe ¶
func (fi *FakeInterfaces) NeighSubscribe(chan<- netlink.NeighUpdate, <-chan struct{}) error
NeighSubscribe subscribes to neighbor table updates. TODO: not implemented.
func (*FakeInterfaces) ReplaceIP ¶
func (fi *FakeInterfaces) ReplaceIP(name string, ip string, prefixLen int) error
ReplaceIP sets the IP addresses of a network interface.
Click to show internal directories.
Click to hide internal directories.