Commit graph

188 commits

Author SHA1 Message Date
Art Yerkes 8e1426d027 Implement WSHGetWildcardAddress
svn path=/trunk/; revision=10766
2004-09-01 03:39:29 +00:00
Art Yerkes 9980d7cf9c Since system services are now provided by the client, we need the
callback struct first.

svn path=/trunk/; revision=10743
2004-08-30 18:12:30 +00:00
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 36d2e136c7 Fixed missing unlock in write.
svn path=/trunk/; revision=10649
2004-08-22 02:15:57 +00:00
Art Yerkes 5eef6d16e3 Removed ASSERT_KM macro. It's not used any longer.
svn path=/trunk/; revision=10619
2004-08-20 16:26:10 +00:00
Magnus Olsen ee97250d94 fix
gcc 3.3.x stop comiling and give a error msg
network/icmp.c: In function `SendICMPComplete':
network/icmp.c:28: warning: unused variable `IPPacket'
make[1]: *** [network/icmp.o] Error 1
make: *** [tcpip] Error 2

svn path=/trunk/; revision=10615
2004-08-20 09:44:20 +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
Casper Hornstrup 455ea22b67 2004-08-16 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/net/ndis/include/.cvsignore: New file.
	* drivers/net/ndis/.cvsignore: Add *.d.
	* drivers/net/ndis/Makefile (TARGET_PCH): Set to include/ndissys.h.
	* drivers/net/ndis/*.c: Use pre-compiled header.

svn path=/trunk/; revision=10568
2004-08-15 23:12:33 +00:00
Casper Hornstrup 7ffd28c060 2004-08-16 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/net/afd/include/.cvsignore: New file.
	* drivers/net/afd/include/tdiconn.h: Don't include <afd.h>.
	* drivers/net/afd/.cvsignore: Add *.d.
	* drivers/net/afd/makefile (TARGET_PCH): Set to include/afd.h.

svn path=/trunk/; revision=10567
2004-08-15 22:51:57 +00:00
Filip Navara a5154371b4 - Use NDIS_DbgPrint instead of DbgPrint for NDIS buffer messages.
svn path=/trunk/; revision=10383
2004-08-04 00:19:11 +00:00
Thomas Bluemel 7d74fb9d99 fixed compiling errors with gcc 3.4.x
svn path=/trunk/; revision=10311
2004-07-29 16:46:22 +00:00
Art Yerkes bc0ec8c03d Fixed includes so that DBG keys on roscfg.h
Fixed subtle bug in miniport.c: if exactly one protocol is registered we
would skip it in MiniIndicateData because we took the .Flink value from the
list head, then compared CurrentEntry->Flink to the list head address.

svn path=/trunk/; revision=10307
2004-07-29 05:00:43 +00:00
Art Yerkes c14c59021f Accidentally missed one breakpoint from the previous debugging session.
svn path=/trunk/; revision=10306
2004-07-29 04:10:53 +00:00
Art Yerkes c0dd64494d Fixed memory overwrite due to too-small allocation.
svn path=/trunk/; revision=10305
2004-07-29 04:09:06 +00:00
Art Yerkes a85dce53e9 According to this osr page:
http://www.osr.com/ddk/network/103ndisx_51pu.htm

NdisMEthIndicateReceive passes an NDIS_HANDLE (Specifically,
MiniportAdapterHandle), rather than the ETH_FILTER structure.  God knows why
this wasn't caught before but it did awfully strange stuff including the
occasional crash, and more importantly, seemingly randomly corrupting the
LAN_ADAPTER and IP_INTERFACE structures in tcpip.sys when we landed in
packet receiving in datalink/lan.c.  Fixed now.

svn path=/trunk/; revision=10276
2004-07-24 04:48:01 +00:00
Filip Navara bdedaa4fe0 - Support for deserialized miniports (experimental).
svn path=/trunk/; revision=10255
2004-07-22 18:54:36 +00:00
Art Yerkes 659a6041bc Forgot to add file tilists.h
svn path=/trunk/; revision=10220
2004-07-19 04:30:04 +00:00
Art Yerkes 6a793b2703 Fixed after prototype change.
svn path=/trunk/; revision=10212
2004-07-18 22:53:59 +00:00
Art Yerkes 0f1eb55991 First commit of afd and msafd onto head.
tcpip: Turned off debug info in CVS.

svn path=/trunk/; revision=10210
2004-07-18 22:49:18 +00:00
Art Yerkes 6ac4bce416 msafd + afd: Changed type of PVOID args to PAFD_WSABUF, avoiding some casts.
Added some tracing.
Converted afd.sys to use METHOD_NEITHER in the correct places.
oskittcp: Added some tracking in tcp_input and tcp_output to help look for
the ack bug.
tcpip: some cleaning.  Realized that an NTE was getting sent to IPReceive as
the Context parameter, but was later treated as IP_INTERFACE.  Changed
prototypes to keep this from happening again.

svn path=/trunk/; revision=10207
2004-07-18 22:03:49 +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
Gé van Geldorp 20180bf59f Silence debug messages
svn path=/trunk/; revision=10006
2004-07-07 08:39:54 +00:00
Filip Navara 8fab52126f - Fix errors during optimized build.
svn path=/trunk/; revision=9983
2004-07-03 17:40:27 +00:00
Art Yerkes 5954327e76 Change from unclegarlic: Don't overwrite packet length.
svn path=/trunk/; revision=9718
2004-06-19 02:03:33 +00:00
Art Yerkes 5fd39d97bb recv now works every time
- Standardized on recvfrom request and reply everywhere
- Added a continuous parameter to FillWSABuffers for stream sockets
- Added function TryToSatisfyRecvRequest
- Create MDLs for the WSABUFS.  These are needed because we aren't in our
  home process when tcpip calls back with data.
- Removed extraneous and potentially confusing lock ReadRequestQueueLock
  Now both ReadRequestQueue and ReceiveQueue rely on ReceiveQueueLock

svn path=/trunk/; revision=9669
2004-06-15 02:56:13 +00:00
Art Yerkes 0999a0ef81 Preliminary version of recv.
svn path=/trunk/; revision=9666
2004-06-14 03:22:27 +00:00
Art Yerkes f773e32aab rawip: Removed the deallocation of the client-supplied mdl. This does not
appear to be part of the definition and is not done in the UDP case.
event: I moved the close notify into it's own function so that it can be
worked on separately.

svn path=/trunk/; revision=9665
2004-06-14 01:40:48 +00:00
Art Yerkes 25ae3e20a7 Removed redundant tracking (now incorporated into NdisAllocatePacket, etc)
that was causing a bugcheck in the 'ping to us' case.  The memory was detected
tracked twice (correctly).

This condition was detected by mifritcher after I checked in.

svn path=/trunk/; revision=9659
2004-06-12 04:46:18 +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
Hartmut Birr bdd1e9e8c6 - Fixed the implementation of MmMapIoSpace.
svn path=/trunk/; revision=9409
2004-05-15 22:45:51 +00:00
Gé van Geldorp 5884627fe6 Silence debug messages
svn path=/trunk/; revision=9391
2004-05-15 07:49:05 +00:00
Gé van Geldorp 45ac874e11 Avoid warnings when using gcc 3.4
svn path=/trunk/; revision=9356
2004-05-11 20:52:10 +00:00
Thomas Bluemel d7bba47d07 added some makefiles
svn path=/trunk/; revision=9096
2004-04-12 12:08:53 +00:00
Art Yerkes 7b9bc747c8 Added bit counting and inverting functions to address.
Broke out some functions in info.c -- They still don't work properly but
are improving.
Added setting of netmask in datalink/lan.c from the registry, broke out
registry reading function.

svn path=/trunk/; revision=8661
2004-03-12 04:21:59 +00:00
Art Yerkes 0c76856d9c More support for IOCTL_TCP_QUERY/SET_INFORMATION_EX
Connected ControlChannel handle type.
Allowed empty EaInfo in create -> ControlChannel.
Added TDI entity for interfaces.
Fixed IPSnmpInfo interface number report.
Fixed returned buffer size report in DispTdiQueryInformationExComplete
Added IPROUTE_ENTRY struct.

What works:
tcpquery lists three entities, two builtin and one IF_ENTITY
tcpquery -i reports 1 interface and 1 address for me (addr=127.0.0.1)

TODO:
Type information for each entity (only two builtin entities are supported now)
Interface info out (IFEntry)
Route info in/out (IPRouteEntry)

svn path=/trunk/; revision=8588
2004-03-08 10:20:18 +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 daaf2a72b8 - Build AFD, TCPIP and TDI with w32api headers.
- Removed the old TDI headers from include/net.

svn path=/trunk/; revision=8508
2004-03-02 18:18:15 +00:00
Casper Hornstrup 47306399fd 2004-02-25 Casper S. Hornstrup <chorns@users.sourceforge.net>
* drivers/net/tcpip/datalink/loopback.c: Reformat.
	* drivers/net/tcpip/network/neighbor.c: Ditto.
	* drivers/net/tcpip/tcpip/info.c: Ditto.
	* drivers/net/tcpip/transport/datagram/datagram.c: Cleanup.
	If there is an out-of-resources situation, don't transmit the
	datagram out of order.

svn path=/trunk/; revision=8381
2004-02-25 20:27:56 +00:00
Casper Hornstrup cc3221be2c 2004-02-22 Casper S. Hornstrup <chorns@users.sourceforge.net>
* config (REGRESSIONTESTS): Add.
	* rules.mak (REGTESTS_PATH_INC): Add.
	* drivers/net/tcpip/makefile: Support regression tests.
	* drivers/net/tcpip/tcpip/main.c: Prepare regression tests.
	* hal/halx86/Makefile: Rename TARGET_LIBPATH to TARGET_IMPLIBPATH.
	* regtests/kmregtests/driver.c (KMRegTestsRegister): Add.
	(KMRegTestsRun): Move call to InitializeTests() and RegisterTests() to
	DriverEntry().
	(KMRegTestsDispatch): Support IOCTL_KMREGTESTS_REGISTER.
	* regtests/kmregtests/kmregtests.h (IOCTL_KMREGTESTS_REGISTER): Define.
	* tools/config.mk: Define REGTESTS if REGRESSIONTESTS = 1.
	* tools/helper.mk: Support module private regression tests.
	(TARGET_LIBPATH): Rename to TARGET_IMPLIBPATH.
	(TARGET_LIBPATH, TARGET_REGTESTS): Add.
	* tools/mkconfig.c: Support REGTESTS.
	* tools/regtests.c (umstubfile, kmstubfile): Add.
	(is_file_changed, write_file_if_changed): Add.
	(KMSTUB): Add.
	(HELP): Mention -u and -k switches.
	(main): Parse -u and -k switches.
	* drivers/net/tcpip/tests: New directory.
	* drivers/net/tcpip/tests/.cvsignore: New file.
	* drivers/net/tcpip/tests/Makefile: Makefile.
	* drivers/net/tcpip/tests/tests: New directory.
	* drivers/net/tcpip/tests/tests/.cvsignore: New file.

svn path=/trunk/; revision=8298
2004-02-22 09:59:17 +00:00
Filip Navara c2458a1a4c CVS maintenance
svn path=/trunk/; revision=8288
2004-02-21 13:56:36 +00:00
Hartmut Birr 5b5028fcb9 - Fixed a wrong index, which resulted in writing over the end of an allocated buffer.
svn path=/trunk/; revision=8284
2004-02-21 12:58:49 +00:00
Art Yerkes 8c9fd64030 Edited includes for new tcp ioctl needed by iphlpapi.
tcpioctl.h: new
I resolved a conflict between iptypes, structs and nspapi regarding some
core structures.
afd.h: removed definitions needed by both user land and kernel land.
tdiinfo.h: added needed definitions.

svn path=/trunk/; revision=8173
2004-02-14 21:27:35 +00:00
Filip Navara b00626d582 - STDCALL/STDCALL_FUNC usage fixes
svn path=/trunk/; revision=8133
2004-02-10 18:11:12 +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 aebff275f5 - Eliminate function pointer typecasts
svn path=/trunk/; revision=8130
2004-02-10 16:22:57 +00:00
Vizzini f9d689b644 - Updated CSQ library to use new kmlibrary target type
- Updated includes in csq.c
 - Added IPv6 ethertype in lan.h
 - Fixed a typo in ip.c
 - Added csqtest driver for testing cancel-safe queues

svn path=/trunk/; revision=8107
2004-02-09 06:59:01 +00:00