7 #ifdef USE_SOCKET_IMPL_LWIP_TCP 10 #include "lwip/inet.h" 13 #include <sys/types.h> 18 #define PF_INET AF_INET 19 #define PF_UNSPEC AF_UNSPEC 26 #define PF_INET6 AF_INET6 28 #define IPPROTO_IPV6 41 29 #define IPPROTO_ICMPV6 58 32 #define TCP_NODELAY 0x01 51 #define SO_REUSEADDR 0x0004 52 #define SO_KEEPALIVE 0x0008 53 #define SO_BROADCAST 0x0020 55 #define SOL_SOCKET 0xfff 66 #define SIN_ZERO_LEN 8 77 struct in6_addr sin6_addr;
105 #if defined(USE_ESP8266) || defined(USE_RP2040) 114 #define ESPHOME_INADDR_ANY ((uint32_t) 0x00000000UL) 115 #define ESPHOME_INADDR_NONE ((uint32_t) 0xFFFFFFFFUL) 116 #else // !USE_ESP8266 117 #define ESPHOME_INADDR_ANY INADDR_ANY 118 #define ESPHOME_INADDR_NONE INADDR_NONE 121 #endif // USE_SOCKET_IMPL_LWIP_TCP 123 #ifdef USE_SOCKET_IMPL_LWIP_SOCKETS 128 #undef LWIP_COMPAT_SOCKETS 129 #define LWIP_COMPAT_SOCKETS 0 131 #include "lwip/sockets.h" 132 #include <sys/types.h> 143 #define ESPHOME_INADDR_ANY ((uint32_t) 0x00000000UL) 144 #define ESPHOME_INADDR_NONE ((uint32_t) 0xFFFFFFFFUL) 146 #define ESPHOME_INADDR_ANY INADDR_ANY 147 #define ESPHOME_INADDR_NONE INADDR_NONE 150 #endif // USE_SOCKET_IMPL_LWIP_SOCKETS 152 #ifdef USE_SOCKET_IMPL_BSD_SOCKETS 156 #include <sys/ioctl.h> 157 #include <sys/socket.h> 158 #include <sys/types.h> 163 #include <arpa/inet.h> 164 #include <netinet/in.h> 165 #include <netinet/ip.h> 166 #include <netinet/tcp.h> 178 #define ESPHOME_INADDR_ANY ((uint32_t) 0x00000000UL) 179 #define ESPHOME_INADDR_NONE ((uint32_t) 0xFFFFFFFFUL) 181 #define ESPHOME_INADDR_ANY INADDR_ANY 182 #define ESPHOME_INADDR_NONE INADDR_NONE 185 #endif // USE_SOCKET_IMPL_BSD_SOCKETS
char sin_zero[SIN_ZERO_LEN]