-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rpl: add source routing header parsing for ng_net
- Loading branch information
Showing
5 changed files
with
135 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (C) 2015 Martine Lenders <[email protected]> | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @defgroup net_ng_rpl New RPL | ||
* @ingroup net | ||
* @{ | ||
* | ||
* @file | ||
* @brief TODO | ||
* | ||
* @author Martine Lenders <[email protected]> | ||
*/ | ||
#ifndef NG_RPL_H_ | ||
#define NG_RPL_H_ | ||
|
||
|
||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* NG_RPL_H_ */ | ||
/** @} */ |
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,70 @@ | ||
/* | ||
* Copyright (C) 2015 Martine Lenders <[email protected]> | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @defgroup net_rpl_srh RPL source routing header extension | ||
* @ingroup net_rpl | ||
* @brief Implementation of RPL source routing extension headers | ||
* @see <a href="https://tools.ietf.org/html/rfc6554"> | ||
* RFC 6554 | ||
* </a> | ||
* @{ | ||
* | ||
* @file | ||
* @brief Definititions for RPL source routing extension headers | ||
* | ||
* @author Martine Lenders <[email protected]> | ||
*/ | ||
#ifndef NG_RPL_SRH_H_ | ||
#define NG_RPL_SRH_H_ | ||
|
||
#include "net/ng_ipv6/addr.h" | ||
#include "net/ng_ipv6/ext.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief Type for source routing header. | ||
*/ | ||
#define NG_RPL_SRH_TYPE (3U) | ||
|
||
/** | ||
* @brief The RPL Source routing header. | ||
* | ||
* @see <a href="https://tools.ietf.org/html/rfc6554"> | ||
* RFC 6554 | ||
* </a> | ||
* | ||
* @extends ng_ipv6_ext_rh_t | ||
*/ | ||
typedef struct __attribute__((packed)) { | ||
uint8_t nh; /**< next header */ | ||
uint8_t len; /**< length in 8 octets without first octet */ | ||
uint8_t type; /**< identifier of a particular routing header type */ | ||
uint8_t seg_left; /**< number of route segments remaining */ | ||
} ng_rpl_srh_t; | ||
|
||
/** | ||
* @brief Extract next hop from the RPL source routing header from a RPL | ||
* source routing header. | ||
* | ||
* @param[in] rh A RPL source routing header. | ||
* | ||
* @return next hop on success, on success | ||
* @return NULL, if not found. | ||
*/ | ||
ng_ipv6_addr_t *ng_rpl_srh_next_hop(ng_rpl_srh_t *rh); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* NG_RPL_SRH_H_ */ | ||
/** @} */ |
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,24 @@ | ||
/* | ||
* Copyright (C) 2015 Martine Lenders <[email protected]> | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @{ | ||
* | ||
* @file | ||
*/ | ||
|
||
#include "net/ng_rpl/srh.h" | ||
|
||
ng_ipv6_addr_t *ng_rpl_srh_next_hop(ng_rpl_srh_t *rh) | ||
{ | ||
/* TODO */ | ||
|
||
return NULL; | ||
} | ||
|
||
/** @} */ |