itr

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: 16 Imported by: 0

Documentation

Index

Constants

View Source
const SNAPLENGTH = 65536

Variables

This section is empty.

Functions

func InitITR

func InitITR(debugFlag bool)

func LookupAndSend

func LookupAndSend(
	pktBuf []byte,
	capLen uint32,
	timeStamp time.Time,
	iid uint32,
	hash32 uint32,
	ifname string,
	srcAddr net.IP,
	dstAddr net.IP,
	puntChannel chan []byte,
	itrLocalData *dptypes.ITRLocalData)

This function expects the parameter pktBuf to be a statically allocated buffer longer than the original packet length. We currently use a buffer of length 64K bytes.

Perform lookup into mapcache database and forward if the lookup succeeds. If not, buffer the packet and send a punt request to lispers.net for resolution. Look for comments inside the function to understand more about what it does.

func SetupPacketCapture

func SetupPacketCapture(iface string, snapLen int) *afpacket.TPacket

// Opens up the pfing on interface and sets up packet capture.

func SetupPacketCapture(ifname string, snapLen uint32) *pfring.Ring {
	// create a new pf_ring to capture packets from our interface
	ring, err := pfring.NewRing(ifname, SNAPLENGTH, pfring.FlagPromisc)

func StartItrThread

func StartItrThread(threadName string,

	handle *afpacket.TPacket,

	umblical chan dptypes.ITRConfiguration,
	puntChannel chan []byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

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