Documentation ¶
Index ¶
- func ConfigureInterface(ifaceIndex int, family AddressFamily, options ConfigurationOptions) error
- func DisableDhcpForInterface(ifaceIndex int, family AddressFamily) error
- func DisableForwardingForInterface(ifaceIndex int, family AddressFamily) error
- func EnableDhcpForInterface(ifaceIndex int, family AddressFamily) error
- func EnableForwardingForInterface(ifaceIndex int, family AddressFamily) error
- func GetDNSConfigurationByMAC(search string, family AddressFamily) (types.DNS, error)
- func GetInterfaceIndexByIP(search net.IP) (int, error)
- func IsDhcpEnabledForInterface(ifaceIndex int, family AddressFamily) (bool, error)
- func IsForwardingEnabledForInterface(ifaceIndex int, family AddressFamily) (bool, error)
- func SetMTUForInterface(ifaceIndex int, family AddressFamily, mtu int) error
- type AddressFamily
- type ConfigurationOptions
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureInterface ¶
func ConfigureInterface(ifaceIndex int, family AddressFamily, options ConfigurationOptions) error
ConfigureInterface configures the given network interface with the given configuration options.
func DisableDhcpForInterface ¶
func DisableDhcpForInterface(ifaceIndex int, family AddressFamily) error
DisableDhcpForInterface disables hcp for given network interface.
func DisableForwardingForInterface ¶
func DisableForwardingForInterface(ifaceIndex int, family AddressFamily) error
DisableForwardingForInterface disables forwarding for given network interface.
func EnableDhcpForInterface ¶
func EnableDhcpForInterface(ifaceIndex int, family AddressFamily) error
EnableDhcpForInterface enables dhcp for given network interface.
func EnableForwardingForInterface ¶
func EnableForwardingForInterface(ifaceIndex int, family AddressFamily) error
EnableForwardingForInterface enables forwarding for given network interface.
func GetDNSConfigurationByMAC ¶
func GetDNSConfigurationByMAC(search string, family AddressFamily) (types.DNS, error)
GetDNSConfigurationByMAC returns dns configuration for given network interface.
func GetInterfaceIndexByIP ¶
GetInterfaceIndexByIP tries to get the network interface index with the given ip address.
func IsDhcpEnabledForInterface ¶
func IsDhcpEnabledForInterface(ifaceIndex int, family AddressFamily) (bool, error)
IsDhcpEnabledForInterface returns true if the given network interface is enabling dhcp.
func IsForwardingEnabledForInterface ¶
func IsForwardingEnabledForInterface(ifaceIndex int, family AddressFamily) (bool, error)
IsForwardingEnabledForInterface returns true if the given network interface is enabling forwarding.
func SetMTUForInterface ¶
func SetMTUForInterface(ifaceIndex int, family AddressFamily, mtu int) error
SetMTUForInterface configures the MTU for given network interface.
Types ¶
type AddressFamily ¶
type AddressFamily string
const ( IPv4 AddressFamily = "IPv4" IPv6 AddressFamily = "IPv6" Dual AddressFamily = "" )
type ConfigurationOptions ¶
ConfigurationOptions specifies the options to configure.
type Interface ¶
type Interface struct { Index int `json:"InterfaceIndex"` Alias string `json:"InterfaceAlias"` Name string `json:"InterfaceName"` Desc string `json:"InterfaceDescription"` MTU int `json:"MtuSize"` Virtual bool `json:"Virtual"` MacAddress string `json:"MacAddress"` }
func GetDefaultGatewayInterface ¶
GetDefaultGatewayInterface returns the first network interface found with a default gateway set.
func GetInterfaceByIndex ¶
GetInterfaceByIndex tries to get the network interface with the given index.
func GetInterfaceByMAC ¶
GetInterfaceByMAC tries to get the network interface with the given mac address.