Code for tunnelling uIP packets over the Rime mesh routing module
#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_netif * | gw_netif |
static uint8_t | is_gateway |
static uip_ipaddr_t | netaddr |
static uip_ipaddr_t | netmask |
static 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} |
#define _DEBUG_ 0 |
#define BUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN]) |
Referenced by recv_data(), and uip_over_mesh_send().
#define PRINTF | ( | ... | ) |
#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 |
|
static |
References NULL, PRINTF, queuebuf_free(), queuebuf_to_packetbuf(), route_decay(), route_lookup(), rt, and send_data.
|
static |
References BUF, linkaddr_node_addr, NULL, packetbuf_copyto(), PRINTF, route_add(), route_lookup(), route_refresh(), tcpip_input(), linkaddr_t::u8, uip_buf, uip_ipaddr_maskcmp, uip_len, and UIP_LLH_LEN.
|
static |
References dataconn, linkaddr_node_addr, packetbuf_totlen(), PRINTF, linkaddr_t::u8, and unicast_send().
|
static |
References NULL, PRINTF, and queuebuf_free().
void uip_over_mesh_init | ( | uint16_t | channels | ) |
void uip_over_mesh_make_announced_gateway | ( | void | ) |
uint8_t uip_over_mesh_send | ( | void | ) |
References BUF, linkaddr_cmp(), linkaddr_copy(), linkaddr_node_addr, linkaddr_null, route_entry::nexthop, NULL, uip_fw_netif::output, PACKETBUF_ATTR_ERELIABLE, PACKETBUF_ATTR_RELIABLE, packetbuf_copyfrom(), packetbuf_set_attr(), PRINTF, queuebuf_new_from_packetbuf(), receiver(), route_decay(), route_discovery, route_discovery_discover(), route_lookup(), ROUTE_TIMEOUT, rt, send_data, linkaddr_t::u8, uip_buf, UIP_FW_DROPPED, UIP_FW_OK, uip_ipaddr_maskcmp, uip_ipaddr_to_quad, uip_len, UIP_LLH_LEN, and UIP_PROTO_TCP.
void uip_over_mesh_set_gateway | ( | linkaddr_t * | gw | ) |
References linkaddr_copy().
Referenced by gateway_announce_recv(), and uip_over_mesh_make_announced_gateway().
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.
|
static |
|
static |
Referenced by send_data(), and uip_over_mesh_init().
|
static |
|
static |
Referenced by uip_over_mesh_init(), and uip_over_mesh_make_announced_gateway().
|
static |
|
static |
Referenced by gateway_announce_recv(), and uip_over_mesh_make_announced_gateway().
|
static |
|
static |
Referenced by ip64_init().
|
static |
|
static |
|
static |
|
static |
Referenced by uip_over_mesh_init(), and uip_over_mesh_send().
|
static |