forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Cc: Martin Townsend <[email protected]> Reviewed-by: Stefan Schmidt <[email protected]> Acked-by: Jukka Rissanen <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
- Loading branch information
Showing
9 changed files
with
213 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* 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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* 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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* 6LoWPAN IPv6 Hop-by-Hop 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_HOP_IDLEN 1 | ||
#define LOWPAN_NHC_HOP_ID_0 0xe0 | ||
#define LOWPAN_NHC_HOP_MASK_0 0xfe | ||
|
||
static void hop_nhid_setup(struct lowpan_nhc *nhc) | ||
{ | ||
nhc->id[0] = LOWPAN_NHC_HOP_ID_0; | ||
nhc->idmask[0] = LOWPAN_NHC_HOP_MASK_0; | ||
} | ||
|
||
LOWPAN_NHC(nhc_hop, "RFC6282 Hop-by-Hop Options", NEXTHDR_HOP, 0, | ||
hop_nhid_setup, LOWPAN_NHC_HOP_IDLEN, NULL, NULL); | ||
|
||
module_lowpan_nhc(nhc_hop); | ||
MODULE_DESCRIPTION("6LoWPAN next header RFC6282 Hop-by-Hop Options compression"); | ||
MODULE_LICENSE("GPL"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* 6LoWPAN IPv6 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_IPV6_IDLEN 1 | ||
#define LOWPAN_NHC_IPV6_ID_0 0xee | ||
#define LOWPAN_NHC_IPV6_MASK_0 0xfe | ||
|
||
static void ipv6_nhid_setup(struct lowpan_nhc *nhc) | ||
{ | ||
nhc->id[0] = LOWPAN_NHC_IPV6_ID_0; | ||
nhc->idmask[0] = LOWPAN_NHC_IPV6_MASK_0; | ||
} | ||
|
||
LOWPAN_NHC(nhc_ipv6, "RFC6282 IPv6", NEXTHDR_IPV6, 0, ipv6_nhid_setup, | ||
LOWPAN_NHC_IPV6_IDLEN, NULL, NULL); | ||
|
||
module_lowpan_nhc(nhc_ipv6); | ||
MODULE_DESCRIPTION("6LoWPAN next header RFC6282 IPv6 compression"); | ||
MODULE_LICENSE("GPL"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* 6LoWPAN IPv6 Mobility 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_MOBILITY_IDLEN 1 | ||
#define LOWPAN_NHC_MOBILITY_ID_0 0xe8 | ||
#define LOWPAN_NHC_MOBILITY_MASK_0 0xfe | ||
|
||
static void mobility_nhid_setup(struct lowpan_nhc *nhc) | ||
{ | ||
nhc->id[0] = LOWPAN_NHC_MOBILITY_ID_0; | ||
nhc->idmask[0] = LOWPAN_NHC_MOBILITY_MASK_0; | ||
} | ||
|
||
LOWPAN_NHC(nhc_mobility, "RFC6282 Mobility", NEXTHDR_MOBILITY, 0, | ||
mobility_nhid_setup, LOWPAN_NHC_MOBILITY_IDLEN, NULL, NULL); | ||
|
||
module_lowpan_nhc(nhc_mobility); | ||
MODULE_DESCRIPTION("6LoWPAN next header RFC6282 Mobility compression"); | ||
MODULE_LICENSE("GPL"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* 6LoWPAN IPv6 Routing 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_ROUTING_IDLEN 1 | ||
#define LOWPAN_NHC_ROUTING_ID_0 0xe2 | ||
#define LOWPAN_NHC_ROUTING_MASK_0 0xfe | ||
|
||
static void routing_nhid_setup(struct lowpan_nhc *nhc) | ||
{ | ||
nhc->id[0] = LOWPAN_NHC_ROUTING_ID_0; | ||
nhc->idmask[0] = LOWPAN_NHC_ROUTING_MASK_0; | ||
} | ||
|
||
LOWPAN_NHC(nhc_routing, "RFC6282 Routing", NEXTHDR_ROUTING, 0, | ||
routing_nhid_setup, LOWPAN_NHC_ROUTING_IDLEN, NULL, NULL); | ||
|
||
module_lowpan_nhc(nhc_routing); | ||
MODULE_DESCRIPTION("6LoWPAN next header RFC6282 Routing compression"); | ||
MODULE_LICENSE("GPL"); |