-
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.
Merge pull request #1767 from Lotterleben/aodvv2_PR
Add the AODVv2 Routing Protocol
- Loading branch information
Showing
19 changed files
with
3,065 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (C) 2014 Freie Universität Berlin | ||
* Copyright (C) 2014 Lotte Steenbrink <[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 aodvv2 AODVv2 | ||
* @brief The Ad-hoc On-demand Distance Vector routing protocol, version 2 | ||
* @ingroup net | ||
* @{ | ||
* | ||
* @file aodvv2/aodvv2.h | ||
* @brief Interface for the AODVv2 routing protocol | ||
* | ||
* @author Lotte Steenbrink <[email protected]> | ||
*/ | ||
|
||
#ifndef AODVV2_H_ | ||
#define AODVV2_H_ | ||
|
||
#include "common/netaddr.h" | ||
#include "rfc5444/rfc5444_print.h" | ||
|
||
#include "aodvv2/types.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief Initialize the AODVv2 routing protocol. | ||
*/ | ||
void aodv_init(void); | ||
|
||
/** | ||
* @brief Set the metric type. If metric_type does not match any known metric | ||
* types, no changes will be made. | ||
* | ||
* @param[in] metric_type type of new metric | ||
*/ | ||
void aodv_set_metric_type(aodvv2_metric_t metric_type); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* AODVV2_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,102 @@ | ||
/* | ||
* Copyright (C) 2014 Freie Universität Berlin | ||
* Copyright (C) 2014 Lotte Steenbrink <[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. | ||
*/ | ||
|
||
/** | ||
* @ingroup aodvv2 | ||
* @{ | ||
* | ||
* @file aodvv2/types.h | ||
* @brief data types for the aodvv2 routing protocol | ||
* | ||
* @author Lotte Steenbrink <[email protected]> | ||
*/ | ||
|
||
#ifndef AODVV2_TYPES_H | ||
#define AODVV2_TYPES_H | ||
|
||
#include "common/netaddr.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief AODVv2 metric types. Extend to include alternate metrics. | ||
*/ | ||
typedef enum { | ||
HOP_COUNT = 3, /**< see RFC6551*/ | ||
} aodvv2_metric_t; | ||
|
||
typedef uint16_t aodvv2_seqnum_t; | ||
|
||
#define AODVV2_DEFAULT_METRIC_TYPE HOP_COUNT | ||
|
||
/** | ||
* @brief AODVv2 message types | ||
*/ | ||
enum rfc5444_msg_type | ||
{ | ||
RFC5444_MSGTYPE_RREQ = 10, | ||
RFC5444_MSGTYPE_RREP = 11, | ||
RFC5444_MSGTYPE_RERR = 12, | ||
}; | ||
|
||
/** | ||
* @brief AODVv2 TLV types | ||
*/ | ||
enum rfc5444_tlv_type | ||
{ | ||
RFC5444_MSGTLV_ORIGSEQNUM, | ||
RFC5444_MSGTLV_TARGSEQNUM, | ||
RFC5444_MSGTLV_UNREACHABLE_NODE_SEQNUM, | ||
RFC5444_MSGTLV_METRIC, | ||
}; | ||
|
||
/** | ||
* @brief Data about an OrigNode or TargNode, typically embedded in an | ||
* aodvv2_packet_data struct. | ||
*/ | ||
struct node_data | ||
{ | ||
struct netaddr addr; /**< IP address of the node */ | ||
uint8_t metric; /**< Metric value */ | ||
aodvv2_seqnum_t seqnum; /**< Sequence Number */ | ||
}; | ||
|
||
/** | ||
* @brief all data contained in a RREQ or RREP. | ||
*/ | ||
struct aodvv2_packet_data | ||
{ | ||
uint8_t hoplimit; /**< Hop limit */ | ||
struct netaddr sender; /**< IP address of the neighboring router | ||
* which sent the RREQ/RREP*/ | ||
aodvv2_metric_t metricType; /**< Metric type */ | ||
struct node_data origNode; /**< Data about the originating node */ | ||
struct node_data targNode; /**< Data about the originating node */ | ||
timex_t timestamp; /**< point at which the packet was (roughly) | ||
* received. Note that this timestamp | ||
* will be set after the packet has been | ||
* successfully parsed. */ | ||
}; | ||
|
||
/** | ||
* @brief Data about an unreachable node to be embedded in a RERR. | ||
*/ | ||
struct unreachable_node | ||
{ | ||
struct netaddr addr; /**< IP address */ | ||
aodvv2_seqnum_t seqnum; /**< Sequence Number */ | ||
}; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* AODVV2_TYPES_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 @@ | ||
include $(RIOTBASE)/Makefile.base |
Oops, something went wrong.