From 9a08e49ca9481e1bb50b8bc18a1d69b84f15cf64 Mon Sep 17 00:00:00 2001
From: Angus Gratton <angus@espressif.com>
Date: Fri, 7 Dec 2018 18:00:29 +1100
Subject: [PATCH] tcpip_adapter: Rename DHCP option types to include DHCP in
 the type name

---
 components/tcpip_adapter/include/tcpip_adapter.h | 14 ++++++++++----
 components/tcpip_adapter/tcpip_adapter_lwip.c    |  4 ++--
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/components/tcpip_adapter/include/tcpip_adapter.h b/components/tcpip_adapter/include/tcpip_adapter.h
index 9d12a1e99e..6850f23a4a 100644
--- a/components/tcpip_adapter/include/tcpip_adapter.h
+++ b/components/tcpip_adapter/include/tcpip_adapter.h
@@ -126,7 +126,10 @@ typedef enum{
     TCPIP_ADAPTER_OP_SET,           /**< Set option */
     TCPIP_ADAPTER_OP_GET,           /**< Get option */
     TCPIP_ADAPTER_OP_MAX
-} tcpip_adapter_option_mode_t;
+} tcpip_adapter_dhcp_option_mode_t;
+
+/* Deprecated name for tcpip_adapter_dhcp_option_mode_t, to remove after ESP-IDF V4.0 */
+typedef tcpip_adapter_dhcp_option_mode_t tcpip_adapter_option_mode_t;
 
 /** @brief Supported options for DHCP client or DHCP server */
 typedef enum{
@@ -135,7 +138,10 @@ typedef enum{
     TCPIP_ADAPTER_REQUESTED_IP_ADDRESS          = 50,   /**< Request specific IP address */
     TCPIP_ADAPTER_IP_ADDRESS_LEASE_TIME         = 51,   /**< Request IP address lease time */
     TCPIP_ADAPTER_IP_REQUEST_RETRY_TIME         = 52,   /**< Request IP address retry counter */
-} tcpip_adapter_option_id_t;
+} tcpip_adapter_dhcp_option_id_t;
+
+/* Deprecated name for tcpip_adapter_dhcp_option_id_t, to remove after ESP-IDF V4.0 */
+typedef tcpip_adapter_dhcp_option_id_t tcpip_adapter_option_id_t;
 
 /**
  * @brief  Initialize the underlying TCP/IP stack
@@ -431,7 +437,7 @@ esp_err_t tcpip_adapter_dhcps_get_status(tcpip_adapter_if_t tcpip_if, tcpip_adap
  *         - ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STOPPED
  *         - ESP_ERR_TCPIP_ADAPTER_DHCP_ALREADY_STARTED
  */
-esp_err_t tcpip_adapter_dhcps_option(tcpip_adapter_option_mode_t opt_op, tcpip_adapter_option_id_t opt_id, void *opt_val, uint32_t opt_len);
+esp_err_t tcpip_adapter_dhcps_option(tcpip_adapter_dhcp_option_mode_t opt_op, tcpip_adapter_dhcp_option_id_t opt_id, void *opt_val, uint32_t opt_len);
 
 /**
  * @brief  Start DHCP server
@@ -486,7 +492,7 @@ esp_err_t tcpip_adapter_dhcpc_get_status(tcpip_adapter_if_t tcpip_if, tcpip_adap
  * @return
  *         - ESP_ERR_NOT_SUPPORTED (not implemented)
  */
-esp_err_t tcpip_adapter_dhcpc_option(tcpip_adapter_option_mode_t opt_op, tcpip_adapter_option_id_t opt_id, void *opt_val, uint32_t opt_len);
+esp_err_t tcpip_adapter_dhcpc_option(tcpip_adapter_dhcp_option_mode_t opt_op, tcpip_adapter_dhcp_option_id_t opt_id, void *opt_val, uint32_t opt_len);
 
 /**
  * @brief Start DHCP client
diff --git a/components/tcpip_adapter/tcpip_adapter_lwip.c b/components/tcpip_adapter/tcpip_adapter_lwip.c
index 6709f6487f..70ea3830c8 100644
--- a/components/tcpip_adapter/tcpip_adapter_lwip.c
+++ b/components/tcpip_adapter/tcpip_adapter_lwip.c
@@ -572,7 +572,7 @@ esp_err_t tcpip_adapter_set_mac(tcpip_adapter_if_t tcpip_if, uint8_t mac[6])
 }
 #endif
 
-esp_err_t tcpip_adapter_dhcps_option(tcpip_adapter_option_mode_t opt_op, tcpip_adapter_option_id_t opt_id, void *opt_val, uint32_t opt_len)
+esp_err_t tcpip_adapter_dhcps_option(tcpip_adapter_dhcp_option_mode_t opt_op, tcpip_adapter_dhcp_option_id_t opt_id, void *opt_val, uint32_t opt_len)
 {
     void *opt_info = dhcps_option_info(opt_id, opt_len);
 
@@ -859,7 +859,7 @@ static esp_err_t tcpip_adapter_dhcps_stop_api(tcpip_adapter_api_msg_t * msg)
     return tcpip_adapter_dhcps_stop(msg->tcpip_if);
 }
 
-esp_err_t tcpip_adapter_dhcpc_option(tcpip_adapter_option_mode_t opt_op, tcpip_adapter_option_id_t opt_id, void *opt_val, uint32_t opt_len)
+esp_err_t tcpip_adapter_dhcpc_option(tcpip_adapter_dhcp_option_mode_t opt_op, tcpip_adapter_dhcp_option_id_t opt_id, void *opt_val, uint32_t opt_len)
 {
     // TODO: when dhcp request timeout,change the retry count
     return ESP_ERR_NOT_SUPPORTED;
-- 
2.40.0