6lowpan: set and use mac_len for mac header length

Set the mac header length while creating the 802.15.4 mac header.

Drop the function for recalculate mac header length in upper layers
which was static and works for intra pan communication only.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: clean lowpan netdev setup

This patch removes some magic number.
Instead of magic numbers we use some defines.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: remove several copies of sk_buff

The current implementation does many copies of the sk_buff for
increasing headroom which are not necessary.

This patch increases the headroom in the maclayer for a worst case
scenario of (sizeof(struct ipv6hdr) + sizeof(struct udphdr)).

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: fix fragmentation on sending side

This patch fixes the fragmentation on sending side according to rfc4944.

Also add improvemnt to use the full payload of a PDU which calculate the
nearest divided to 8 payload length for the fragmentation datagram
offset attribute.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: allow to skip bytes in lowpan_fetch_skb

This will add support to skip bytes from skb with the lowpan_fetch_skb
function.

This is necessary for upcomming patches.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: fix fragmentation on receiving side

This patch fixes the fragmentation of receiving 6lowpan packets.
The current fragmentation isn't rfc4944 compatible.

Add support for fragmentation frame match with source and destination
addresses, instead of using tag id of fragmentation header only.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: fix udp compression/uncompression

The current udp compression/uncompression have several issues.

A list of founded issues:

1. Byteordering issues in both functions which indicate that these functions
   never worked correctly.

2. Compress source port at first then destination port. This is switched
   in case ((ntohs(uh->source) & LOWPAN_NHC_UDP_8BIT_MASK) of udp header
   compress function.

3. Add failure case if we get a elided checksum while uncompress udp header.
   This is currently not supported.

Other fixes/improvements are that this patch get udp compression working with
the new fragmentation implementation and uses the lowpan_fetch_skb function.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>