Documentation ¶
Index ¶
- Variables
- func DirectRouting(ip net.IP) (bool, error)
- func EnsureV4AddressOnLink(ipn IP4Net, link netlink.Link) error
- func GetDefaultGatewayIface() (*net.Interface, error)
- func GetIfaceIP4Addr(iface *net.Interface) (net.IP, error)
- func GetIfaceIP4AddrMatch(iface *net.Interface, matchAddr net.IP) error
- func GetInterfaceByIP(ip net.IP) (*net.Interface, 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 GetDefaultGatewayIface ¶
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.