Needed to compile Tera Term.
From: Alex Henrie alexhenrie24@gmail.com
--- include/mstcpip.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/include/mstcpip.h b/include/mstcpip.h index cb3ce8d41d4..08201f4ea8f 100644 --- a/include/mstcpip.h +++ b/include/mstcpip.h @@ -45,6 +45,16 @@ struct tcp_keepalive #define RCVALL_ON 1 #define RCVALL_SOCKETLEVELONLY 2
+#define IN4ADDR_ANY_INIT { 0, 0, 0, 0 } +#define IN4ADDR_LOOPBACK_INIT { 126, 0, 0, 1 } +#define IN4ADDR_BROADCAST_INIT { 255, 255, 255, 255 } +#define IN4ADDR_ALLNODESONLINK_INIT { 224, 0, 0, 1 } +#define IN4ADDR_ALLROUTERSONLINK_INIT { 224, 0, 0, 2 } +#define IN4ADDR_ALLIGMPV3ROUTERSONLINK_INIT { 224, 0, 0, 22 } +#define IN4ADDR_ALLTEREDONODESONLINK_INIT { 224, 0, 0, 253 } +#define IN4ADDR_LINKLOCALPREFIX_INIT { 169, 254, 0, 0 } +#define IN4ADDR_MULTICASTPREFIX_INIT { 224, 0, 0, 0 } + #else
#define WS_SIO_RCVALL _WSAIOW(WS_IOC_VENDOR, 1) @@ -63,6 +73,16 @@ struct tcp_keepalive #define WS_RCVALL_ON 1 #define WS_RCVALL_SOCKETLEVELONLY 2
+#define WS_IN4ADDR_ANY_INIT { 0, 0, 0, 0 } +#define WS_IN4ADDR_LOOPBACK_INIT { 126, 0, 0, 1 } +#define WS_IN4ADDR_BROADCAST_INIT { 255, 255, 255, 255 } +#define WS_IN4ADDR_ALLNODESONLINK_INIT { 224, 0, 0, 1 } +#define WS_IN4ADDR_ALLROUTERSONLINK_INIT { 224, 0, 0, 2 } +#define WS_IN4ADDR_ALLIGMPV3ROUTERSONLINK_INIT { 224, 0, 0, 22 } +#define WS_IN4ADDR_ALLTEREDONODESONLINK_INIT { 224, 0, 0, 253 } +#define WS_IN4ADDR_LINKLOCALPREFIX_INIT { 169, 254, 0, 0 } +#define WS_IN4ADDR_MULTICASTPREFIX_INIT { 224, 0, 0, 0 } + #endif /* USE_WS_PREFIX */
#endif /* __WINE_MSTCPIP_H */
From: Alex Henrie alexhenrie24@gmail.com
--- include/ws2ipdef.h | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/include/ws2ipdef.h b/include/ws2ipdef.h index adc534dcb32..51d4c9f5ac2 100644 --- a/include/ws2ipdef.h +++ b/include/ws2ipdef.h @@ -337,13 +337,43 @@ typedef struct WS(in6_pktinfo) { #ifndef USE_WS_PREFIX #define INET_ADDRSTRLEN 22 #define INET6_ADDRSTRLEN 65 -#define IN6ADDR_ANY_INIT { 0 } -#define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } +#define IN6ADDR_6BONETESTPREFIX_INIT { 0x3f,0xfe,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define IN6ADDR_6TO4PREFIX_INIT { 0x20,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define IN6ADDR_ALLMLDV2ROUTERSONLINK_INIT { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } +#define IN6ADDR_ALLNODESONLINK_INIT { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } +#define IN6ADDR_ALLNODESONNODE_INIT { 0xff,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } +#define IN6ADDR_ALLROUTERSONLINK_INIT { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } +#define IN6ADDR_ANY_INIT { 0 } +#define IN6ADDR_LINKLOCALPREFIX_INIT { 0xfe,0x80,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } +#define IN6ADDR_MULTICASTPREFIX_INIT { 0xff,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define IN6ADDR_SITELOCALPREFIX_INIT { 0xfe,0xc0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define IN6ADDR_SOLICITEDNODEMULTICASTPREFIX_INIT { 0xff,2,0,0,0,0,0,0,0,0,0,0x01,0xff,0,0,0 } +#define IN6ADDR_TEREDOINITIALLINKLOCALADDRESS_INIT { 0xfe,0x80,0,0,0,0,0,0,0,0,0xff,0xff,0xff,0xff,0xff,0xfe } +#define IN6ADDR_TEREDOPREFIX_INIT { 0x20,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define IN6ADDR_TEREDOPREFIX_INIT_OLD { 0x3f,0xfe,0x83,0x1f,0,0,0,0,0,0,0,0,0,0,0,0 } +#define IN6ADDR_ULAPREFIX_INIT { 0xfc,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define IN6ADDR_V4MAPPEDPREFIX_INIT { 0,0,0,0,0,0,0,0,0,0,0xff,0xff,0,0,0,0 } #else #define WS_INET_ADDRSTRLEN 22 #define WS_INET6_ADDRSTRLEN 65 -#define WS_IN6ADDR_ANY_INIT { 0 } -#define WS_IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } +#define WS_IN6ADDR_6BONETESTPREFIX_INIT { 0x3f,0xfe,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define WS_IN6ADDR_6TO4PREFIX_INIT { 0x20,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define WS_IN6ADDR_ALLMLDV2ROUTERSONLINK_INIT { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } +#define WS_IN6ADDR_ALLNODESONLINK_INIT { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } +#define WS_IN6ADDR_ALLNODESONNODE_INIT { 0xff,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } +#define WS_IN6ADDR_ALLROUTERSONLINK_INIT { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } +#define WS_IN6ADDR_ANY_INIT { 0 } +#define WS_IN6ADDR_LINKLOCALPREFIX_INIT { 0xfe,0x80,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define WS_IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } +#define WS_IN6ADDR_MULTICASTPREFIX_INIT { 0xff,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define WS_IN6ADDR_SITELOCALPREFIX_INIT { 0xfe,0xc0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define WS_IN6ADDR_SOLICITEDNODEMULTICASTPREFIX_INIT { 0xff,2,0,0,0,0,0,0,0,0,0,0x01,0xff,0,0,0 } +#define WS_IN6ADDR_TEREDOINITIALLINKLOCALADDRESS_INIT { 0xfe,0x80,0,0,0,0,0,0,0,0,0xff,0xff,0xff,0xff,0xff,0xfe } +#define WS_IN6ADDR_TEREDOPREFIX_INIT { 0x20,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define WS_IN6ADDR_TEREDOPREFIX_INIT_OLD { 0x3f,0xfe,0x83,0x1f,0,0,0,0,0,0,0,0,0,0,0,0 } +#define WS_IN6ADDR_ULAPREFIX_INIT { 0xfc,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } +#define WS_IN6ADDR_V4MAPPEDPREFIX_INIT { 0,0,0,0,0,0,0,0,0,0,0xff,0xff,0,0,0,0 } #endif /* USE_WS_PREFIX */
#define SS_PORT(ssp) (((PSOCKADDR_IN)(ssp))->sin_port)
From: Alex Henrie alexhenrie24@gmail.com
Needed to compile Tera Term. --- dlls/ws2_32/Makefile.in | 1 + dlls/ws2_32/inaddr.c | 52 +++++++++++++++++++++++++++++++++++++++++ include/ws2ipdef.h | 25 ++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 dlls/ws2_32/inaddr.c
diff --git a/dlls/ws2_32/Makefile.in b/dlls/ws2_32/Makefile.in index 83ae5e915ae..c303e73d9c8 100644 --- a/dlls/ws2_32/Makefile.in +++ b/dlls/ws2_32/Makefile.in @@ -5,6 +5,7 @@ DELAYIMPORTS = dnsapi advapi32 iphlpapi user32
C_SRCS = \ async.c \ + inaddr.c \ protocol.c \ socket.c \ unixlib.c diff --git a/dlls/ws2_32/inaddr.c b/dlls/ws2_32/inaddr.c new file mode 100644 index 00000000000..f226908d02c --- /dev/null +++ b/dlls/ws2_32/inaddr.c @@ -0,0 +1,52 @@ +/* + * ws2_32 static library constants + * + * Copyright 2022 Alex Henrie + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep implib +#endif + +#include "winsock2.h" +#include "mstcpip.h" +#include "ws2ipdef.h" + +const IN_ADDR in4addr_alligmpv3routersonlink = {{ IN4ADDR_ALLIGMPV3ROUTERSONLINK_INIT }}; +const IN_ADDR in4addr_allnodesonlink = {{ IN4ADDR_ALLNODESONLINK_INIT }}; +const IN_ADDR in4addr_allroutersonlink = {{ IN4ADDR_ALLROUTERSONLINK_INIT }}; +const IN_ADDR in4addr_allteredohostsonlink = {{ IN4ADDR_ALLTEREDONODESONLINK_INIT }}; +const IN_ADDR in4addr_any = {{ IN4ADDR_ANY_INIT }}; +const IN_ADDR in4addr_broadcast = {{ IN4ADDR_BROADCAST_INIT }}; +const IN_ADDR in4addr_linklocalprefix = {{ IN4ADDR_LINKLOCALPREFIX_INIT }}; +const IN_ADDR in4addr_loopback = {{ IN4ADDR_LOOPBACK_INIT }}; +const IN_ADDR in4addr_multicastprefix = {{ IN4ADDR_MULTICASTPREFIX_INIT }}; + +const IN6_ADDR in6addr_6to4prefix = {{ IN6ADDR_6TO4PREFIX_INIT }}; +const IN6_ADDR in6addr_allmldv2routersonlink = {{ IN6ADDR_ALLMLDV2ROUTERSONLINK_INIT }}; +const IN6_ADDR in6addr_allnodesonlink = {{ IN6ADDR_ALLNODESONLINK_INIT }}; +const IN6_ADDR in6addr_allnodesonnode = {{ IN6ADDR_ALLNODESONNODE_INIT }}; +const IN6_ADDR in6addr_allroutersonlink = {{ IN6ADDR_ALLROUTERSONLINK_INIT }}; +const IN6_ADDR in6addr_any = {{ IN6ADDR_ANY_INIT }}; +const IN6_ADDR in6addr_linklocalprefix = {{ IN6ADDR_LINKLOCALPREFIX_INIT }}; +const IN6_ADDR in6addr_loopback = {{ IN6ADDR_LOOPBACK_INIT }}; +const IN6_ADDR in6addr_multicastprefix = {{ IN6ADDR_MULTICASTPREFIX_INIT }}; +const IN6_ADDR in6addr_solicitednodemulticastprefix = {{ IN6ADDR_SOLICITEDNODEMULTICASTPREFIX_INIT }}; +const IN6_ADDR in6addr_teredoinitiallinklocaladdress = {{ IN6ADDR_TEREDOINITIALLINKLOCALADDRESS_INIT }}; +const IN6_ADDR in6addr_teredoprefix = {{ IN6ADDR_TEREDOPREFIX_INIT }}; +const IN6_ADDR in6addr_teredoprefix_old = {{ IN6ADDR_TEREDOPREFIX_INIT_OLD }}; +const IN6_ADDR in6addr_v4mappedprefix = {{ IN6ADDR_V4MAPPEDPREFIX_INIT }}; diff --git a/include/ws2ipdef.h b/include/ws2ipdef.h index 51d4c9f5ac2..773f4c09dc5 100644 --- a/include/ws2ipdef.h +++ b/include/ws2ipdef.h @@ -386,6 +386,31 @@ typedef struct WS(in6_pktinfo) { #define WS_SIO_IDEAL_SEND_BACKLOG_QUERY WS__IOR('t', 123, ULONG) #endif
+extern const IN_ADDR WS(in4addr_alligmpv3routersonlink); +extern const IN_ADDR WS(in4addr_allnodesonlink); +extern const IN_ADDR WS(in4addr_allroutersonlink); +extern const IN_ADDR WS(in4addr_allteredohostsonlink); +extern const IN_ADDR WS(in4addr_any); +extern const IN_ADDR WS(in4addr_broadcast); +extern const IN_ADDR WS(in4addr_linklocalprefix); +extern const IN_ADDR WS(in4addr_loopback); +extern const IN_ADDR WS(in4addr_multicastprefix); + +extern const IN6_ADDR WS(in6addr_6to4prefix); +extern const IN6_ADDR WS(in6addr_allmldv2routersonlink); +extern const IN6_ADDR WS(in6addr_allnodesonlink); +extern const IN6_ADDR WS(in6addr_allnodesonnode); +extern const IN6_ADDR WS(in6addr_allroutersonlink); +extern const IN6_ADDR WS(in6addr_any); +extern const IN6_ADDR WS(in6addr_linklocalprefix); +extern const IN6_ADDR WS(in6addr_loopback); +extern const IN6_ADDR WS(in6addr_multicastprefix); +extern const IN6_ADDR WS(in6addr_solicitednodemulticastprefix); +extern const IN6_ADDR WS(in6addr_teredoinitiallinklocaladdress); +extern const IN6_ADDR WS(in6addr_teredoprefix); +extern const IN6_ADDR WS(in6addr_teredoprefix_old); +extern const IN6_ADDR WS(in6addr_v4mappedprefix); + #ifdef __cplusplus extern "C" { #endif