Microchip® Advanced Software Framework

tcpip.c File Reference

    Code for tunnelling uIP packets over the Rime mesh routing module
Author
Adam Dunkels adam@.nosp@m.sics.nosp@m..se
Mathilde Durvy mdurv.nosp@m.y@ci.nosp@m.sco.c.nosp@m.om (IPv6 related code)
Julien Abeille jabei.nosp@m.lle@.nosp@m.cisco.nosp@m..com (IPv6 related code)
#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_conntcp_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_connudp_broadcast_new (uint16_t port, void *appstate)
 Create a new UDP broadcast connection. More...
 
struct uip_udp_connudp_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])
#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().

anonymous enum
Enumerator
TCP_POLL 
UDP_POLL 
PACKET_INPUT 

static void check_for_tcp_syn ( void  )
static
static void packet_input ( void  )
static
PROCESS ( tcpip_process  ,
"TCP/IP stack"   
)
static void start_periodic_tcp_timer ( void  )
static

uint8_t(* outputfunc)(const uip_lladdr_t *a)
static
struct etimer periodic
static