By default, esp-idf or the Arduino framework handles incoming Ethernet packets using the
static esp_err_t eth_input_to_netif(esp_eth_handle_t eth_handle, uint8_t *buffer, uint32_t length, void *priv);
function in components/esp_eth/src/esp_eth_netif_glue.c
which (besides calling just calls the exported functionesp_netif_receive()
:
static esp_err_t eth_input_to_netif(esp_eth_handle_t eth_handle, uint8_t *buffer, uint32_t length, void *priv) { return esp_netif_receive((esp_netif_t *)priv, buffer, length, NULL); }
The function esp_netif_receive()
is declared in esp_netif.h
and implemented in esp_netif_lwip.c
.
This function will call esp_netif->lwip_input_fn(...)
on the packet, which will in turn call the interface-type specific .input_fn(...)
, which is one of
or for wrapped interfaces:
esp_netif_lwip_slip_input
esp_netif_lwip_ppp_input