2000-08-02 00:24:26 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS TCP/IP protocol driver
|
|
|
|
* FILE: include/tcp.h
|
|
|
|
* PURPOSE: Transmission Control Protocol definitions
|
|
|
|
*/
|
2010-02-26 11:43:19 +00:00
|
|
|
|
|
|
|
#pragma once
|
2000-08-02 00:24:26 +00:00
|
|
|
|
2005-05-08 02:16:32 +00:00
|
|
|
typedef VOID
|
2004-08-22 18:42:42 +00:00
|
|
|
(*PTCP_COMPLETION_ROUTINE)( PVOID Context, NTSTATUS Status, ULONG Count );
|
|
|
|
|
2001-07-04 20:40:24 +00:00
|
|
|
/* TCPv4 header structure */
|
2006-01-07 07:40:14 +00:00
|
|
|
#include <pshpack1.h>
|
2004-03-04 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/net/tcpip/tcpip/i386: New directory.
* drivers/net/tcpip/tcpip/i386/checksum.S: New file.
* drivers/net/tcpip/notes.txt: New file.
* drivers/net/afd/afd/dispatch.c (AfdDispCompleteListen): Signal ACCEPT
network event.
(AfdDispEventSelect): Reference event handle.
* drivers/net/afd/afd/tdi.c (TdiListen): Remove unused event.
Move Iosb and RequestConnectionInfo to AFD_LISTEN_REQUEST structure.
* drivers/net/afd/include/afd.h (AFDFCB): Replace EventObjects with
EventObject of type PKEVENT.
* drivers/net/tcpip/makefile (ARCH_OBJECTS): New variable.
(TARGET_OBJECTS): Add ARCH_OBJECTS.
* drivers/net/tcpip/include/address.h (AddrCloneAddress): New prototype.
* drivers/net/tcpip/include/checksum.h (ChecksumFold, csum_partial): New
prototype.
(TCPv4Checksum): New macro.
(CorrectChecksum): Rename to IPv4CorrectChecksum.
(TCPv4CorrectChecksum): New macro.
* drivers/net/tcpip/include/ip.h (IPv4_DF_MASK): New constant.
* drivers/net/tcpip/include/tcp.h (TCP_XXX): Correct constants.
(TCPCreateSegment, TCPFreeSegment, TCPAddSegment): Prototype.
* drivers/net/tcpip/include/titypes.h (TCP_SEND_REQUEST): Add SequenceNumber
and AckNumber.
(TCP_SEGMENT): New structure.
(CONNECTION_ENDPOINT): Add ListenRequest and ReceivedSegments.
* drivers/net/tcpip/network/transmit.c (SendFragments): Release memory
for Data on failure.
* drivers/net/tcpip/tcpip/address.c (AddrCloneAddress): New function.
* drivers/net/tcpip/tcpip/checksum.c (ChecksumFold): Factor out folding
from ChecksumCompute.
* drivers/net/tcpip/tcpip/dispatch.c (DispTdiListen): Support asynchronous
operation.
* drivers/net/tcpip/tcpip/fileobjs.c (FileOpenAddress): Don't cast to
PTDI_ADDRESS_IP.
Initialize ReceivedSegments.
* drivers/net/tcpip/tcpip/routines.c (DisplayIPHeader): New function.
(DisplayIPPacket): Call DisplayIPHeader().
(DisplayTCPHeader): Change format strings.
* drivers/net/tcpip/transport/tcp/tcp.c (IPIdentification,
TCPSegmentList): Add.
(TCPCreateSegment, TCPFreeSegment, TCPAddSegment,
TCPBuildAndTransmitSendRequest2, TCPiSelectISS, TCPiReceiveListen,
TCPiReceiveSynSent, TCPiReceiveSynReceived, TCPiReceiveData): New
function.
(TCPiBuildPacket): Build segment.
(TCPStartup): Initialize TCPSegmentList.
(TCPShutdown): Cleanup TCPSegmentList.
svn path=/trunk/; revision=8537
2004-03-04 20:45:39 +00:00
|
|
|
typedef struct TCPv4_HEADER {
|
|
|
|
USHORT SourcePort; /* Source port */
|
|
|
|
USHORT DestinationPort; /* Destination port */
|
|
|
|
ULONG SequenceNumber; /* Sequence number */
|
|
|
|
ULONG AckNumber; /* Acknowledgement number */
|
|
|
|
UCHAR DataOffset; /* Data offset; 32-bit words (leftmost 4 bits) */
|
|
|
|
UCHAR Flags; /* Control bits (rightmost 6 bits) */
|
|
|
|
USHORT Window; /* Maximum acceptable receive window */
|
|
|
|
USHORT Checksum; /* Checksum of segment */
|
|
|
|
USHORT Urgent; /* Pointer to urgent data */
|
2006-01-07 07:40:14 +00:00
|
|
|
} TCPv4_HEADER, *PTCPv4_HEADER;
|
2001-07-04 20:40:24 +00:00
|
|
|
|
|
|
|
#define TCPOPT_END_OF_LIST 0x0
|
|
|
|
#define TCPOPT_NO_OPERATION 0x1
|
|
|
|
#define TCPOPT_MAX_SEG_SIZE 0x2
|
|
|
|
|
|
|
|
#define TCPOPTLEN_MAX_SEG_SIZE 0x4
|
|
|
|
|
2004-06-09 18:11:39 +00:00
|
|
|
/* Data offset; 32-bit words (leftmost 4 bits); convert to bytes */
|
|
|
|
#define TCP_DATA_OFFSET(DataOffset)(((DataOffset) & 0xF0) >> (4-2))
|
|
|
|
|
2001-07-04 20:40:24 +00:00
|
|
|
|
|
|
|
/* TCPv4 pseudo header */
|
2004-03-04 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/net/tcpip/tcpip/i386: New directory.
* drivers/net/tcpip/tcpip/i386/checksum.S: New file.
* drivers/net/tcpip/notes.txt: New file.
* drivers/net/afd/afd/dispatch.c (AfdDispCompleteListen): Signal ACCEPT
network event.
(AfdDispEventSelect): Reference event handle.
* drivers/net/afd/afd/tdi.c (TdiListen): Remove unused event.
Move Iosb and RequestConnectionInfo to AFD_LISTEN_REQUEST structure.
* drivers/net/afd/include/afd.h (AFDFCB): Replace EventObjects with
EventObject of type PKEVENT.
* drivers/net/tcpip/makefile (ARCH_OBJECTS): New variable.
(TARGET_OBJECTS): Add ARCH_OBJECTS.
* drivers/net/tcpip/include/address.h (AddrCloneAddress): New prototype.
* drivers/net/tcpip/include/checksum.h (ChecksumFold, csum_partial): New
prototype.
(TCPv4Checksum): New macro.
(CorrectChecksum): Rename to IPv4CorrectChecksum.
(TCPv4CorrectChecksum): New macro.
* drivers/net/tcpip/include/ip.h (IPv4_DF_MASK): New constant.
* drivers/net/tcpip/include/tcp.h (TCP_XXX): Correct constants.
(TCPCreateSegment, TCPFreeSegment, TCPAddSegment): Prototype.
* drivers/net/tcpip/include/titypes.h (TCP_SEND_REQUEST): Add SequenceNumber
and AckNumber.
(TCP_SEGMENT): New structure.
(CONNECTION_ENDPOINT): Add ListenRequest and ReceivedSegments.
* drivers/net/tcpip/network/transmit.c (SendFragments): Release memory
for Data on failure.
* drivers/net/tcpip/tcpip/address.c (AddrCloneAddress): New function.
* drivers/net/tcpip/tcpip/checksum.c (ChecksumFold): Factor out folding
from ChecksumCompute.
* drivers/net/tcpip/tcpip/dispatch.c (DispTdiListen): Support asynchronous
operation.
* drivers/net/tcpip/tcpip/fileobjs.c (FileOpenAddress): Don't cast to
PTDI_ADDRESS_IP.
Initialize ReceivedSegments.
* drivers/net/tcpip/tcpip/routines.c (DisplayIPHeader): New function.
(DisplayIPPacket): Call DisplayIPHeader().
(DisplayTCPHeader): Change format strings.
* drivers/net/tcpip/transport/tcp/tcp.c (IPIdentification,
TCPSegmentList): Add.
(TCPCreateSegment, TCPFreeSegment, TCPAddSegment,
TCPBuildAndTransmitSendRequest2, TCPiSelectISS, TCPiReceiveListen,
TCPiReceiveSynSent, TCPiReceiveSynReceived, TCPiReceiveData): New
function.
(TCPiBuildPacket): Build segment.
(TCPStartup): Initialize TCPSegmentList.
(TCPShutdown): Cleanup TCPSegmentList.
svn path=/trunk/; revision=8537
2004-03-04 20:45:39 +00:00
|
|
|
typedef struct TCPv4_PSEUDO_HEADER {
|
|
|
|
ULONG SourceAddress; /* Source address */
|
|
|
|
ULONG DestinationAddress; /* Destination address */
|
|
|
|
UCHAR Zero; /* Reserved */
|
|
|
|
UCHAR Protocol; /* Protocol */
|
|
|
|
USHORT TCPLength; /* Size of TCP segment */
|
2006-01-07 07:40:14 +00:00
|
|
|
} TCPv4_PSEUDO_HEADER, *PTCPv4_PSEUDO_HEADER;
|
|
|
|
#include <poppack.h>
|
2001-07-04 20:40:24 +00:00
|
|
|
|
2004-08-29 20:04:42 +00:00
|
|
|
typedef struct _SLEEPING_THREAD {
|
|
|
|
LIST_ENTRY Entry;
|
|
|
|
PVOID SleepToken;
|
|
|
|
KEVENT Event;
|
|
|
|
} SLEEPING_THREAD, *PSLEEPING_THREAD;
|
2001-07-04 20:40:24 +00:00
|
|
|
|
2009-11-21 13:00:37 +00:00
|
|
|
typedef struct _CLIENT_DATA {
|
|
|
|
BOOLEAN Unlocked;
|
|
|
|
KSPIN_LOCK Lock;
|
2009-12-31 23:33:24 +00:00
|
|
|
KIRQL OldIrql;
|
2009-11-21 13:00:37 +00:00
|
|
|
} CLIENT_DATA, *PCLIENT_DATA;
|
|
|
|
|
2001-07-04 20:40:24 +00:00
|
|
|
/* Retransmission timeout constants */
|
|
|
|
|
|
|
|
/* Lower bound for retransmission timeout in TCP timer ticks */
|
|
|
|
#define TCP_MIN_RETRANSMISSION_TIMEOUT 1*1000 /* 1 tick */
|
|
|
|
|
|
|
|
/* Upper bound for retransmission timeout in TCP timer ticks */
|
|
|
|
#define TCP_MAX_RETRANSMISSION_TIMEOUT 1*60*1000 /* 1 tick */
|
|
|
|
|
|
|
|
/* Smoothing factor */
|
|
|
|
#define TCP_ALPHA_RETRANSMISSION_TIMEOUT(x)(((x)*8)/10) /* 0.8 */
|
|
|
|
|
|
|
|
/* Delay variance factor */
|
|
|
|
#define TCP_BETA_RETRANSMISSION_TIMEOUT(x)(((x)*16)/10) /* 1.6 */
|
|
|
|
|
2010-09-21 06:11:24 +00:00
|
|
|
#define SEL_CONNECT 1
|
|
|
|
#define SEL_FIN 2
|
|
|
|
#define SEL_RST 4
|
|
|
|
#define SEL_ABRT 8
|
|
|
|
#define SEL_READ 16
|
|
|
|
#define SEL_WRITE 32
|
|
|
|
#define SEL_ACCEPT 64
|
|
|
|
#define SEL_OOB 128
|
|
|
|
#define SEL_ERROR 256
|
|
|
|
#define SEL_FINOUT 512
|
|
|
|
|
|
|
|
#define FREAD 0x0001
|
|
|
|
#define FWRITE 0x0002
|
2001-07-04 20:40:24 +00:00
|
|
|
|
|
|
|
/* Datagram/segment send request flags */
|
|
|
|
|
|
|
|
#define SRF_URG TCP_URG
|
|
|
|
#define SRF_ACK TCP_ACK
|
|
|
|
#define SRF_PSH TCP_PSH
|
|
|
|
#define SRF_RST TCP_RST
|
|
|
|
#define SRF_SYN TCP_SYN
|
|
|
|
#define SRF_FIN TCP_FIN
|
|
|
|
|
2004-12-01 08:14:15 +00:00
|
|
|
extern LONG TCP_IPIdentification;
|
2009-11-21 13:00:37 +00:00
|
|
|
extern CLIENT_DATA ClientInfo;
|
2004-12-01 08:14:15 +00:00
|
|
|
|
2004-12-25 21:30:20 +00:00
|
|
|
/* accept.c */
|
2010-09-21 06:11:24 +00:00
|
|
|
NTSTATUS TCPCheckPeerForAccept(PVOID Context,
|
|
|
|
PTDI_REQUEST_KERNEL Request);
|
2004-12-25 21:30:20 +00:00
|
|
|
NTSTATUS TCPListen( PCONNECTION_ENDPOINT Connection, UINT Backlog );
|
2009-11-22 02:32:47 +00:00
|
|
|
BOOLEAN TCPAbortListenForSocket( PCONNECTION_ENDPOINT Listener,
|
|
|
|
PCONNECTION_ENDPOINT Connection );
|
2004-12-25 21:30:20 +00:00
|
|
|
NTSTATUS TCPAccept
|
|
|
|
( PTDI_REQUEST Request,
|
|
|
|
PCONNECTION_ENDPOINT Listener,
|
|
|
|
PCONNECTION_ENDPOINT Connection,
|
|
|
|
PTCP_COMPLETION_ROUTINE Complete,
|
|
|
|
PVOID Context );
|
|
|
|
|
|
|
|
/* tcp.c */
|
2004-09-30 05:44:10 +00:00
|
|
|
PCONNECTION_ENDPOINT TCPAllocateConnectionEndpoint( PVOID ClientContext );
|
|
|
|
VOID TCPFreeConnectionEndpoint( PCONNECTION_ENDPOINT Connection );
|
|
|
|
|
2005-05-08 02:16:32 +00:00
|
|
|
NTSTATUS TCPSocket( PCONNECTION_ENDPOINT Connection,
|
2004-09-30 05:44:10 +00:00
|
|
|
UINT Family, UINT Type, UINT Proto );
|
|
|
|
|
2009-11-21 13:00:37 +00:00
|
|
|
VOID HandleSignalledConnection(PCONNECTION_ENDPOINT Connection);
|
|
|
|
|
2004-03-04 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/net/tcpip/tcpip/i386: New directory.
* drivers/net/tcpip/tcpip/i386/checksum.S: New file.
* drivers/net/tcpip/notes.txt: New file.
* drivers/net/afd/afd/dispatch.c (AfdDispCompleteListen): Signal ACCEPT
network event.
(AfdDispEventSelect): Reference event handle.
* drivers/net/afd/afd/tdi.c (TdiListen): Remove unused event.
Move Iosb and RequestConnectionInfo to AFD_LISTEN_REQUEST structure.
* drivers/net/afd/include/afd.h (AFDFCB): Replace EventObjects with
EventObject of type PKEVENT.
* drivers/net/tcpip/makefile (ARCH_OBJECTS): New variable.
(TARGET_OBJECTS): Add ARCH_OBJECTS.
* drivers/net/tcpip/include/address.h (AddrCloneAddress): New prototype.
* drivers/net/tcpip/include/checksum.h (ChecksumFold, csum_partial): New
prototype.
(TCPv4Checksum): New macro.
(CorrectChecksum): Rename to IPv4CorrectChecksum.
(TCPv4CorrectChecksum): New macro.
* drivers/net/tcpip/include/ip.h (IPv4_DF_MASK): New constant.
* drivers/net/tcpip/include/tcp.h (TCP_XXX): Correct constants.
(TCPCreateSegment, TCPFreeSegment, TCPAddSegment): Prototype.
* drivers/net/tcpip/include/titypes.h (TCP_SEND_REQUEST): Add SequenceNumber
and AckNumber.
(TCP_SEGMENT): New structure.
(CONNECTION_ENDPOINT): Add ListenRequest and ReceivedSegments.
* drivers/net/tcpip/network/transmit.c (SendFragments): Release memory
for Data on failure.
* drivers/net/tcpip/tcpip/address.c (AddrCloneAddress): New function.
* drivers/net/tcpip/tcpip/checksum.c (ChecksumFold): Factor out folding
from ChecksumCompute.
* drivers/net/tcpip/tcpip/dispatch.c (DispTdiListen): Support asynchronous
operation.
* drivers/net/tcpip/tcpip/fileobjs.c (FileOpenAddress): Don't cast to
PTDI_ADDRESS_IP.
Initialize ReceivedSegments.
* drivers/net/tcpip/tcpip/routines.c (DisplayIPHeader): New function.
(DisplayIPPacket): Call DisplayIPHeader().
(DisplayTCPHeader): Change format strings.
* drivers/net/tcpip/transport/tcp/tcp.c (IPIdentification,
TCPSegmentList): Add.
(TCPCreateSegment, TCPFreeSegment, TCPAddSegment,
TCPBuildAndTransmitSendRequest2, TCPiSelectISS, TCPiReceiveListen,
TCPiReceiveSynSent, TCPiReceiveSynReceived, TCPiReceiveData): New
function.
(TCPiBuildPacket): Build segment.
(TCPStartup): Initialize TCPSegmentList.
(TCPShutdown): Cleanup TCPSegmentList.
svn path=/trunk/; revision=8537
2004-03-04 20:45:39 +00:00
|
|
|
PTCP_SEGMENT TCPCreateSegment(
|
|
|
|
PIP_PACKET IPPacket,
|
2004-06-09 18:11:39 +00:00
|
|
|
PTCPv4_HEADER TCPHeader,
|
2004-03-04 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/net/tcpip/tcpip/i386: New directory.
* drivers/net/tcpip/tcpip/i386/checksum.S: New file.
* drivers/net/tcpip/notes.txt: New file.
* drivers/net/afd/afd/dispatch.c (AfdDispCompleteListen): Signal ACCEPT
network event.
(AfdDispEventSelect): Reference event handle.
* drivers/net/afd/afd/tdi.c (TdiListen): Remove unused event.
Move Iosb and RequestConnectionInfo to AFD_LISTEN_REQUEST structure.
* drivers/net/afd/include/afd.h (AFDFCB): Replace EventObjects with
EventObject of type PKEVENT.
* drivers/net/tcpip/makefile (ARCH_OBJECTS): New variable.
(TARGET_OBJECTS): Add ARCH_OBJECTS.
* drivers/net/tcpip/include/address.h (AddrCloneAddress): New prototype.
* drivers/net/tcpip/include/checksum.h (ChecksumFold, csum_partial): New
prototype.
(TCPv4Checksum): New macro.
(CorrectChecksum): Rename to IPv4CorrectChecksum.
(TCPv4CorrectChecksum): New macro.
* drivers/net/tcpip/include/ip.h (IPv4_DF_MASK): New constant.
* drivers/net/tcpip/include/tcp.h (TCP_XXX): Correct constants.
(TCPCreateSegment, TCPFreeSegment, TCPAddSegment): Prototype.
* drivers/net/tcpip/include/titypes.h (TCP_SEND_REQUEST): Add SequenceNumber
and AckNumber.
(TCP_SEGMENT): New structure.
(CONNECTION_ENDPOINT): Add ListenRequest and ReceivedSegments.
* drivers/net/tcpip/network/transmit.c (SendFragments): Release memory
for Data on failure.
* drivers/net/tcpip/tcpip/address.c (AddrCloneAddress): New function.
* drivers/net/tcpip/tcpip/checksum.c (ChecksumFold): Factor out folding
from ChecksumCompute.
* drivers/net/tcpip/tcpip/dispatch.c (DispTdiListen): Support asynchronous
operation.
* drivers/net/tcpip/tcpip/fileobjs.c (FileOpenAddress): Don't cast to
PTDI_ADDRESS_IP.
Initialize ReceivedSegments.
* drivers/net/tcpip/tcpip/routines.c (DisplayIPHeader): New function.
(DisplayIPPacket): Call DisplayIPHeader().
(DisplayTCPHeader): Change format strings.
* drivers/net/tcpip/transport/tcp/tcp.c (IPIdentification,
TCPSegmentList): Add.
(TCPCreateSegment, TCPFreeSegment, TCPAddSegment,
TCPBuildAndTransmitSendRequest2, TCPiSelectISS, TCPiReceiveListen,
TCPiReceiveSynSent, TCPiReceiveSynReceived, TCPiReceiveData): New
function.
(TCPiBuildPacket): Build segment.
(TCPStartup): Initialize TCPSegmentList.
(TCPShutdown): Cleanup TCPSegmentList.
svn path=/trunk/; revision=8537
2004-03-04 20:45:39 +00:00
|
|
|
ULONG SegmentLength);
|
|
|
|
|
|
|
|
VOID TCPFreeSegment(
|
|
|
|
PTCP_SEGMENT Segment);
|
|
|
|
|
|
|
|
VOID TCPAddSegment(
|
|
|
|
PCONNECTION_ENDPOINT Connection,
|
2004-06-09 18:11:39 +00:00
|
|
|
PTCP_SEGMENT Segment,
|
|
|
|
PULONG Acknowledged);
|
2001-07-04 20:40:24 +00:00
|
|
|
|
|
|
|
NTSTATUS TCPConnect(
|
2004-09-30 05:44:10 +00:00
|
|
|
PCONNECTION_ENDPOINT Connection,
|
2001-07-04 20:40:24 +00:00
|
|
|
PTDI_CONNECTION_INFORMATION ConnInfo,
|
2004-09-30 05:44:10 +00:00
|
|
|
PTDI_CONNECTION_INFORMATION ReturnInfo,
|
|
|
|
PTCP_COMPLETION_ROUTINE Complete,
|
|
|
|
PVOID Context);
|
2001-07-04 20:40:24 +00:00
|
|
|
|
2004-12-04 23:29:56 +00:00
|
|
|
NTSTATUS TCPDisconnect(
|
|
|
|
PCONNECTION_ENDPOINT Connection,
|
|
|
|
UINT Flags,
|
2011-07-02 20:36:35 +00:00
|
|
|
PLARGE_INTEGER Timeout,
|
2004-12-04 23:29:56 +00:00
|
|
|
PTDI_CONNECTION_INFORMATION ConnInfo,
|
|
|
|
PTDI_CONNECTION_INFORMATION ReturnInfo,
|
|
|
|
PTCP_COMPLETION_ROUTINE Complete,
|
|
|
|
PVOID Context);
|
|
|
|
|
2004-06-09 18:11:39 +00:00
|
|
|
NTSTATUS TCPReceiveData(
|
2005-05-08 02:16:32 +00:00
|
|
|
PCONNECTION_ENDPOINT Connection,
|
2004-06-09 18:11:39 +00:00
|
|
|
PNDIS_BUFFER Buffer,
|
|
|
|
ULONG ReceiveLength,
|
2004-09-30 05:44:10 +00:00
|
|
|
PULONG BytesReceived,
|
2004-06-09 18:11:39 +00:00
|
|
|
ULONG ReceiveFlags,
|
2004-09-30 05:44:10 +00:00
|
|
|
PTCP_COMPLETION_ROUTINE Complete,
|
|
|
|
PVOID Context);
|
2003-12-25 Casper S. Hornstrup <chorns@users.sourceforge.net>
* apps/utils/net/roshttpd/error.cpp (ReportErrorStr): Cast to wchar_t*,
not __wchar_t*.
* apps/utils/net/roshttpd/makefile (TARGET_CPPFLAGS): Add -Wno-deprecated.
(TARGET_GCCLIBS): Add stdc++.
* apps/utils/net/roshttpd/common/socket.cpp: Include <string.h>.
* apps/utils/net/roshttpd/common/thread.cpp (CThread::CThread): Fix
warning.
* drivers/net/afd/afd/afd.c (ListenRequestLookasideList): New variable.
(DriverEntry): Initialize ListenRequestLookasideList.
* drivers/net/afd/afd/dispatch.c (AfdDispCompleteListen): New function.
(AfdDispListen): Partial implement.
* drivers/net/afd/afd/opnclose.c (AfdInitializeFCB): Initialize
NewFCB->ListenRequestQueue.
(AfdKillListenRequests): New function.
(AfdClose): Call AfdKillListenRequests.
* drivers/net/afd/afd/routines.c (DumpName): New function.
* drivers/net/afd/afd/tdi.c (TdiAddressSizeFromType): New function.
(TdiBuildConnectionInfo): Initialize ConnInfo->OptionsLength.
(TdiBuildNullConnectionInfo): New function.
(TdiOpenAddressFileIPv4, TdiOpenConnectionEndpointFile): EaName is
0-terminated.
(TdiListen): New function.
* drivers/net/afd/include/afd.h (AFDFCB): Add ListenRequestQueue.
(AFD_LISTEN_REQUEST): New structure.
(ListenRequestLookasideList): Declare.
(DumpName, TdiListen): Add prototypes.
* drivers/net/tcpip/datalink/lan.c (BindAdapter): Initialize
AnsiAddress.Length and AnsiAddress.MaximumLength.
* drivers/net/tcpip/include/debug.h: Define DEBUG_TCP.
* drivers/net/tcpip/include/routines.h (DisplayTCPPacket): Add
prototype.
(DISPLAY_TCP_PACKET): Define.
* drivers/net/tcpip/include/tcp.h (TCPListen): Add prototype.
* drivers/net/tcpip/include/titypes.h (ADDRESS_FILE): Add Connection.
* drivers/net/tcpip/network/ip.c (IPLocateNTEOnInterface): Cleanup.
* drivers/net/tcpip/tcpip/address.c (AddrSearchNext): Port is in
network byte order.
* drivers/net/tcpip/tcpip/dispatch.c (DispTdiAssociateAddress):
Initialize AddrFile->Connection.
(DispTdiListen): Implement.
* drivers/net/tcpip/tcpip/fileobjs.c (FileOpenAddress): Don't
initialize AddrFile->Connections.
* drivers/net/tcpip/tcpip/routines.c: Include <tcp.h>.
(DisplayIPPacket): Enable.
(DisplayTCPHeader, DisplayTCPPacket): New functions.
* drivers/net/tcpip/transport/tcp/tcp.c: Include <routines.h>.
(TCPListen, TCPiReceive): New functions.
(TCPReceive): Partial implement.
* lib/msafd/misc/helpers.c (CreateHelperDLLDatabase): Add
{SOCK_STREAM,IPPROTO_TCP,0} and {SOCK_DGRAM,IPPROTO_UDP,0} mappings.
* lib/ntdll/ldr/utils.c (LdrLoadDll): Print name of DLL if not found.
* lib/ws2_32/include/ws2_32.h (Initialized): Declare.
(WINSOCK_THREAD_BLOCK): Remove Initialized member.
* (WSAINITIALIZED, WSASETINITIALIZED): Update.
* lib/ws2_32/misc/catalog.c (CreateCatalog): Add
{SOCK_STREAM,IPPROTO_TCP,0} and {SOCK_DGRAM,IPPROTO_UDP,0} mappings.
(Initialized): New variable.
(DllMain): Don't initialize p->Initialized.
* ntoskrnl/dbg/kdb.c: Include <ctype.h>.
* subsys/win32k/ntuser/message.c (NtUserDispatchMessage): Kill noisy
message.
svn path=/trunk/; revision=7232
2003-12-25 14:06:15 +00:00
|
|
|
|
2004-06-09 18:11:39 +00:00
|
|
|
NTSTATUS TCPSendData(
|
2004-09-30 05:44:10 +00:00
|
|
|
PCONNECTION_ENDPOINT Connection,
|
|
|
|
PCHAR Buffer,
|
2004-07-08 06:36:04 +00:00
|
|
|
ULONG DataSize,
|
2004-09-30 05:44:10 +00:00
|
|
|
PULONG DataUsed,
|
2006-01-04 22:40:48 +00:00
|
|
|
ULONG Flags,
|
|
|
|
PTCP_COMPLETION_ROUTINE Complete,
|
|
|
|
PVOID Context);
|
2001-07-04 20:40:24 +00:00
|
|
|
|
2004-09-30 05:44:10 +00:00
|
|
|
NTSTATUS TCPClose( PCONNECTION_ENDPOINT Connection );
|
2004-08-19 21:39:00 +00:00
|
|
|
|
2011-08-01 20:10:55 +00:00
|
|
|
NTSTATUS TCPTranslateError( const INT8 err );
|
2004-08-19 21:39:00 +00:00
|
|
|
|
2011-08-01 20:10:55 +00:00
|
|
|
UINT TCPAllocatePort( const UINT HintPort );
|
2004-12-11 16:36:06 +00:00
|
|
|
|
2011-08-01 20:10:55 +00:00
|
|
|
VOID TCPFreePort( const UINT Port );
|
2004-12-11 16:36:06 +00:00
|
|
|
|
2009-02-19 20:14:39 +00:00
|
|
|
NTSTATUS TCPGetSockAddress
|
2005-05-08 02:16:32 +00:00
|
|
|
( PCONNECTION_ENDPOINT Connection,
|
2009-02-19 20:14:39 +00:00
|
|
|
PTRANSPORT_ADDRESS TransportAddress,
|
|
|
|
BOOLEAN RemoteAddress );
|
2005-01-13 06:46:22 +00:00
|
|
|
|
2000-08-02 00:24:26 +00:00
|
|
|
NTSTATUS TCPStartup(
|
2001-07-04 20:40:24 +00:00
|
|
|
VOID);
|
2000-08-02 00:24:26 +00:00
|
|
|
|
|
|
|
NTSTATUS TCPShutdown(
|
2001-07-04 20:40:24 +00:00
|
|
|
VOID);
|
2000-08-02 00:24:26 +00:00
|
|
|
|
2009-11-22 02:32:47 +00:00
|
|
|
BOOLEAN TCPRemoveIRP( PCONNECTION_ENDPOINT Connection, PIRP Irp );
|
2010-09-21 06:11:24 +00:00
|
|
|
|
|
|
|
VOID
|
|
|
|
TCPUpdateInterfaceLinkStatus(PIP_INTERFACE IF);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
TCPUpdateInterfaceIPInformation(PIP_INTERFACE IF);
|
|
|
|
|
|
|
|
VOID
|
2011-08-07 19:13:23 +00:00
|
|
|
FlushListenQueue(PCONNECTION_ENDPOINT Connection, const NTSTATUS Status);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
FlushConnectQueue(PCONNECTION_ENDPOINT Connection, const NTSTATUS Status);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
FlushReceiveQueue(PCONNECTION_ENDPOINT Connection, const NTSTATUS Status, const BOOLEAN interlocked);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
FlushSendQueue(PCONNECTION_ENDPOINT Connection, const NTSTATUS Status, const BOOLEAN interlocked);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
FlushShutdownQueue(PCONNECTION_ENDPOINT Connection, const NTSTATUS Status, const BOOLEAN interlocked);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
FlushAllQueues(PCONNECTION_ENDPOINT Connection, NTSTATUS Status);
|
|
|
|
|
|
|
|
VOID CompleteBucket(PCONNECTION_ENDPOINT Connection, PTDI_BUCKET Bucket, const BOOLEAN Synchronous);
|
2013-08-12 03:09:28 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
LibTCPDumpPcb(PVOID SocketContext);
|