Documentation
¶
Index ¶
- Constants
- Variables
- func IPLenToVer(l int) int
- func IPPrefixesContain(prefixes []IPPrefix, ip IP) bool
- func IPVerToLen(ver int) int
- func RefPrefixesContain(prefixes []RefPrefix, ref Ref) bool
- type AddrRec
- type IP
- func (a IP) Add(b IP) IP
- func (a IP) And(b IP) IP
- func (ip IP) As4In6() IP
- func (ip IP) AsSlice() []byte
- func (ip IP) AsSlice4() []byte
- func (ip IP) AsSlice6() []byte
- func (ip IP) AsUint128() Uint128
- func (ip IP) AsUint128Cast() Uint128
- func (ip IP) AsUint32() uint32
- func (ip IP) AsUnixSockaddr() unix.Sockaddr
- func (ip IP) ByteFromEnd(i int) byte
- func (a IP) Compare(b IP) int
- func (ip IP) Is4() bool
- func (ip IP) Is4In6() bool
- func (ip IP) Is6() bool
- func (ip IP) IsGlobalUnicast() bool
- func (ip IP) IsLinkLocal() bool
- func (ip IP) IsZero() bool
- func (ip IP) IsZeroAddr() bool
- func (ip IP) Len() int
- func (a IP) Not() IP
- func (a IP) Or(b IP) IP
- func (ip IP) String() string
- func (ip IP) Un4In6() IP
- func (ip IP) Ver() int
- func (a IP) XOr(b IP) IP
- type IPPrefix
- type IpRef
- type Ref
- type RefPrefix
- type Uint128
- func MustParseUint128(s string, base int) Uint128
- func ParseUint128(s string, base int) (Uint128, bool)
- func Uint128FromBig(i *big.Int) (Uint128, bool)
- func Uint128FromBytesBE(src []byte) Uint128
- func Uint128FromBytesLE(src []byte) Uint128
- func Uint128FromUint16(x uint16) Uint128
- func Uint128FromUint32(x uint32) Uint128
- func Uint128FromUint64(x uint64) Uint128
- func Uint128FromUint8(x uint8) Uint128
- func (x Uint128) Add(y Uint128) (z Uint128)
- func (x Uint128) AddCarry(y Uint128, cin uint64) (z Uint128, cout uint64)
- func (x Uint128) And(y Uint128) Uint128
- func (x Uint128) AndNot(y Uint128) Uint128
- func (x Uint128) AsBytesBE() (dst [16]byte)
- func (x Uint128) AsBytesLE() (dst [16]byte)
- func (x Uint128) AsSliceBE() []byte
- func (x Uint128) AsSliceLE() []byte
- func (x Uint128) Big() *big.Int
- func (x Uint128) Bit(n int) uint
- func (x Uint128) BitLen() int
- func (x Uint128) Cmp(y Uint128) int
- func (x Uint128) Compl() Uint128
- func (x Uint128) Format(base int) string
- func (x Uint128) FormatHex() string
- func (x Uint128) Int() int
- func (x Uint128) IntCheck() (int, bool)
- func (x Uint128) IsZero() bool
- func (x Uint128) LeadingZeros() int
- func (x Uint128) Lsh(n uint) Uint128
- func (x Uint128) Mul(y Uint128) (z Uint128)
- func (x Uint128) Or(y Uint128) Uint128
- func (x Uint128) PutBytesBE(dst []byte)
- func (x Uint128) PutBytesLE(dst []byte)
- func (x Uint128) Rsh(n uint) Uint128
- func (x Uint128) String() string
- func (x Uint128) Sub(y Uint128) (z Uint128)
- func (x Uint128) SubBorrow(y Uint128, bin uint64) (z Uint128, bout uint64)
- func (x Uint128) TrailingZeros() int
- func (x Uint128) Uint16() uint16
- func (x Uint128) Uint16Check() (uint16, bool)
- func (x Uint128) Uint32() uint32
- func (x Uint128) Uint32Check() (uint32, bool)
- func (x Uint128) Uint64() uint64
- func (x Uint128) Uint64Check() (uint64, bool)
- func (x Uint128) Uint8() uint8
- func (x Uint128) Uint8Check() (uint8, bool)
- func (x Uint128) Xor(y Uint128) Uint128
Constants ¶
View Source
const ( V1_SIG = 0x11 // v1 signature V1_HDR_LEN = 8 V1_MARK_LEN = 4 + 4 // oid + mark // v1 header offsets V1_VER = 0 // must be 0x11 V1_CMD = 1 V1_PKTID = 2 V1_PKTLEN = 6 // v1 mark offsets V1_OID = 0 V1_MARK = 4 // v1 host data offsets V1_HOST_DATA_BATCHID = 0 V1_HOST_DATA_COUNT = 0 V1_HOST_DATA_HASH = 4 V1_HOST_DATA_SOURCE = 12 // v1 save dnssource offsets V1_DNSSOURCE_MARK = 4 V1_DNSSOURCE_XMARK = 4 V1_DNSSOURCE_HASH = 8 V1_DNSSOURCE_SOURCE = 16 )
View Source
const ( V1_NOOP = 0 V1_SET_AREC = 1 V1_SET_MARK = 2 V1_GET_REF = 4 V1_GET_EA = 6 V1_MC_GET_EA = 7 V1_SAVE_OID = 8 V1_SAVE_TIME_BASE = 9 V1_RECOVER_EA = 10 V1_RECOVER_REF = 11 V1_MC_HOST_DATA = 14 V1_MC_HOST_DATA_HASH = 15 V1_SAVE_DNSSOURCE = 16 )
View Source
const ( V1_DATA = 0x00 V1_REQ = 0x40 V1_ACK = 0x80 V1_NACK = 0xC0 )
View Source
const ( //V1_TYPE_NONE = 0 //V1_TYPE_AREC = 1 //V1_TYPE_IPV4 = 3 V1_TYPE_STRING = 4 )
Variables ¶
View Source
var UINT128_0 = Uint128FromUint64(0)
View Source
var UINT128_1 = Uint128FromUint64(1)
View Source
var UINT128_2_127 = UINT128_1.Lsh(127)
View Source
var UINT128_MAX = UINT128_0.Sub(UINT128_1)
Functions ¶
func IPLenToVer ¶ added in v1.2.0
func IPPrefixesContain ¶ added in v1.4.0
func IPVerToLen ¶ added in v1.2.0
func RefPrefixesContain ¶ added in v1.4.0
Types ¶
type IP ¶
func IPFromUint128 ¶ added in v1.4.0
func IPFromUint32 ¶
func IPFromUnixSockaddr ¶ added in v1.4.0
func MustParseIP ¶
func (IP) AsUint128Cast ¶ added in v1.4.0
func (IP) AsUnixSockaddr ¶ added in v1.4.0
func (IP) ByteFromEnd ¶
func (IP) IsGlobalUnicast ¶ added in v1.4.0
func (IP) IsLinkLocal ¶
func (IP) IsZero ¶
Tests if the IP is equal to the zero-initialized value. This is distinct from the zero IP address (eg. 0.0.0.0 or ::).
func (IP) IsZeroAddr ¶
type IPPrefix ¶ added in v1.4.0
func IPPrefixAllVer ¶ added in v1.4.0
func IPPrefixComplete ¶ added in v1.4.0
func IPPrefixFrom ¶ added in v1.4.0
func IPPrefixSingle ¶ added in v1.4.0
func MustParseIPPrefix ¶ added in v1.4.0
func ParseIPPrefix ¶ added in v1.4.0
type IpRef ¶ added in v1.1.0
func MustParseIpRef ¶ added in v1.3.0
func ParseIpRef ¶ added in v1.3.0
type Ref ¶ added in v1.3.0
type Ref Uint128
The zero ref is Ref{}
func MustParseRef ¶ added in v1.3.0
func ParseRefInPrefix ¶ added in v1.4.0
func RefFromBytesBE ¶ added in v1.3.0
func (Ref) StringInPrefix ¶ added in v1.4.0
type RefPrefix ¶ added in v1.4.0
type RefPrefix struct {
// contains filtered or unexported fields
}
The zero value is the prefix which contains all refs
func MustParseRefPrefix ¶ added in v1.4.0
func ParseRefPrefix ¶ added in v1.4.0
func RefPrefixComplete ¶ added in v1.4.0
func RefPrefixComplete() RefPrefix
func RefPrefixFrom ¶ added in v1.4.0
func RefPrefixSingle ¶ added in v1.4.0
func (RefPrefix) RefUint128 ¶ added in v1.4.0
type Uint128 ¶ added in v1.3.0
type Uint128 struct {
L, H uint64
}
func MustParseUint128 ¶ added in v1.3.0
func Uint128FromBytesBE ¶ added in v1.3.0
func Uint128FromBytesLE ¶ added in v1.3.0
func Uint128FromUint16 ¶ added in v1.3.0
func Uint128FromUint32 ¶ added in v1.3.0
func Uint128FromUint64 ¶ added in v1.3.0
func Uint128FromUint8 ¶ added in v1.3.0
func (Uint128) LeadingZeros ¶ added in v1.3.0
func (Uint128) PutBytesBE ¶ added in v1.3.0
func (Uint128) PutBytesLE ¶ added in v1.3.0
func (Uint128) TrailingZeros ¶ added in v1.3.0
func (Uint128) Uint16Check ¶ added in v1.3.0
func (Uint128) Uint32Check ¶ added in v1.3.0
func (Uint128) Uint64Check ¶ added in v1.3.0
func (Uint128) Uint8Check ¶ added in v1.3.0
Click to show internal directories.
Click to hide internal directories.