Merge branch 'xap_firewall' of github.com:seshness/click into xap_firewall
Fix support for '%{element}'.

Ruben Merz report.
Cache-aware RadixIPLookup.

Contains three changes to RadixIPLookup which contribute to better
performance (0.87x original lookup time):

1] Removed derviable fields from the Radix class:
    _n, _nchildren and _bitshift have been removed from the Radix
    class.  _n and _bitshift are now stored in an array indexed by the
    level of the radix node. _nchildren was read only in free_radix()
    to check for existing children. This check has been removed, since
    it is possible to safely free existing children by checking if
    r->children[i].child is not NULL.

2] Changed branching factor to (16, 4, 4, 4, 4) from (8, 4, 4, 4,
   4, 4, 4).  There are 2^16 nodes in level zero followed by 2^4 nodes
   in all subsequent levels.

3] Added a compressed vector (_lookup) for route lookups.  _lookup
   holds unique combinations of (gateway, port) pairs. When a route is
   added to the vector, it is added to _v unconditionally. The route is
   added to _lookup only if its (gateway, port) does not already exist
   in _lookup. The higher order 8 bits of the key index into _lookup,
   the remaining 24 bits index into _v.  _lookup is limited to 256
   entries and _v to 16777216.

Tested for correctness using tests in test/ip.
Benchmarked against original RadixIPLookup, DirectIPLookup, RangeIPLookup
as well as variants of RadixIPLookup.
Benchmarks available in mvenk/click cache_aware_radixtree.
Netmap: Include NETMAP_API.
Update test
Clicky: Avoid crash on processing error.

Reported by Matteo Croce.
Add NotifierSignal::swap.
Netmap: Adapt to Luigi's separation of TX and RX ring counts, I think.
Router: Expose direction-agnostic visit() function.
Null: Improve documentation.
Element::Port: Expose an assign() function.

This should basically not be called except in special circumstances. But it
won't be, because all Element functions that expose Ports expose const
Ports.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Apostrophe beautification program.
Bypass: Add new element for zero-overhead path switching.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Improve documentation.
Notifier: Add activate callbacks.

An activate callback is a function that gets called when a notifier becomes
true. Implement dependent signals that way. Clean up some code. Tests pass.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Notifier::upstream_empty_signal: Add callback version.

Also downstream_full_signal. Add various overloaded versions. Deprecate
some existing code.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
PullSwitch: Add precise wake notification.

Now, in a situation like this,

  src0, src1, src2, src3, src4 => p :: PullSwitch(0) -> sink;

"sink" will only be scheduled if "src0" becomes nonempty. Previously,
"sink" would be scheduled if any of src1-4 become nonempty; it would then
go back to sleep, but still.

Cliff Frey and Justin Delegard reported an issue, which they solved in a
different way.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Why not get rid of some destructors the compiler can generate?
Merge pull request #43 from mvenk/m_cache_aware_radixtree

Cache-aware RadixIPLookup.
Avoid warnings on some compilers.