[6319] | 1 | /** @file wlan_exp_ip_udp_arp.h |
---|
| 2 | * @brief Mango wlan_exp IP/UDP Library (Internal Structures / Functions) |
---|
| 3 | * |
---|
| 4 | * @copyright Copyright 2014-2019, Mango Communications. All rights reserved. |
---|
| 5 | * Distributed under the Mango Reference Design license (https://mangocomm.com/802.11/license) |
---|
| 6 | */ |
---|
| 7 | #ifndef WLAN_EXP_IP_UDP_ARP_H_ |
---|
| 8 | #define WLAN_EXP_IP_UDP_ARP_H_ |
---|
| 9 | |
---|
| 10 | #include "wlan_mac_high_sw_config.h" |
---|
| 11 | |
---|
| 12 | #if WLAN_SW_CONFIG_ENABLE_WLAN_EXP |
---|
| 13 | |
---|
| 14 | #include "wlan_exp_ip_udp.h" |
---|
| 15 | |
---|
| 16 | // Forward declarations |
---|
| 17 | struct eth_rx_queue_buffer_t; |
---|
| 18 | struct eth_tx_queue_buffer_t; |
---|
| 19 | |
---|
| 20 | // ARP Table entry |
---|
| 21 | typedef struct arp_cache_entry_t{ |
---|
| 22 | u32 age; // Age that increments on receptions and is reset when a cache entry is confirmed |
---|
| 23 | // Since the cache size is limited, age is used to determine which entry should be |
---|
| 24 | // overwritten once the cache is full. |
---|
| 25 | u16 state; // ARP_TABLE_USED or ARP_TABLE_UNUSED |
---|
| 26 | u8 haddr[ETH_ADDR_LEN]; // 6-byte MAC address |
---|
| 27 | u8 paddr[IP_ADDR_LEN]; // 4-byte IPv4 address |
---|
| 28 | } arp_cache_entry_t; |
---|
| 29 | |
---|
| 30 | void arp_init_cache(); |
---|
| 31 | int arp_process_packet(struct eth_rx_queue_buffer_t* eth_rx_queue_buffer, struct eth_tx_queue_buffer_t* eth_tx_queue_buffer); |
---|
| 32 | int arp_update_cache(u8* hw_addr, u8* ip_addr); |
---|
| 33 | int arp_get_hw_addr(u8* hw_addr, u8* ip_addr); |
---|
| 34 | |
---|
| 35 | #endif //WLAN_SW_CONFIG_ENABLE_WLAN_EXP |
---|
| 36 | #endif /* WLAN_EXP_IP_UDP_ARP_H_ */ |
---|