Microchip® Advanced Software Framework

ip64.c File Reference
#include "ip64.h"
#include "ip64-addr.h"
#include "ip64-addrmap.h"
#include "ip64-conf.h"
#include "ip64-special-ports.h"
#include "ip64-eth-interface.h"
#include "ip64-tap-driver.h"
#include "ip64-slip-interface.h"
#include "ip64-ipv4-dhcp.h"
#include "contiki-net.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "net/ip/uip-debug.h"

Data Structures

struct  icmpv4_hdr
 
struct  icmpv6_hdr
 
struct  ipv4_hdr
 
struct  ipv6_hdr
 
struct  tcp_hdr
 
struct  udp_hdr
 

Macros

#define _DEBUG_   0
 
#define BUFSIZE   UIP_BUFSIZE
 
#define DEFAULT_LIFETIME   (CLOCK_SECOND * 60 * 5)
 
#define EPHEMERAL_PORTRANGE   1024
 
#define ICMP6_ECHO   128
 
#define ICMP6_ECHO_REPLY   129
 
#define ICMP_ECHO   8
 
#define ICMP_ECHO_REPLY   0
 
#define IP_PROTO_ICMPV4   1
 
#define IP_PROTO_ICMPV6   58
 
#define IP_PROTO_TCP   6
 
#define IP_PROTO_UDP   17
 
#define IPV4_HDRLEN   20
 
#define IPV6_HDRLEN   40
 
#define PRINTF(...)
 
#define RST_LIFETIME   (CLOCK_SECOND * 30)
 
#define SYN_LIFETIME   (CLOCK_SECOND * 20)
 
#define TCP_FIN   0x01
 
#define TCP_RST   0x04
 
#define TCP_SYN   0x02
 

Functions

static uint16_t chksum (uint16_t sum, const uint8_t *data, uint16_t len)
 
static void interface_init (void)
 
static void interface_output (void)
 
int ip64_4to6 (const uint8_t *ipv4packet, const uint16_t ipv4packet_len, uint8_t *resultpacket)
 
int ip64_6to4 (const uint8_t *ipv6packet, const uint16_t ipv6packet_len, uint8_t *resultpacket)
 
void ip64_conv (uip_ip4addr_t *addr, char ipadr[])
 
const uip_ip4addr_tip64_get_draddr (void)
 
const uip_ip4addr_tip64_get_hostaddr (void)
 
const uip_ip4addr_tip64_get_netmask (void)
 
int ip64_hostaddr_is_configured (void)
 
void ip64_init (void)
 
void ip64_set_draddr (const uip_ip4addr_t *draddr)
 
void ip64_set_hostaddr (const uip_ip4addr_t *hostaddr)
 
void ip64_set_ipv4_address (const uip_ip4addr_t *addr, const uip_ip4addr_t *netmask)
 
void ip64_set_ipv6_address (const uip_ip6addr_t *addr)
 
void ip64_set_netmask (const uip_ip4addr_t *netmask)
 
static uint16_t ipv4_checksum (struct ipv4_hdr *hdr)
 
static uint16_t ipv4_transport_checksum (const uint8_t *packet, uint16_t len, uint8_t proto)
 
static uint16_t ipv6_transport_checksum (const uint8_t *packet, uint16_t len, uint8_t proto)
 

Variables

static uip_ip4addr_t ip64_draddr
 
static uip_ip4addr_t ip64_hostaddr
 
static uint8_t ip64_hostaddr_configured = 0
 
static uip_ip4addr_t ip64_netmask
 
uint8_t * ip64_packet_buffer = ip64_packet_buffer_aligned.u8
 
uip_buf_t ip64_packet_buffer_aligned
 
uint16_t ip64_packet_buffer_maxlen = BUFSIZE
 
struct uip_fallback_interface ip64_uip_fallback_interface
 
static uint16_t ipid
 
static uip_ip4addr_t ipv4_broadcast_addr
 
static uip_ip6addr_t ipv6_local_address
 
static uint8_t ipv6_local_address_configured = 0
 

#define _DEBUG_   0
#define BUFSIZE   UIP_BUFSIZE

Referenced by ip64_4to6().

#define DEFAULT_LIFETIME   (CLOCK_SECOND * 60 * 5)

Referenced by ip64_6to4().

#define EPHEMERAL_PORTRANGE   1024

Referenced by ip64_4to6(), and ip64_6to4().

#define ICMP6_ECHO   128

Referenced by ip64_4to6().

#define ICMP6_ECHO_REPLY   129

Referenced by ip64_6to4().

#define ICMP_ECHO   8

Referenced by ip64_4to6().

#define ICMP_ECHO_REPLY   0

Referenced by ip64_6to4().

#define IP_PROTO_ICMPV4   1
#define IP_PROTO_ICMPV6   58

Referenced by ip64_4to6(), and ip64_6to4().

#define IP_PROTO_TCP   6

Referenced by ip64_4to6(), and ip64_6to4().

#define IP_PROTO_UDP   17

Referenced by ip64_4to6(), and ip64_6to4().

#define IPV4_HDRLEN   20
#define IPV6_HDRLEN   40
#define PRINTF (   ...)
#define RST_LIFETIME   (CLOCK_SECOND * 30)

Referenced by ip64_6to4().

#define SYN_LIFETIME   (CLOCK_SECOND * 20)

Referenced by ip64_6to4().

#define TCP_FIN   0x01

Referenced by ip64_6to4().

#define TCP_RST   0x04

Referenced by ip64_6to4().

#define TCP_SYN   0x02

Referenced by ip64_6to4().

static uint16_t chksum ( uint16_t  sum,
const uint8_t *  data,
uint16_t  len 
)
static
static void interface_init ( void  )
static
static void interface_output ( void  )
static
void ip64_conv ( uip_ip4addr_t addr,
char  ipadr[] 
)

References i, NULL, str, and uip_ip4addr_t::u8.

Referenced by ip64_init().

const uip_ip4addr_t* ip64_get_draddr ( void  )
const uip_ip4addr_t* ip64_get_netmask ( void  )
int ip64_hostaddr_is_configured ( void  )

References ip64_hostaddr_configured.

Referenced by PROCESS_THREAD().

void ip64_set_draddr ( const uip_ip4addr_t draddr)

References ip64_addr_copy4().

Referenced by ip64_dhcpc_configured(), and ip64_init().

void ip64_set_hostaddr ( const uip_ip4addr_t hostaddr)
void ip64_set_ipv4_address ( const uip_ip4addr_t addr,
const uip_ip4addr_t netmask 
)
void ip64_set_ipv6_address ( const uip_ip6addr_t addr)
void ip64_set_netmask ( const uip_ip4addr_t netmask)
static uint16_t ipv4_checksum ( struct ipv4_hdr hdr)
static

References chksum(), IPV4_HDRLEN, and uip_htons().

Referenced by ip64_6to4().

static uint16_t ipv4_transport_checksum ( const uint8_t *  packet,
uint16_t  len,
uint8_t  proto 
)
static
static uint16_t ipv6_transport_checksum ( const uint8_t *  packet,
uint16_t  len,
uint8_t  proto 
)
static

uip_ip4addr_t ip64_draddr
static

Referenced by ip64_get_draddr().

uip_ip4addr_t ip64_hostaddr
static

Referenced by ip64_get_hostaddr().

uint8_t ip64_hostaddr_configured = 0
static
uip_ip4addr_t ip64_netmask
static

Referenced by ip64_get_netmask().

uint8_t* ip64_packet_buffer = ip64_packet_buffer_aligned.u8
uip_buf_t ip64_packet_buffer_aligned
uint16_t ip64_packet_buffer_maxlen = BUFSIZE

Referenced by PROCESS_THREAD().

struct uip_fallback_interface ip64_uip_fallback_interface
Initial value:
= {
}
static void interface_output(void)
Definition: ip64.c:906
static void interface_init(void)
Definition: ip64.c:900
uint16_t ipid
static
uip_ip4addr_t ipv4_broadcast_addr
static
uip_ip6addr_t ipv6_local_address
static
uint8_t ipv6_local_address_configured = 0
static