From patchwork Wed Dec 9 21:46:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 554818 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3B86A1402A9 for ; Thu, 10 Dec 2015 08:48:19 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=zBQC1Njh; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753739AbbLIVsN (ORCPT ); Wed, 9 Dec 2015 16:48:13 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:33589 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754046AbbLIVrc (ORCPT ); Wed, 9 Dec 2015 16:47:32 -0500 Received: by mail-wm0-f46.google.com with SMTP id c201so5395469wme.0; Wed, 09 Dec 2015 13:47:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ObRCPE9kM7tljpyDeXLBzILNF65ipHrVPzVtUpeRuOI=; b=zBQC1Njhy3j5mOwHiy6/oCxBqwx7qTONSGZSq54dYfgyHt7Yz/B6qnSnUd+yBSYG4B +PAWzs1IGaLWD/x7FW5Ja+eBsw4iOfFF5U+eP3GNWNNRJDpRhVn5mZEZBq8US5KH0Fwk +/aA5W47IcmUw0ANeftKH85yrB/UvD/PuQsKv06r6VtdNQLGmRr30p6GVDEGkvt6MSA2 40H7N8Rnp4alegyVd5KqioY3rYDJ3kW7ro/jZh/LYncYvQ4W5b520u3ZtxIuzIigYOkW 0y0EbqHyS9D7KIa1YUKxQ0FSzVLEl5jptrR9coOhxPEZ+mcVaAnOQdQqc9IQpmAjoGbr McBQ== X-Received: by 10.28.46.137 with SMTP id u131mr13497497wmu.61.1449697650725; Wed, 09 Dec 2015 13:47:30 -0800 (PST) Received: from omega.localdomain (p20030064A928605CE2CB4EFFFE1BB546.dip0.t-ipconnect.de. [2003:64:a928:605c:e2cb:4eff:fe1b:b546]) by smtp.gmail.com with ESMTPSA id 143sm28074625wmv.18.2015.12.09.13.47.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Dec 2015 13:47:30 -0800 (PST) From: Alexander Aring To: linux-wpan@vger.kernel.org Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, kernel@pengutronix.de, Stefan Schmidt , Alexander Aring Subject: [PATCH bluetooth-next 06/10] 6lowpan: add nhc module for GHC fragmentation extension header detection Date: Wed, 9 Dec 2015 22:46:27 +0100 Message-Id: <1449697591-15991-7-git-send-email-alex.aring@gmail.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1449697591-15991-1-git-send-email-alex.aring@gmail.com> References: <1449697591-15991-1-git-send-email-alex.aring@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Stefan Schmidt Acked-by: Jukka Rissanen Signed-off-by: Stefan Schmidt Signed-off-by: Alexander Aring --- net/6lowpan/Kconfig | 6 ++++++ net/6lowpan/Makefile | 1 + net/6lowpan/nhc_ghc_ext_frag.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 net/6lowpan/nhc_ghc_ext_frag.c diff --git a/net/6lowpan/Kconfig b/net/6lowpan/Kconfig index e5184e6..13abcc5 100644 --- a/net/6lowpan/Kconfig +++ b/net/6lowpan/Kconfig @@ -81,4 +81,10 @@ config 6LOWPAN_GHC_EXT_HDR_DEST 6LoWPAN IPv6 destination option generic header compression according to RFC7400. +config 6LOWPAN_GHC_EXT_HDR_FRAG + tristate "GHC Fragmentation Options Header Support" + ---help--- + 6LoWPAN IPv6 fragmentation option generic header compression + according to RFC7400. + endif diff --git a/net/6lowpan/Makefile b/net/6lowpan/Makefile index fc4bac0..fb3f48d 100644 --- a/net/6lowpan/Makefile +++ b/net/6lowpan/Makefile @@ -16,3 +16,4 @@ obj-$(CONFIG_6LOWPAN_GHC_EXT_HDR_HOP) += nhc_ghc_ext_hop.o obj-$(CONFIG_6LOWPAN_GHC_UDP) += nhc_ghc_udp.o obj-$(CONFIG_6LOWPAN_GHC_ICMPV6) += nhc_ghc_icmpv6.o obj-$(CONFIG_6LOWPAN_GHC_EXT_HDR_DEST) += nhc_ghc_ext_dest.o +obj-$(CONFIG_6LOWPAN_GHC_EXT_HDR_FRAG) += nhc_ghc_ext_frag.o diff --git a/net/6lowpan/nhc_ghc_ext_frag.c b/net/6lowpan/nhc_ghc_ext_frag.c new file mode 100644 index 0000000..1308b79 --- /dev/null +++ b/net/6lowpan/nhc_ghc_ext_frag.c @@ -0,0 +1,28 @@ +/* + * 6LoWPAN Extension Header compression according to RFC7400 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include "nhc.h" + +#define LOWPAN_GHC_EXT_FRAG_IDLEN 1 +#define LOWPAN_GHC_EXT_FRAG_ID_0 0xb4 +#define LOWPAN_GHC_EXT_FRAG_MASK_0 0xfe + +static void frag_ghid_setup(struct lowpan_nhc *nhc) +{ + nhc->id[0] = LOWPAN_GHC_EXT_FRAG_ID_0; + nhc->idmask[0] = LOWPAN_GHC_EXT_FRAG_MASK_0; +} + +LOWPAN_NHC(ghc_ext_frag, "RFC7400 Fragmentation Extension Header", + NEXTHDR_FRAGMENT, 0, frag_ghid_setup, + LOWPAN_GHC_EXT_FRAG_IDLEN, NULL, NULL); + +module_lowpan_nhc(ghc_ext_frag); +MODULE_DESCRIPTION("6LoWPAN generic header fragmentation extension compression"); +MODULE_LICENSE("GPL");