Code for tunnelling uIP packets over the Rime mesh routing module
#include "contiki-net.h"
#include "net/ip/uip.h"
#include "net/ip/uip-split.h"
#include "net/ip/uip-packetqueue.h"
#include "net/ipv6/uip-nd6.h"
#include "net/ipv6/uip-ds6.h"
#include <string.h>
#include "net/ip/uip-debug.h"
#include "rpl/rpl.h"
#include "rpl/rpl-private.h"
Data Structures | |
struct | internal_state |
struct | listenport |
Macros | |
#define | _DEBUG_ DEBUG_NONE |
#define | TCP_SYN 0x02 |
#define | UIP_ICMP_BUF ((struct uip_icmp_hdr *)&uip_buf[UIP_LLIPH_LEN + uip_ext_len]) |
#define | UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) |
#define | UIP_LOG(m) |
#define | UIP_TCP_BUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN]) |
Enumerations | |
enum | { TCP_POLL, UDP_POLL, PACKET_INPUT } |
Functions | |
static void | check_for_tcp_syn (void) |
static void | eventhandler (process_event_t ev, process_data_t data) |
uint8_t | icmp6_new (void *appstate) |
register an ICMPv6 callback More... | |
static void | packet_input (void) |
PROCESS (tcpip_process,"TCP/IP stack") | |
PROCESS_THREAD (tcpip_process, ev, data) | |
static void | start_periodic_tcp_timer (void) |
void | tcp_attach (struct uip_conn *conn, void *appstate) |
Attach a TCP connection to the current process. More... | |
struct uip_conn * | tcp_connect (uip_ipaddr_t *ripaddr, uint16_t port, void *appstate) |
Open a TCP connection to the specified IP address and port. More... | |
void | tcp_listen (uint16_t port) |
Open a TCP port. More... | |
void | tcp_unlisten (uint16_t port) |
Close a listening TCP port. More... | |
void | tcpip_icmp6_call (uint8_t type) |
This function is called at reception of an ICMPv6 packet If an application registered as an ICMPv6 listener (with icmp6_new), it will be called through a process_post_synch() More... | |
void | tcpip_input (void) |
Deliver an incoming packet to the TCP/IP stack. More... | |
void | tcpip_ipv6_output (void) |
This function does address resolution and then calls tcpip_output. More... | |
uint8_t | tcpip_output (const uip_lladdr_t *a) |
Output packet to layer 2 The eventual parameter is the MAC address of the destination. More... | |
void | tcpip_poll_tcp (struct uip_conn *conn) |
Cause a specified TCP connection to be polled. More... | |
void | tcpip_poll_udp (struct uip_udp_conn *conn) |
Cause a specified UDP connection to be polled. More... | |
void | tcpip_set_outputfunc (uint8_t(*f)(const uip_lladdr_t *)) |
void | tcpip_uipcall (void) |
void | udp_attach (struct uip_udp_conn *conn, void *appstate) |
Attach the current process to a UDP connection. More... | |
struct uip_udp_conn * | udp_broadcast_new (uint16_t port, void *appstate) |
Create a new UDP broadcast connection. More... | |
struct uip_udp_conn * | udp_new (const uip_ipaddr_t *ripaddr, uint16_t port, void *appstate) |
Create a new UDP connection. More... | |
Variables | |
static uint8_t(* | outputfunc )(const uip_lladdr_t *a) |
static struct etimer | periodic |
static struct internal_state | s |
process_event_t | tcpip_event |
The uIP event. More... | |
process_event_t | tcpip_icmp6_event |
The ICMP6 event. More... | |
#define _DEBUG_ DEBUG_NONE |
#define TCP_SYN 0x02 |
Referenced by check_for_tcp_syn().
#define UIP_ICMP_BUF ((struct uip_icmp_hdr *)&uip_buf[UIP_LLIPH_LEN + uip_ext_len]) |
#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) |
Referenced by check_for_tcp_syn(), and tcpip_ipv6_output().
#define UIP_LOG | ( | m | ) |
Referenced by tcpip_ipv6_output(), and tcpip_output().
#define UIP_TCP_BUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN]) |
Referenced by check_for_tcp_syn().
|
static |
References start_periodic_tcp_timer(), TCP_SYN, UIP_IP_BUF, UIP_PROTO_TCP, and UIP_TCP_BUF.
Referenced by packet_input().
|
static |
References uip_conn::appstate, uip_udp_conn::appstate, etimer_expired(), etimer_restart(), i, internal_state::listenports, uip_udp_conn::lport, NULL, tcpip_uipstate::p, listenport::p, PACKET_INPUT, packet_input(), periodic, listenport::port, PRINTF, PROCESS_EVENT_EXITED, PROCESS_EVENT_TIMER, PROCESS_NONE, s, start_periodic_tcp_timer(), TCP_POLL, tcpip_ipv6_output(), tcpip_output(), uip_conn::tcpstateflags, UDP_POLL, UIP_CLOSED, uip_conn_active, uip_conns, UIP_CONNS, uip_ds6_periodic(), uip_ds6_timer_periodic, uip_fw_periodic(), uip_len, UIP_LISTENPORTS, uip_periodic, uip_poll_conn, uip_reass_over(), uip_udp_conns, UIP_UDP_CONNS, uip_udp_periodic_conn, and uip_unlisten().
Referenced by PROCESS_THREAD().
|
static |
References check_for_tcp_syn(), PRINTF, tcpip_ipv6_output(), tcpip_output(), uip_fw_forward(), UIP_FW_LOCAL, uip_input, uip_len, and uip_split_output().
Referenced by eventhandler().
PROCESS | ( | tcpip_process | , |
"TCP/IP stack" | |||
) |
PROCESS_THREAD | ( | tcpip_process | , |
ev | , | ||
data | |||
) |
|
static |
References etimer_expired(), etimer_restart(), and periodic.
Referenced by check_for_tcp_syn(), eventhandler(), and tcpip_uipcall().
|
static |
Referenced by tcpip_output(), and tcpip_set_outputfunc().
|
static |
Referenced by eventhandler(), PROCESS_THREAD(), and start_periodic_tcp_timer().
|
static |
Referenced by eventhandler(), PROCESS_THREAD(), tcp_attach(), tcp_listen(), tcp_unlisten(), tcpip_uipcall(), udp_attach(), and udp_new().