Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NetifManager ¶
func NewNetifManager ¶
func NewNetifManager(ips []net.IP) *NetifManager
NewNetifManager returns a new instance of NetifManager with the ip address set to the provided values These ip addresses will be bound to any devices created by this instance.
func (*NetifManager) AddDummyDevice ¶
func (m *NetifManager) AddDummyDevice(name string) error
AddDummyDevice creates a dummy device with the given name. It also binds the ip address of the NetifManager instance to this device. This function returns an error if the device exists or if address binding fails.
func (*NetifManager) EnsureDummyDevice ¶
func (m *NetifManager) EnsureDummyDevice(name string) (bool, error)
EnsureDummyDevice checks for the presence of the given dummy device and creates one if it does not exist. Returns a boolean to indicate if this device was found and error if any.
func (*NetifManager) RemoveDummyDevice ¶
func (m *NetifManager) RemoveDummyDevice(name string) error
RemoveDummyDevice deletes the dummy device with the given name.