trireme-lib: go.aporeto.io/trireme-lib/utils/ipprefix Index | Files

package ipprefix

import "go.aporeto.io/trireme-lib/utils/ipprefix"

Index

Package Files

ipprefix.go

type FuncOnLpmIP Uses

type FuncOnLpmIP func(val interface{}) bool

FuncOnLpmIP is the type of func which will operate on the value associated with the lpm ip.

type FuncOnVals Uses

type FuncOnVals func(val interface{}) interface{}

FuncOnVals is the type of the func which will operate on each value and will return a new value for each associated value.

type IPcache Uses

type IPcache interface {
    // Put takes an argument an ip address, mask and value.
    Put(net.IP, int, interface{})
    // Get takes an argument the IP address and mask and returns the value that is stored for
    // that key.
    Get(net.IP, int) (interface{}, bool)
    // RunFuncOnLpmIP function takes as an argument an IP address and a function. It finds the
    // subnet to which this IP belongs with the longest prefix match. It then calls the
    // function supplied by the user on the value stored and if it succeeds then it returns.
    RunFuncOnLpmIP(net.IP, FuncOnLpmIP)
    // RunFuncOnVals takes an argument a function which is called on all the values stored in
    // the cache. This can be used to update the old values with the new values. If the new
    // value is nil, it will delete the key.
    RunFuncOnVals(FuncOnVals)
}

IPcache is an interface which provides functionality to store ip's and do longest prefix match

func NewIPCache Uses

func NewIPCache() IPcache

NewIPCache creates an object which is implementing the interface IPcache

Package ipprefix imports 3 packages (graph) and is imported by 4 packages. Updated 2019-09-21. Refresh now. Tools for package owners.