2014-06-18 12:11:12 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2014 Freie Universität Berlin
|
|
|
|
*
|
2014-08-21 23:52:42 +02:00
|
|
|
* 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.
|
2014-06-18 12:11:12 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2014-12-06 14:28:38 +01:00
|
|
|
* @ingroup rpl
|
2014-06-18 12:11:12 +02:00
|
|
|
* @brief Routing Protocol for Low power and Lossy Networks
|
|
|
|
* @{
|
|
|
|
*
|
2014-11-30 21:51:27 +01:00
|
|
|
* @file
|
2014-06-18 12:11:12 +02:00
|
|
|
* @brief RPL storing-mode header
|
|
|
|
*
|
2014-07-08 16:54:54 +02:00
|
|
|
* Header which includes all mode related RPL-functions. All functions are mandatory for any
|
|
|
|
* RPL-mode. Describes receiving and sending of all RPL-related messages and special initialization behavior.
|
|
|
|
*
|
|
|
|
* @author Eric Engel <eric.engel@fu-berlin.de>
|
|
|
|
* @author Fabian Brandt <fabianbr@zedat.fu-berlin.de>
|
2014-06-18 12:11:12 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __RPL_SM_H
|
|
|
|
#define __RPL_SM_H
|
|
|
|
|
|
|
|
#include "rpl_structs.h"
|
|
|
|
#include "rpl_config.h"
|
|
|
|
#include "rpl.h"
|
|
|
|
|
2014-10-10 11:51:11 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2014-06-18 12:11:12 +02:00
|
|
|
/**
|
|
|
|
* @brief Initialization of RPL-root.
|
|
|
|
*
|
|
|
|
* This function initializes all RPL resources especially for root purposes. Initializes a new DODAG and sets
|
|
|
|
* itself as root. Starts trickle-timer so sending DIOs starts and other can join the DODAG.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void rpl_init_root_mode(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Initialization of RPL storing mode.
|
|
|
|
*
|
|
|
|
* This function initializes all basic RPL mode resources. For this mode this includes only acquiring the own
|
|
|
|
* address.
|
|
|
|
*
|
|
|
|
* @param[in] my_ipv6_address Own IPv6 address as assigned by RPL core-initialization.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void rpl_init_mode(ipv6_addr_t *my_ipv6_address);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Sends a DIO-message to a given destination
|
|
|
|
*
|
|
|
|
* This function sends a DIO message to a given destination. This is triggered by the trickle-timer.
|
|
|
|
*
|
|
|
|
* @param[in] destination IPv6-address of the destination of the DIO. Should be a direct neighbor or multicast address.
|
|
|
|
*
|
|
|
|
*/
|
2014-07-08 16:54:54 +02:00
|
|
|
void rpl_send_DIO_mode(ipv6_addr_t *destination);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Returns whether a node is root or not
|
|
|
|
*
|
|
|
|
* This function initializes all basic RPL mode resources. For this mode this includes only acquiring the own
|
|
|
|
* address.
|
|
|
|
*
|
|
|
|
* @return 1 if node is root
|
|
|
|
* @return 0 if node is not root
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
uint8_t rpl_is_root_mode(void);
|
2014-06-18 12:11:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Sends a DAO-message to a given destination
|
|
|
|
*
|
|
|
|
* This function sends a DAO message to a given destination.
|
|
|
|
*
|
|
|
|
* @param[in] destination IPv6-address of the destination of the DAO. Should be the proffered parent.
|
|
|
|
* @param[in] lifetime Lifetime of the node. Reflect the estimated time of presence in the network.
|
|
|
|
* @param[in] default_lifetime If true, param lifetime is ignored and lifetime is DODAG default-lifetime
|
|
|
|
* @param[in] start_index Describes whether a DAO must be split because of too many routing entries.
|
|
|
|
*
|
|
|
|
*/
|
2014-07-08 16:54:54 +02:00
|
|
|
void rpl_send_DAO_mode(ipv6_addr_t *destination, uint8_t lifetime, bool default_lifetime, uint8_t start_index);
|
2014-06-18 12:11:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Sends a DIS-message to a given destination
|
|
|
|
*
|
|
|
|
* This function sends a DIS message to a given destination.
|
|
|
|
*
|
|
|
|
* @param[in] destination IPv6-address of the destination of the DIS. Should be a direct neighbor.
|
|
|
|
*
|
|
|
|
*/
|
2014-07-08 16:54:54 +02:00
|
|
|
void rpl_send_DIS_mode(ipv6_addr_t *destination);
|
2014-06-18 12:11:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Sends a DAO acknowledgment-message to a given destination
|
|
|
|
*
|
|
|
|
* This function sends a DAO_ACK message to a given destination.
|
|
|
|
*
|
|
|
|
* @param[in] destination IPv6-address of the destination of the DAO_ACK. Should be a direct neighbor.
|
|
|
|
*
|
|
|
|
*/
|
2014-07-08 16:54:54 +02:00
|
|
|
void rpl_send_DAO_ACK_mode(ipv6_addr_t *destination);
|
2014-06-18 12:11:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Receives a DIO message
|
|
|
|
*
|
|
|
|
* This function handles receiving a DIO message in any mode .
|
|
|
|
*
|
|
|
|
*/
|
2014-07-08 16:54:54 +02:00
|
|
|
void rpl_recv_DIO_mode(void);
|
2014-06-18 12:11:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Receives a DAO message
|
|
|
|
*
|
|
|
|
* This function handles receiving a DAO message in any mode.
|
|
|
|
*
|
|
|
|
*/
|
2014-07-08 16:54:54 +02:00
|
|
|
void rpl_recv_DAO_mode(void);
|
2014-06-18 12:11:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Receives a DIS message
|
|
|
|
*
|
|
|
|
* This function handles receiving a DIS message in any mode.
|
|
|
|
*
|
|
|
|
*/
|
2014-07-08 16:54:54 +02:00
|
|
|
void rpl_recv_DIS_mode(void);
|
2014-06-18 12:11:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Receives a DAO acknowledgment message
|
|
|
|
*
|
|
|
|
* This function handles receiving a DAO_ACK message in any mode.
|
|
|
|
*
|
|
|
|
*/
|
2014-07-08 16:54:54 +02:00
|
|
|
void rpl_recv_dao_ack_mode(void);
|
2014-06-18 12:11:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Sends a RPL message to a given destination
|
|
|
|
*
|
|
|
|
* This function sends any RPl related messages to a given destination. This implementation should be equal
|
|
|
|
* for all modes and therefore should not be altered. Every mode related RPL-sending function calls this for
|
|
|
|
* relaying it in lower layers to sixlowpan. Because send-functions are wrapped by a mutex in rpl.c, the same
|
|
|
|
* mutex applies here.
|
|
|
|
*
|
|
|
|
* @param[in] destination IPv6-address of the destination of the message.
|
|
|
|
* @param[in] payload Payload of the message.
|
2014-11-30 22:34:50 +01:00
|
|
|
* @param[in] p_len Length of the message
|
2014-06-18 12:11:12 +02:00
|
|
|
* @param[in] next_header Index to next header in message.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void rpl_send(ipv6_addr_t *destination, uint8_t *payload, uint16_t p_len, uint8_t next_header);
|
|
|
|
|
2014-10-10 11:51:11 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2014-06-18 12:11:12 +02:00
|
|
|
#endif /* __RPL_SM_H */
|
|
|
|
/** @} */
|