Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff0fcc29 authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann
Browse files

6lowpan: nhc: add other known rfc6282 compressions



This patch adds other known rfc6282 compression formats to the nhc
framework. These compression formats are known but not implemented yet.
For now this is useful to printout a warning which compression format
isn't supported.

Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Cc: Martin Townsend <mtownsend1973@gmail.com>
Reviewed-by: default avatarStefan Schmidt <s.schmidt@samsung.com>
Acked-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent cc6ed268
Loading
Loading
Loading
Loading
+38 −0
Original line number Diff line number Diff line
@@ -14,6 +14,44 @@ menuconfig 6LOWPAN_NHC

if 6LOWPAN_NHC

config 6LOWPAN_NHC_DEST
	tristate "Destination Options Header Support"
	default y
	---help---
	  6LoWPAN IPv6 Destination Options Header compression according to
	  RFC6282.

config 6LOWPAN_NHC_FRAGMENT
	tristate "Fragment Header Support"
	default y
	---help---
	  6LoWPAN IPv6 Fragment Header compression according to RFC6282.

config 6LOWPAN_NHC_HOP
	tristate "Hop-by-Hop Options Header Support"
	default y
	---help---
	  6LoWPAN IPv6 Hop-by-Hop Options Header compression according to
	  RFC6282.

config 6LOWPAN_NHC_IPV6
	tristate "IPv6 Header Support"
	default y
	---help---
	  6LoWPAN IPv6 Header compression according to RFC6282.

config 6LOWPAN_NHC_MOBILITY
	tristate "Mobility Header Support"
	default y
	---help---
	  6LoWPAN IPv6 Mobility Header compression according to RFC6282.

config 6LOWPAN_NHC_ROUTING
	tristate "Routing Header Support"
	default y
	---help---
	  6LoWPAN IPv6 Routing Header compression according to RFC6282.

config 6LOWPAN_NHC_UDP
	tristate "UDP Header Support"
	default y
+6 −0
Original line number Diff line number Diff line
@@ -3,4 +3,10 @@ obj-$(CONFIG_6LOWPAN) += 6lowpan.o
6lowpan-y := iphc.o nhc.o

#rfc6282 nhcs
obj-$(CONFIG_6LOWPAN_NHC_DEST) += nhc_dest.o
obj-$(CONFIG_6LOWPAN_NHC_FRAGMENT) += nhc_fragment.o
obj-$(CONFIG_6LOWPAN_NHC_HOP) += nhc_hop.o
obj-$(CONFIG_6LOWPAN_NHC_IPV6) += nhc_ipv6.o
obj-$(CONFIG_6LOWPAN_NHC_MOBILITY) += nhc_mobility.o
obj-$(CONFIG_6LOWPAN_NHC_ROUTING) += nhc_routing.o
obj-$(CONFIG_6LOWPAN_NHC_UDP) += nhc_udp.o
+6 −0
Original line number Diff line number Diff line
@@ -613,6 +613,12 @@ EXPORT_SYMBOL_GPL(lowpan_header_compress);

static int __init lowpan_module_init(void)
{
	request_module_nowait("nhc_dest");
	request_module_nowait("nhc_fragment");
	request_module_nowait("nhc_hop");
	request_module_nowait("nhc_ipv6");
	request_module_nowait("nhc_mobility");
	request_module_nowait("nhc_routing");
	request_module_nowait("nhc_udp");

	return 0;

net/6lowpan/nhc_dest.c

0 → 100644
+28 −0
Original line number Diff line number Diff line
/*
 *	6LoWPAN IPv6 Destination Options Header compression according to
 *	RFC6282
 *
 *	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_NHC_DEST_IDLEN	1
#define LOWPAN_NHC_DEST_ID_0	0xe6
#define LOWPAN_NHC_DEST_MASK_0	0xfe

static void dest_nhid_setup(struct lowpan_nhc *nhc)
{
	nhc->id[0] = LOWPAN_NHC_DEST_ID_0;
	nhc->idmask[0] = LOWPAN_NHC_DEST_MASK_0;
}

LOWPAN_NHC(nhc_dest, "RFC6282 Destination Options", NEXTHDR_DEST, 0,
	   dest_nhid_setup, LOWPAN_NHC_DEST_IDLEN, NULL, NULL);

module_lowpan_nhc(nhc_dest);
MODULE_DESCRIPTION("6LoWPAN next header RFC6282 Destination Options compression");
MODULE_LICENSE("GPL");
+27 −0
Original line number Diff line number Diff line
/*
 *	6LoWPAN IPv6 Fragment Header compression according to RFC6282
 *
 *	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_NHC_FRAGMENT_IDLEN	1
#define LOWPAN_NHC_FRAGMENT_ID_0	0xe4
#define LOWPAN_NHC_FRAGMENT_MASK_0	0xfe

static void fragment_nhid_setup(struct lowpan_nhc *nhc)
{
	nhc->id[0] = LOWPAN_NHC_FRAGMENT_ID_0;
	nhc->idmask[0] = LOWPAN_NHC_FRAGMENT_MASK_0;
}

LOWPAN_NHC(nhc_fragment, "RFC6282 Fragment", NEXTHDR_FRAGMENT, 0,
	   fragment_nhid_setup, LOWPAN_NHC_FRAGMENT_IDLEN, NULL, NULL);

module_lowpan_nhc(nhc_fragment);
MODULE_DESCRIPTION("6LoWPAN next header RFC6282 Fragment compression");
MODULE_LICENSE("GPL");
Loading