-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the AODVv2 Routing Protocol #1767
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This header would be happy about gettting documented. ;-)