ETHFW API Guide

Introduction

Functions

int32_t EthFwArp_getHwAddr (const ip4_addr_t *ipAddr, struct eth_addr *hwAddr, uint16_t vlanId)
 Get MAC address corresponding to a registered client's IPv4 address. More...
 
void EthFwArp_sendRaw (struct netif *netif, const struct eth_addr *ethSrcAddr, const struct eth_addr *ethDstAddr, const struct eth_addr *hwSrcAddr, const ip4_addr_t *ipSrcAddr, const struct eth_addr *hwDstAddr, const ip4_addr_t *ipDstAddr, uint16_t vlanId, const u16_t opcode)
 Sends ARP response on behalf of a registered remote client. More...
 

Function Documentation

◆ EthFwArp_getHwAddr()

int32_t EthFwArp_getHwAddr ( const ip4_addr_t *  ipAddr,
struct eth_addr *  hwAddr,
uint16_t  vlanId 
)

Get MAC address corresponding to a registered client's IPv4 address.

Get the MAC address of a remote client that has previously registered its MAC address and IPv4 address with Ethernet Firmware through ETHREMOTECFG_CMD_REGISTER_IPv4 command.

Parameters
ipAddrIPv4 address
hwAddrMAC address corresponding to the IPv4 (if registered)
vlanIdVLAN id
Returns
ETHFW_SOK if IPv4 address was registered, or a negative error code otherwise.

◆ EthFwArp_sendRaw()

void EthFwArp_sendRaw ( struct netif *  netif,
const struct eth_addr *  ethSrcAddr,
const struct eth_addr *  ethDstAddr,
const struct eth_addr *  hwSrcAddr,
const ip4_addr_t *  ipSrcAddr,
const struct eth_addr *  hwDstAddr,
const ip4_addr_t *  ipDstAddr,
uint16_t  vlanId,
const u16_t  opcode 
)

Sends ARP response on behalf of a registered remote client.

Sends an ARP response on behalf of a remote client that has previously registers its MAC address and IPv4 address with Ethernet Firmware through ETHREMOTECFG_CMD_REGISTER_IPv4 command.

This function is based on lwIP's etharp_raw().

Parameters
netifEnet netif on which ARP response will be sent
ethSrcAddrSource MAC address for the Ethernet header
ethDstAddrDestination MAC address for the Ethernet header
hwSrcAddrSource MAC address for the ARP protocol header
ipSrcAddrSource IP address for the ARP protocol header
hwDstAddrDestination MAC address for the ARP protocol header
ipDstAddrDestination IP address for the ARP protocol header
vlanIdVLAN id
opcodeType of the ARP packet