cidr

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(s string) *net.IPNet

Parse is a convenience function that returns only the IPNet This function ignores errors since it is primarily a test helper, the result could be nil

Types

type Node

type Node struct {
	// contains filtered or unexported fields
}

type Tree4

type Tree4 struct {
	// contains filtered or unexported fields
}

func NewTree4

func NewTree4() *Tree4

func (*Tree4) AddCIDR

func (tree *Tree4) AddCIDR(cidr *net.IPNet, val interface{})

func (*Tree4) Contains

func (tree *Tree4) Contains(ip iputil.VpnIp) (value interface{})

Finds the first match, which may be the least specific

func (*Tree4) Match

func (tree *Tree4) Match(ip iputil.VpnIp) (value interface{})

Finds the most specific match

func (*Tree4) MostSpecificContains

func (tree *Tree4) MostSpecificContains(ip iputil.VpnIp) (value interface{})

Finds the most specific match

type Tree6

type Tree6 struct {
	// contains filtered or unexported fields
}

func NewTree6

func NewTree6() *Tree6

func (*Tree6) AddCIDR

func (tree *Tree6) AddCIDR(cidr *net.IPNet, val interface{})

func (*Tree6) MostSpecificContains

func (tree *Tree6) MostSpecificContains(ip net.IP) (value interface{})

Finds the most specific match

func (*Tree6) MostSpecificContainsIpV4

func (tree *Tree6) MostSpecificContainsIpV4(ip iputil.VpnIp) (value interface{})

func (*Tree6) MostSpecificContainsIpV6

func (tree *Tree6) MostSpecificContainsIpV6(hi, lo uint64) (value interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL