From: Chris Packham <judge.packham@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 1/2] Initial net6.h
Date: Wed, 16 Jan 2013 23:01:26 +1300 [thread overview]
Message-ID: <1358330487-18955-2-git-send-email-judge.packham@gmail.com> (raw)
In-Reply-To: <1358330487-18955-1-git-send-email-judge.packham@gmail.com>
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).
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
include/net6.h | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
create mode 100644 include/net6.h
diff --git a/include/net6.h b/include/net6.h
new file mode 100644
index 0000000..2ef7405
--- /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.
+ */
+
+typedef union ip6addr_t {
+ __u8 u6_addr8[16];
+ __u16 u6_addr16[8];
+ __u32 u6_addr32[4];
+} IP6addr_t;
+
+/**
+ * struct ipv6hdr - Internet Protocol V6 (IPv6) header.
+ *
+ * IPv6 packet header as defined in RFC xxxx.
+ *
+ * BEWARE, it is incorrect. The first 4 bits of flow_lbl
+ * are glued to priority now, forming "class".
+ */
+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];
+ __u16 payload_len;
+ __u8 nexthdr;
+ __u8 hop_limit;
+ IP6addr_t saddr;
+ IP6addr_t daddr;
+};
+
--
1.7.12.rc2.16.g034161a
#####################################################################################
Scanned by MailMarshal - M86 Security's comprehensive email content security solution.
#####################################################################################
next prev parent reply other threads:[~2013-01-16 10:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-16 10:01 [U-Boot] [RFC PATCH 0/2] Initial IPv6 support Chris Packham
2013-01-16 10:01 ` Chris Packham [this message]
2013-01-16 22:37 ` [U-Boot] [RFC PATCH 1/2] Initial net6.h Kim Phillips
2013-01-16 10:01 ` [U-Boot] [RFC PATCH 2/2] lib/vsprintf.c: add IPv6 compressed format %pI6c Chris Packham
2013-01-16 10:18 ` [U-Boot] [RFC PATCH 0/2] Initial IPv6 support Chris Packham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1358330487-18955-2-git-send-email-judge.packham@gmail.com \
--to=judge.packham@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox