p2p.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Cenk Gündoğan <mail@cgundogan.de>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
23 #ifndef NET_GNRC_RPL_P2P_H
24 #define NET_GNRC_RPL_P2P_H
25 
26 #include "net/ipv6/addr.h"
27 #include "net/gnrc.h"
28 #include "net/gnrc/rpl/structs.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
38 #define GNRC_RPL_P2P_MOP (0x04)
39 
46 #define GNRC_RPL_P2P_LIFETIME (0x02)
47 
54 #define GNRC_RPL_P2P_COMPR (0)
55 
62 #define GNRC_RPL_P2P_MAX_RANK (0)
63 
71 #define GNRC_RPL_P2P_DEFAULT_DIO_INTERVAL_MIN (6)
72 #define GNRC_RPL_P2P_DEFAULT_DIO_REDUNDANCY_CONSTANT (1)
73 
80 #define GNRC_RPL_P2P_DEFAULT_LIFETIME (0xFF)
81 #define GNRC_RPL_P2P_LIFETIME_UNIT (0xFFFF)
82 
90 #define GNRC_RPL_P2P_OPT_RDO (0x0A)
91 
98 #define GNRC_RPL_P2P_ICMPV6_CODE_DRO (0x04)
99 
106 #define GNRC_RPL_P2P_ICMPV6_CODE_DRO_ACK (0x05)
107 
111 #define GNRC_RPL_P2P_DRO_DELAY (4)
112 
116 #define GNRC_RPL_P2P_MSG_TYPE_DRO_HANDLE (0x09A0)
117 
121 extern const uint8_t gnrc_rpl_p2p_lifetime_lookup[4];
122 
135 gnrc_rpl_instance_t *gnrc_rpl_p2p_root_init(uint8_t instance_id, ipv6_addr_t *dodag_id,
136  ipv6_addr_t *target, bool gen_inst_id);
137 
145 
153 
161 
169 
173 void gnrc_rpl_p2p_update(void);
174 
175 #ifdef __cplusplus
176 }
177 #endif
178 
179 #endif /* NET_GNRC_RPL_P2P_H */
180 
RPL data structs.
Definitions for IPv6 addresses.
void gnrc_rpl_p2p_rdo_parse(gnrc_rpl_p2p_opt_rdo_t *rdo, gnrc_rpl_p2p_ext_t *p2p_ext)
Parse an RDO.
P2P-RPL data structs.
void gnrc_rpl_p2p_update(void)
Updates the lifetime of the P2P Dodag and the delay of the DRO.
gnrc_rpl_instance_t * gnrc_rpl_p2p_root_init(uint8_t instance_id, ipv6_addr_t *dodag_id, ipv6_addr_t *target, bool gen_inst_id)
Initialization of a P2P-RPL Instance as root node.
const uint8_t gnrc_rpl_p2p_lifetime_lookup[4]
Lookup table used to decode/encode the lifetime values.
struct gnrc_rpl_instance gnrc_rpl_instance_t
Instance representation.
Definition: structs.h:216
Includes all essential GNRC network stack base modules.
Extended DODAG information for P2P-RPL.
Definition: p2p_structs.h:79
void gnrc_rpl_p2p_send_DRO(gnrc_pktsnip_t *pkt, gnrc_rpl_p2p_ext_t *p2p_ext)
Send a DRO control message.
P2P Route Discovery Object (RDO) Option.
Definition: p2p_structs.h:42
void gnrc_rpl_p2p_recv_DRO(gnrc_pktsnip_t *pkt, ipv6_addr_t *src)
Receive and parse a DRO control message.
Type to represent parts (either headers or payload) of a packet, called snips.
Data type to represent an IPv6 address.
Definition: ipv6/addr.h:74
gnrc_pktsnip_t * gnrc_rpl_p2p_rdo_build(gnrc_pktsnip_t *pkt, gnrc_rpl_p2p_ext_t *p2p_ext)
Build an RDO.