Microchip® Advanced Software Framework

ip64-arp.c File Reference
#include "ip64.h"
#include "ip64-eth.h"
#include "ip64-arp.h"
#include <string.h>
#include <stdio.h>

Data Structures

struct  arp_entry
 
struct  arp_hdr
 
struct  ethip_hdr
 
struct  ipv4_hdr
 

Macros

#define _DEBUG_   0
 
#define ARP_HWTYPE_ETH   1
 
#define ARP_REPLY   2
 
#define ARP_REQUEST   1
 
#define printf(...)
 
#define PRINTF(...)
 

Functions

static void arp_update (uip_ip4addr_t *ipaddr, struct uip_eth_addr *ethaddr)
 
uint16_t ip64_arp_arp_input (const uint8_t *packet, uint16_t packet_len)
 
int ip64_arp_check_cache (const uint8_t *nlhdr)
 
int ip64_arp_create_arp_request (uint8_t *llhdr, const uint8_t *nlhdr)
 
int ip64_arp_create_ethhdr (uint8_t *llhdr, const uint8_t *nlhdr)
 
void ip64_arp_init (void)
 Initialize the ARP module. More...
 
void ip64_arp_timer (void)
 Periodic ARP processing function. More...
 

Variables

static struct arp_entry arp_table [UIP_ARPTAB_SIZE]
 
static uint8_t arptime
 
static struct ip64_eth_addr broadcast_ethaddr
 
static const uint16_t broadcast_ipaddr [2] = {0xffff,0xffff}
 
static uint8_t tmpage
 
const uip_ipaddr_t uip_all_zeroes_addr
 

#define _DEBUG_   0
#define ARP_HWTYPE_ETH   1
#define ARP_REPLY   2

Referenced by ip64_arp_arp_input().

#define ARP_REQUEST   1
#define printf (   ...)
#define PRINTF (   ...)

static void arp_update ( uip_ip4addr_t ipaddr,
struct uip_eth_addr ethaddr 
)
static
void ip64_arp_init ( void  )

Initialize the ARP module.

References arp_table, i, ipaddr, and UIP_ARPTAB_SIZE.

void ip64_arp_timer ( void  )

Periodic ARP processing function.

This function performs periodic timer processing in the ARP module and should be called at regular intervals. The recommended interval is 10 seconds between the calls.

References arp_table, arptime, i, arp_entry::ipaddr, arp_entry::time, UIP_ARP_MAXAGE, UIP_ARPTAB_SIZE, and uip_ip4addr_cmp.

uint8_t arptime
static

Referenced by arp_update(), and ip64_arp_timer().

struct ip64_eth_addr broadcast_ethaddr
static
Initial value:
=
{{0xff,0xff,0xff,0xff,0xff,0xff}}
const uint16_t broadcast_ipaddr[2] = {0xffff,0xffff}
static
uint8_t tmpage
static