summaryrefslogtreecommitdiffstats
path: root/net/6lowpan
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-01-09 10:42:59 -0500
committerMarcel Holtmann <marcel@holtmann.org>2015-02-14 17:08:44 -0500
commitff0fcc2987b42857d233e8a72c7476fb1e520110 (patch)
tree8f5c5f0e10a832de8a6f8869e831614264ff7584 /net/6lowpan
parentcc6ed2684751b0a1074b37c080983b6ce737ed22 (diff)
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: Alexander Aring <alex.aring@gmail.com> Cc: Martin Townsend <mtownsend1973@gmail.com> Reviewed-by: Stefan Schmidt <s.schmidt@samsung.com> Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/6lowpan')
-rw-r--r--net/6lowpan/Kconfig38
-rw-r--r--net/6lowpan/Makefile6
-rw-r--r--net/6lowpan/iphc.c6
-rw-r--r--net/6lowpan/nhc_dest.c28
-rw-r--r--net/6lowpan/nhc_fragment.c27
-rw-r--r--net/6lowpan/nhc_hop.c27
-rw-r--r--net/6lowpan/nhc_ipv6.c27
-rw-r--r--net/6lowpan/nhc_mobility.c27
-rw-r--r--net/6lowpan/nhc_routing.c27
9 files changed, 213 insertions, 0 deletions
diff --git a/net/6lowpan/Kconfig b/net/6lowpan/Kconfig
index e45c96321845..7fa0f382e7d1 100644
--- a/net/6lowpan/Kconfig
+++ b/net/6lowpan/Kconfig
@@ -14,6 +14,44 @@ menuconfig 6LOWPAN_NHC
14 14
15if 6LOWPAN_NHC 15if 6LOWPAN_NHC
16 16
17config 6LOWPAN_NHC_DEST
18 tristate "Destination Options Header Support"
19 default y
20 ---help---
21 6LoWPAN IPv6 Destination Options Header compression according to
22 RFC6282.
23
24config 6LOWPAN_NHC_FRAGMENT
25 tristate "Fragment Header Support"
26 default y
27 ---help---
28 6LoWPAN IPv6 Fragment Header compression according to RFC6282.
29
30config 6LOWPAN_NHC_HOP
31 tristate "Hop-by-Hop Options Header Support"
32 default y
33 ---help---
34 6LoWPAN IPv6 Hop-by-Hop Options Header compression according to
35 RFC6282.
36
37config 6LOWPAN_NHC_IPV6
38 tristate "IPv6 Header Support"
39 default y
40 ---help---
41 6LoWPAN IPv6 Header compression according to RFC6282.
42
43config 6LOWPAN_NHC_MOBILITY
44 tristate "Mobility Header Support"
45 default y
46 ---help---
47 6LoWPAN IPv6 Mobility Header compression according to RFC6282.
48
49config 6LOWPAN_NHC_ROUTING
50 tristate "Routing Header Support"
51 default y
52 ---help---
53 6LoWPAN IPv6 Routing Header compression according to RFC6282.
54
17config 6LOWPAN_NHC_UDP 55config 6LOWPAN_NHC_UDP
18 tristate "UDP Header Support" 56 tristate "UDP Header Support"
19 default y 57 default y
diff --git a/net/6lowpan/Makefile b/net/6lowpan/Makefile
index abf551d31881..eb8baa72adc8 100644
--- a/net/6lowpan/Makefile
+++ b/net/6lowpan/Makefile
@@ -3,4 +3,10 @@ obj-$(CONFIG_6LOWPAN) += 6lowpan.o
36lowpan-y := iphc.o nhc.o 36lowpan-y := iphc.o nhc.o
4 4
5#rfc6282 nhcs 5#rfc6282 nhcs
6obj-$(CONFIG_6LOWPAN_NHC_DEST) += nhc_dest.o
7obj-$(CONFIG_6LOWPAN_NHC_FRAGMENT) += nhc_fragment.o
8obj-$(CONFIG_6LOWPAN_NHC_HOP) += nhc_hop.o
9obj-$(CONFIG_6LOWPAN_NHC_IPV6) += nhc_ipv6.o
10obj-$(CONFIG_6LOWPAN_NHC_MOBILITY) += nhc_mobility.o
11obj-$(CONFIG_6LOWPAN_NHC_ROUTING) += nhc_routing.o
6obj-$(CONFIG_6LOWPAN_NHC_UDP) += nhc_udp.o 12obj-$(CONFIG_6LOWPAN_NHC_UDP) += nhc_udp.o
diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c
index 390bdd9677df..94a375c04f21 100644
--- a/net/6lowpan/iphc.c
+++ b/net/6lowpan/iphc.c
@@ -613,6 +613,12 @@ EXPORT_SYMBOL_GPL(lowpan_header_compress);
613 613
614static int __init lowpan_module_init(void) 614static int __init lowpan_module_init(void)
615{ 615{
616 request_module_nowait("nhc_dest");
617 request_module_nowait("nhc_fragment");
618 request_module_nowait("nhc_hop");
619 request_module_nowait("nhc_ipv6");
620 request_module_nowait("nhc_mobility");
621 request_module_nowait("nhc_routing");
616 request_module_nowait("nhc_udp"); 622 request_module_nowait("nhc_udp");
617 623
618 return 0; 624 return 0;
diff --git a/net/6lowpan/nhc_dest.c b/net/6lowpan/nhc_dest.c
new file mode 100644
index 000000000000..0b292c9646eb
--- /dev/null
+++ b/net/6lowpan/nhc_dest.c
@@ -0,0 +1,28 @@
1/*
2 * 6LoWPAN IPv6 Destination Options Header compression according to
3 * RFC6282
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include "nhc.h"
12
13#define LOWPAN_NHC_DEST_IDLEN 1
14#define LOWPAN_NHC_DEST_ID_0 0xe6
15#define LOWPAN_NHC_DEST_MASK_0 0xfe
16
17static void dest_nhid_setup(struct lowpan_nhc *nhc)
18{
19 nhc->id[0] = LOWPAN_NHC_DEST_ID_0;
20 nhc->idmask[0] = LOWPAN_NHC_DEST_MASK_0;
21}
22
23LOWPAN_NHC(nhc_dest, "RFC6282 Destination Options", NEXTHDR_DEST, 0,
24 dest_nhid_setup, LOWPAN_NHC_DEST_IDLEN, NULL, NULL);
25
26module_lowpan_nhc(nhc_dest);
27MODULE_DESCRIPTION("6LoWPAN next header RFC6282 Destination Options compression");
28MODULE_LICENSE("GPL");
diff --git a/net/6lowpan/nhc_fragment.c b/net/6lowpan/nhc_fragment.c
new file mode 100644
index 000000000000..473dbc58ef84
--- /dev/null
+++ b/net/6lowpan/nhc_fragment.c
@@ -0,0 +1,27 @@
1/*
2 * 6LoWPAN IPv6 Fragment Header compression according to RFC6282
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include "nhc.h"
11
12#define LOWPAN_NHC_FRAGMENT_IDLEN 1
13#define LOWPAN_NHC_FRAGMENT_ID_0 0xe4
14#define LOWPAN_NHC_FRAGMENT_MASK_0 0xfe
15
16static void fragment_nhid_setup(struct lowpan_nhc *nhc)
17{
18 nhc->id[0] = LOWPAN_NHC_FRAGMENT_ID_0;
19 nhc->idmask[0] = LOWPAN_NHC_FRAGMENT_MASK_0;
20}
21
22LOWPAN_NHC(nhc_fragment, "RFC6282 Fragment", NEXTHDR_FRAGMENT, 0,
23 fragment_nhid_setup, LOWPAN_NHC_FRAGMENT_IDLEN, NULL, NULL);
24
25module_lowpan_nhc(nhc_fragment);
26MODULE_DESCRIPTION("6LoWPAN next header RFC6282 Fragment compression");
27MODULE_LICENSE("GPL");
diff --git a/net/6lowpan/nhc_hop.c b/net/6lowpan/nhc_hop.c
new file mode 100644
index 000000000000..1eb66be16f19
--- /dev/null
+++ b/net/6lowpan/nhc_hop.c
@@ -0,0 +1,27 @@
1/*
2 * 6LoWPAN IPv6 Hop-by-Hop Options Header compression according to RFC6282
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include "nhc.h"
11
12#define LOWPAN_NHC_HOP_IDLEN 1
13#define LOWPAN_NHC_HOP_ID_0 0xe0
14#define LOWPAN_NHC_HOP_MASK_0 0xfe
15
16static void hop_nhid_setup(struct lowpan_nhc *nhc)
17{
18 nhc->id[0] = LOWPAN_NHC_HOP_ID_0;
19 nhc->idmask[0] = LOWPAN_NHC_HOP_MASK_0;
20}
21
22LOWPAN_NHC(nhc_hop, "RFC6282 Hop-by-Hop Options", NEXTHDR_HOP, 0,
23 hop_nhid_setup, LOWPAN_NHC_HOP_IDLEN, NULL, NULL);
24
25module_lowpan_nhc(nhc_hop);
26MODULE_DESCRIPTION("6LoWPAN next header RFC6282 Hop-by-Hop Options compression");
27MODULE_LICENSE("GPL");
diff --git a/net/6lowpan/nhc_ipv6.c b/net/6lowpan/nhc_ipv6.c
new file mode 100644
index 000000000000..2313d1600af3
--- /dev/null
+++ b/net/6lowpan/nhc_ipv6.c
@@ -0,0 +1,27 @@
1/*
2 * 6LoWPAN IPv6 Header compression according to RFC6282
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include "nhc.h"
11
12#define LOWPAN_NHC_IPV6_IDLEN 1
13#define LOWPAN_NHC_IPV6_ID_0 0xee
14#define LOWPAN_NHC_IPV6_MASK_0 0xfe
15
16static void ipv6_nhid_setup(struct lowpan_nhc *nhc)
17{
18 nhc->id[0] = LOWPAN_NHC_IPV6_ID_0;
19 nhc->idmask[0] = LOWPAN_NHC_IPV6_MASK_0;
20}
21
22LOWPAN_NHC(nhc_ipv6, "RFC6282 IPv6", NEXTHDR_IPV6, 0, ipv6_nhid_setup,
23 LOWPAN_NHC_IPV6_IDLEN, NULL, NULL);
24
25module_lowpan_nhc(nhc_ipv6);
26MODULE_DESCRIPTION("6LoWPAN next header RFC6282 IPv6 compression");
27MODULE_LICENSE("GPL");
diff --git a/net/6lowpan/nhc_mobility.c b/net/6lowpan/nhc_mobility.c
new file mode 100644
index 000000000000..60d3f3886c98
--- /dev/null
+++ b/net/6lowpan/nhc_mobility.c
@@ -0,0 +1,27 @@
1/*
2 * 6LoWPAN IPv6 Mobility Header compression according to RFC6282
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include "nhc.h"
11
12#define LOWPAN_NHC_MOBILITY_IDLEN 1
13#define LOWPAN_NHC_MOBILITY_ID_0 0xe8
14#define LOWPAN_NHC_MOBILITY_MASK_0 0xfe
15
16static void mobility_nhid_setup(struct lowpan_nhc *nhc)
17{
18 nhc->id[0] = LOWPAN_NHC_MOBILITY_ID_0;
19 nhc->idmask[0] = LOWPAN_NHC_MOBILITY_MASK_0;
20}
21
22LOWPAN_NHC(nhc_mobility, "RFC6282 Mobility", NEXTHDR_MOBILITY, 0,
23 mobility_nhid_setup, LOWPAN_NHC_MOBILITY_IDLEN, NULL, NULL);
24
25module_lowpan_nhc(nhc_mobility);
26MODULE_DESCRIPTION("6LoWPAN next header RFC6282 Mobility compression");
27MODULE_LICENSE("GPL");
diff --git a/net/6lowpan/nhc_routing.c b/net/6lowpan/nhc_routing.c
new file mode 100644
index 000000000000..c393280f11c4
--- /dev/null
+++ b/net/6lowpan/nhc_routing.c
@@ -0,0 +1,27 @@
1/*
2 * 6LoWPAN IPv6 Routing Header compression according to RFC6282
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
8 */
9
10#include "nhc.h"
11
12#define LOWPAN_NHC_ROUTING_IDLEN 1
13#define LOWPAN_NHC_ROUTING_ID_0 0xe2
14#define LOWPAN_NHC_ROUTING_MASK_0 0xfe
15
16static void routing_nhid_setup(struct lowpan_nhc *nhc)
17{
18 nhc->id[0] = LOWPAN_NHC_ROUTING_ID_0;
19 nhc->idmask[0] = LOWPAN_NHC_ROUTING_MASK_0;
20}
21
22LOWPAN_NHC(nhc_routing, "RFC6282 Routing", NEXTHDR_ROUTING, 0,
23 routing_nhid_setup, LOWPAN_NHC_ROUTING_IDLEN, NULL, NULL);
24
25module_lowpan_nhc(nhc_routing);
26MODULE_DESCRIPTION("6LoWPAN next header RFC6282 Routing compression");
27MODULE_LICENSE("GPL");