Ensure that click_ino is prepare()d with mutual exclusion.

Derrick Pallas found this one too! Will this suffice?

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
clickfs: More synchronization clarification. Thanks Derrick!
Don't install tool includes multiply.
Much, much faster to do installtree in Perl.
Add click_write_fence().

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Ensure that ClickIno::_generation is set in the proper order.
Const correctness for array_memory::move_construct.
add click inputswitch

InputSwitch is like Switch, except it selects an input port rather than
an output port. Unlike PullSwitch, InputSwitch uses push processing.

For example, for a wireless roaming client you can now say:
    ap0, ap1, ap2
    => cli_in_sw :: InputSwitch(0)
    -> cli
    -> cli_out_sw :: Switch(0)
    => ap0, ap1, ap2;

and then:
    write cli_in_sw.switch 1,
    write cli_out_sw.switch 1,
to make it roam to ap1.

Reviewed-by: cliff@meraki.com
Signed-off-by: Patrick Verkaik <patrick@meraki.net>
Merge pull request #86 from trackpick/inputswitch

add click inputswitch
ToDevice.u: Only select default METHOD if supported.

Fix bug introduced in 3d46d1b5, triggered if the methods enabled by
TODEVICE_ALLOW_* and FROMDEVICE_ALLOW_* do not match, in which case a
default METHOD could be selected that was only enabled for FromDevice.u
and not for ToDevice.u, causing ToDevice.u to silently drop packets.

Signed-off-by: Søren Løvborg <soeren.j.loevborg@siemens.com>
ToDevice.u: Document METHOD values and defaults.

Signed-off-by: Søren Løvborg <soeren.j.loevborg@siemens.com>
configure: Fix argument order for probing libpcap.

Fix configure script, which would incorrectly pass -lpcap to gcc
BEFORE the source file, causing problems detecting libpcap features
under some circumstances.

Signed-off-by: Søren Løvborg <soeren.j.loevborg@siemens.com>
Merge pull request #85 from kwi-dk/master

ToDevice.u and configure bugfixes
IPClassifier: Add per-output pattern handlers.

Request from Momina Khan. Meraki has something like this.
Merge pull request #87 from pallas/master

linuxmodule/FromHost: add ether handler
linuxmodule: fix md5_append wrt non-virt data

sg_init_one uses sg_init_buf, which only works with kmalloc'd data.  In
particular, this excludes anything vmalloc'd as well as anything in the
rodata section of the module.  The code that was failing for me was
essentially

	String str("data");
	uint8_t digest[16];

	md5_state_t state;
	md5_init(&state);
	md5_append(&state, str.data(), str.length());
	md5_finish(&state, digest);
	md5_free(&state);

and the work-around was to invoke String::mutable_data() prior to the
md5_append, which kmalloc's and makes String::data() safe for sg_init_buf.

The better solution is to call virt_addr_valid, only using sg_init_one if
true; otherwise, we must use vmalloc_to_page on individual pages, which will
walk the page-table and should do the Right Thing.

Since vmalloc'd data might not be continuous, we must iterate over the
individual pages that make up the allocation.  Because this is expensive to
begin with, we call update for each page using a single scatterlist rather
than allocating an sg_table and calling update once.  This also simplifies
the code.

I tested this by adding

	click_chatter("%p %d %d %d", data, off, len, nbytes);

inside the loop and watching it "do the Right Thing" to a large vmalloc
allocation, verifying that the hash was correct using md5sum.