cidrmap

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_KEYS           = 1024
	LPM_MAP_VALUE_SIZE = 1
)
View Source
const (
	MapName = "cilium_cidr_"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CIDRMap

type CIDRMap struct {
	Fd       int
	AddrSize int // max prefix length in bytes, 4 for IPv4, 16 for IPv6
	// contains filtered or unexported fields
}

CIDRMap refers to an LPM trie map at 'path'.

func OpenMap

func OpenMap(path string, prefixlen int) (*CIDRMap, bool, error)

OpenMap opens a new CIDRMap. 'bool' returns 'true' if the map was created, and 'false' if the map already existed.

func (*CIDRMap) AllowCIDR

func (cm *CIDRMap) AllowCIDR(cidr net.IPNet) error

AllowCIDR inserts an entry to 'cm' with key 'cidr'. Value is currently not used.

func (*CIDRMap) CIDRExists

func (cm *CIDRMap) CIDRExists(cidr net.IPNet) bool

CIDRExists returns true if 'cidr' exists in map 'cm'

func (*CIDRMap) Close

func (cm *CIDRMap) Close() error

Close closes the FD of the given CIDRMap

func (*CIDRMap) DeepCopy

func (cm *CIDRMap) DeepCopy() *CIDRMap

DeepCopy duplicates CIDRMap 'cm', but both copies refer to the same map.

func (*CIDRMap) String

func (cm *CIDRMap) String() string

String returns the path of the map.

Jump to

Keyboard shortcuts

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