Contiki 3.x
rpl-ns.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, 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  * \file
34  * RPL non-storing mode specific functions. Includes support for
35  * source routing.
36  *
37  * \author Simon Duquennoy <simon.duquennoy@inria.fr>
38  */
39 
40 
41 #ifndef RPL_NS_H
42 #define RPL_NS_H
43 
44 #include "rpl-conf.h"
45 
46 #ifdef RPL_NS_CONF_LINK_NUM
47 #define RPL_NS_LINK_NUM RPL_NS_CONF_LINK_NUM
48 #else /* RPL_NS_CONF_LINK_NUM */
49 #define RPL_NS_LINK_NUM 32
50 #endif /* RPL_NS_CONF_LINK_NUM */
51 
52 typedef struct rpl_ns_node {
53  struct rpl_ns_node *next;
54  uint32_t lifetime;
55  rpl_dag_t *dag;
56  /* Store only IPv6 link identifiers as all nodes in the DAG share the same prefix */
57  unsigned char link_identifier[8];
58  struct rpl_ns_node *parent;
59 } rpl_ns_node_t;
60 
61 int rpl_ns_num_nodes(void);
62 void rpl_ns_expire_parent(rpl_dag_t *dag, const uip_ipaddr_t *child, const uip_ipaddr_t *parent);
63 rpl_ns_node_t *rpl_ns_update_node(rpl_dag_t *dag, const uip_ipaddr_t *child, const uip_ipaddr_t *parent, uint32_t lifetime);
64 void rpl_ns_init(void);
65 rpl_ns_node_t *rpl_ns_node_head(void);
66 rpl_ns_node_t *rpl_ns_node_next(rpl_ns_node_t *item);
67 rpl_ns_node_t *rpl_ns_get_node(const rpl_dag_t *dag, const uip_ipaddr_t *addr);
68 int rpl_ns_is_node_reachable(const rpl_dag_t *dag, const uip_ipaddr_t *addr);
69 void rpl_ns_get_node_global_addr(uip_ipaddr_t *addr, rpl_ns_node_t *node);
70 void rpl_ns_periodic();
71 
72 #endif /* RPL_NS_H */
static uip_ds6_addr_t * addr
Pointer to a router list entry.
Definition: uip-nd6.c:124