Skip to content

Commit bc94df7

Browse files
committed
[TCPIP] Add ip_addr_t typedef
ip_addr_t is used in later versions of LWIP.
1 parent 5e5b31e commit bc94df7

File tree

5 files changed

+24
-23
lines changed

5 files changed

+24
-23
lines changed

drivers/network/tcpip/ip/lwip_glue/lwip_glue.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#endif
1414

1515
typedef struct tcp_pcb* PTCP_PCB;
16+
typedef struct ip_addr ip4_addr_t;
1617

1718
typedef struct _QUEUE_ENTRY
1819
{
@@ -36,7 +37,7 @@ struct lwip_callback_msg
3637
} FreeSocket;
3738
struct {
3839
PCONNECTION_ENDPOINT Connection;
39-
struct ip_addr *IpAddress;
40+
ip_addr_t *IpAddress;
4041
u16_t Port;
4142
} Bind;
4243
struct {
@@ -50,7 +51,7 @@ struct lwip_callback_msg
5051
} Send;
5152
struct {
5253
PCONNECTION_ENDPOINT Connection;
53-
struct ip_addr *IpAddress;
54+
ip_addr_t *IpAddress;
5455
u16_t Port;
5556
} Connect;
5657
struct {
@@ -103,15 +104,15 @@ extern void TCPRecvEventHandler(void *arg);
103104
/* TCP functions */
104105
PTCP_PCB LibTCPSocket(void *arg);
105106
VOID LibTCPFreeSocket(PTCP_PCB pcb);
106-
err_t LibTCPBind(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port);
107+
err_t LibTCPBind(PCONNECTION_ENDPOINT Connection, ip4_addr_t *const ipaddr, const u16_t port);
107108
PTCP_PCB LibTCPListen(PCONNECTION_ENDPOINT Connection, const u8_t backlog);
108-
err_t LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, const u16_t len, u32_t *sent, const int safe);
109-
err_t LibTCPConnect(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port);
109+
err_t LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, const u16_t len, ULONG *sent, const int safe);
110+
err_t LibTCPConnect(PCONNECTION_ENDPOINT Connection, ip4_addr_t *const ipaddr, const u16_t port);
110111
err_t LibTCPShutdown(PCONNECTION_ENDPOINT Connection, const int shut_rx, const int shut_tx);
111112
err_t LibTCPClose(PCONNECTION_ENDPOINT Connection, const int safe, const int callback);
112113

113-
err_t LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port);
114-
err_t LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port);
114+
err_t LibTCPGetPeerName(PTCP_PCB pcb, ip4_addr_t *const ipaddr, u16_t *const port);
115+
err_t LibTCPGetHostName(PTCP_PCB pcb, ip4_addr_t *const ipaddr, u16_t *const port);
115116
void LibTCPAccept(PTCP_PCB pcb, struct tcp_pcb *listen_pcb, void *arg);
116117
void LibTCPSetNoDelay(PTCP_PCB pcb, BOOLEAN Set);
117118
void LibTCPGetSocketStatus(PTCP_PCB pcb, PULONG State);

drivers/network/tcpip/ip/lwip_glue/tcp.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ LibTCPBindCallback(void *arg)
412412
}
413413

414414
err_t
415-
LibTCPBind(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port)
415+
LibTCPBind(PCONNECTION_ENDPOINT Connection, ip4_addr_t *const ipaddr, const u16_t port)
416416
{
417417
struct lwip_callback_msg *msg;
418418
err_t ret;
@@ -554,7 +554,7 @@ LibTCPSendCallback(void *arg)
554554
}
555555

556556
err_t
557-
LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, const u16_t len, u32_t *sent, const int safe)
557+
LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, const u16_t len, ULONG *sent, const int safe)
558558
{
559559
err_t ret;
560560
struct lwip_callback_msg *msg;
@@ -619,7 +619,7 @@ LibTCPConnectCallback(void *arg)
619619
}
620620

621621
err_t
622-
LibTCPConnect(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port)
622+
LibTCPConnect(PCONNECTION_ENDPOINT Connection, ip_addr_t *const ipaddr, const u16_t port)
623623
{
624624
struct lwip_callback_msg *msg;
625625
err_t ret;
@@ -841,7 +841,7 @@ LibTCPAccept(PTCP_PCB pcb, struct tcp_pcb *listen_pcb, void *arg)
841841
}
842842

843843
err_t
844-
LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port)
844+
LibTCPGetHostName(PTCP_PCB pcb, ip_addr_t *const ipaddr, u16_t *const port)
845845
{
846846
if (!pcb)
847847
return ERR_CLSD;
@@ -853,7 +853,7 @@ LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port)
853853
}
854854

855855
err_t
856-
LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr * const ipaddr, u16_t * const port)
856+
LibTCPGetPeerName(PTCP_PCB pcb, ip_addr_t * const ipaddr, u16_t * const port)
857857
{
858858
if (!pcb)
859859
return ERR_CLSD;

drivers/network/tcpip/ip/transport/tcp/accept.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ NTSTATUS TCPCheckPeerForAccept(PVOID Context,
2121
NTSTATUS Status;
2222
PTDI_CONNECTION_INFORMATION WhoIsConnecting;
2323
PTA_IP_ADDRESS RemoteAddress;
24-
struct ip_addr ipaddr;
24+
ip_addr_t ipaddr;
2525

2626
if (Request->RequestFlags & TDI_QUERY_ACCEPT)
2727
DbgPrint("TDI_QUERY_ACCEPT NOT SUPPORTED!!!\n");
@@ -47,7 +47,7 @@ NTSTATUS TCPCheckPeerForAccept(PVOID Context,
4747
NTSTATUS TCPListen(PCONNECTION_ENDPOINT Connection, UINT Backlog)
4848
{
4949
NTSTATUS Status = STATUS_SUCCESS;
50-
struct ip_addr AddressToBind;
50+
ip_addr_t AddressToBind;
5151
TA_IP_ADDRESS LocalAddress;
5252

5353
ASSERT(Connection);

drivers/network/tcpip/ip/transport/tcp/if.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <ipifcons.h>
1010

1111
err_t
12-
TCPSendDataCallback(struct netif *netif, struct pbuf *p, struct ip_addr *dest)
12+
TCPSendDataCallback(struct netif *netif, struct pbuf *p, ip4_addr_t *dest)
1313
{
1414
NDIS_STATUS NdisStatus;
1515
PNEIGHBOR_CACHE_ENTRY NCE;
@@ -117,9 +117,9 @@ TCPInterfaceInit(struct netif *netif)
117117
VOID
118118
TCPRegisterInterface(PIP_INTERFACE IF)
119119
{
120-
struct ip_addr ipaddr;
121-
struct ip_addr netmask;
122-
struct ip_addr gw;
120+
ip_addr_t ipaddr;
121+
ip_addr_t netmask;
122+
ip_addr_t gw;
123123

124124
gw.addr = 0;
125125
ipaddr.addr = 0;
@@ -143,9 +143,9 @@ TCPUnregisterInterface(PIP_INTERFACE IF)
143143
VOID
144144
TCPUpdateInterfaceIPInformation(PIP_INTERFACE IF)
145145
{
146-
struct ip_addr ipaddr;
147-
struct ip_addr netmask;
148-
struct ip_addr gw;
146+
ip_addr_t ipaddr;
147+
ip_addr_t netmask;
148+
ip_addr_t gw;
149149

150150
gw.addr = 0;
151151

drivers/network/tcpip/ip/transport/tcp/tcp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ NTSTATUS TCPConnect
306306
PVOID Context )
307307
{
308308
NTSTATUS Status;
309-
struct ip_addr bindaddr, connaddr;
309+
ip_addr_t bindaddr, connaddr;
310310
IP_ADDRESS RemoteAddress;
311311
USHORT RemotePort;
312312
TA_IP_ADDRESS LocalAddress;
@@ -660,7 +660,7 @@ NTSTATUS TCPGetSockAddress
660660
BOOLEAN GetRemote )
661661
{
662662
PTA_IP_ADDRESS AddressIP = (PTA_IP_ADDRESS)Address;
663-
struct ip_addr ipaddr;
663+
ip_addr_t ipaddr;
664664
NTSTATUS Status;
665665

666666
AddressIP->TAAddressCount = 1;

0 commit comments

Comments
 (0)