From patchwork Fri Jan 25 00:56:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 215512 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id CDD5C2C0084 for ; Fri, 25 Jan 2013 11:58:23 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 593994A10A; Fri, 25 Jan 2013 01:58:22 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ivVC55QvV6Eh; Fri, 25 Jan 2013 01:58:22 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CCDBD4A122; Fri, 25 Jan 2013 01:58:19 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E13C74A111 for ; Fri, 25 Jan 2013 01:58:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PbVWiQx-DPlq for ; Fri, 25 Jan 2013 01:58:17 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from gate.alliedtelesyn.co.nz (gate.alliedtelesyn.co.nz [202.49.72.33]) by theia.denx.de (Postfix) with SMTP id 66BBB4A10A for ; Fri, 25 Jan 2013 01:58:16 +0100 (CET) Received: (qmail 7230 invoked from network); 25 Jan 2013 00:58:14 -0000 Received: from mmarshal3.atlnz.lc (10.32.18.43) by gate-int.alliedtelesyn.co.nz with SMTP; 25 Jan 2013 00:58:14 -0000 Received: from alliedtelesyn.co.nz (Not Verified[10.32.16.32]) by mmarshal3.atlnz.lc with MailMarshal (v7, 1, 0, 4874) id ; Fri, 25 Jan 2013 13:57:47 +1300 Received: from MAIL/SpoolDir by alliedtelesyn.co.nz (Mercury 1.48); 25 Jan 13 13:02:16 +1200 Received: from SpoolDir by MAIL (Mercury 1.48); 25 Jan 13 13:01:44 +1200 Received: from chrisp-dl.ws.atlnz.lc (10.33.22.46) by alliedtelesyn.co.nz (Mercury 1.48) with ESMTP; 25 Jan 13 13:01:19 +1200 Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id 62094228FD; Fri, 25 Jan 2013 13:57:18 +1300 (NZDT) From: Chris Packham To: u-boot@lists.denx.de, Joe Hershberger Date: Fri, 25 Jan 2013 13:56:52 +1300 Message-Id: <1359075418-9031-2-git-send-email-judge.packham@gmail.com> X-Mailer: git-send-email 1.7.12.rc2.16.g034161a In-Reply-To: <1359075418-9031-1-git-send-email-judge.packham@gmail.com> References: <1359075418-9031-1-git-send-email-judge.packham@gmail.com> Cc: Chris Packham , Kim Phillips Subject: [U-Boot] [RFC PATCH v3 1/7] Initial net6.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Chris Packham 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 --- Changes in v3: - add reviewed-by from Kim Phillips 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 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 " +#endif + __u8 flow_lbl[3]; + __be16 payload_len; + __u8 nexthdr; + __u8 hop_limit; + IP6addr_t saddr; + IP6addr_t daddr; +}; + +#endif /* __NET6_H__ */