Microchip® Advanced Software Framework

uip-fw.c File Reference

uIP packet forwarding.

Author
Adam Dunkels adam@.nosp@m.sics.nosp@m..se

This file implements a number of simple functions which do packet forwarding over multiple network interfaces with uIP.

#include <string.h>
#include "contiki-conf.h"
#include "net/ip/uip.h"
#include "net/ip/uip_arch.h"
#include "net/ipv4/uip-fw.h"

Data Structures

struct  fwcache_entry
 
struct  icmpip_hdr
 
struct  tcpip_hdr
 

Macros

#define BUF   ((struct tcpip_hdr *)&uip_buf[UIP_LLH_LEN])
 
#define FW_TIME   20
 
#define FWCACHE_SIZE   2
 
#define ICMP_ECHO   8
 
#define ICMP_TE   11
 
#define ICMPBUF   ((struct icmpip_hdr *)&uip_buf[UIP_LLH_LEN])
 
#define notdef   0
 

Functions

static struct uip_fw_netiffind_netif (void)
 
static void fwcache_register (void)
 
static unsigned char ipaddr_maskcmp (uip_ipaddr_t *ipaddr, uip_ipaddr_t *netipaddr, uip_ipaddr_t *netmask)
 
static void time_exceeded (void)
 
void uip_fw_default (struct uip_fw_netif *netif)
 Register a default network interface. More...
 
uint8_t uip_fw_forward (void)
 Forward an IP packet in the uip_buf buffer. More...
 
void uip_fw_init (void)
 Initialize the uIP packet forwarding module. More...
 
uint8_t uip_fw_output (void)
 Output an IP packet on the correct network interface. More...
 
void uip_fw_periodic (void)
 Perform periodic processing. More...
 
void uip_fw_register (struct uip_fw_netif *netif)
 Register a network interface with the forwarding module. More...
 

Variables

static struct uip_fw_netifdefaultnetif = NULL
 
static struct fwcache_entry fwcache [FWCACHE_SIZE]
 
static struct uip_fw_netifnetifs = NULL