testing

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeNetsh

type FakeNetsh struct {
}

no-op implementation of netsh Interface

func NewFake

func NewFake() *FakeNetsh

func (*FakeNetsh) DeleteIPAddress

func (*FakeNetsh) DeleteIPAddress(args []string) error

DeleteIPAddress checks if the specified IP address is present and, if so, deletes it.

func (*FakeNetsh) DeletePortProxyRule

func (*FakeNetsh) DeletePortProxyRule(args []string) error

DeletePortProxyRule deletes the specified portproxy rule. If the rule did not exist, return error.

func (*FakeNetsh) EnableForwarding

func (*FakeNetsh) EnableForwarding(iface string) error

Enable forwarding on the interface (name or index)

func (*FakeNetsh) EnsurePortProxyRule

func (*FakeNetsh) EnsurePortProxyRule(args []string) (bool, error)

func (*FakeNetsh) GetDefaultGatewayIfaceName

func (*FakeNetsh) GetDefaultGatewayIfaceName() (string, error)

GetDefaultGatewayIfaceName returns a fake default interface

func (*FakeNetsh) GetInterfaceByIP

func (*FakeNetsh) GetInterfaceByIP(ipAddr string) (netsh.Ipv4Interface, error)

Gets an interface by ip address

func (*FakeNetsh) GetInterfaceByName

func (*FakeNetsh) GetInterfaceByName(name string) (netsh.Ipv4Interface, error)

Gets an interface by name

func (*FakeNetsh) GetInterfaceNameToIndexMap

func (*FakeNetsh) GetInterfaceNameToIndexMap() (map[string]int, error)

func (*FakeNetsh) GetInterfaces

func (*FakeNetsh) GetInterfaces() ([]netsh.Ipv4Interface, error)

GetInterfaces uses the show addresses command and returns a formatted structure

func (*FakeNetsh) Restore

func (*FakeNetsh) Restore(args []string) error

Restore runs `netsh exec` to restore portproxy or addresses using a file. TODO Check if this is required, most likely not

Jump to

Keyboard shortcuts

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