Contiki-NG
rpl-ext-header.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017, Inria.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the Institute nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * This file is part of the Contiki operating system.
30  */
31 
32 /**
33  * \addtogroup rpl-lite
34  * @{
35  *
36  * \file
37  * Header file for rpl-ext-header
38  *
39  * \author Simon Duquennoy <simon.duquennoy@inria.fr>
40  */
41 
42  #ifndef RPL_EXT_HEADER_H_
43  #define RPL_EXT_HEADER_H_
44 
45 /********** Public functions **********/
46 
47 /**
48 * Look for next hop from SRH of current uIP packet.
49 *
50 * \param ipaddr A pointer to the address where to store the next hop.
51 * \return 1 if a next hop was found, 0 otherwise
52 */
53 int rpl_ext_header_srh_get_next_hop(uip_ipaddr_t *ipaddr);
54 
55 /**
56 * Process and update SRH in-place,
57 * i.e. internal address swapping as per RFC6554
58 * \return 1 if SRH found, 0 otherwise
59 */
61 
62 /**
63 * Process and update the RPL hop-by-hop extension headers of
64 * the current uIP packet.
65 *
66 * \param uip_ext_opt_offset The offset within the uIP packet where
67 * extension headers start
68 * \return 1 in case the packet is valid and to be processed further,
69 * 0 in case the packet must be dropped.
70 */
72 
73 /**
74  * Adds/updates all RPL extension headers to current uIP packet.
75  *
76  * \return 1 in case of success, 0 otherwise
77 */
78 int rpl_ext_header_update(void);
79 
80 /**
81  * Removes all RPL extension headers.
82 */
83 void rpl_ext_header_remove(void);
84 
85  /** @} */
86 
87 #endif /* RPL_EXT_HEADER_H_ */
static uip_ipaddr_t ipaddr
Pointer to prefix information option in uip_buf.
Definition: uip-nd6.c:125
void rpl_ext_header_remove(void)
Removes all RPL extension headers.
int rpl_ext_header_hbh_update(int uip_ext_opt_offset)
Process and update the RPL hop-by-hop extension headers of the current uIP packet.
int rpl_ext_header_srh_get_next_hop(uip_ipaddr_t *ipaddr)
Look for next hop from SRH of current uIP packet.
int rpl_ext_header_update(void)
Adds/updates all RPL extension headers to current uIP packet.
uint8_t uip_ext_opt_offset
length of the header options read
Definition: uip6.c:134
int rpl_ext_header_srh_update(void)
Process and update SRH in-place, i.e.