Author: jgardou
Date: Wed Oct  8 21:16:00 2014
New Revision: 64628

URL: http://svn.reactos.org/svn/reactos?rev=64628&view=rev
Log:
Revert r64621.
It breaks internet connections.

Removed:
    trunk/reactos/drivers/network/tcpip/tcpip/cinfo.c
Modified:
    trunk/reactos/dll/win32/wshtcpip/wshtcpip.c
    trunk/reactos/drivers/network/tcpip/CMakeLists.txt
    trunk/reactos/drivers/network/tcpip/include/info.h
    trunk/reactos/drivers/network/tcpip/include/tcp.h
    trunk/reactos/drivers/network/tcpip/tcpip/info.c
    trunk/reactos/include/psdk/tcpioctl.h
    trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
    trunk/reactos/lib/drivers/lwip/src/include/rosip.h
    trunk/reactos/lib/drivers/lwip/src/rostcp.c

Modified: trunk/reactos/dll/win32/wshtcpip/wshtcpip.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wshtcpip/wshtcpip.c?rev=64628&r1=64627&r2=64628&view=diff
==============================================================================
--- trunk/reactos/dll/win32/wshtcpip/wshtcpip.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wshtcpip/wshtcpip.c [iso-8859-1] Wed Oct  8 
21:16:00 2014
@@ -156,18 +156,12 @@
     return NO_ERROR;
 }
 
-static
-void
-GetTdiTypeId(
-    _In_ INT Level,
-    _In_ INT OptionName,
-    _Out_ PULONG TdiType,
-    _Out_ PULONG TdiId)
+UINT
+GetAddressOption(INT Level, INT OptionName)
 {
     switch (Level)
     {
        case SOL_SOCKET:
-          *TdiType = INFO_TYPE_ADDRESS_OBJECT;
           switch (OptionName)
           {
              case SO_KEEPALIVE:
@@ -180,26 +174,21 @@
           break;
 
        case IPPROTO_IP:
-          *TdiType = INFO_TYPE_ADDRESS_OBJECT;
           switch (OptionName)
           {
              case IP_TTL:
-                *TdiId = AO_OPTION_TTL;
-                return;
+                return AO_OPTION_TTL;
 
              case IP_DONTFRAGMENT:
-                 *TdiId = AO_OPTION_IP_DONTFRAGMENT;
-                 return;
+                return AO_OPTION_IP_DONTFRAGMENT;
 
 #if 0
              case IP_RECEIVE_BROADCAST:
-                 *TdiId = AO_OPTION_BROADCAST;
-                 return;
+                return AO_OPTION_BROADCAST;
 #endif
 
              case IP_HDRINCL:
-                 *TdiId = AO_OPTION_IP_HDRINCL;
-                 return;
+                return AO_OPTION_IP_HDRINCL;
 
              default:
                 break;
@@ -209,10 +198,10 @@
        case IPPROTO_TCP:
           switch (OptionName)
           {
-              *TdiType = INFO_TYPE_CONNECTION;
              case TCP_NODELAY:
-                 *TdiId = TCP_SOCKET_NODELAY;
-                 return;
+                 /* FIXME: Return proper option */
+                 ASSERT(FALSE);
+                 break;
              default:
                  break;
           }
@@ -222,8 +211,7 @@
     }
 
     DPRINT1("Unknown level/option name: %d %d\n", Level, OptionName);
-    *TdiType = 0;
-    *TdiId = 0;
+    return 0;
 }
 
 INT
@@ -654,7 +642,7 @@
     IN  INT OptionLength)
 {
     PSOCKET_CONTEXT Context = HelperDllSocketContext;
-    ULONG TdiType, TdiId;
+    UINT RealOptionName;
     INT Status;
     PTCP_REQUEST_SET_INFORMATION_EX Info;
     PQUEUED_REQUEST Queued, NextQueued;
@@ -709,11 +697,9 @@
             switch (OptionName)
             {
                 case TCP_NODELAY:
-                    if (OptionLength < sizeof(CHAR))
-                    {
-                        return WSAEFAULT;
-                    }
-                    break;
+                    /* FIXME -- Send this to TCPIP */
+                    DPRINT1("Set: TCP_NODELAY not yet supported\n");
+                    return 0;
 
                 default:
                     /* Invalid option */
@@ -728,8 +714,8 @@
     }
 
     /* If we get here, GetAddressOption must return something valid */
-    GetTdiTypeId(Level, OptionName, &TdiId, &TdiType);
-    ASSERT((TdiId != 0) && (TdiType != 0));
+    RealOptionName = GetAddressOption(Level, OptionName);
+    ASSERT(RealOptionName != 0);
 
     Info = HeapAlloc(GetProcessHeap(), 0, sizeof(*Info) + OptionLength);
     if (!Info)
@@ -738,8 +724,8 @@
     Info->ID.toi_entity.tei_entity = Context->AddrFileEntityType;
     Info->ID.toi_entity.tei_instance = Context->AddrFileInstance;
     Info->ID.toi_class = INFO_CLASS_PROTOCOL;
-    Info->ID.toi_type = TdiType;
-    Info->ID.toi_id = TdiId;
+    Info->ID.toi_type = INFO_TYPE_ADDRESS_OBJECT;
+    Info->ID.toi_id = RealOptionName;
     Info->BufferSize = OptionLength;
     memcpy(Info->Buffer, OptionValue, OptionLength);
 

Modified: trunk/reactos/drivers/network/tcpip/CMakeLists.txt
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/CMakeLists.txt?rev=64628&r1=64627&r2=64628&view=diff
==============================================================================
--- trunk/reactos/drivers/network/tcpip/CMakeLists.txt  [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/CMakeLists.txt  [iso-8859-1] Wed Oct  8 
21:16:00 2014
@@ -14,7 +14,6 @@
     datalink/lan.c
     tcpip/ainfo.c
     tcpip/buffer.c
-    tcpip/cinfo.c
     tcpip/dispatch.c
     tcpip/fileobjs.c
     tcpip/iinfo.c

Modified: trunk/reactos/drivers/network/tcpip/include/info.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/include/info.h?rev=64628&r1=64627&r2=64628&view=diff
==============================================================================
--- trunk/reactos/drivers/network/tcpip/include/info.h  [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/include/info.h  [iso-8859-1] Wed Oct  8 
21:16:00 2014
@@ -183,11 +183,6 @@
                               PVOID Buffer,
                               PUINT BufferSize);
 
-TDI_STATUS SetConnectionInfo(TDIObjectID *ID,
-                             PCONNECTION_ENDPOINT Connection,
-                             PVOID Buffer,
-                             UINT BufferSize);
-
 /* Insert and remove entities */
 VOID InsertTDIInterfaceEntity( PIP_INTERFACE Interface );
 

Modified: trunk/reactos/drivers/network/tcpip/include/tcp.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/include/tcp.h?rev=64628&r1=64627&r2=64628&view=diff
==============================================================================
--- trunk/reactos/drivers/network/tcpip/include/tcp.h   [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/include/tcp.h   [iso-8859-1] Wed Oct  8 
21:16:00 2014
@@ -186,8 +186,6 @@
 
 BOOLEAN TCPRemoveIRP( PCONNECTION_ENDPOINT Connection, PIRP Irp );
 
-NTSTATUS TCPSetNoDelay(PCONNECTION_ENDPOINT Connection, BOOLEAN Set);
-
 VOID
 TCPUpdateInterfaceLinkStatus(PIP_INTERFACE IF);
 

Removed: trunk/reactos/drivers/network/tcpip/tcpip/cinfo.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpip/cinfo.c?rev=64627
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/cinfo.c   [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/cinfo.c   (removed)
@@ -1,32 +0,0 @@
-/*
- * COPYRIGHT:   See COPYING in the top level directory
- * PROJECT:     ReactOS TCP/IP protocol driver
- * FILE:        tcpip/cinfo.c
- * PURPOSE:     Per-socket connection information.
- * PROGRAMMER:  Jérôme Gardou
- */
-
-#include "precomp.h"
-
-TDI_STATUS SetConnectionInfo(TDIObjectID *ID,
-                             PCONNECTION_ENDPOINT Connection,
-                             PVOID Buffer,
-                             UINT BufferSize)
-{
-    ASSERT(ID->toi_type == INFO_TYPE_CONNECTION);
-    switch (ID->toi_id)
-    {
-        case TCP_SOCKET_NODELAY:
-        {
-            BOOLEAN Set;
-            if (BufferSize < sizeof(BOOLEAN))
-                return TDI_INVALID_PARAMETER;
-            Set = *(BOOLEAN*)Buffer;
-            return TCPSetNoDelay(Connection, Set);
-        }
-        default:
-            DbgPrint("TCPIP: Unknown connection info ID: %u.\n", ID->toi_id);
-    }
-
-    return TDI_INVALID_PARAMETER;
-}

Modified: trunk/reactos/drivers/network/tcpip/tcpip/info.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpip/info.c?rev=64628&r1=64627&r2=64628&view=diff
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/info.c    [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/info.c    [iso-8859-1] Wed Oct  8 
21:16:00 2014
@@ -326,25 +326,12 @@
     switch (ID->toi_class)
     {
        case INFO_CLASS_PROTOCOL:
-          switch (ID->toi_type)
+          if (ID->toi_type == INFO_TYPE_ADDRESS_OBJECT)
           {
-              case INFO_TYPE_ADDRESS_OBJECT:
-              {
-                  if ((EntityListContext = GetContext(ID->toi_entity)))
-                       return SetAddressFileInfo(ID, EntityListContext, 
Buffer, BufferSize);
-                  else
-                       return TDI_INVALID_PARAMETER;
-              }
-              case INFO_TYPE_CONNECTION:
-              {
-                  PADDRESS_FILE AddressFile = GetContext(ID->toi_entity);
-                  if (AddressFile == NULL)
-                       return TDI_INVALID_PARAMETER;
-                   return SetConnectionInfo(ID, AddressFile->Connection, 
Buffer, BufferSize);
-              }
-              default:
-                  DbgPrint("TCPIP: IOCTL_TCP_SET_INFORMATION_EX - Unrecognized 
information type for INFO_CLASS_PROTOCOL: 0x%#x.\n", ID->toi_type);
-                  return TDI_INVALID_PARAMETER;
+              if ((EntityListContext = GetContext(ID->toi_entity)))
+                   return SetAddressFileInfo(ID, EntityListContext, Buffer, 
BufferSize);
+              else
+                   return TDI_INVALID_PARAMETER;
           }
 
          switch (ID->toi_id)

Modified: trunk/reactos/include/psdk/tcpioctl.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/tcpioctl.h?rev=64628&r1=64627&r2=64628&view=diff
==============================================================================
--- trunk/reactos/include/psdk/tcpioctl.h       [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/tcpioctl.h       [iso-8859-1] Wed Oct  8 
21:16:00 2014
@@ -90,9 +90,6 @@
 #define AO_OPTION_UNBIND            37
 #define AO_OPTION_PROTECT           38
 
-/* TCP connection options */
-#define TCP_SOCKET_NODELAY 1
-
 typedef struct IFEntry
 {
     ULONG if_index;

Modified: trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c?rev=64628&r1=64627&r2=64628&view=diff
==============================================================================
--- trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c    [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/ip/transport/tcp/tcp.c    [iso-8859-1] Wed Oct  8 
21:16:00 2014
@@ -674,16 +674,4 @@
     return Found;
 }
 
-NTSTATUS
-TCPSetNoDelay(
-    PCONNECTION_ENDPOINT Connection,
-    BOOLEAN Set)
-{
-    if (Connection->SocketContext == NULL)
-        return STATUS_UNSUCCESSFUL;
-    LibTCPSetNoDelay(Connection->SocketContext, Set);
-    return STATUS_SUCCESS;
-}
-
-
 /* EOF */

Modified: trunk/reactos/lib/drivers/lwip/src/include/rosip.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/lwip/src/include/rosip.h?rev=64628&r1=64627&r2=64628&view=diff
==============================================================================
--- trunk/reactos/lib/drivers/lwip/src/include/rosip.h  [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/lwip/src/include/rosip.h  [iso-8859-1] Wed Oct  8 
21:16:00 2014
@@ -107,11 +107,10 @@
 err_t       LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr *const ipaddr, 
u16_t *const port);
 err_t       LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, 
u16_t *const port);
 void        LibTCPAccept(PTCP_PCB pcb, struct tcp_pcb *listen_pcb, void *arg);
-void        LibTCPSetNoDelay(PTCP_PCB pcb, BOOLEAN Set);
 
 /* IP functions */
 void LibIPInsertPacket(void *ifarg, const void *const data, const u32_t size);
 void LibIPInitialize(void);
 void LibIPShutdown(void);
 
-#endif
+#endif

Modified: trunk/reactos/lib/drivers/lwip/src/rostcp.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/lwip/src/rostcp.c?rev=64628&r1=64627&r2=64628&view=diff
==============================================================================
--- trunk/reactos/lib/drivers/lwip/src/rostcp.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/lwip/src/rostcp.c [iso-8859-1] Wed Oct  8 
21:16:00 2014
@@ -829,14 +829,3 @@
 
     return ERR_OK;
 }
-
-void
-LibTCPSetNoDelay(
-    PTCP_PCB pcb,
-    BOOLEAN Set)
-{
-    if (Set)
-        pcb->flags |= TF_NODELAY;
-    else
-        pcb->flags &= ~TF_NODELAY;
-}


Reply via email to