From f4b00736269ce4212c1dde2011840577ff0143f1 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Fri, 14 Nov 2025 13:04:09 +0000 Subject: [PATCH] session.h: Support building with LwIP, but LWIP_IPV4 / LWIP_IPV6 not set Add in a dummy struct sockaddr_in or sockaddr_in6 as appropriate as would be defined in LwIP. Signed-off-by: Jon Shallow --- session.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/session.h b/session.h index 21903d84..b791ea4c 100644 --- a/session.h +++ b/session.h @@ -76,6 +76,27 @@ typedef struct { #undef write #undef read typedef unsigned char uint8_t; +#if ! LWIP_IPV4 +/* members are in network byte order */ +struct sockaddr_in { + u8_t sin_len; + sa_family_t sin_family; + in_port_t sin_port; + struct in_addr sin_addr; +#define SIN_ZERO_LEN 8 + char sin_zero[SIN_ZERO_LEN]; +}; +#endif /* ! LWIP_IPV4 */ +#if ! LWIP_IPV6 +struct sockaddr_in6 { + u8_t sin6_len; /* length of this structure */ + sa_family_t sin6_family; /* AF_INET6 */ + in_port_t sin6_port; /* Transport layer port # */ + u32_t sin6_flowinfo; /* IPv6 flow information */ + struct in6_addr sin6_addr; /* IPv6 address */ + u32_t sin6_scope_id; /* Set of interfaces for scope */ +}; +#endif /* ! LWIP_IPV6 */ #elif defined(IS_WINDOWS) #include