This is automatically generated documentation. Edit after the "COMMENTS" heading; changes to the main body will be lost.
LinearIPLookup -- Click element; simple IP routing table
LinearIPLookup(ADDR1/MASK1 [GW1] OUT1, ADDR2/MASK2 [GW2] OUT2, ...)
Ports: 1 input, any number of outputs
Package: ip (core)
Note: Lookups and table updates with LinearIPLookup are extremely slow; the RadixIPLookup and DirectIPLookup elements should be preferred in almost all cases. See IPRouteTable for a performance comparison. We provide LinearIPLookup nevertheless for its simplicity. Expects a destination IP address annotation with each packet. Looks up that address in its routing table, using longest-prefix-match, sets the destination annotation to the corresponding GW (if specified), and emits the packet on the indicated OUTput port. Each argument is a route, specifying a destination and mask, an optional gateway IP address, and an output port. LinearIPLookup uses a linear search algorithm that may look at every route on each packet. It is therefore most suitable for small routing tables.
This example delivers broadcasts and packets addressed to the local host (22.214.171.124) to itself, packets to net 18.26.4 to the local interface, and all others via gateway 126.96.36.199:
... -> GetIPAddress(16) -> rt; rt :: LinearIPLookup(188.8.131.52/32 0, 184.108.40.206/32 0, 220.127.116.11/32 0, 18.26.4/24 1, 0/0 18.104.22.168 1); rt -> ToHost; rt -> ... -> ToDevice(eth0);
ADDR/MASK [GW] OUT'. Fails if a route for
set ADDR/MASK [GW] OUT' to add a route, and `
remove ADDR/MASK' to remove a route. You can supply multiple commands, one per line; all commands are executed as one atomic operation.
Generated by 'click-elem2man' from '../elements/ip/lineariplookup.hh' on 24/May/2007.