bitvector: fix operator|= bug

In the case that the lhs bitvector is shorter than the rhs bitvector,
operator|= tries to 'or' in words past the end of the rhs bitvector
(presumably uninitialized memory).

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Bitvector internals: Use word_type, wbits, wmask, wshift throughout.

Don't assume that word_type will always be uint32_t.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Bitvector internals: Update documentation style.

And some other nits -- introduce Bit::flip() and Bitvector::flip().

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Update ns-3 click integration urls in README and INSTALL files
Add BitvectorTest element.

This element currently indicates a problem with Bitvector.
Correct Bitvector bugs.

And correct a use of undefined behavior -- we can't assume that
_f0 and _f1 are adjacent, make them a true array.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Merge pull request #55 from lalithsuresh/doc-patch

Update ns-3 click integration urls in README and INSTALL files
Internal: Attempt to avoid problems with GCC 4.2.1.

Jimmy Kjällman reported the problem.
Internal: If strlen(cstr) is constant, then cstr must be stable.

I hope so, anyway!
Whoopsy.
FreeBSD GCC still isn't happy. It may be happy if we check for NULL first.

It appears to generate suboptimal code, but at least doesn't crash.
Fix strict checking in wifidecap for LLC frame
AnyDevice: Ensure non-existent devices are added to the device map

The logic rework in ae76f68c1bae0a19adb6f22937f6b2cf4f7911d5
introduced a subtle bug. If a FromDevice/ToDevice/ToHost element
uses ALLOW_NONEXISTENT true, AnyDevice::set_device() would fail
to enter the device into the AnyDeviceMap.

The problem is that set_device() assumes that since _dev == dev
(which will happen in the non-existent case since NULL == NULL)
this is a carrier change only, and it exits early without ever
entering the device in the map.

The previous implementation of AnyDevice::find_device() did not
have this problem, as it would insert the device unconditionally.

Check explicitly for this case (new device being inserted, and it
is a non-existent device, and it is not in the map already), and
add it to the map.

Signed-off-by: Kevin Paul Herbert <kph@meraki.net>
Merge pull request #57 from kph/anydevice-fix

AnyDevice: Ensure non-existent devices are added to the device map
BoundedIntArg: Allow unsigned bounds.

Requested by Cliff Frey. Requires rigamarole. Simultaneously, prefer
click_intmax_t to click_int_large_t and so forth.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Add test for lexer problem reported by Asa Zernik.
Correct lexer error demonstrated by last test.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Support atomic_cmpxchg on architectures that define it as a function

Click uses the C-preprocessor to determine whether an architecture
has defined atomic_cmpxchg. The ARM architecture (among others)
defines this as an inline function, so Click will not attempt
to use atomic_cmpxchg on those architectures. This causes the
warning "using nonatomic approximation..." when building for SMP
on ARM.

Signed-off-by: Kevin Paul Herbert <kph@meraki.net>
Merge pull request #63 from kph/atomic

Support atomic_cmpxchg on architectures that define it as a function
Fix ac_cv_linuxmodule_click_skb_recycle test.

Add -Werror-implicit-function-declaration to ac_cv_linuxmodule_click_skb_recycle
test to detect if skb_recycle actually return sk_buff ptr. Otherwise, autoconf
logs a warning about implicit declaration and passes.