type_traits: Add fast_argument<T> and char_array<S>.

fast_argument<T>::type is either "const T &" or "T", depending on whether
we expect argument copying is good.

char_array<S> is a fixed-length array of S characters.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Vector: Rewrite to use array_memory.

The goals here are (1) to improve the readability of the Vector function
implementations, and (2) to reduce code size (and, potentially, slightly
improve speed) by using memcpy() and memmove() when possible. We do this by
using template metaprogramming to detect trivial copyability. We simplify
the vector functions by relying on an underlying "array_memory" template,
which knows how to move slabs of array-allocated objects around, and does
so using memmove() when possible. We reduce code size by delegating vector
functions to an underlying "vector_memory" template, whose implementation
(for trivially-copyable objects) depends only on the object's size.

These functions should make DEQueue easier to maintain.

The checkin does in fact slightly reduce code size (post-strip) and
slightly improve performance.

Also, document Vector.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Deque: Rewrite template for fuller functionality and to use array_memory.

But getting all the cases right for best possible array_memory use --
i.e., at most 3 memmoves per operation on trivially copyable types --
is way too much work and probably not worth it. So don't bother.

This adds one important function: it is now OK to call, e.g.,
deque.insert(deque.begin(), deque[1]), which was not OK before (because
the memory for the deque[1] reference might disappear).

Also, document Deque, and rename it to Deque from DEQueue (the new name
is what the standard uses).

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
List all driver names explicitly.
Add Timestamp::timeval_ceil() function.

To be used to fix an ns integration bug, in a slightly different way.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Attempt to fix more click+ns3 scheduling behavior

using Timestamp::timeval_ceil(). Sascha Alexander Jopen and others
reported problems.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
More NS scheduling: Only run 1000 times at the current timestamp.

Hopefully addresses Sascha's issue.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Correct Task rescheduling problem caught by Cliff Frey.

Some of the Task::reschedule() logic assumed that
"current_thread_is_running()" returns false in interrupt context. But it
did not. Now it does. This lets us simplify some code elsewhere.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Sascha points out that in NS the initial timestamp is 0.
Correct build error on linuxmodule packages.

Reported by Josh J. The problem: a "${prefix}" variable was not expanded
properly.
Attempt to allow installation on PlanetLab Europe nodes.

Christos Tsilopoulos reports their perl breaks here.
Classifier: Degrade the alignment error to a warning.

And add some more extensive context to help users. Inspired by Markku
Savela report.
include/click/md5.h: Improve #includes and old Linux compatibility.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
RangeIPLookup::flush_table(): fix incorrect memset
Merge pull request #40 from pallas/master

Fix RangeIPLookup::flush_table memset
Follow the bouncing idiot
Updates to man2html, including an important correctness fix

visible in the language manual.
Silence a warning.
SetIPChecksum: Network header defaults to first byte in packet.

Ruetee Chitpranee report.
Documentation nits.