Documentation ¶
Index ¶
- func MergePrefixes32(left uint32, leftLength uint, right uint32, rightLength uint) (uint32, uint)
- func MergePrefixes64(leftLeft uint64, leftRight uint64, leftLength uint, rightLeft uint64, ...) (uint64, uint64, uint)
- func ParseIPFromString(address string) (*IPv4Address, *IPv6Address, error)
- func ShiftLeftIPv6(left uint64, right uint64, length uint, bitCount uint) (uint64, uint64, uint)
- func ShiftRightIPv6(left uint64, right uint64, bitCount uint) (uint64, uint64)
- type IPv4Address
- type IPv6Address
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergePrefixes32 ¶
MergePrefixes32 merges two 32-bit prefixes, returning new prefix, new length
func MergePrefixes64 ¶
func MergePrefixes64(leftLeft uint64, leftRight uint64, leftLength uint, rightLeft uint64, rightRight uint64, rightLength uint) (uint64, uint64, uint)
MergePrefixes64 merges two pairs of uint64s, returning a new prefix, new length
func ParseIPFromString ¶
func ParseIPFromString(address string) (*IPv4Address, *IPv6Address, error)
ParseIPFromString parses a string address, returning a v4 or v6 IP address TODO: make this more performant:
- is the fmt.Sprintf necessary?
func ShiftLeftIPv6 ¶
ShiftLeftIPv6 shifts IPv6 (as two uint64's) to the left
Types ¶
type IPv4Address ¶
IPv4Address is a representation of an IPv4 address and CIDR
func NewIPv4Address ¶
func NewIPv4Address(address uint32, length uint) IPv4Address
NewIPv4Address creates an address from the input IPv4 address
func NewIPv4AddressFromBytes ¶
func NewIPv4AddressFromBytes(address []byte, length uint) IPv4Address
NewIPv4AddressFromBytes creates an address from the input IPv4 address bytes - address must be 4 bytes
func (*IPv4Address) IsLeftBitSet ¶
func (i *IPv4Address) IsLeftBitSet() bool
IsLeftBitSet returns whether the leftmost bit is set
func (*IPv4Address) ShiftLeft ¶
func (i *IPv4Address) ShiftLeft(shiftCount uint)
ShiftLeft shifts the address to the left
type IPv6Address ¶
IPv6Address is a representation of an IPv6 address and CIDR
func NewIPv6Address ¶
func NewIPv6Address(address []byte, length uint) IPv6Address
NewIPv6Address creates an address from the input IPv6 bytes (must be length 16)
func (*IPv6Address) IsLeftBitSet ¶
func (ip *IPv6Address) IsLeftBitSet() bool
IsLeftBitSet returns whether the leftmost bit is set
func (*IPv6Address) ShiftLeft ¶
func (ip *IPv6Address) ShiftLeft(bitCount uint)
ShiftLeft shifts the bits |bitCount| bits left
Directories ¶
Path | Synopsis |
---|---|
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |
Package template is the base of code generation for type-specific trees
|
Package template is the base of code generation for type-specific trees |