Commit graph

17 commits

Author SHA1 Message Date
Art Yerkes
aa3eb8fc7c Oskit can now be linked from userland. This is part one of my plan.
tcpip: provide malloc + free, sleep + wakeup functions
oskittcp: remove functions and headers that imply km and supply them from the
user.
tcp_usrreq: i was printing a possibly free mbuf here.

svn path=/trunk/; revision=10734
2004-08-29 20:04:42 +00:00
Art Yerkes
c24ef8433f AFD: Fixed handling of cancelling in flight requests when closing the socket.
Closing a socket doesn't crash but still hangs.  Needs work.
oskittcp: corrected problem with send data, trying out slightly different
scheme of dealing with closed socket.
tcpip: added support for SEL_FIN in socket state callback and corrected
support for returning error in TCPReceiveData.

svn path=/trunk/; revision=10650
2004-08-22 18:42:42 +00:00
Art Yerkes
9d7db6ee1c oskittcp: new import. less diff output versus pure sources.
no deleted code this time around.  all properly ifdef'd
more use of bsd style adapter structs and adapter queries with provided
support by tcpip.sys.
correct prototypes
some diff output is reformatting

tcpip: some bug fixes, -Wall -Werror on, all prototypes in
remove the need for MaxLLHeaderSize anywhere except lan.c
unify meaning of Header and Data members of IP_PACKET
unify PCHAR types in routines.c
move one more address into the struct, eliminating management and extra
poll alloc in NCE
eliminate wrong use of PIP_INTERFACE as NTE pointer in dispatch functions
other fixes

svn path=/trunk/; revision=10601
2004-08-19 21:39:00 +00:00
Casper Hornstrup
ad002d5bd9 2004-08-16 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/net/tcpip/include/.cvsignore: New file.
	* drivers/net/tcpip/include/precomp.h: New file.
	* drivers/net/tcpip/Makefile (TARGET_PCH): Set to include/precomp.h.
	* drivers/net/tcpip/tests/Makefile (TARGET_PCH): Reset.
	* drivers/net/tcpip/*/*.c: Use pre-compiled header.

svn path=/trunk/; revision=10569
2004-08-15 23:41:26 +00:00
Art Yerkes
e6f5d067e0 oskittcp: fixed handling of uio in send.
afd: fixed send.
tcpip: fixed double-complete of send irp.

svn path=/trunk/; revision=10122
2004-07-15 03:21:47 +00:00
Art Yerkes
494edc04e5 Fixed for TCPIP
Regularized TCPSendData and TCPReceiveData parameters and calling.
Added number of bytes IoStatus for TDI_SEND_DATAGRAM and TDI_SEND as
specified in the OSR entry for TDI_SEND_DATAGRAM.
Fixed IRQL in packet send event.  We now use KeRaiseIrql to make sure we're
in DISPATCH_LEVEL.
Fixed socket state callback for new afd.  Now fully based on io completion.

svn path=/trunk/; revision=10032
2004-07-08 06:36:04 +00:00
Art Yerkes
c1d0686eaa This is a merge onto head of the last two months worth of changes to the
networking code.

There is individual change info on the branch arty_20040329.

Here is a summary of what changed:

tcpip:

- Added a mostly working transport/tcp branch based on oskittcp
  (checked in at drivers/lib/oskittcp).  This code shares almost nothing
  with the previous version.

- Regularized IRP handling

- Fixed ownership of buffers throughout tcpip.sys.  Buffers are now
  required to be copied in a few more cases, but everybody can call
  anybody else and not have to worry about keeping a buffer alive
  for any specific reason.

- Also moved lots more operations onto the stack (small datastructures
  and pointers).  This will result in a further simplification of the
  code here.

- Made each completion routine solely responsible for freeing memory
  from the corresponding action.

- Removed reference counted small address structures in favor if inlines

- Changed and clarified ownership rules almost everwhere

- Fixed a few more type punning style errors

- Added more info used by iphlpapi

- Added some memory tracing stuff

ndis:

- Fixed one or two type punning errors

ws2_32:

- Added getservbyname and getprotobyname (partial)

oskittcp:

- Diagnostics everywhere

- Eliminated dependence on raw_ip input

- Simplified buffering and signalling model a bit

- Added memory checking as in tcpip

- more to come

svn path=/trunk/; revision=9647
2004-06-09 18:11:39 +00:00
Filip Navara
1f2169eb29 2004-04-04 Filip Navara <xnavara@volny.cz>
* drivers/net/afd/afd/dispatch.c (AfdDispGetName): Implement.
	* drivers/net/afd/include/afd.h (TdiQueryInformation): Declare.
	* drivers/net/tcpip/tcpip/dispatch.c (DispTdiQueryInformation):
	Partially implement for TDI_QUERY_ADDRESS_INFO request.
	* drivers/net/tcpip/transport/tcp/tcp.c (TCPiBuildPacket):
	Don't use variable name NdisBuffer, because it causes conficts.

svn path=/trunk/; revision=8543
2004-03-05 00:48:11 +00:00
Casper Hornstrup
318a90741d 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
Filip Navara
8ccf098ee6 reactos/drivers/net/afd/afd/afd.c (AfdDispatch): Correctly set
Irp->IoStatus.Information.
(AfdUnload): Make it STDCALL.
(DriverEntry): Don't cast function pointers.
reactos/drivers/net/afd/afd/dispatch.c (AfdDispGetName): New function, still
incomplete.
reactos/drivers/net/afd/include/afd.h (AfdDispGetName): Declare.
reactos/drivers/net/tcpip/tcpip/main.c (TiDispatchOpenClose):
Use STDCALL instead of STDCALL_FUNC.
(TiUnload): Make it STDCALL.
(DriverEntry): Don't cast function pointers.
reactos/drivers/net/tcpip/transport/tcp/tcp.c (TCPConnect):
Don't free the NDIS buffer, it's already done on another place and return
STATUS_PENDING to avoid completing the Irp two times.
reactos/lib/msafd/misc/stubs.c (WSPGetSockName, WSPGetPeerName):
Moved to ...
reactos/lib/msafd/misc/dllmain.c (WSPGetSockName, WSPGetPeerName):
... here, direct the calls to afd.sys.

svn path=/trunk/; revision=8132
2004-02-10 17:12:42 +00:00
Filip Navara
6c639db134 - Fixed some address calculations
svn path=/trunk/; revision=8074
2004-02-07 12:03:11 +00:00
Art Yerkes
24fecbb518 Added afd/tdiconn.c with corrections by filip navara
afd/dispatch.c fixed ptr arith + bug fix by filip
afd/tdi.c removed functions dealing with TDI_CONNECTION_INFORMATION (tdiconn)
tcpip fixes by filip

svn path=/trunk/; revision=8072
2004-02-07 04:50:44 +00:00
Casper Hornstrup
08ba5babf3 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
Casper Hornstrup
36aa98343d 2003-01-15 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/net/tcpip/makefile (TCP_OBJECTS): Add transport/tcp/tcpcore.o,
	transport/tcp/tcp_input.o, transport/tcp/tcp_ipv4.o,
	transport/tcp/tcp_output.o, and transport/tcp/tcp_timer.o.
	* drivers/net/tcpip/transport/tcp/tcp.c (TCPStartup): Call tcp_init().
	* drivers/net/tcpip/include/linux.h: New file.
	* drivers/net/tcpip/include/tcpcore.h: Ditto.
	* drivers/net/tcpip/include/tcpdef.h: Ditto.
	* drivers/net/tcpip/transport/tcp/tcp_input.c: Ditto.
	* drivers/net/tcpip/transport/tcp/tcp_ipv4.c: Ditto.
	* drivers/net/tcpip/transport/tcp/tcp_output.c: Ditto.
	* drivers/net/tcpip/transport/tcp/tcp_timer.c: Ditto.
	* drivers/net/tcpip/transport/tcp/tcpcore.c: Ditto.

svn path=/trunk/; revision=4011
2003-01-15 21:57:31 +00:00
Casper Hornstrup
3a9de284ad Updated clean rules.
Implemented sequenced lists and lookaside lists.
Started on TCP/IP connection endpoints.
Save process window station in EPROCESS instead of PEB.
NOTICE: please do a make win32k_clean or you might experience a crash

svn path=/trunk/; revision=2036
2001-07-04 20:40:24 +00:00
David Welch
a859ee0c1e Added networking code from Casper Hornstrup
svn path=/trunk/; revision=1283
2000-08-02 00:24:26 +00:00
David Welch
b5ff23bb2f Added networking code from Casper Hornstrup
svn path=/trunk/; revision=1282
2000-08-02 00:02:53 +00:00