#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 |
Referenced by ip64_arp_create_arp_request().
#define ARP_REPLY 2 |
Referenced by ip64_arp_arp_input().
#define ARP_REQUEST 1 |
Referenced by ip64_arp_arp_input(), and ip64_arp_create_arp_request().
#define printf | ( | ... | ) |
#define PRINTF | ( | ... | ) |
|
static |
References uip_eth_addr::addr, arp_table, arptime, c, arp_entry::ethaddr, i, arp_entry::ipaddr, arp_entry::time, UIP_ARPTAB_SIZE, uip_ip4addr_cmp, and uip_ip4addr_copy.
Referenced by ip64_arp_arp_input().
uint16_t ip64_arp_arp_input | ( | const uint8_t * | packet, |
uint16_t | packet_len | ||
) |
References ip64_eth_addr::addr, uip_eth_addr::addr, ARP_REPLY, ARP_REQUEST, arp_update(), ip64_eth_hdr::dest, arp_hdr::dhwaddr, arp_hdr::dipaddr, arp_hdr::ethhdr, IP64_ETH_TYPE_ARP, ip64_get_hostaddr(), arp_hdr::opcode, printf, arp_hdr::shwaddr, arp_hdr::sipaddr, ip64_eth_hdr::src, ip64_eth_hdr::type, uip_ip4addr_t::u8, UIP_HTONS, uip_ip4addr_cmp, and uip_ip4addr_copy.
Referenced by ip64_eth_interface_input().
int ip64_arp_check_cache | ( | const uint8_t * | nlhdr | ) |
References arp_table, ipv4_hdr::destipaddr, i, ip64_get_draddr(), ip64_get_hostaddr(), ip64_get_netmask(), arp_entry::ipaddr, ipaddr, printf, uip_ip4addr_t::u8, UIP_ARPTAB_SIZE, uip_ip4addr_cmp, uip_ip4addr_copy, uip_ipaddr, uip_ipaddr_maskcmp, and uip_ipaddr_to_quad.
Referenced by output().
int ip64_arp_create_arp_request | ( | uint8_t * | llhdr, |
const uint8_t * | nlhdr | ||
) |
References ip64_eth_addr::addr, uip_eth_addr::addr, ARP_HWTYPE_ETH, ARP_REQUEST, ip64_eth_hdr::dest, ipv4_hdr::destipaddr, arp_hdr::dhwaddr, arp_hdr::dipaddr, arp_hdr::ethhdr, arp_hdr::hwlen, arp_hdr::hwtype, IP64_ETH_TYPE_ARP, IP64_ETH_TYPE_IP, ip64_get_draddr(), ip64_get_hostaddr(), ip64_get_netmask(), ipaddr, arp_hdr::opcode, arp_hdr::protocol, arp_hdr::protolen, arp_hdr::shwaddr, arp_hdr::sipaddr, ip64_eth_hdr::src, ip64_eth_hdr::type, uip_appdata, uip_buf, UIP_HTONS, uip_ip4addr_copy, uip_ipaddr_maskcmp, UIP_LLH_LEN, and UIP_TCPIP_HLEN.
Referenced by output().
int ip64_arp_create_ethhdr | ( | uint8_t * | llhdr, |
const uint8_t * | nlhdr | ||
) |
References ip64_eth_addr::addr, uip_eth_addr::addr, arp_table, ip64_eth_hdr::dest, ipv4_hdr::destipaddr, arp_entry::ethaddr, i, IP64_ETH_TYPE_IP, ip64_get_draddr(), ip64_get_hostaddr(), ip64_get_netmask(), arp_entry::ipaddr, ipaddr, ip64_eth_hdr::src, ip64_eth_hdr::type, uip_ip4addr_t::u8, UIP_ARPTAB_SIZE, UIP_HTONS, uip_ip4addr_cmp, uip_ip4addr_copy, uip_ipaddr, and uip_ipaddr_maskcmp.
Referenced by output().
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.
|
static |
Referenced by arp_update(), ip64_arp_check_cache(), ip64_arp_create_ethhdr(), ip64_arp_init(), and ip64_arp_timer().
|
static |
Referenced by arp_update(), and ip64_arp_timer().
|
static |
|
static |
|
static |