42 #include "contiki-net.h"
44 #ifndef UAODV_NUM_RT_ENTRIES
45 #define UAODV_NUM_RT_ENTRIES 8
52 MEMB(route_mem,
struct uaodv_rt_entry, UAODV_NUM_RT_ENTRIES);
62 struct uaodv_rt_entry *
63 uaodv_rt_add(uip_ipaddr_t *dest, uip_ipaddr_t *nexthop,
64 unsigned hop_count,
const uint32_t *seqno)
66 struct uaodv_rt_entry *e;
69 e = uaodv_rt_lookup_any(dest);
82 e->hop_count = hop_count;
83 e->hseqno = uip_ntohl(*seqno);
92 struct uaodv_rt_entry *
93 uaodv_rt_lookup_any(uip_ipaddr_t *dest)
95 struct uaodv_rt_entry *e;
98 if(uip_ipaddr_cmp(dest, &e->dest)) {
105 struct uaodv_rt_entry *
106 uaodv_rt_lookup(uip_ipaddr_t *dest)
108 struct uaodv_rt_entry *e;
110 e = uaodv_rt_lookup_any(dest);
111 if(e !=
NULL && e->is_bad)
118 uaodv_rt_remove(
struct uaodv_rt_entry *e)
126 uaodv_rt_lru(
struct uaodv_rt_entry *e)
135 uaodv_rt_flush_all(
void)
137 struct uaodv_rt_entry *e;
void * list_pop(list_t list)
Remove the first object on a list.
void memb_init(struct memb *m)
Initialize a memory block that was declared with MEMB().
void list_push(list_t list, void *item)
Add an item to the start of the list.
char memb_free(struct memb *m, void *ptr)
Deallocate a memory block from a memory block previously declared with MEMB().
void * memb_alloc(struct memb *m)
Allocate a memory block from a block of memory declared with MEMB().
#define NULL
The null pointer.
void list_remove(list_t list, void *item)
Remove a specific element from a list.
void list_init(list_t list)
Initialize a list.
#define uip_ipaddr_copy(dest, src)
Copy an IP address from one place to another.
void * list_head(list_t list)
Get a pointer to the first element of a list.
#define MEMB(name, structure, num)
Declare a memory block.
#define LIST(name)
Declare a linked list.
void * list_chop(list_t list)
Remove the last object on the list.
Routing tables for the micro implementation of the AODV ad hoc routing protocol ...