Contiki-NG
Toggle main menu visibility
Loading...
Searching...
No Matches
nullrouting.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017, RISE SICS.
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 routing
34
* @{
35
*
36
* \file
37
* A routing protocol that does nothing
38
*
39
* \author Simon Duquennoy <simon.duquennoy@ri.se>
40
*/
41
42
#include "
net/routing/routing.h
"
43
44
/*---------------------------------------------------------------------------*/
45
static
void
46
init
(
void
)
47
{
48
}
49
/*---------------------------------------------------------------------------*/
50
static
void
51
root_set_prefix(uip_ipaddr_t *prefix, uip_ipaddr_t *iid)
52
{
53
}
54
/*---------------------------------------------------------------------------*/
55
static
int
56
root_start(
void
)
57
{
58
return
0;
59
}
60
/*---------------------------------------------------------------------------*/
61
static
int
62
node_is_root(
void
)
63
{
64
return
0;
65
}
66
/*---------------------------------------------------------------------------*/
67
static
int
68
get_root_ipaddr(uip_ipaddr_t *
ipaddr
)
69
{
70
return
0;
71
}
72
/*---------------------------------------------------------------------------*/
73
static
int
74
get_sr_node_ipaddr(uip_ipaddr_t *
addr
,
const
uip_sr_node_t
*node)
75
{
76
return
0;
77
}
78
/*---------------------------------------------------------------------------*/
79
static
void
80
leave_network(
void
)
81
{
82
}
83
/*---------------------------------------------------------------------------*/
84
static
int
85
node_has_joined(
void
)
86
{
87
return
1;
88
}
89
/*---------------------------------------------------------------------------*/
90
static
int
91
node_is_reachable(
void
)
92
{
93
return
1;
94
}
95
/*---------------------------------------------------------------------------*/
96
static
void
97
global_repair(
const
char
*str)
98
{
99
}
100
/*---------------------------------------------------------------------------*/
101
static
void
102
local_repair(
const
char
*str)
103
{
104
}
105
/*---------------------------------------------------------------------------*/
106
static
bool
107
ext_header_remove(
void
)
108
{
109
#if NETSTACK_CONF_WITH_IPV6
110
return
uip_remove_ext_hdr
();
111
#else
112
return
true
;
113
#endif
/* NETSTACK_CONF_WITH_IPV6 */
114
}
115
/*---------------------------------------------------------------------------*/
116
static
int
117
ext_header_update(
void
)
118
{
119
return
1;
120
}
121
/*---------------------------------------------------------------------------*/
122
static
int
123
ext_header_hbh_update(uint8_t *ext_buf,
int
opt_offset)
124
{
125
return
1;
126
}
127
/*---------------------------------------------------------------------------*/
128
static
int
129
ext_header_srh_update(
void
)
130
{
131
return
0;
/* Means SRH not found */
132
}
133
/*---------------------------------------------------------------------------*/
134
static
int
135
ext_header_srh_get_next_hop(uip_ipaddr_t *
ipaddr
)
136
{
137
return
0;
138
}
139
/*---------------------------------------------------------------------------*/
140
static
void
141
link_callback(
const
linkaddr_t *
addr
,
int
status,
int
numtx)
142
{
143
}
144
/*---------------------------------------------------------------------------*/
145
static
void
146
neighbor_state_changed(
uip_ds6_nbr_t
*
nbr
)
147
{
148
}
149
/*---------------------------------------------------------------------------*/
150
static
void
151
drop_route(
uip_ds6_route_t
*route)
152
{
153
}
154
/*---------------------------------------------------------------------------*/
155
static
uint8_t
156
is_in_leaf_mode(
void
)
157
{
158
return
0;
159
}
160
/*---------------------------------------------------------------------------*/
161
const
struct
routing_driver
nullrouting_driver = {
162
"nullrouting"
,
163
init,
164
root_set_prefix,
165
root_start,
166
node_is_root,
167
get_root_ipaddr,
168
get_sr_node_ipaddr,
169
leave_network,
170
node_has_joined,
171
node_is_reachable,
172
global_repair,
173
local_repair,
174
ext_header_remove,
175
ext_header_update,
176
ext_header_hbh_update,
177
ext_header_srh_update,
178
ext_header_srh_get_next_hop,
179
link_callback,
180
neighbor_state_changed,
181
drop_route,
182
is_in_leaf_mode,
183
};
184
/*---------------------------------------------------------------------------*/
185
186
/** @}*/
init
static int init(void)
Definition
cc2538-rf.c:556
uip_ds6_route_t
struct uip_ds6_route uip_ds6_route_t
An entry in the routing table.
uip_remove_ext_hdr
bool uip_remove_ext_hdr(void)
Removes all IPv6 extension headers from uip_buf, updates length fields (uip_len and uip_ext_len).
Definition
uip6.c:491
uip_sr_node_t
struct uip_sr_node uip_sr_node_t
A node in a source routing graph, stored at the root and representing all child-parent relationship.
uip_ds6_nbr_t
struct uip_ds6_nbr uip_ds6_nbr_t
The default nbr_table entry (when UIP_DS6_NBR_MULTI_IPV6_ADDRS is disabled), that implements nbr cach...
routing.h
Routing driver header file.
routing_driver
The structure of a routing protocol driver.
Definition
routing.h:60
nbr
static uip_ds6_nbr_t * nbr
Pointer to llao option in uip_buf.
Definition
uip-nd6.c:106
ipaddr
static uip_ipaddr_t ipaddr
Pointer to prefix information option in uip_buf.
Definition
uip-nd6.c:116
addr
static uip_ds6_addr_t * addr
Pointer to a nbr cache entry.
Definition
uip-nd6.c:107
os
net
routing
nullrouting
nullrouting.c
Generated on
for Contiki-NG by
1.17.0