Documentation
¶
Index ¶
- Variables
- func DisableForwardingForInterface(iface *net.Interface) error
- func EnableForwardingForInterface(iface *net.Interface) error
- func GetDefaultGatewayInterface() (*net.Interface, error)
- func GetInterfaceByIP(search net.IP) (*net.Interface, error)
- func GetInterfaceIP4Addr(iface *net.Interface) (net.IP, error)
- func IsForwardingEnabledForInterface(iface *net.Interface) (bool, error)
- func NativelyLittle() bool
- type IP4
- type IP4Net
- func (n IP4Net) Contains(ip IP4) bool
- func (n IP4Net) Empty() bool
- func (n IP4Net) Equal(other IP4Net) bool
- func (n IP4Net) MarshalJSON() ([]byte, error)
- func (n IP4Net) Mask() uint32
- func (n IP4Net) Network() IP4Net
- func (n IP4Net) Next() IP4Net
- func (n IP4Net) Overlaps(other IP4Net) bool
- func (n IP4Net) String() string
- func (n IP4Net) StringSep(octetSep, prefixSep string) string
- func (n IP4Net) ToIPNet() *net.IPNet
- func (n *IP4Net) UnmarshalJSON(j []byte) error
Constants ¶
This section is empty.
Variables ¶
var NativeEndian binary.ByteOrder
NativeEndian is the ByteOrder of the current system.
Functions ¶
func DisableForwardingForInterface ¶ added in v0.14.0
DisableForwardingForInterface disables forwarding for given interface. The process must run with elevated rights. Otherwise the function will fail with an "Access Denied" error.
func EnableForwardingForInterface ¶ added in v0.14.0
EnableForwardingForInterface enables forwarding for given interface. The process must run with elevated rights. Otherwise the function will fail with an "Access Denied" error.
func GetDefaultGatewayInterface ¶ added in v0.14.0
GetDefaultGatewayInterface returns the first network interface found with a default gateway set
func GetInterfaceByIP ¶
GetInterfaceByIP tries to get the network interface with the given ip address
func GetInterfaceIP4Addr ¶ added in v0.14.0
GetInterfaceIP4Addr returns the IPv4 address for the given network interface
func IsForwardingEnabledForInterface ¶ added in v0.14.0
func NativelyLittle ¶
func NativelyLittle() bool
Types ¶
type IP4 ¶
type IP4 uint32
func MustParseIP4 ¶ added in v0.5.6
func (IP4) MarshalJSON ¶
MarshalJSON: json.Marshaler impl
func (IP4) NetworkOrder ¶
func (*IP4) UnmarshalJSON ¶
UnmarshalJSON: json.Unmarshaler impl
type IP4Net ¶
similar to net.IPNet but has uint based representation
func (IP4Net) MarshalJSON ¶
MarshalJSON: json.Marshaler impl
func (*IP4Net) UnmarshalJSON ¶
UnmarshalJSON: json.Unmarshaler impl