fib

package
v0.0.0-...-e596c9e Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const DATABASEWRITEFILE = "/show-ztr"
View Source
const SCRUBTHRESHOLD = 5 * 60

5 minutes scrub threshold

View Source
const STATSPUNTINTERVAL = 10

Variables

This section is empty.

Functions

func AddDecapStatistics

func AddDecapStatistics(statName string, pkts uint64,
	bytes uint64, unixSeconds int64)

func ComputeICV

func ComputeICV(buf []byte, icvKey []byte) []byte

func CraftAndSendLispPacket

func CraftAndSendLispPacket(
	pktBuf []byte,
	capLen uint32,
	timeStamp time.Time,
	hash32 uint32,
	mapEntry *dptypes.MapCacheEntry,
	iid uint32,
	itrLocalData *dptypes.ITRLocalData)

func DeleteMapCacheEntry

func DeleteMapCacheEntry(iid uint32, eid net.IP)

func FlushMapCache

func FlushMapCache()

This function will delete all map-cache entries that we have.

func GenerateIVByteArray

func GenerateIVByteArray(ivHigh uint32, ivLow uint64, ivArray []byte) []byte

func GenerateRandToken

func GenerateRandToken(max int64) int64

func GetEidMaps

func GetEidMaps() []dptypes.EIDEntry

func GetEtrNatPort

func GetEtrNatPort() int32

func GetIPv4UplinkAddr

func GetIPv4UplinkAddr() net.IP

func GetIPv6UplinkAddr

func GetIPv6UplinkAddr() net.IP

func GetIVArray

func GetIVArray(itrLocalData *dptypes.ITRLocalData, ivArray []byte) []byte

Get IV as a byte array

func GetIfaceEIDs

func GetIfaceEIDs() []string

func GetInterfaces

func GetInterfaces() []string

func GetItrCryptoPort

func GetItrCryptoPort() uint

func GetLispIID

func GetLispIID(hdr []byte) uint32

func GetLispKeyId

func GetLispKeyId(hdr []byte) byte

func GetLispNonce

func GetLispNonce(hdr []byte) uint32

func IfaceGetEids

func IfaceGetEids(name string) []net.IP

func InitDecapTable

func InitDecapTable()

func InitIfaceMaps

func InitIfaceMaps()

func InitItrCryptoPort

func InitItrCryptoPort()

func InitMapCache

func InitMapCache(debugFlag bool, lispDir string)

func LookupAndAdd

func LookupAndAdd(iid uint32,
	eid net.IP, timeStamp time.Time) (*dptypes.MapCacheEntry, bool)

Do a lookup into map cache database. If a resolved entry is not found, create and add an un-resolved entry for buffering packets.

func LookupAndUpdate

func LookupAndUpdate(iid uint32, eid net.IP, rlocs []dptypes.Rloc) *dptypes.MapCacheEntry

Add/update map cache entry. Look at the comments inside this function to understand more about what it does.

func LookupDecapKeys

func LookupDecapKeys(ip net.IP) *dptypes.DecapKeys

func LookupIfaceEids

func LookupIfaceEids(iid uint32) []net.IP

func LookupIfaceIID

func LookupIfaceIID(name string) uint32

func MapcacheScrubThread

func MapcacheScrubThread()

This thread wakes up every minute, to find the map cache entries that are in resolve state for more than 5 minutes. Resolve entries that are older than 5 minutes will be deleted.

func NewEIDMap

func NewEIDMap() *dptypes.EIDMap

func NewIfaceMap

func NewIfaceMap() *dptypes.InterfaceMap

func PrintHexBytes

func PrintHexBytes(data []byte) string

Groups 4 bytes at a time and prints

func PublishLispInfoStatus

func PublishLispInfoStatus(ctx *dptypes.DataplaneContext)

func PublishLispMetrics

func PublishLispMetrics(ctx *dptypes.DataplaneContext,
	encapStatistics *dptypes.LispStatistics,
	decapStatistics *dptypes.DecapStatistics)

func PutItrCryptoPort

func PutItrCryptoPort(port uint)

func SetLispIID

func SetLispIID(hdr []byte, iid uint32)

func SetLispKeyId

func SetLispKeyId(hdr []byte, keyId byte)

func SetLispNonce

func SetLispNonce(hdr []byte, nonce uint32)

func SetUplinkAddrs

func SetUplinkAddrs(ipv4 net.IP, ipv6 net.IP)

Control thread looks for changes to /var/run/zedrouter/DeviceNetworkStatus/global.json and selects uplinks for ipv4 & ipv6 addresses. We store these uplink addresses at a global location. ITR threads will make READ accesses for uplink addresses simultaneously. Control thread can change these uplink addresses any time. Since it is not possible to change all the fields of UpLinkAddress structure, we allocate a new structure (initialize it) and then atomically change the global pointer such that it points to the newly allocated data structure.

At the same time ITR threads atomically load the pointer to global location. Atomic read ensures that the pointer value is loaded from memory location rather from local storage (register).

func ShowDecapKeys

func ShowDecapKeys()

func ShowIfaceEIDs

func ShowIfaceEIDs()

func ShowIfaceIIDs

func ShowIfaceIIDs()

func ShowMapCacheEntries

func ShowMapCacheEntries()

func StatsThread

func StatsThread(puntChannel chan []byte,
	ctx *dptypes.DataplaneContext)

Stats thread starts every STATSPUNTINTERVAL seconds and punts map cache statistics to lispers.net.

func StoreEtrNatPort

func StoreEtrNatPort(port int32)

func UpdateDecapKeys

func UpdateDecapKeys(entry *dptypes.DecapKeys)

func UpdateIfaceEids

func UpdateIfaceEids(eidEntries []dptypes.EIDEntry)

func UpdateIfaceIIDs

func UpdateIfaceIIDs(interfaces []dptypes.Interface)

func UpdateMapCacheEntry

func UpdateMapCacheEntry(iid uint32, eid net.IP, rlocs []dptypes.Rloc)

Add/update map cache entry. Along with that, process and send out any buffered packets attached to this entry.

Types

This section is empty.

Jump to

Keyboard shortcuts

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