diff mbox

[U-Boot,RFC,v2,1/5] Initial net6.h

Message ID 1358472932-32083-2-git-send-email-judge.packham@gmail.com
State RFC
Headers show

Commit Message

Chris Packham Jan. 18, 2013, 1:35 a.m. UTC
From: Chris Packham <chris.packham@alliedtelesis.co.nz>

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).

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

---
Changes in v2:
 -use __be16/__be32
 -add ipv6_addr_v4mapped and ipv6_addr_is_isatap inline functions

 include/net6.h | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 include/net6.h

Comments

Kim Phillips Jan. 18, 2013, 9:15 p.m. UTC | #1
On Fri, 18 Jan 2013 14:35:28 +1300
Chris Packham <judge.packham@gmail.com> wrote:

> From: Chris Packham <chris.packham@alliedtelesis.co.nz>
> 
> 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).
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> 
> ---
Reviewed-by: Kim Phillips <kim.phillips@freescale.com>

> NOTICE: This message contains privileged and confidential
> information intended only for the use of the addressee
> named above. If you are not the intended recipient of
> this message you are hereby notified that you must not
> disseminate, copy or take any action in reliance on it.
> If you have received this message in error please
> notify Allied Telesis Labs Ltd immediately.
> Any views expressed in this message are those of the
> individual sender, except where the sender has the
> authority to issue and specifically states them to
> be the views of Allied Telesis Labs.

get rid of this message; this is a public forum.

Kim
diff mbox

Patch

diff --git a/include/net6.h b/include/net6.h
new file mode 100644
index 0000000..03bccb2
--- /dev/null
+++ b/include/net6.h
@@ -0,0 +1,43 @@ 
+/**
+ * Simple IPv6 network layer implementation.
+ *
+ * Based and/or adapted from the IPv4 network layer in net.[hc]
+ *
+ * (C) Copyright 2013 Allied Telesis Labs NZ
+ *
+ * This file is released under the terms of GPL v2 and any later version.
+ * See the file COPYING in the root directory of the source tree for details.
+ */
+#ifndef __NET6_H__
+#define __NET6_H__
+
+typedef union ip6addr_t {
+	__u8	u6_addr8[16];
+	__be16	u6_addr16[8];
+	__be32	u6_addr32[4];
+} IP6addr_t;
+
+/**
+ * struct ipv6hdr - Internet Protocol V6 (IPv6) header.
+ *
+ * IPv6 packet header as defined in RFC 2460.
+ */
+struct ip6_hdr {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+	__u8    priority:4,
+		version:4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+	__u8    version:4,
+		priority:4;
+#else
+#error  "Please fix <asm/byteorder.h>"
+#endif
+	__u8		flow_lbl[3];
+	__be16		payload_len;
+	__u8		nexthdr;
+	__u8		hop_limit;
+	IP6addr_t	saddr;
+	IP6addr_t	daddr;
+};
+
+#endif /* __NET6_H__ */