Microchip® Advanced Software Framework

uaodv.c File Reference

    Micro implementation of the AODV ad hoc routing protocol
Author
Adam Dunkels adam@.nosp@m.sics.nosp@m..se
#include <stdio.h>
#include <stdarg.h>
#include "contiki.h"
#include "net/ipv4/uaodv-def.h"
#include "net/ipv4/uaodv-rt.h"
#include "net/ipv4/uaodv.h"
#include "lib/assert.h"

Macros

#define add_rreq_extensions(p)   0 /* Don't add anything */
 
#define BUF   ((struct uip_udpip_hdr *)&uip_buf[UIP_LLH_LEN])
 
#define MY_NET_DIAMETER   20
 
#define MY_ROUTE_TIMEOUT   0x7fffffff /* Should be 0xffffffff! */
 
#define NDEBUG
 
#define NFWCACHE   16
 
#define print_debug(...)   do{}while(0)
 
#define PRINTF(...)   do {} while (0)
 
#define SCMP32(a, b)   ((int32_t)((a) - (b)))
 
#define uip_udp_sender()   (&BUF->srcipaddr)
 

Enumerations

enum  {
  COMMAND_NONE,
  COMMAND_SEND_RREQ,
  COMMAND_SEND_RERR
}
 

Functions

static CC_INLINE void fwc_add (const uip_ipaddr_t *orig, const uint32_t *id)
 
static CC_INLINE int fwc_lookup (const uip_ipaddr_t *orig, const uint32_t *id)
 
static void handle_incoming_packet (void)
 
static void handle_incoming_rerr (void)
 
static void handle_incoming_rrep (void)
 
static void handle_incoming_rreq (void)
 
static CC_INLINE uint32_t last_known_seqno (uip_ipaddr_t *host)
 
 PROCESS (uaodv_process,"uAODV")
 
 PROCESS_THREAD (uaodv_process, ev, data)
 
static void send_rerr (uip_ipaddr_t *addr, uint32_t *seqno)
 
static void send_rrep (uip_ipaddr_t *dest, uip_ipaddr_t *nexthop, uip_ipaddr_t *orig, uint32_t *seqno, unsigned hop_count)
 
static void send_rreq (uip_ipaddr_t *addr)
 
static void sendto (const uip_ipaddr_t *dest, const void *buf, int len)
 
void uaodv_bad_dest (uip_ipaddr_t *dest)
 
struct uaodv_rt_entryuaodv_request_route_to (uip_ipaddr_t *host)
 

Variables

static uip_ipaddr_t bad_dest
 
static uint32_t bad_seqno
 
static struct uip_udp_connbcastconn
 
static enum { ... }  command
 
struct {
   uint32_t   id
 
   uip_ipaddr_t   orig
 
fwcache [NFWCACHE]
 
static uint32_t my_hseqno
 
static struct timer next_time
 
static uip_ipaddr_t rreq_addr
 
static uint32_t rreq_id
 
static struct uip_udp_connunicastconn
 

#define add_rreq_extensions (   p)    0 /* Don't add anything */

Referenced by handle_incoming_rreq(), and send_rreq().

#define MY_NET_DIAMETER   20

Referenced by send_rreq().

#define MY_ROUTE_TIMEOUT   0x7fffffff /* Should be 0xffffffff! */

Referenced by send_rrep().

#define NDEBUG
#define NFWCACHE   16

Referenced by fwc_add(), and fwc_lookup().

#define print_debug (   ...)    do{}while(0)
#define PRINTF (   ...)    do {} while (0)
#define SCMP32 (   a,
 
)    ((int32_t)((a) - (b)))
#define uip_udp_sender ( )    (&BUF->srcipaddr)

anonymous enum
Enumerator
COMMAND_NONE 
COMMAND_SEND_RREQ 
COMMAND_SEND_RERR 

static CC_INLINE void fwc_add ( const uip_ipaddr_t orig,
const uint32_t *  id 
)
static
static CC_INLINE int fwc_lookup ( const uip_ipaddr_t orig,
const uint32_t *  id 
)
static
static CC_INLINE uint32_t last_known_seqno ( uip_ipaddr_t host)
static
PROCESS ( uaodv_process  ,
"uAODV"   
)
static void sendto ( const uip_ipaddr_t dest,
const void *  buf,
int  len 
)
static

uip_ipaddr_t bad_dest
static
uint32_t bad_seqno
static
struct uip_udp_conn* bcastconn
static
enum { ... } command
struct { ... } fwcache[NFWCACHE]

Referenced by fwc_add(), and fwc_lookup().

uint32_t my_hseqno
static
struct timer next_time
static

Referenced by uaodv_request_route_to().

uip_ipaddr_t rreq_addr
static
uint32_t rreq_id
static

Referenced by send_rreq().

struct uip_udp_conn * unicastconn
static

Referenced by sendto().