#ifndef __TCP_H
#define __TCP_H
-typedef VOID
+typedef VOID
(*PTCP_COMPLETION_ROUTINE)( PVOID Context, NTSTATUS Status, ULONG Count );
/* TCPv4 header structure */
+#include <pshpack1.h>
typedef struct TCPv4_HEADER {
USHORT SourcePort; /* Source port */
USHORT DestinationPort; /* Destination port */
USHORT Window; /* Maximum acceptable receive window */
USHORT Checksum; /* Checksum of segment */
USHORT Urgent; /* Pointer to urgent data */
-} __attribute__((packed)) TCPv4_HEADER, *PTCPv4_HEADER;
+} TCPv4_HEADER, *PTCPv4_HEADER;
/* TCPv4 header flags */
#define TCP_URG 0x20
UCHAR Zero; /* Reserved */
UCHAR Protocol; /* Protocol */
USHORT TCPLength; /* Size of TCP segment */
-} __attribute__((packed)) TCPv4_PSEUDO_HEADER, *PTCPv4_PSEUDO_HEADER;
+} TCPv4_PSEUDO_HEADER, *PTCPv4_PSEUDO_HEADER;
+#include <poppack.h>
typedef struct _SLEEPING_THREAD {
LIST_ENTRY Entry;
PCONNECTION_ENDPOINT TCPAllocateConnectionEndpoint( PVOID ClientContext );
VOID TCPFreeConnectionEndpoint( PCONNECTION_ENDPOINT Connection );
-NTSTATUS TCPSocket( PCONNECTION_ENDPOINT Connection,
+NTSTATUS TCPSocket( PCONNECTION_ENDPOINT Connection,
UINT Family, UINT Type, UINT Proto );
PTCP_SEGMENT TCPCreateSegment(
PVOID Context);
NTSTATUS TCPReceiveData(
- PCONNECTION_ENDPOINT Connection,
+ PCONNECTION_ENDPOINT Connection,
PNDIS_BUFFER Buffer,
ULONG ReceiveLength,
PULONG BytesReceived,
PCHAR Buffer,
ULONG DataSize,
PULONG DataUsed,
- ULONG Flags);
+ ULONG Flags,
+ PTCP_COMPLETION_ROUTINE Complete,
+ PVOID Context);
NTSTATUS TCPClose( PCONNECTION_ENDPOINT Connection );
VOID TCPFreePort( UINT Port );
NTSTATUS TCPGetPeerAddress
-( PCONNECTION_ENDPOINT Connection,
+( PCONNECTION_ENDPOINT Connection,
PTRANSPORT_ADDRESS TransportAddress );
NTSTATUS TCPStartup(
NTSTATUS TCPShutdown(
VOID);
+VOID TCPRemoveIRP( PCONNECTION_ENDPOINT Connection, PIRP Irp );
+
#endif /* __TCP_H */