Contiki-NG
Toggle main menu visibility
Loading...
Searching...
No Matches
uip-mcast6-route.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011, Loughborough University - Computer Science
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
*
14
* 3. Neither the name of the copyright holder nor the names of its
15
* contributors may be used to endorse or promote products derived
16
* from this software without specific prior written permission.
17
*
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29
* OF THE POSSIBILITY OF SUCH DAMAGE.
30
*/
31
/**
32
* \addtogroup uip-multicast
33
* @{
34
*/
35
/**
36
* \file
37
* Header file for multicast routing table manipulation
38
*
39
* \author
40
* George Oikonomou - <oikonomou@users.sourceforge.net>
41
*/
42
#ifndef UIP_MCAST6_ROUTE_H_
43
#define UIP_MCAST6_ROUTE_H_
44
45
#include "contiki.h"
46
#include "
net/ipv6/uip.h
"
47
48
#include <stdint.h>
49
/*---------------------------------------------------------------------------*/
50
/** \brief An entry in the multicast routing table */
51
typedef
struct
uip_mcast6_route
{
52
struct
uip_mcast6_route
*
next
;
/**< Routes are arranged in a linked list */
53
uip_ipaddr_t
group
;
/**< The multicast group */
54
uint32_t
lifetime
;
/**< Entry lifetime seconds */
55
void
*
dag
;
/**< Pointer to an rpl_dag_t struct */
56
}
uip_mcast6_route_t
;
57
/*---------------------------------------------------------------------------*/
58
/** \name Multicast Routing Table Manipulation */
59
/** @{ */
60
61
/**
62
* \brief Lookup a multicast route
63
* \param group A pointer to the multicast group to be searched for
64
* \return A pointer to the new routing entry, or NULL if the route could not
65
* be found
66
*/
67
uip_mcast6_route_t
*
uip_mcast6_route_lookup
(uip_ipaddr_t *
group
);
68
69
/**
70
* \brief Add a multicast route
71
* \param group A pointer to the multicast group to be added
72
* \return A pointer to the new route, or NULL if the route could not be added
73
*/
74
uip_mcast6_route_t
*
uip_mcast6_route_add
(uip_ipaddr_t *
group
);
75
76
/**
77
* \brief Remove a multicast route
78
* \param route A pointer to the route to be removed
79
*/
80
void
uip_mcast6_route_rm
(
uip_mcast6_route_t
*route);
81
82
/**
83
* \brief Retrieve the count of multicast routes
84
* \return The number of multicast routes
85
*/
86
int
uip_mcast6_route_count
(
void
);
87
88
/**
89
* \brief Retrieve a pointer to the start of the multicast routes list
90
* \return A pointer to the start of the multicast routes
91
*
92
* If the multicast routes list is empty, this function will return NULL
93
*/
94
uip_mcast6_route_t
*
uip_mcast6_route_list_head
(
void
);
95
/*---------------------------------------------------------------------------*/
96
/**
97
* \brief Multicast routing table init routine
98
*
99
* Multicast routing tables are not necessarily required by all
100
* multicast engines. For instance, trickle multicast does not rely on
101
* the existence of a routing table. Therefore, this function here
102
* should be invoked by each engine's init routine only if the relevant
103
* functionality is required. This is also why this function should not
104
* get hooked into the uip-ds6 core.
105
*/
106
void
uip_mcast6_route_init
(
void
);
107
/** @} */
108
109
#endif
/* UIP_MCAST6_ROUTE_H_ */
110
/** @} */
uip_mcast6_route_count
int uip_mcast6_route_count(void)
Retrieve the count of multicast routes.
Definition
uip-mcast6-route.c:123
uip_mcast6_route_list_head
uip_mcast6_route_t * uip_mcast6_route_list_head(void)
Retrieve a pointer to the start of the multicast routes list.
Definition
uip-mcast6-route.c:117
uip_mcast6_route_add
uip_mcast6_route_t * uip_mcast6_route_add(uip_ipaddr_t *group)
Add a multicast route.
Definition
uip-mcast6-route.c:81
uip_mcast6_route_rm
void uip_mcast6_route_rm(uip_mcast6_route_t *route)
Remove a multicast route.
Definition
uip-mcast6-route.c:102
uip_mcast6_route_lookup
uip_mcast6_route_t * uip_mcast6_route_lookup(uip_ipaddr_t *group)
Lookup a multicast route.
Definition
uip-mcast6-route.c:66
uip_mcast6_route_t
struct uip_mcast6_route uip_mcast6_route_t
An entry in the multicast routing table.
uip_mcast6_route_init
void uip_mcast6_route_init()
Multicast routing table init routine.
Definition
uip-mcast6-route.c:129
uip_mcast6_route
An entry in the multicast routing table.
Definition
uip-mcast6-route.h:51
uip_mcast6_route::dag
void * dag
Pointer to an rpl_dag_t struct.
Definition
uip-mcast6-route.h:55
uip_mcast6_route::group
uip_ipaddr_t group
The multicast group.
Definition
uip-mcast6-route.h:53
uip_mcast6_route::next
struct uip_mcast6_route * next
Routes are arranged in a linked list.
Definition
uip-mcast6-route.h:52
uip_mcast6_route::lifetime
uint32_t lifetime
Entry lifetime seconds.
Definition
uip-mcast6-route.h:54
uip.h
Header file for the uIP TCP/IP stack.
os
net
ipv6
multicast
uip-mcast6-route.h
Generated on
for Contiki-NG by
1.17.0