Longest Prefix Matching ...
More...
Go to the source code of this file.
|
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...
|
|
Longest Prefix Matching ...
- Todo:
- TODO docu
Definition in file lpm.lua.
function mg_lpm4Table addEntry |
( |
addr |
, |
|
|
depth |
, |
|
|
entry |
|
|
) |
| |
Add an entry to a Table.
- Parameters
-
addr | IPv4 network address of the destination network. |
depth | number of significant bits of the destination network address |
entry | routing 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
-
n | Number of entry pointers |
- Returns
- Wrapper table around the allocated array
function mod createLpm4Table |
( |
socket |
, |
|
|
table |
, |
|
|
entry_ctype |
|
|
) |
| |
Create a new LPM lookup table.
- Parameters
-
socket | optional (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
-
packets | Array of mbufs (bufArray), for which the lookup will be performed |
mask | optional (default = all packets), bitmask, for which packets the lookup should be performed |
hitMask | Bitmask, 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. |
entries | Preallocated routing entry Pointers |