Possible protocol level values supported are @ref SOL_SOCKET and @ref SOL_SSL_SOCKET.
-* Possible options when the protocol level is @ref SOL_SOCKET :
-*
-*
-* |
-* @ref SO_SSL_BYPASS_X509_VERIF |
-* Allow an opened SSL socket to bypass the X509
-* certificate verification process. It is highly recommended NOT to use
-* this socket option in production software applications. The option is
-* supported for debugging and testing purposes. The option value should be
-* casted to int type and it is handled as a boolean flag. |
-*
-*
-* | @ref SO_SSL_SNI |
-* Set the Server Name Indicator (SNI) for an SSL socket. The SNI is a
-* null terminated string containing the server name associated with the
-* connection. It must not exceed the size of @ref HOSTNAME_MAX_SIZE. |
-*
-*
-* | @ref SO_SSL_ENABLE_SESSION_CACHING |
-* This option allow the TLS to cache the session information for fast
-* TLS session establishment in future connections using the TLS Protocol
-* session resume features. |
-*
-*
- */
- /**@{*/
-/*!
-@fn \
- NMI_API sint8 setsockopt(SOCKET socket, uint8 u8Level, uint8 option_name,
- const void *option_value, uint16 u16OptionLen);
-
-@param [in] sock
- Socket handler.
-
-@param [in] level
- protocol level. See description above.
-
-@param [in] option_name
- option to be set. See description above.
-
-@param [in] option_value
- pointer to user provided value.
-
-@param [in] option_len
- length of the option value in bytes.
-@return
- The function shall return \ref SOCK_ERR_NO_ERROR for successful operation
- and a negative value (indicating the error) otherwise.
-@sa SOL_SOCKET, SOL_SSL_SOCKET, IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP
-*/
-NMI_API sint8 winc1500_socket_setsockopt(SOCKET socket, uint8 u8Level, uint8 option_name,
- const void *option_value, uint16 u16OptionLen);
-
-
-/** @} */
-/** @defgroup GetSocketOptionsFn getsockopt
- * @ingroup SocketAPI
- * Get socket options retrieves
-* This Function isn't implemented yet but this is the form that will be released later.
- */
- /**@{*/
-/*!
-@fn \
- sint8 getsockopt(SOCKET sock, uint8 u8Level, uint8 u8OptName, const void *pvOptValue, uint8 * pu8OptLen);
-
-@brief
-
-@param [in] sock
- Socket Identifie.
-@param [in] u8Level
- The protocol level of the option.
-@param [in] u8OptName
- The u8OptName argument specifies a single option to get.
-@param [out] pvOptValue
- The pvOptValue argument contains pointer to a buffer containing the option value.
-@param [out] pu8OptLen
- Option value buffer length.
-@return
- The function shall return ZERO for successful operation and a negative value otherwise.
-*/
-NMI_API sint8 winc1500_socket_getsockopt(SOCKET sock, uint8 u8Level, uint8 u8OptName, const void *pvOptValue, uint8* pu8OptLen);
-/** @} */
-
-/**@}*/
-/** @defgroup PingFn m2m_ping_req
- * @ingroup SocketAPI
- * The function sends ping request to the given IP Address.
- */
- /**@{*/
-/*!
-@fn \
- NMI_API sint8 m2m_ping_req(uint32 u32DstIP, uint8 u8TTL, tpfPingCb fpPingCb);
-
-@param [in] u32DstIP
- Target Destination IP Address for the ping request. It must be represented in Network byte order.
- The function nmi_inet_addr could be used to translate the dotted decimal notation IP
- to its Network bytes order integer represntative.
-
-@param [in] u8TTL
- IP TTL value for the ping request. If set to ZERO, the dfault value SHALL be used.
-
-@param [in] fpPingCb
- Callback will be called to deliver the ping statistics.
-
-@see nmi_inet_addr
-@return The function returns @ref M2M_SUCCESS for successful operations and a negative value otherwise.
-*/
-NMI_API sint8 m2m_ping_req(uint32 u32DstIP, uint8 u8TTL, tpfPingCb fpPingCb);
-/**@}*/
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __SOCKET_H__ */
+/**
+ *
+ * \file
+ *
+ * \brief WINC BSD compatible Socket Interface.
+ *
+ * Copyright (c) 2016-2021 Microchip Technology Inc. and its subsidiaries.
+ *
+ * \asf_license_start
+ *
+ * \page License
+ *
+ * Subject to your compliance with these terms, you may use Microchip
+ * software and any derivatives exclusively with Microchip products.
+ * It is your responsibility to comply with third party license terms applicable
+ * to your use of third party software (including open source software) that
+ * may accompany Microchip software.
+ *
+ * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
+ * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
+ * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
+ * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
+ * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
+ * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
+ * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
+ * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
+ * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
+ * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
+ * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
+ *
+ * \asf_license_stop
+ *
+ */
+
+#ifndef __SOCKET_H__
+#define __SOCKET_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @defgroup SocketHeader Socket
+ * BSD compatible socket interface between the host layer and the network
+ * protocol stacks in the firmware.
+ * These functions are used by the host application to send or receive
+ * packets and to do other socket operations.
+ */
+
+/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
+INCLUDES
+*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
+
+#include "common/include/nm_common.h"
+#include "driver/include/m2m_types.h"
+
+
+
+/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
+MACROS
+*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
+/**
+ * @defgroup SocketDefines Defines
+ * @ingroup SocketHeader
+ */
+
+/** @defgroup IPDefines TCP/IP Defines
+ * @ingroup SocketDefines
+ * The following list of macros are used to define constants used throughout the socket layer.
+ * @{
+ */
+
+/*
+ * HOSTNAME_MAX_SIZE is defined here and also in host_drv/socket/include/m2m_socket_host_if.h
+ * The two definitions must match.
+*/
+#define HOSTNAME_MAX_SIZE 64
+/*!<
+ Maximum allowed size for a host domain name passed to the function gethostbyname @ref gethostbyname.
+ command value. Used with the @ref setsockopt function.
+*/
+
+#define SOCKET_BUFFER_MAX_LENGTH 1400
+/*!<
+ Maximum allowed size for a socket data buffer. Used with @ref send socket
+ function to ensure that the buffer sent is within the allowed range.
+*/
+
+#ifdef __ZEPHYR__
+
+#include