MoonGen
 All Files Functions Variables Pages
lpm.lua File Reference

Longest Prefix Matching ... More...

Go to the source code of this file.

Functions

function mod createLpm4Table (socket, table, entry_ctype)
 Create a new LPM lookup table. More...
 
function mg_lpm4Table addEntry (addr, depth, entry)
 Add an entry to a Table. More...
 
function mg_lpm4Table lookupBurst (packets, mask, hitMask, entries)
 Perform IPv4 route lookup for a burst of packets This should not be used for single packet lookup, as ist brings a significant penalty for bursts <<64. More...
 
function mg_lpm4Table allocateEntry ()
 Allocates an LPM table entry. More...
 
function mg_lpm4Table allocateEntryPtrs (n)
 Allocates an array of pointers to routing table entries This is used during burst lookup, to store references to the result entries. More...
 
function mod decrementTTL (pkts, in_mask, out_mask, ipv4)
 FIXME: this should not be in LPM module. More...
 

Detailed Description

Longest Prefix Matching ...

Todo:
TODO docu

Definition in file lpm.lua.

Function Documentation

function mg_lpm4Table addEntry ( addr  ,
depth  ,
entry   
)

Add an entry to a Table.

Parameters
addrIPv4 network address of the destination network.
depthnumber of significant bits of the destination network address
entryrouting table entry (will be copied)
Returns
true if entry was added without error
function mg_lpm4Table allocateEntry ( )

Allocates an LPM table entry.

Returns
The newly allocated entry
function mg_lpm4Table allocateEntryPtrs ( n  )

Allocates an array of pointers to routing table entries This is used during burst lookup, to store references to the result entries.

Parameters
nNumber of entry pointers
Returns
Wrapper table around the allocated array
function mod createLpm4Table ( socket  ,
table  ,
entry_ctype   
)

Create a new LPM lookup table.

Parameters
socketoptional (default = socket of the calling thread), CPU socket, where memory for the table should be allocated.
Returns
the table handler
function mod decrementTTL ( pkts  ,
in_mask  ,
out_mask  ,
ipv4   
)

FIXME: this should not be in LPM module.

but where? Decrements the IP TTL field of all masked packets by one. out_mask masks the successfully decremented packets (TTL did not reach zero).

function mg_lpm4Table lookupBurst ( packets  ,
mask  ,
hitMask  ,
entries   
)

Perform IPv4 route lookup for a burst of packets This should not be used for single packet lookup, as ist brings a significant penalty for bursts <<64.

Parameters
packetsArray of mbufs (bufArray), for which the lookup will be performed
maskoptional (default = all packets), bitmask, for which packets the lookup should be performed
hitMaskBitmask, where the routed packets are flagged with one. This may be the same Bitmask as passed in the mask parameter, in this case not routed packets will be cleared in the bitmask.
entriesPreallocated routing entry Pointers