|
|
|
@@ -40,8 +40,10 @@
|
|
|
|
|
#endif // CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT
|
|
|
|
|
|
|
|
|
|
#include "esp_netif_lwip_ppp.h"
|
|
|
|
|
#if ESP_DHCPS
|
|
|
|
|
#include "dhcpserver/dhcpserver.h"
|
|
|
|
|
#include "dhcpserver/dhcpserver_options.h"
|
|
|
|
|
#endif
|
|
|
|
|
#include "netif/dhcp_state.h"
|
|
|
|
|
#include "esp_event.h"
|
|
|
|
|
#include "esp_log.h"
|
|
|
|
@@ -75,6 +77,26 @@
|
|
|
|
|
return esp_netif_lwip_ipc_call(function, netif, (void *)(param)); \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Utility macros to convert esp-ip addresses (both IPv6+IPv4 versions unconditionally)
|
|
|
|
|
* and lwip-ip addresses (contain only enabled portion of the address for each IP stack)
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#if LWIP_IPV4 && LWIP_IPV6
|
|
|
|
|
#define ESPIP_TO_IP(espip, ip) memcpy((ip), (espip), sizeof(ip_addr_t));
|
|
|
|
|
#define IP_TO_ESPIP(ip, espip) memcpy((espip), (ip), sizeof(ip_addr_t));
|
|
|
|
|
#elif LWIP_IPV4
|
|
|
|
|
#define ESPIP_TO_IP(espip, ip) memcpy((ip), &((espip)->u_addr.ip4), sizeof(ip_addr_t));
|
|
|
|
|
#define IP_TO_ESPIP(ip, espip) do { memcpy(&((espip)->u_addr.ip4), (ip), sizeof(ip4_addr_t)); \
|
|
|
|
|
(espip)->type = ESP_IPADDR_TYPE_V4; \
|
|
|
|
|
} while(0)
|
|
|
|
|
#elif LWIP_IPV6
|
|
|
|
|
#define ESPIP_TO_IP(espip, ip) memcpy((ip), &((espip)->u_addr.ip6), sizeof(ip_addr_t));
|
|
|
|
|
#define IP_TO_ESPIP(ip, espip) do { memcpy(&((espip)->u_addr.ip6), (ip), sizeof(ip6_addr_t)); \
|
|
|
|
|
(espip)->type = ESP_IPADDR_TYPE_V6; \
|
|
|
|
|
} while(0)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief If netif protocol not enabled in menuconfig, log the error and return appropriate code indicating failure
|
|
|
|
|
*/
|
|
|
|
@@ -107,16 +129,20 @@ static esp_netif_t *s_last_default_esp_netif = NULL;
|
|
|
|
|
static bool s_is_last_default_esp_netif_overridden = false;
|
|
|
|
|
static netif_ext_callback_t netif_callback = { .callback_fn = NULL, .next = NULL };
|
|
|
|
|
|
|
|
|
|
#if LWIP_IPV4
|
|
|
|
|
static void esp_netif_internal_dhcpc_cb(struct netif *netif);
|
|
|
|
|
#endif
|
|
|
|
|
#if LWIP_IPV6
|
|
|
|
|
static void esp_netif_internal_nd6_cb(struct netif *p_netif, uint8_t ip_index);
|
|
|
|
|
#endif /* LWIP_IPV6 */
|
|
|
|
|
|
|
|
|
|
static void netif_callback_fn(struct netif* netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t* args)
|
|
|
|
|
{
|
|
|
|
|
#if LWIP_IPV4
|
|
|
|
|
if (reason & DHCP_CB_CHANGE) {
|
|
|
|
|
esp_netif_internal_dhcpc_cb(netif);
|
|
|
|
|
}
|
|
|
|
|
#endif /* LWIP_IPV4 */
|
|
|
|
|
#if LWIP_IPV6
|
|
|
|
|
if ((reason & LWIP_NSC_IPV6_ADDR_STATE_CHANGED) && (args != NULL)) {
|
|
|
|
|
s8_t addr_idx = args->ipv6_addr_state_changed.addr_index;
|
|
|
|
@@ -152,19 +178,6 @@ static esp_err_t remove_lwip_netif_callback(struct esp_netif_api_msg_s *msg)
|
|
|
|
|
return ESP_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void dns_clear_servers(bool keep_fallback)
|
|
|
|
|
{
|
|
|
|
|
u8_t numdns = 0;
|
|
|
|
|
|
|
|
|
|
for (numdns = 0; numdns < DNS_MAX_SERVERS; numdns ++) {
|
|
|
|
|
if (keep_fallback && numdns == DNS_FALLBACK_SERVER_INDEX) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dns_setserver(numdns, NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_LWIP_GARP_TMR_INTERVAL
|
|
|
|
|
|
|
|
|
|
static void netif_send_garp(void *arg)
|
|
|
|
@@ -436,6 +449,7 @@ esp_err_t esp_netif_bridge_fdb_remove(esp_netif_t *esp_netif_br, uint8_t *addr)
|
|
|
|
|
}
|
|
|
|
|
#endif // CONFIG_ESP_NETIF_BRIDGE_EN
|
|
|
|
|
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
void esp_netif_set_ip4_addr(esp_ip4_addr_t *addr, uint8_t a, uint8_t b, uint8_t c, uint8_t d)
|
|
|
|
|
{
|
|
|
|
|
ip4_addr_t *address = (ip4_addr_t*)addr;
|
|
|
|
@@ -451,6 +465,7 @@ uint32_t esp_ip4addr_aton(const char *addr)
|
|
|
|
|
{
|
|
|
|
|
return ipaddr_addr(addr);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
esp_err_t esp_netif_str_to_ip4(const char *src, esp_ip4_addr_t *dst)
|
|
|
|
|
{
|
|
|
|
@@ -579,6 +594,7 @@ static esp_err_t esp_netif_init_configuration(esp_netif_t *esp_netif, const esp_
|
|
|
|
|
|
|
|
|
|
// Configure general esp-netif properties
|
|
|
|
|
memcpy(esp_netif->mac, cfg->base->mac, NETIF_MAX_HWADDR_LEN);
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
if (cfg->base->ip_info == NULL) {
|
|
|
|
|
ip4_addr_set_zero(&esp_netif->ip_info->ip);
|
|
|
|
|
ip4_addr_set_zero(&esp_netif->ip_info->gw);
|
|
|
|
@@ -587,7 +603,7 @@ static esp_err_t esp_netif_init_configuration(esp_netif_t *esp_netif, const esp_
|
|
|
|
|
memcpy(esp_netif->ip_info, cfg->base->ip_info, sizeof(esp_netif_ip_info_t));
|
|
|
|
|
}
|
|
|
|
|
memcpy(esp_netif->ip_info_old, esp_netif->ip_info, sizeof(esp_netif_ip_info_t));
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
// Setup main config parameters
|
|
|
|
|
esp_netif->lost_ip_event = cfg->base->lost_ip_event;
|
|
|
|
|
esp_netif->get_ip_event = cfg->base->get_ip_event;
|
|
|
|
@@ -786,7 +802,9 @@ static void esp_netif_lwip_remove(esp_netif_t *esp_netif)
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
if (esp_netif->flags & ESP_NETIF_DHCP_CLIENT) {
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
dhcp_cleanup(esp_netif->lwip_netif);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@@ -828,8 +846,12 @@ static esp_err_t esp_netif_lwip_add(esp_netif_t *esp_netif)
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
#endif // CONFIG_ESP_NETIF_BRIDGE_EN
|
|
|
|
|
if (NULL == netif_add(esp_netif->lwip_netif, (struct ip4_addr*)&esp_netif->ip_info->ip,
|
|
|
|
|
(struct ip4_addr*)&esp_netif->ip_info->netmask, (struct ip4_addr*)&esp_netif->ip_info->gw,
|
|
|
|
|
if (NULL == netif_add(esp_netif->lwip_netif,
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
(struct ip4_addr*)&esp_netif->ip_info->ip,
|
|
|
|
|
(struct ip4_addr*)&esp_netif->ip_info->netmask,
|
|
|
|
|
(struct ip4_addr*)&esp_netif->ip_info->gw,
|
|
|
|
|
#endif
|
|
|
|
|
esp_netif, esp_netif->lwip_init_fn, tcpip_input)) {
|
|
|
|
|
esp_netif_lwip_remove(esp_netif);
|
|
|
|
|
return ESP_ERR_ESP_NETIF_IF_NOT_READY;
|
|
|
|
@@ -907,6 +929,7 @@ esp_err_t esp_netif_set_driver_config(esp_netif_t *esp_netif,
|
|
|
|
|
return ESP_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
static esp_err_t esp_netif_reset_ip_info(esp_netif_t *esp_netif)
|
|
|
|
|
{
|
|
|
|
|
ip4_addr_set_zero(&(esp_netif->ip_info->ip));
|
|
|
|
@@ -914,6 +937,7 @@ static esp_err_t esp_netif_reset_ip_info(esp_netif_t *esp_netif)
|
|
|
|
|
ip4_addr_set_zero(&(esp_netif->ip_info->netmask));
|
|
|
|
|
return ESP_OK;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
esp_err_t esp_netif_set_mac_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
{
|
|
|
|
@@ -1051,6 +1075,7 @@ static esp_err_t esp_netif_start_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
LOG_NETIF_DISABLED_AND_DO("DHCP Server", return ESP_ERR_NOT_SUPPORTED);
|
|
|
|
|
#endif
|
|
|
|
|
} else if (esp_netif->flags & ESP_NETIF_DHCP_CLIENT) {
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
if (esp_netif->dhcpc_status != ESP_NETIF_DHCP_STARTED) {
|
|
|
|
|
if (p_netif != NULL) {
|
|
|
|
|
struct dhcp *dhcp_data = NULL;
|
|
|
|
@@ -1064,6 +1089,9 @@ static esp_err_t esp_netif_start_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
LOG_NETIF_DISABLED_AND_DO("IPv4's DHCP Client", return ESP_ERR_NOT_SUPPORTED);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
esp_netif_update_default_netif(esp_netif, ESP_NETIF_STARTED);
|
|
|
|
@@ -1110,6 +1138,7 @@ static esp_err_t esp_netif_stop_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
LOG_NETIF_DISABLED_AND_DO("DHCP Server", return ESP_ERR_NOT_SUPPORTED);
|
|
|
|
|
#endif
|
|
|
|
|
} else if (esp_netif->flags & ESP_NETIF_DHCP_CLIENT) {
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
dhcp_release(lwip_netif);
|
|
|
|
|
dhcp_stop(lwip_netif);
|
|
|
|
|
dhcp_cleanup(lwip_netif);
|
|
|
|
@@ -1117,6 +1146,9 @@ static esp_err_t esp_netif_stop_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
esp_netif->dhcpc_status = ESP_NETIF_DHCP_INIT;
|
|
|
|
|
|
|
|
|
|
esp_netif_reset_ip_info(esp_netif);
|
|
|
|
|
#else
|
|
|
|
|
LOG_NETIF_DISABLED_AND_DO("IPv4's DHCP Client", return ESP_ERR_NOT_SUPPORTED);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
netif_set_down(lwip_netif);
|
|
|
|
@@ -1176,6 +1208,7 @@ esp_err_t esp_netif_receive(esp_netif_t *esp_netif, void *buffer, size_t len, vo
|
|
|
|
|
return ESP_OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
static esp_err_t esp_netif_start_ip_lost_timer(esp_netif_t *esp_netif);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
@@ -1272,7 +1305,6 @@ static void esp_netif_ip_lost_timer(void *arg)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static esp_err_t esp_netif_start_ip_lost_timer(esp_netif_t *esp_netif)
|
|
|
|
|
{
|
|
|
|
|
esp_netif_ip_info_t *ip_info_old = esp_netif->ip_info;
|
|
|
|
@@ -1337,6 +1369,19 @@ static esp_err_t esp_netif_dhcpc_stop_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
|
|
|
|
|
esp_err_t esp_netif_dhcpc_stop(esp_netif_t *esp_netif) _RUN_IN_LWIP_TASK_IF_SUPPORTED(esp_netif_dhcpc_stop_api, esp_netif, NULL)
|
|
|
|
|
|
|
|
|
|
static void dns_clear_servers(bool keep_fallback)
|
|
|
|
|
{
|
|
|
|
|
u8_t numdns = 0;
|
|
|
|
|
|
|
|
|
|
for (numdns = 0; numdns < DNS_MAX_SERVERS; numdns ++) {
|
|
|
|
|
if (keep_fallback && numdns == DNS_FALLBACK_SERVER_INDEX) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dns_setserver(numdns, NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static esp_err_t esp_netif_dhcpc_start_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
{
|
|
|
|
|
esp_netif_t *esp_netif = msg->esp_netif;
|
|
|
|
@@ -1388,6 +1433,7 @@ static esp_err_t esp_netif_dhcpc_start_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
esp_err_t esp_netif_dhcpc_start(esp_netif_t *esp_netif) _RUN_IN_LWIP_TASK_IF_SUPPORTED(esp_netif_dhcpc_start_api, esp_netif, NULL)
|
|
|
|
|
#endif /* CONFIG_LWIP_IPV4 */
|
|
|
|
|
|
|
|
|
|
#if ESP_DHCPS
|
|
|
|
|
esp_err_t esp_netif_dhcps_get_status(esp_netif_t *esp_netif, esp_netif_dhcp_status_t *status)
|
|
|
|
@@ -1556,8 +1602,10 @@ static esp_err_t esp_netif_up_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
|
|
|
|
|
struct netif *lwip_netif = esp_netif->lwip_netif;
|
|
|
|
|
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
/* use last obtained ip, or static ip */
|
|
|
|
|
netif_set_addr(lwip_netif, (ip4_addr_t*)&esp_netif->ip_info->ip, (ip4_addr_t*)&esp_netif->ip_info->netmask, (ip4_addr_t*)&esp_netif->ip_info->gw);
|
|
|
|
|
#endif
|
|
|
|
|
netif_set_up(lwip_netif);
|
|
|
|
|
netif_set_link_up(lwip_netif);
|
|
|
|
|
|
|
|
|
@@ -1581,11 +1629,13 @@ static esp_err_t esp_netif_down_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
struct netif *lwip_netif = esp_netif->lwip_netif;
|
|
|
|
|
|
|
|
|
|
if (esp_netif->flags & ESP_NETIF_DHCP_CLIENT && esp_netif->dhcpc_status == ESP_NETIF_DHCP_STARTED) {
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
dhcp_stop(esp_netif->lwip_netif);
|
|
|
|
|
|
|
|
|
|
esp_netif->dhcpc_status = ESP_NETIF_DHCP_INIT;
|
|
|
|
|
|
|
|
|
|
esp_netif_reset_ip_info(esp_netif);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
#if CONFIG_LWIP_IPV6
|
|
|
|
|
for(int8_t i = 0 ;i < LWIP_IPV6_NUM_ADDRESSES ;i++) {
|
|
|
|
@@ -1595,12 +1645,16 @@ static esp_err_t esp_netif_down_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
netif_ip6_addr_set_state(lwip_netif, i, IP6_ADDR_INVALID);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
netif_set_addr(lwip_netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4);
|
|
|
|
|
#endif
|
|
|
|
|
netif_set_down(lwip_netif);
|
|
|
|
|
netif_set_link_down(lwip_netif);
|
|
|
|
|
|
|
|
|
|
if (esp_netif->flags & ESP_NETIF_DHCP_CLIENT) {
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
esp_netif_start_ip_lost_timer(esp_netif);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
esp_netif_update_default_netif(esp_netif, ESP_NETIF_STOPPED);
|
|
|
|
@@ -1626,6 +1680,7 @@ bool esp_netif_is_netif_up(esp_netif_t *esp_netif)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
esp_err_t esp_netif_get_old_ip_info(esp_netif_t *esp_netif, esp_netif_ip_info_t *ip_info)
|
|
|
|
|
{
|
|
|
|
|
ESP_LOGD(TAG, "%s esp_netif:%p", __func__, esp_netif);
|
|
|
|
@@ -1746,6 +1801,7 @@ static esp_err_t esp_netif_set_ip_info_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
esp_err_t esp_netif_set_ip_info(esp_netif_t *esp_netif, const esp_netif_ip_info_t *ip_info) _RUN_IN_LWIP_TASK_IF_SUPPORTED(esp_netif_set_ip_info_api, esp_netif, ip_info)
|
|
|
|
|
#endif /* CONFIG_LWIP_IPV4 */
|
|
|
|
|
|
|
|
|
|
struct array_mac_ip_t {
|
|
|
|
|
int num;
|
|
|
|
@@ -1786,12 +1842,8 @@ static esp_err_t esp_netif_set_dns_info_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
|
|
|
|
|
ESP_LOGD(TAG, "esp_netif_set_dns_info: if=%p type=%d dns=%x", esp_netif, type, dns->ip.u_addr.ip4.addr);
|
|
|
|
|
|
|
|
|
|
ip_addr_t *lwip_ip = (ip_addr_t*)&dns->ip;
|
|
|
|
|
#if CONFIG_LWIP_IPV6 && LWIP_IPV4
|
|
|
|
|
if (!IP_IS_V4(lwip_ip) && !IP_IS_V6(lwip_ip)) {
|
|
|
|
|
lwip_ip->type = IPADDR_TYPE_V4;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
ip_addr_t lwip_ip = {};
|
|
|
|
|
ESPIP_TO_IP(&dns->ip, &lwip_ip);
|
|
|
|
|
if (esp_netif->flags & ESP_NETIF_DHCP_SERVER) {
|
|
|
|
|
#if ESP_DHCPS
|
|
|
|
|
// if DHCP server configured to set DNS in dhcps API
|
|
|
|
@@ -1799,13 +1851,13 @@ static esp_err_t esp_netif_set_dns_info_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
ESP_LOGD(TAG, "set dns invalid type");
|
|
|
|
|
return ESP_ERR_ESP_NETIF_INVALID_PARAMS;
|
|
|
|
|
} else {
|
|
|
|
|
dhcps_dns_setserver(esp_netif->dhcps, lwip_ip);
|
|
|
|
|
dhcps_dns_setserver(esp_netif->dhcps, &lwip_ip);
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
LOG_NETIF_DISABLED_AND_DO("DHCP Server", return ESP_ERR_NOT_SUPPORTED);
|
|
|
|
|
#endif
|
|
|
|
|
} else {
|
|
|
|
|
dns_setserver(type, lwip_ip);
|
|
|
|
|
dns_setserver(type, &lwip_ip);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ESP_OK;
|
|
|
|
@@ -1822,7 +1874,7 @@ esp_err_t esp_netif_set_dns_info(esp_netif_t *esp_netif, esp_netif_dns_type_t ty
|
|
|
|
|
return ESP_ERR_ESP_NETIF_INVALID_PARAMS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ip4_addr_isany_val(dns->ip.u_addr.ip4)) {
|
|
|
|
|
if (ESP_IP_IS_ANY(dns->ip)) {
|
|
|
|
|
ESP_LOGD(TAG, "set dns invalid dns");
|
|
|
|
|
return ESP_ERR_ESP_NETIF_INVALID_PARAMS;
|
|
|
|
|
}
|
|
|
|
@@ -1856,7 +1908,7 @@ static esp_err_t esp_netif_get_dns_info_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
const ip_addr_t* dns_ip = NULL;
|
|
|
|
|
dns_ip = dns_getserver(type);
|
|
|
|
|
if(dns_ip != NULL) {
|
|
|
|
|
memcpy(&dns->ip, dns_ip, sizeof(ip_addr_t));
|
|
|
|
|
IP_TO_ESPIP(dns_ip, &dns->ip);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -2187,7 +2239,9 @@ esp_err_t esp_netif_dhcps_option(esp_netif_t *esp_netif, esp_netif_dhcp_option_m
|
|
|
|
|
struct dhcp_params opts = { .op = opt_op, .id = opt_id, .len = opt_len, .val = opt_val };
|
|
|
|
|
return esp_netif_lwip_ipc_call(esp_netif_dhcps_option_api, esp_netif, &opts);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#endif // ESP_DHCPS
|
|
|
|
|
|
|
|
|
|
#if CONFIG_LWIP_IPV4
|
|
|
|
|
|
|
|
|
|
esp_err_t esp_netif_dhcpc_option_api(esp_netif_api_msg_t *msg)
|
|
|
|
|
{
|
|
|
|
@@ -2248,6 +2302,8 @@ esp_err_t esp_netif_dhcpc_option(esp_netif_t *esp_netif, esp_netif_dhcp_option_m
|
|
|
|
|
return esp_netif_lwip_ipc_call(esp_netif_dhcpc_option_api, esp_netif, &opts);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* CONFIG_LWIP_IPV4 */
|
|
|
|
|
|
|
|
|
|
int esp_netif_get_netif_impl_index(esp_netif_t *esp_netif)
|
|
|
|
|
{
|
|
|
|
|
if (esp_netif == NULL || esp_netif->lwip_netif == NULL) {
|
|
|
|
|