mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-15 19:34:03 +00:00
esp-netif: Added API to get the underlying interface name
The interface name can be used in socket API, i.e. setsockopt(). The API esp_netif_get_netif_impl_name() shoudl be used to populate standard interface structure struct ifreq.
This commit is contained in:
@@ -402,6 +402,22 @@ esp_err_t esp_netif_set_old_ip_info(esp_netif_t *esp_netif, const esp_netif_ip_i
|
||||
*/
|
||||
int esp_netif_get_netif_impl_index(esp_netif_t *esp_netif);
|
||||
|
||||
/**
|
||||
* @brief Get net interface name from network stack implementation
|
||||
*
|
||||
* @note This name could be used in `setsockopt()` to bind socket with appropriate interface
|
||||
*
|
||||
* @param[in] esp_netif Handle to esp-netif instance
|
||||
* @param[out] name Interface name as specified in underlying TCP/IP stack. Note that the
|
||||
* actual name will be copied to the specified buffer, which must be allocated to hold
|
||||
* maximum interface name size (6 characters for lwIP)
|
||||
*
|
||||
* @return
|
||||
* - ESP_OK
|
||||
* - ESP_ERR_ESP_NETIF_INVALID_PARAMS
|
||||
*/
|
||||
esp_err_t esp_netif_get_netif_impl_name(esp_netif_t *esp_netif, char* name);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user