BLIP no longer starts itself.

The way IPDispatchP was calling its own SplitControl meant that in a top
level app SplitControl.done() would be called twice: once when it was
triggered from IPDispatch and once when the top level app called
SplitControl.start().

Since BLIP provides a SplitControl interface, components that want to
use blip should be able to call start whenever they want and not have
IPDispatch automagically doing it for them.
BLIP: Better handing of address modes

BLIP has relied on the magical IN6_PREFIX #define to determine if it
should use DHCP or static addresses. While this still works (to try not
to break existing code), application writers are encouraged to explicitely
declare by what mechanism they would like their application to aquire
an IPv6 address.

To use a static address based on a #define prefix (IN6_PREFIX) add:

    components StaticIPAddressC;

to your application. To use DHCP, add:

	components Dhcp6C;

to your application.

I changed the name from NoDhcpC to StaticIpAddressC because I hope to
implement SLAAC, and in that case there are two alternatives to
a static IP, and a more descriptive name is needed.

I updated the BLIP apps slightly to better select how addressing happens
while not greatly chaning it.
BLIP: pack_address() better supports hdr comp.

RFC6282 allows a node to completely elide the src address of the ipv6
header if the prefix matches the global prefix and the lower 64 bits can
be determined from other parts of the packet. This patch adds that
support by checking to see if the EUI64 that is sent in the 15.4 header
matches the lower 64 bits of the address to be packed.

It also fixes a bunch of errant whitespace.
BLIP: Added UDP checksum recalculation

In the case that a transmitting node sends a UDP packet and uses
stateful address compression, the UDP checksum it calculates is "wrong".
That is, it calculates it when it doesn't know its full address.
Therefore, when its address gets expanded and the UDP packet makes it to
the end host, the checksum is invalid.

This patch checks for when stateful address uncompression is used and
rechecks the checksum in that case.

This patch could be expanded to handle more headers and other checksums,
as well as a check to verify the old checksum is still correct before
creating a new one (on incorrect data at that point).
BLIP: uncompression now checks buffer lengths

The lib6lowpan code was assuming it had a well formed incoming packet.
It returned errors if it got unexpected bits, but never if it didn't get
enough bits, even though the valid length of the buffer was passed to
the unpack function. This would occasionally cause errors much later
because invalid packets were being processed and the length was invalid.

This commit adds length checking throughout the entire unpack stack to
make sure that the incoming packet is long enough for each part being
unpacked.

Without this patch the stack works fine if all nodes on the channel are
sending valid 6LoWPAN packets. However, if a node is just sending random
data which happens to match 6LoWPAN packets, receiving nodes segfault.
BLIP: Updated lib6lowpan tests

The tests now work with the changed lib6lowpan code.
BLIP: Fixed warnings

I fixed a couple little nits that caused compiler warnings.
BLIP: Fix issue with length byte in ext. headers

6lowpan compression specifies that the length byte of a compressed
extension header is the number of bytes that follow the length byte.
Therefore it should not include the header type nor the length byte in
the total.

This commit fixes that and reworks how the extension header compression
functions work so that keeping track of buffers isn't spread to multiple
functions. Also, I fixed one of the tests so that it now compressess,
uncompresses, and recompresses a series of headers to verify that it is
working.
BLIP: Check uncompressed ipv6 packets length

If a stray packet happens to come in with a first data byte that matches
that of an uncompressed IPv6 packet, the code was just taking that at
face value and passing it up the stack. Now it at least checks that it
is long enought to contain a ipv6 header. This prevents the length of
the packet from becoming screwed up when the payload length is
calculated later on.
BLIP: Improved printf() debugging

I improved the routing table printing to be well formatted.
Removed improper files from the repository.

- Removed all old .cvsignore files.
- Removed tunit.extra. (references toscontrib)
  This extra relies on having toscontrib, so it should be in toscontrib.
  By setting the TINYOS_ROOT_DIR_ADDITIONAL variable this should be easy.
- Removing eval-crash.diff
  This seems to be an errantly commited file.
Updated .gitignore

Added all of the various make output
Removed assumed environment variables

Many places in /tools (and in READMEs) code or documentation assumes
that there are environment variables set. In order to remove the
requirement that environment variables need be set, this commit changes
structure to work without the environment variables. Generally, this
means adding an argument so that callers of scripts can pass in the
information the environment variable used to provide.

A major consequence of this is that ncc --print-tosdir no longer works.
Any instance of this is now removed.
Set TINYOS_ROOT_DIR in Makefile, change var names

This removes the non-desireable requirement that a user must set
environment variables in order to build TinyOS. The $TOSROOT variable
then trickles through the makefiles and in makerules $TOSDIR is set.

The overhead to do this is small (1 line in each application makefile)
but it should really help make tinyos more user friendly.

TOSROOT is set with "?=" meaning that it won't override TOSROOT if it is
already set by an environment variable.

Makefile.include in the root sets TOSDIR and MAKERULES before including
$(MAKERULES). This allows the current env variables to override the
derived settings.

Changing TinyOS Make system variable names:

| Old Variable        | Proposed Variable Name      | Default Value                    | Purpose                                                             |
|---------------------|-----------------------------|----------------------------------|---------------------------------------------------------------------|
| TOSROOT             | TINYOS_ROOT_DIR             | relative to application Makefile | Base for all other variable defaults                                |
| TOSDIR              | TINYOS_OS_DIR               | $TINYOS_ROOT_DIR/tos             | Path to `/tos` folder containing main system source to compile with |
| TINYOS_MAKE_PATH    | TINYOS_MAKE_DIR             | $TINYOS_ROOT_DIR/support/make    | Path to `/make` that contains the targets, extras, and rules        |
| MAKERULES           | TINYOS_MAKERULES            | $TINYOS_MAKE_DIR/Makerules       | Path to main makefile                                               |
| TINYOS_MAKELOCAL    | TINYOS_MAKELOCAL            | $TINYOS_MAKE_DIR/Makelocal       | Path to optional Makelocal file                                     |
| TINYOS_MAKEDEFAULTS | TINYOS_MAKEDEFAULTS         | $TINYOS_MAKE_DIR/Makedefaults    | Path to Makedefaults                                                |
| TOSMAKE_PATH        | TINYOS_MAKE_DIR_ADDITIONAL  | unset                            | Space separated paths of additional `support/make` directories      |
Moved support code to tools/, now gets installed

In order to remove more environment variable usage, the tinyos python
code must be installed on the user's system instead of in the tinyos
tree. This commit moves all the python to tools so automake will install
it. Doing this requires one subtle change: "import tos" will no longer
work. It needs to be "from tinyos import tos" now.

I think I updated all of the relevant files.

One note: python3 is handled a bit weirdly, and therefore tos-serlook.py
may not be able to find tinyos.misc.hexdump. It seems that
/usr/local/lib/python3/dist-packages is not in the search path by
default. I fixed this by adding "tinyos.pth" containing the correct
directory to /usr/local/lib/python3.2/dist-packages.

The CoAP support code will now be built and installed with tinyos-tools.

I updated coap.extra to reflect the moved .c files.

Moved blip support to /tools directory

Will not compile the blip sdk code on cygwin as it only supports linux and mac.

Moved sf and serial_tun to /tools

I have no idea if anyone still uses this code. The configure script for
sf is out of date and does not work with newer automake (I updated it).

I also renamed some binaries so they can be installed. If the user is
installing TinyOS, they may as well _install_ tinyos. Why make them hunt
around for different binaries? If something shouldn't be installed, then
the question is why is it distributed with the main TinyOS source? It
should be some sort of optional extra somewhere, not part of the main
source. Hard drives are big, just give me all of the TinyOS tools.

Because there are 2 sf applications, the cpp version is named sf2.

Moved java to /tools; Removed env vars

Java is now compiled and installed with tinyos-tools

Moved imote2-ocd-program.py to /tools

No reason to have the makefile need to dig into tools in order to
install to the hardware.
Changed tinyos-tools version to 1.6.0
Removing ncc, nesdoc, mig, ncg

ncc is a very strange step in the build process. It is basically a
magical perl script that sets a bunch of include directories, but is
really just another opaque layer to figuring out how tinyos is getting
built. While trying to re-write it to make it a bit cleaner and smarter,
I had a realization: Why are include directories and nesc flags (which
are used to compile code) smack dab in the middle of a src folder
(tos/platforms/<platform>/platform)? Why isn't all of that contained in
the make system (where you would expect it to be? In fact, why do we
need these magic files (platform, family, sensor) at all?

This commit addresses these questions by starting to move what was in
the platform (etc.) files into the make system. In this way, X.target
files include Y.platform files, Z.sensor files, (etc.) in order to get
all of the relevant flags without needing to write perl code.

Also, tos-sub-tosdir tool makes the %T flag magical. Instead of just
being replaced with $TOSDIR, it is replaced with all of the $TOSDIR
paths that point to actual folders. This allows for first class support
for out of tree platforms, as they will be able to use the %T syntax and
have it just work. This is convienent because if the platform ever gets
moved to tinyos-main it will just work.

Removed nesdoc; Use nesdoc-archive instead

nesdoc was another ncc style script, now you just call the python
scripts directly.

Removed mig and ncg

mig and ncg are more examples of magic scripts, mostly because they use
ncc. To remove them, I replaced all instances of mig with nescc-mig and
ncg with nescc-ncg. Then I added the correct argument to make sure they
still execute correctly.

This isn't as bad as it sounds due to $(NESC_PFLAGS) being very useful.
That variable basically replaces what ncc used to do.
Removed default-platform

default-platform wasn't really being used, so now an explicit target
must be provided to all tinyos-tools. Therefore -print-target is no
longer a reasonable option.
Streamlining Make system

Changing variable names to be more consistent and insightful.
Refactoring make microcontrollers

Reformating all of the platforms to use the common Makerule targets
among other things.

.rules files are now much more concise and duplicate much less.