RetroArch
|
Go to the source code of this file.
Classes | |
struct | eth_addr |
struct | eth_hdr |
struct | etharp_hdr |
struct | ethip_hdr |
Macros | |
#define | ETH_PAD_SIZE 0 |
#define | ARP_TMR_INTERVAL 5000 |
#define | ETHTYPE_ARP 0x0806 |
#define | ETHTYPE_IP 0x0800 |
Functions | |
void | etharp_init (void) |
void | etharp_tmr (void) |
void | etharp_ip_input (struct netif *netif, struct pbuf *p) |
void | etharp_arp_input (struct netif *netif, struct eth_addr *ethaddr, struct pbuf *p) |
err_t | etharp_output (struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q) |
err_t | etharp_query (struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q) |
err_t | etharp_request (struct netif *netif, struct ip_addr *ipaddr) |
Variables | |
PACK_STRUCT_BEGIN struct eth_addr | PACK_STRUCT_STRUCT |
#define ARP_TMR_INTERVAL 5000 |
5 seconds period
#define ETH_PAD_SIZE 0 |
#define ETHTYPE_ARP 0x0806 |
#define ETHTYPE_IP 0x0800 |
Responds to ARP requests to us. Upon ARP replies to us, add entry to cache send out queued IP packets. Updates cache with snooped address pairs.
Should be called for incoming ARP packets. The pbuf in the argument is freed by this function.
netif | The lwIP network interface on which the ARP packet pbuf arrived. |
pbuf | The ARP packet that arrived on netif. Is freed by this function. |
ethaddr | Ethernet address of netif. |
Updates the ARP table using the given IP packet.
Uses the incoming IP packet's source address to update the ARP cache for the local network. The function does not alter or free the packet. This function must be called before the packet p is passed to the IP layer.
netif | The lwIP network interface on which the IP packet pbuf arrived. |
pbuf | The IP packet that arrived on netif. |
Resolve and fill-in Ethernet address header for outgoing packet.
For IP multicast and broadcast, corresponding Ethernet addresses are selected and the packet is transmitted on the link.
For unicast addresses, the packet is submitted to etharp_query(). In case the IP address is outside the local network, the IP address of the gateway is used.
netif | The lwIP network interface which the IP packet will be sent on. |
ipaddr | The IP address of the packet destination. |
pbuf | The pbuf(s) containing the IP packet to be sent. |
Send an ARP request for the given IP address and/or queue a packet.
If the IP address was not yet in the cache, a pending ARP cache entry is added and an ARP request is sent for the given address. The packet is queued on this entry.
If the IP address was already pending in the cache, a new ARP request is sent for the given address. The packet is queued on this entry.
If the IP address was already stable in the cache, and a packet is given, it is directly sent and no ARP request is sent out.
If the IP address was already stable in the cache, and no packet is given, an ARP request is sent out.
netif | The lwIP network interface on which ipaddr must be queried for. |
ipaddr | The IP address to be resolved. |
q | If non-NULL, a pbuf that must be delivered to the IP address. q is not freed by this function. |
Clears expired entries in the ARP table.
This function should be called every ETHARP_TMR_INTERVAL microseconds (5 seconds), in order to expire entries in the ARP table.
PACK_STRUCT_END PACK_STRUCT_BEGIN struct ethip_hdr PACK_STRUCT_STRUCT |