https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bc94df7288bfb1a607052bd543af53d574edbefa

commit bc94df7288bfb1a607052bd543af53d574edbefa
Author:     Hervé Poussineau <[email protected]>
AuthorDate: Sat Apr 20 19:22:54 2024 +0200
Commit:     Hervé Poussineau <[email protected]>
CommitDate: Sun Nov 3 22:49:45 2024 +0100

    [TCPIP] Add ip_addr_t typedef
    
    ip_addr_t is used in later versions of LWIP.
---
 drivers/network/tcpip/ip/lwip_glue/lwip_glue.h  | 15 ++++++++-------
 drivers/network/tcpip/ip/lwip_glue/tcp.c        | 10 +++++-----
 drivers/network/tcpip/ip/transport/tcp/accept.c |  4 ++--
 drivers/network/tcpip/ip/transport/tcp/if.c     | 14 +++++++-------
 drivers/network/tcpip/ip/transport/tcp/tcp.c    |  4 ++--
 5 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/drivers/network/tcpip/ip/lwip_glue/lwip_glue.h 
b/drivers/network/tcpip/ip/lwip_glue/lwip_glue.h
index 5fdd5b73446..ac7ab13e01f 100644
--- a/drivers/network/tcpip/ip/lwip_glue/lwip_glue.h
+++ b/drivers/network/tcpip/ip/lwip_glue/lwip_glue.h
@@ -13,6 +13,7 @@
 #endif
 
 typedef struct tcp_pcb* PTCP_PCB;
+typedef struct ip_addr ip4_addr_t;
 
 typedef struct _QUEUE_ENTRY
 {
@@ -36,7 +37,7 @@ struct lwip_callback_msg
         } FreeSocket;
         struct {
             PCONNECTION_ENDPOINT Connection;
-            struct ip_addr *IpAddress;
+            ip_addr_t *IpAddress;
             u16_t Port;
         } Bind;
         struct {
@@ -50,7 +51,7 @@ struct lwip_callback_msg
         } Send;
         struct {
             PCONNECTION_ENDPOINT Connection;
-            struct ip_addr *IpAddress;
+            ip_addr_t *IpAddress;
             u16_t Port;
         } Connect;
         struct {
@@ -103,15 +104,15 @@ extern void TCPRecvEventHandler(void *arg);
 /* TCP functions */
 PTCP_PCB    LibTCPSocket(void *arg);
 VOID        LibTCPFreeSocket(PTCP_PCB pcb);
-err_t       LibTCPBind(PCONNECTION_ENDPOINT Connection, struct ip_addr *const 
ipaddr, const u16_t port);
+err_t       LibTCPBind(PCONNECTION_ENDPOINT Connection, ip4_addr_t *const 
ipaddr, const u16_t port);
 PTCP_PCB    LibTCPListen(PCONNECTION_ENDPOINT Connection, const u8_t backlog);
-err_t       LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, 
const u16_t len, u32_t *sent, const int safe);
-err_t       LibTCPConnect(PCONNECTION_ENDPOINT Connection, struct ip_addr 
*const ipaddr, const u16_t port);
+err_t       LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, 
const u16_t len, ULONG *sent, const int safe);
+err_t       LibTCPConnect(PCONNECTION_ENDPOINT Connection, ip4_addr_t *const 
ipaddr, const u16_t port);
 err_t       LibTCPShutdown(PCONNECTION_ENDPOINT Connection, const int shut_rx, 
const int shut_tx);
 err_t       LibTCPClose(PCONNECTION_ENDPOINT Connection, const int safe, const 
int callback);
 
-err_t       LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr *const ipaddr, 
u16_t *const port);
-err_t       LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, 
u16_t *const port);
+err_t       LibTCPGetPeerName(PTCP_PCB pcb, ip4_addr_t *const ipaddr, u16_t 
*const port);
+err_t       LibTCPGetHostName(PTCP_PCB pcb, ip4_addr_t *const ipaddr, u16_t 
*const port);
 void        LibTCPAccept(PTCP_PCB pcb, struct tcp_pcb *listen_pcb, void *arg);
 void        LibTCPSetNoDelay(PTCP_PCB pcb, BOOLEAN Set);
 void        LibTCPGetSocketStatus(PTCP_PCB pcb, PULONG State);
diff --git a/drivers/network/tcpip/ip/lwip_glue/tcp.c 
b/drivers/network/tcpip/ip/lwip_glue/tcp.c
index 4b04d1d4073..4ac40594d06 100644
--- a/drivers/network/tcpip/ip/lwip_glue/tcp.c
+++ b/drivers/network/tcpip/ip/lwip_glue/tcp.c
@@ -412,7 +412,7 @@ done:
 }
 
 err_t
-LibTCPBind(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, 
const u16_t port)
+LibTCPBind(PCONNECTION_ENDPOINT Connection, ip4_addr_t *const ipaddr, const 
u16_t port)
 {
     struct lwip_callback_msg *msg;
     err_t ret;
@@ -554,7 +554,7 @@ done:
 }
 
 err_t
-LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, const u16_t 
len, u32_t *sent, const int safe)
+LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, const u16_t 
len, ULONG *sent, const int safe)
 {
     err_t ret;
     struct lwip_callback_msg *msg;
@@ -619,7 +619,7 @@ done:
 }
 
 err_t
-LibTCPConnect(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, 
const u16_t port)
+LibTCPConnect(PCONNECTION_ENDPOINT Connection, ip_addr_t *const ipaddr, const 
u16_t port)
 {
     struct lwip_callback_msg *msg;
     err_t ret;
@@ -841,7 +841,7 @@ LibTCPAccept(PTCP_PCB pcb, struct tcp_pcb *listen_pcb, void 
*arg)
 }
 
 err_t
-LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const 
port)
+LibTCPGetHostName(PTCP_PCB pcb, ip_addr_t *const ipaddr, u16_t *const port)
 {
     if (!pcb)
         return ERR_CLSD;
@@ -853,7 +853,7 @@ LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const 
ipaddr, u16_t *const port)
 }
 
 err_t
-LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr * const ipaddr, u16_t * const 
port)
+LibTCPGetPeerName(PTCP_PCB pcb, ip_addr_t * const ipaddr, u16_t * const port)
 {
     if (!pcb)
         return ERR_CLSD;
diff --git a/drivers/network/tcpip/ip/transport/tcp/accept.c 
b/drivers/network/tcpip/ip/transport/tcp/accept.c
index cfab933003d..a6c41627fea 100644
--- a/drivers/network/tcpip/ip/transport/tcp/accept.c
+++ b/drivers/network/tcpip/ip/transport/tcp/accept.c
@@ -21,7 +21,7 @@ NTSTATUS TCPCheckPeerForAccept(PVOID Context,
     NTSTATUS Status;
     PTDI_CONNECTION_INFORMATION WhoIsConnecting;
     PTA_IP_ADDRESS RemoteAddress;
-    struct ip_addr ipaddr;
+    ip_addr_t ipaddr;
 
     if (Request->RequestFlags & TDI_QUERY_ACCEPT)
         DbgPrint("TDI_QUERY_ACCEPT NOT SUPPORTED!!!\n");
@@ -47,7 +47,7 @@ NTSTATUS TCPCheckPeerForAccept(PVOID Context,
 NTSTATUS TCPListen(PCONNECTION_ENDPOINT Connection, UINT Backlog)
 {
     NTSTATUS Status = STATUS_SUCCESS;
-    struct ip_addr AddressToBind;
+    ip_addr_t AddressToBind;
     TA_IP_ADDRESS LocalAddress;
 
     ASSERT(Connection);
diff --git a/drivers/network/tcpip/ip/transport/tcp/if.c 
b/drivers/network/tcpip/ip/transport/tcp/if.c
index e69c3667fc3..2e57532ca53 100644
--- a/drivers/network/tcpip/ip/transport/tcp/if.c
+++ b/drivers/network/tcpip/ip/transport/tcp/if.c
@@ -9,7 +9,7 @@
 #include <ipifcons.h>
 
 err_t
-TCPSendDataCallback(struct netif *netif, struct pbuf *p, struct ip_addr *dest)
+TCPSendDataCallback(struct netif *netif, struct pbuf *p, ip4_addr_t *dest)
 {
     NDIS_STATUS NdisStatus;
     PNEIGHBOR_CACHE_ENTRY NCE;
@@ -117,9 +117,9 @@ TCPInterfaceInit(struct netif *netif)
 VOID
 TCPRegisterInterface(PIP_INTERFACE IF)
 {
-    struct ip_addr ipaddr;
-    struct ip_addr netmask;
-    struct ip_addr gw;
+    ip_addr_t ipaddr;
+    ip_addr_t netmask;
+    ip_addr_t gw;
 
     gw.addr = 0;
     ipaddr.addr = 0;
@@ -143,9 +143,9 @@ TCPUnregisterInterface(PIP_INTERFACE IF)
 VOID
 TCPUpdateInterfaceIPInformation(PIP_INTERFACE IF)
 {
-    struct ip_addr ipaddr;
-    struct ip_addr netmask;
-    struct ip_addr gw;
+    ip_addr_t ipaddr;
+    ip_addr_t netmask;
+    ip_addr_t gw;
 
     gw.addr = 0;
 
diff --git a/drivers/network/tcpip/ip/transport/tcp/tcp.c 
b/drivers/network/tcpip/ip/transport/tcp/tcp.c
index 89b9184fdca..394cc0510ad 100644
--- a/drivers/network/tcpip/ip/transport/tcp/tcp.c
+++ b/drivers/network/tcpip/ip/transport/tcp/tcp.c
@@ -306,7 +306,7 @@ NTSTATUS TCPConnect
   PVOID Context )
 {
     NTSTATUS Status;
-    struct ip_addr bindaddr, connaddr;
+    ip_addr_t bindaddr, connaddr;
     IP_ADDRESS RemoteAddress;
     USHORT RemotePort;
     TA_IP_ADDRESS LocalAddress;
@@ -660,7 +660,7 @@ NTSTATUS TCPGetSockAddress
   BOOLEAN GetRemote )
 {
     PTA_IP_ADDRESS AddressIP = (PTA_IP_ADDRESS)Address;
-    struct ip_addr ipaddr;
+    ip_addr_t ipaddr;
     NTSTATUS Status;
 
     AddressIP->TAAddressCount = 1;

Reply via email to