Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { // EnsurePortProxyRule checks if the specified redirect exists, if not creates it EnsurePortProxyRule(args []string) (bool, error) // DeletePortProxyRule deletes the specified portproxy rule. If the rule did not exist, return error. DeletePortProxyRule(args []string) error // DeleteIPAddress checks if the specified IP address is present and, if so, deletes it. DeleteIPAddress(args []string) error // Restore runs `netsh exec` to restore portproxy or addresses using a file. // TODO Check if this is required, most likely not Restore(args []string) error // Get the interface name that has the default gateway GetDefaultGatewayIfaceName() (string, error) // Get a list of interfaces and addresses GetInterfaces() ([]Ipv4Interface, error) // Gets an interface by name GetInterfaceByName(name string) (Ipv4Interface, error) // Gets an interface by ip address in the format a.b.c.d GetInterfaceByIP(ipAddr string) (Ipv4Interface, error) // Enable forwarding on the interface (name or index) EnableForwarding(iface string) error }
Interface is an injectable interface for running netsh commands. Implementations must be goroutine-safe.
Click to show internal directories.
Click to hide internal directories.