Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableForwardingByIndex ¶
EnableForwardingByIndex enables the interface forwarding by index
func EnableForwardingByName ¶
EnableForwardingByName enables the interface forwarding by name
func GetDefaultGatewayIfaceIndex ¶
GetDefaultGatewayIfaceIndex get the interface index that has the default gateway
func GetDefaultGatewayIfaceName ¶
GetDefaultGatewayIfaceName get the interface name that has the default gateway
Types ¶
type Ipv4Interface ¶
type Ipv4Interface struct { Idx int Name string Description string IpAddress string IpMask string DefaultGatewayAddress string DhcpEnabled bool }
func GetInterfaceByIP ¶
func GetInterfaceByIP(ipAddr string) (Ipv4Interface, error)
GetInterfaceByIP gets an interface by ip address in the format a.b.c.d
func GetInterfaceByIndex ¶
func GetInterfaceByIndex(idx int) (Ipv4Interface, error)
GetInterfaceByIndex gets an interface by index
func GetInterfaceByName ¶
func GetInterfaceByName(name string) (Ipv4Interface, error)
GetInterfaceByName gets an interface by name
func GetInterfaces ¶
func GetInterfaces() (ifaces []Ipv4Interface, err error)
GetInterfaces gets a list of interfaces and addresses
func (*Ipv4Interface) GetSubnet ¶
func (i *Ipv4Interface) GetSubnet() *net.IPNet
func (Ipv4Interface) String ¶
func (i Ipv4Interface) String() string
Click to show internal directories.
Click to hide internal directories.