Initial net6.h

Has the definition of an IPv6 address and IPv6 header. It may make sense
to separate the v4 support from net.h (or to include this in net.h).

Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

Series-to: uboot
Series-prefix: RFC
Series-version: 2
Series-changes: 2
 -use __be16/__be32
 -add ipv6_addr_v4mapped and ipv6_addr_is_isatap inline functions

Cover-letter:
Initial IPv6 support

This series so far covers the introduction of a IP6addr_t and
printing/parsing of addresses. I have a patch for testing these basic
things which I haven't included in this series yet. Is there a unittest
facility for u-boot I should be using?

A few open questions

1) Presumably the majority of the actual V6 code would be included by a
config option (CONFIG_IPV6). How far should I take that? Should the
vsprintf code be conditional?

2) Our current out of tree code parallels net.c and net.h. Should I
continue this for the final version or integrate it into net.[ch].

3) rxhand_f currently takes an IPaddr_t. I haven't looked at the usage
of this yet but to support V6 this may need to be a new union or a void
*.

END
lib/vsprintf.c: add IPv6 compressed format %pI6c

Add support for "human friendly" IPv6 address representations as
specified in
http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-00

This code has been adapted from Linux kernel with minimal modification.

Cc: Joe Hershberger <joe.hershberger@gmail.com>
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

Series-changes: 2
 -Add support for printing mapped and ISATAP addresses
lib/net_utils.c: make string_to_ip stricter

Previously values greater than 255 were implicitly truncated. Add some
stricter checking to reject addresses with components >255.

With the input "1234192.168.1.1" the old behaviour would truncate the
address to 192.168.1.1. New behaviour rejects the string outright and
returns 0, which for the purposes of IP addresses can be considered an
error.

Cc: Joe Hershberger <joe.hershberger@gmail.com>
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
lib/net_utils.c: add string_to_ip6

string_to_ip6 parses an IPv6 address from a string. Parsing v6 addresses
is a bit more complicated than parsing v4 because there are a number of
different formats that can be used.

Cc: Joe Hershberger <joe.hershberger@gmail.com>
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

Series-notes:
I'm sure the parsing can be better and done in less code with only a
single pass but I haven't yet figured it out. The main problem is that
"::" can represent a variable number of contiguous "0000:" so when
parsing "::" we can't tell how many half words to skip.
END
common.h: add getenv_IP6addr

Analogous to getenv_IPaddr but for IPv6. This allows the caller to get an
IP6addr_t from an environment variable.

Cc: Joe Hershberger <joe.hershberger@gmail.com>
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
testing