Documentation
¶
Index ¶
- Constants
- Variables
- func CopyIP(ip net.IP) net.IP
- func IPNetFromPrefix(p *Prefix) net.IPNet
- func ParseIPv4(s string) net.IP
- func SameIp(a net.IP, b net.IP) bool
- type Prefix
- func (p *Prefix) AFI() int
- func (p *Prefix) ApplyMask() *Prefix
- func (p *Prefix) ApplyReverseMask() *Prefix
- func (p *Prefix) ByteLength() int
- func (p *Prefix) Copy() *Prefix
- func (p *Prefix) Equal(x *Prefix) bool
- func (p *Prefix) IsDefault() bool
- func (p *Prefix) MarshalJSON() ([]byte, error)
- func (p *Prefix) Match(q *Prefix) bool
- func (p *Prefix) String() string
- type Ptree
- func (this *Ptree) Acquire(key []byte, keyLength int) *PtreeNode
- func (this *Ptree) AcquireByIPv4(key []byte) *PtreeNode
- func (this *Ptree) AcquireByIPv6(key []byte) *PtreeNode
- func (this *Ptree) AcquireByMaxBits(key []byte) *PtreeNode
- func (this *Ptree) AcquireByUint32(keyInt uint32) *PtreeNode
- func (this *Ptree) AcquireWithItem(key []byte, keyLength int, v interface{}) *PtreeNode
- func (this *Ptree) Lookup(key []byte, keyLength int) *PtreeNode
- func (this *Ptree) LookupByIPv4(key []byte) *PtreeNode
- func (this *Ptree) LookupByIPv6(key []byte) *PtreeNode
- func (this *Ptree) LookupByMaxBits(key []byte) *PtreeNode
- func (this *Ptree) LookupByUint32(keyInt uint32) *PtreeNode
- func (this *Ptree) LookupTop() *PtreeNode
- func (this *Ptree) Match(key []byte, keyLength int) *PtreeNode
- func (this *Ptree) MatchIPv4(key []byte) *PtreeNode
- func (this *Ptree) MatchIPv6(key []byte) *PtreeNode
- func (this *Ptree) Next(node *PtreeNode) *PtreeNode
- func (this *Ptree) Release(node *PtreeNode)
- func (this *Ptree) ReleaseByUint32(keyInt uint32)
- func (this *Ptree) ReleaseWithItem(key []byte, keyLength int, v interface{})
- func (this *Ptree) ReverseOrderSet()
- func (this *Ptree) Top() *PtreeNode
- type PtreeNode
Constants ¶
View Source
const ( AFI_IP = iota AFI_IP6 AFI_MAX )
Variables ¶
View Source
var MaskBits = []byte{0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff}
View Source
var MaskReverseBits = []byte{0xff, 0x7f, 0x3f, 0x1f, 0x0f, 0x07, 0x03, 0x01, 0x00}
Functions ¶
func IPNetFromPrefix ¶
Types ¶
type Prefix ¶
func NewPrefixAFI ¶
func ParsePrefix ¶
func PrefixFromIPNet ¶
func PrefixFromNode ¶
func (*Prefix) ApplyReverseMask ¶
func (*Prefix) ByteLength ¶
func (*Prefix) MarshalJSON ¶
type Ptree ¶
type Ptree struct {
// contains filtered or unexported fields
}
func (*Ptree) AcquireByIPv4 ¶
func (*Ptree) AcquireByIPv6 ¶
func (*Ptree) AcquireByMaxBits ¶
func (*Ptree) AcquireByUint32 ¶
func (*Ptree) AcquireWithItem ¶
func (*Ptree) LookupByIPv4 ¶
func (*Ptree) LookupByIPv6 ¶
func (*Ptree) LookupByMaxBits ¶
func (*Ptree) LookupByUint32 ¶
func (*Ptree) ReleaseByUint32 ¶
func (*Ptree) ReleaseWithItem ¶
func (*Ptree) ReverseOrderSet ¶
func (this *Ptree) ReverseOrderSet()
type PtreeNode ¶
type PtreeNode struct {
Item interface{}
// contains filtered or unexported fields
}
func NewPtreeNode ¶
Click to show internal directories.
Click to hide internal directories.