Microchip® Advanced Software Framework

uip-over-mesh.c File Reference

    Code for tunnelling uIP packets over the Rime mesh routing module
Author
Adam Dunkels adam@.nosp@m.sics.nosp@m..se
#include <stdio.h>
#include "net/ipv4/uip-fw.h"
#include "net/ipv4/uip-over-mesh.h"
#include "net/rime/route-discovery.h"
#include "net/rime/route.h"
#include "net/rime/trickle.h"

Data Structures

struct  gateway_msg
 

Macros

#define _DEBUG_   0
 
#define BUF   ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
 
#define PRINTF(...)
 
#define ROUTE_DISCOVERY_INTERVAL   CLOCK_SECOND * 4
 
#define ROUTE_TIMEOUT   CLOCK_SECOND * 4
 
#define ROUTE_TRICKLE_INTERVAL   CLOCK_SECOND * 32
 

Functions

static void gateway_announce_recv (struct trickle_conn *c)
 
static void new_route (struct route_discovery_conn *c, const linkaddr_t *to)
 
static void recv_data (struct unicast_conn *c, const linkaddr_t *from)
 
static void send_data (linkaddr_t *next)
 
static void timedout (struct route_discovery_conn *c)
 
void uip_over_mesh_init (uint16_t channels)
 
void uip_over_mesh_make_announced_gateway (void)
 
uint8_t uip_over_mesh_send (void)
 
void uip_over_mesh_set_gateway (linkaddr_t *gw)
 
void uip_over_mesh_set_gateway_netif (struct uip_fw_netif *n)
 
void uip_over_mesh_set_net (uip_ipaddr_t *addr, uip_ipaddr_t *mask)
 

Variables

static struct unicast_callbacks data_callbacks = { recv_data }
 
static struct unicast_conn dataconn
 
static linkaddr_t gateway
 
static struct trickle_conn gateway_announce_conn
 
static struct uip_fw_netifgw_netif
 
static uint8_t is_gateway
 
static uip_ipaddr_t netaddr
 
static uip_ipaddr_t netmask
 
static struct queuebufqueued_packet
 
static linkaddr_t queued_receiver
 
static struct
route_discovery_callbacks 
rdc = { new_route, timedout }
 
static struct route_discovery_conn route_discovery
 
static const struct
trickle_callbacks 
trickle_call = {gateway_announce_recv}
 

#define _DEBUG_   0
#define BUF   ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN])

Referenced by recv_data(), and uip_over_mesh_send().

#define ROUTE_DISCOVERY_INTERVAL   CLOCK_SECOND * 4

Referenced by uip_over_mesh_init().

#define ROUTE_TIMEOUT   CLOCK_SECOND * 4

Referenced by uip_over_mesh_send().

#define ROUTE_TRICKLE_INTERVAL   CLOCK_SECOND * 32

Referenced by uip_over_mesh_init().

static void gateway_announce_recv ( struct trickle_conn c)
static
static void new_route ( struct route_discovery_conn c,
const linkaddr_t to 
)
static
static void send_data ( linkaddr_t next)
static
static void timedout ( struct route_discovery_conn c)
static

References NULL, PRINTF, and queuebuf_free().

void uip_over_mesh_set_gateway ( linkaddr_t gw)
void uip_over_mesh_set_gateway_netif ( struct uip_fw_netif n)

References n.

void uip_over_mesh_set_net ( uip_ipaddr_t addr,
uip_ipaddr_t mask 
)

References uip_ipaddr_copy.

struct unicast_callbacks data_callbacks = { recv_data }
static
struct unicast_conn dataconn
static

Referenced by send_data(), and uip_over_mesh_init().

linkaddr_t gateway
static
struct trickle_conn gateway_announce_conn
static
struct uip_fw_netif* gw_netif
static
uint8_t is_gateway
static
uip_ipaddr_t netaddr
static
uip_ipaddr_t netmask
static

Referenced by ip64_init().

struct queuebuf* queued_packet
static
linkaddr_t queued_receiver
static
struct route_discovery_callbacks rdc = { new_route, timedout }
static
struct route_discovery_conn route_discovery
static
const struct trickle_callbacks trickle_call = {gateway_announce_recv}
static