Documentation ¶
Index ¶
- Variables
- func DirectRouting(ip net.IP) (bool, error)
- func EnsureV4AddressOnLink(ipn IP4Net, link netlink.Link) error
- func GetDefaultGatewayInterface() (*net.Interface, error)
- func GetInterfaceByIP(ip net.IP) (*net.Interface, error)
- func GetInterfaceIP4Addr(iface *net.Interface) (net.IP, error)
- func GetInterfaceIP4AddrMatch(iface *net.Interface, matchAddr net.IP) error
- func NativelyLittle() bool
- func OpenTun(name string) (*os.File, string, error)
- 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 ¶
View Source
var NativeEndian binary.ByteOrder
NativeEndian is the ByteOrder of the current system.
Functions ¶
func EnsureV4AddressOnLink ¶ added in v0.10.0
EnsureV4AddressOnLink ensures that there is only one v4 Addr on `link` and it equals `ipn`. If there exist multiple addresses on link, it returns an error message to tell callers to remove additional address.
func GetDefaultGatewayInterface ¶ added in v0.13.0
func GetInterfaceIP4Addr ¶ added in v0.13.0
func GetInterfaceIP4AddrMatch ¶ added in v0.13.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
Click to show internal directories.
Click to hide internal directories.