/** @file wlan_exp_ip_udp_arp.h * @brief Mango wlan_exp IP/UDP Library (Internal Structures / Functions) * * @copyright Copyright 2014-2019, Mango Communications. All rights reserved. * Distributed under the Mango Reference Design license (https://mangocomm.com/802.11/license) */ #ifndef WLAN_EXP_IP_UDP_ARP_H_ #define WLAN_EXP_IP_UDP_ARP_H_ #include "wlan_mac_high_sw_config.h" #if WLAN_SW_CONFIG_ENABLE_WLAN_EXP #include "wlan_exp_ip_udp.h" // Forward declarations struct eth_rx_queue_buffer_t; struct eth_tx_queue_buffer_t; // ARP Table entry typedef struct arp_cache_entry_t{ u32 age; // Age that increments on receptions and is reset when a cache entry is confirmed // Since the cache size is limited, age is used to determine which entry should be // overwritten once the cache is full. u16 state; // ARP_TABLE_USED or ARP_TABLE_UNUSED u8 haddr[ETH_ADDR_LEN]; // 6-byte MAC address u8 paddr[IP_ADDR_LEN]; // 4-byte IPv4 address } arp_cache_entry_t; void arp_init_cache(); int arp_process_packet(struct eth_rx_queue_buffer_t* eth_rx_queue_buffer, struct eth_tx_queue_buffer_t* eth_tx_queue_buffer); int arp_update_cache(u8* hw_addr, u8* ip_addr); int arp_get_hw_addr(u8* hw_addr, u8* ip_addr); #endif //WLAN_SW_CONFIG_ENABLE_WLAN_EXP #endif /* WLAN_EXP_IP_UDP_ARP_H_ */