2000-07-09 13:19:35 +02:00
|
|
|
/*
|
|
|
|
* WSOCK32 specific functions
|
|
|
|
*
|
|
|
|
* Copyright (C) 1993,1994,1996,1997 John Brezak, Erik Bos, Alex Korobka.
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2000-07-09 13:19:35 +02:00
|
|
|
*/
|
|
|
|
|
2001-01-17 21:19:14 +01:00
|
|
|
|
2000-07-23 21:28:24 +02:00
|
|
|
#include "config.h"
|
2001-11-19 03:23:22 +01:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2001-11-19 03:23:22 +01:00
|
|
|
#include "winsock2.h"
|
|
|
|
#include "winnt.h"
|
|
|
|
#include "wscontrol.h"
|
2003-05-13 06:44:14 +02:00
|
|
|
#include "iphlpapi.h"
|
2001-01-17 21:19:14 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(winsock);
|
2000-07-09 13:19:35 +02:00
|
|
|
|
2003-04-05 00:04:47 +02:00
|
|
|
/* internal remapper function for the IP_ constants */
|
|
|
|
static INT _remap_optname(INT level, INT optname)
|
|
|
|
{
|
|
|
|
TRACE("level=%d, optname=%d\n", level, optname);
|
2003-05-13 06:44:14 +02:00
|
|
|
if (level == IPPROTO_IP) {
|
2003-04-05 00:04:47 +02:00
|
|
|
switch (optname) { /***** from value *****/
|
|
|
|
case 2: return 9; /* IP_MULTICAST_IF */
|
|
|
|
case 3: return 10; /* IP_MULTICAST_TTL */
|
|
|
|
case 4: return 11; /* IP_MULTICAST_LOOP */
|
|
|
|
case 5: return 12; /* IP_ADD_MEMBERSHIP */
|
|
|
|
case 6: return 13; /* IP_DROP_MEMBERSHIP */
|
|
|
|
case 7: return 4; /* IP_TTL */
|
|
|
|
case 8: return 3; /* IP_TOS */
|
|
|
|
case 9: return 14; /* IP_DONTFRAGMENT */
|
|
|
|
default: FIXME("Unknown optname %d, can't remap!\n", optname); return optname;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* don't need to do anything */
|
|
|
|
return optname;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* setsockopt (WSOCK32.21)
|
|
|
|
*
|
|
|
|
* We have these forwarders because, for reasons unknown to us mere mortals,
|
|
|
|
* the values of the IP_ constants changed between winsock.h and winsock2.h.
|
|
|
|
* So, we need to remap them here.
|
|
|
|
*/
|
|
|
|
INT WINAPI WS1_setsockopt(SOCKET s, INT level, INT optname, char *optval, INT optlen)
|
|
|
|
{
|
|
|
|
return setsockopt(s, level, _remap_optname(level, optname), optval, optlen);
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* getsockopt (WSOCK32.7)
|
|
|
|
*/
|
|
|
|
INT WINAPI WS1_getsockopt(SOCKET s, INT level, INT optname, char *optval, INT *optlen)
|
|
|
|
{
|
|
|
|
return getsockopt(s, level, _remap_optname(level, optname), optval, optlen);
|
|
|
|
}
|
2000-07-09 13:19:35 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
2001-07-11 20:56:41 +02:00
|
|
|
* WsControl (WSOCK32.1001)
|
2000-07-23 21:28:24 +02:00
|
|
|
*
|
2002-06-01 01:06:46 +02:00
|
|
|
* WsControl seems to be an undocumented Win95 function. A lot of
|
2000-07-23 21:28:24 +02:00
|
|
|
* discussion about WsControl can be found on the net, e.g.
|
|
|
|
* Subject: Re: WSOCK32.DLL WsControl Exported Function
|
|
|
|
* From: "Peter Rindfuss" <rindfuss-s@medea.wz-berlin.de>
|
|
|
|
* Date: 1997/08/17
|
|
|
|
*
|
|
|
|
* WSCNTL_TCPIP_QUERY_INFO option is partially implemeted based
|
2002-06-01 01:06:46 +02:00
|
|
|
* on observing the behaviour of WsControl with an app in
|
2000-07-23 21:28:24 +02:00
|
|
|
* Windows 98. It is not fully implemented, and there could
|
|
|
|
* be (are?) errors due to incorrect assumptions made.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* WsControl returns WSCTL_SUCCESS on success.
|
|
|
|
* STATUS_BUFFER_TOO_SMALL is returned if the output buffer length
|
|
|
|
* (*pcbResponseInfoLen) is too small, otherwise errors return -1.
|
|
|
|
*
|
2002-06-01 01:06:46 +02:00
|
|
|
* It doesn't seem to generate errors that can be retrieved by
|
2000-07-23 21:28:24 +02:00
|
|
|
* WSAGetLastError().
|
|
|
|
*
|
2000-07-09 13:19:35 +02:00
|
|
|
*/
|
2000-07-23 21:28:24 +02:00
|
|
|
|
|
|
|
DWORD WINAPI WsControl(DWORD protocoll,
|
|
|
|
DWORD action,
|
|
|
|
LPVOID pRequestInfo,
|
|
|
|
LPDWORD pcbRequestInfoLen,
|
|
|
|
LPVOID pResponseInfo,
|
2002-06-01 01:06:46 +02:00
|
|
|
LPDWORD pcbResponseInfoLen)
|
2000-07-09 13:19:35 +02:00
|
|
|
{
|
2003-05-13 06:44:14 +02:00
|
|
|
|
2000-07-23 21:28:24 +02:00
|
|
|
/* Get the command structure into a pointer we can use,
|
|
|
|
rather than void */
|
|
|
|
TDIObjectID *pcommand = (TDIObjectID *)pRequestInfo;
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-07-23 21:28:24 +02:00
|
|
|
TRACE (" WsControl TOI_ID=>0x%lx<, {TEI_ENTITY=0x%lx, TEI_INSTANCE=0x%lx}, TOI_CLASS=0x%lx, TOI_TYPE=0x%lx\n",
|
|
|
|
pcommand->toi_id, pcommand->toi_entity.tei_entity, pcommand->toi_entity.tei_instance,
|
|
|
|
pcommand->toi_class, pcommand->toi_type );
|
|
|
|
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
switch (action)
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
case WSCNTL_TCPIP_QUERY_INFO:
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
|
|
|
switch (pcommand->toi_id)
|
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
/*
|
2000-07-23 21:28:24 +02:00
|
|
|
ENTITY_LIST_ID seems to get number of adapters in the system.
|
|
|
|
(almost like an index to be used when calling other WsControl options)
|
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
case ENTITY_LIST_ID:
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
|
|
|
TDIEntityID *baseptr = pResponseInfo;
|
2003-05-13 06:44:14 +02:00
|
|
|
DWORD numInt, i, ipAddrTableSize;
|
|
|
|
PMIB_IPADDRTABLE table;
|
2000-07-23 21:28:24 +02:00
|
|
|
|
|
|
|
if (pcommand->toi_class != INFO_CLASS_GENERIC &&
|
2002-06-01 01:06:46 +02:00
|
|
|
pcommand->toi_type != INFO_TYPE_PROVIDER)
|
|
|
|
{
|
2000-07-23 21:28:24 +02:00
|
|
|
FIXME ("Unexpected Option for ENTITY_LIST_ID request -> toi_class=0x%lx, toi_type=0x%lx\n",
|
|
|
|
pcommand->toi_class, pcommand->toi_type);
|
2002-06-01 01:06:46 +02:00
|
|
|
return (WSAEOPNOTSUPP);
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2003-05-13 06:44:14 +02:00
|
|
|
GetNumberOfInterfaces(&numInt);
|
2000-07-23 21:28:24 +02:00
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
if (*pcbResponseInfoLen < sizeof(TDIEntityID)*(numInt*2) )
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
|
|
|
return (STATUS_BUFFER_TOO_SMALL);
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2003-05-13 06:44:14 +02:00
|
|
|
/* expect a 1:1 correspondence between interfaces and IP
|
|
|
|
addresses, so use the cheaper (less memory allocated)
|
|
|
|
GetIpAddrTable rather than GetIfTable */
|
|
|
|
ipAddrTableSize = 0;
|
|
|
|
GetIpAddrTable(NULL, &ipAddrTableSize, FALSE);
|
|
|
|
table = (PMIB_IPADDRTABLE)calloc(1, ipAddrTableSize);
|
|
|
|
if (!table) return -1; /* FIXME: better error code */
|
|
|
|
GetIpAddrTable(table, &ipAddrTableSize, FALSE);
|
|
|
|
|
2000-07-23 21:28:24 +02:00
|
|
|
/* 0 it out first */
|
2003-05-13 06:44:14 +02:00
|
|
|
memset(baseptr, 0, sizeof(TDIEntityID)*(table->dwNumEntries*2));
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2003-05-13 06:44:14 +02:00
|
|
|
for (i=0; i<table->dwNumEntries; i++)
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
|
|
|
/* tei_instance is an network interface identifier.
|
2002-06-01 01:06:46 +02:00
|
|
|
I'm not quite sure what the difference is between tei_entity values of
|
2000-07-23 21:28:24 +02:00
|
|
|
CL_NL_ENTITY and IF_ENTITY */
|
2003-05-13 06:44:14 +02:00
|
|
|
baseptr->tei_entity = CL_NL_ENTITY; baseptr->tei_instance = table->table[i].dwIndex; baseptr++;
|
|
|
|
baseptr->tei_entity = IF_ENTITY; baseptr->tei_instance = table->table[i].dwIndex; baseptr++;
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Calculate size of out buffer */
|
2003-05-13 06:44:14 +02:00
|
|
|
*pcbResponseInfoLen = sizeof(TDIEntityID)*(table->dwNumEntries*2);
|
|
|
|
free(table);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-07-23 21:28:24 +02:00
|
|
|
break;
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* ENTITY_TYPE_ID is used to obtain simple information about a
|
2000-07-23 21:28:24 +02:00
|
|
|
network card, such as MAC Address, description, interface type,
|
|
|
|
number of network addresses, etc. */
|
|
|
|
case ENTITY_TYPE_ID: /* ALSO: IP_MIB_STATS_ID */
|
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
if (pcommand->toi_class == INFO_CLASS_GENERIC && pcommand->toi_type == INFO_TYPE_PROVIDER)
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
|
|
|
if (pcommand->toi_entity.tei_entity == IF_ENTITY)
|
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
* ((ULONG *)pResponseInfo) = IF_MIB;
|
2000-07-23 21:28:24 +02:00
|
|
|
|
|
|
|
/* Calculate size of out buffer */
|
|
|
|
*pcbResponseInfoLen = sizeof (ULONG);
|
|
|
|
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
else if (pcommand->toi_entity.tei_entity == CL_NL_ENTITY)
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
* ((ULONG *)pResponseInfo) = CL_NL_IP;
|
2000-07-23 21:28:24 +02:00
|
|
|
|
|
|
|
/* Calculate size of out buffer */
|
2002-06-01 01:06:46 +02:00
|
|
|
*pcbResponseInfoLen = sizeof (ULONG);
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (pcommand->toi_class == INFO_CLASS_PROTOCOL &&
|
|
|
|
pcommand->toi_type == INFO_TYPE_PROVIDER)
|
|
|
|
{
|
|
|
|
if (pcommand->toi_entity.tei_entity == IF_ENTITY)
|
|
|
|
{
|
2003-05-13 06:44:14 +02:00
|
|
|
MIB_IFROW row;
|
|
|
|
DWORD index = pcommand->toi_entity.tei_instance, ret;
|
|
|
|
DWORD size = sizeof(row) - sizeof(row.wszName) -
|
|
|
|
sizeof(row.bDescr);
|
2002-01-22 00:37:53 +01:00
|
|
|
|
2003-05-13 06:44:14 +02:00
|
|
|
if (*pcbResponseInfoLen < size)
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
2003-05-13 06:44:14 +02:00
|
|
|
return (STATUS_BUFFER_TOO_SMALL);
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
2003-05-13 06:44:14 +02:00
|
|
|
row.dwIndex = index;
|
|
|
|
ret = GetIfEntry(&row);
|
|
|
|
if (ret != NO_ERROR)
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
2003-05-13 06:44:14 +02:00
|
|
|
ERR ("Error retrieving data for interface index %lu\n", index);
|
|
|
|
return -1; /* FIXME: better error code */
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
2003-05-13 06:44:14 +02:00
|
|
|
size = sizeof(row) - sizeof(row.wszName) -
|
|
|
|
sizeof(row.bDescr) + row.dwDescrLen;
|
|
|
|
if (*pcbResponseInfoLen < size)
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
2003-05-13 06:44:14 +02:00
|
|
|
return (STATUS_BUFFER_TOO_SMALL);
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
2003-05-13 06:44:14 +02:00
|
|
|
memcpy(pResponseInfo, &row.dwIndex, size);
|
|
|
|
*pcbResponseInfoLen = size;
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
else if (pcommand->toi_entity.tei_entity == CL_NL_ENTITY)
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
/* This case is used to obtain general statistics about the
|
2000-07-23 21:28:24 +02:00
|
|
|
network */
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2003-05-13 06:44:14 +02:00
|
|
|
if (*pcbResponseInfoLen < sizeof(MIB_IPSTATS))
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
|
|
|
return (STATUS_BUFFER_TOO_SMALL);
|
|
|
|
}
|
2003-05-13 06:44:14 +02:00
|
|
|
GetIpStatistics((PMIB_IPSTATS)pResponseInfo);
|
2000-07-23 21:28:24 +02:00
|
|
|
|
2003-05-13 06:44:14 +02:00
|
|
|
/* Calculate size of out buffer */
|
|
|
|
*pcbResponseInfoLen = sizeof(MIB_IPSTATS);
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME ("Unexpected Option for ENTITY_TYPE_ID request -> toi_class=0x%lx, toi_type=0x%lx\n",
|
|
|
|
pcommand->toi_class, pcommand->toi_type);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
return (WSAEOPNOTSUPP);
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
2000-07-09 13:19:35 +02:00
|
|
|
|
2000-07-23 21:28:24 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
/* IP_MIB_ADDRTABLE_ENTRY_ID is used to obtain more detailed information about a
|
2000-07-23 21:28:24 +02:00
|
|
|
particular network adapter */
|
2002-06-01 01:06:46 +02:00
|
|
|
case IP_MIB_ADDRTABLE_ENTRY_ID:
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
2003-05-13 06:44:14 +02:00
|
|
|
DWORD index = pcommand->toi_entity.tei_instance;
|
|
|
|
PMIB_IPADDRROW baseIPInfo = (PMIB_IPADDRROW) pResponseInfo;
|
|
|
|
PMIB_IPADDRTABLE table;
|
|
|
|
DWORD tableSize, i;
|
2000-07-23 21:28:24 +02:00
|
|
|
|
2003-05-13 06:44:14 +02:00
|
|
|
if (*pcbResponseInfoLen < sizeof(MIB_IPADDRROW))
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
return (STATUS_BUFFER_TOO_SMALL);
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2003-05-13 06:44:14 +02:00
|
|
|
/* overkill, get entire table, because there isn't an
|
|
|
|
exported function that gets just one entry, and don't
|
|
|
|
necessarily want our own private export. */
|
|
|
|
tableSize = 0;
|
|
|
|
GetIpAddrTable(NULL, &tableSize, FALSE);
|
|
|
|
table = (PMIB_IPADDRTABLE)calloc(1, tableSize);
|
|
|
|
if (!table) return -1; /* FIXME: better error code */
|
|
|
|
GetIpAddrTable(table, &tableSize, FALSE);
|
|
|
|
for (i = 0; i < table->dwNumEntries; i++)
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
2003-05-13 06:44:14 +02:00
|
|
|
if (table->table[i].dwIndex == index)
|
|
|
|
{
|
|
|
|
memcpy(baseIPInfo, &table->table[i],
|
|
|
|
sizeof(MIB_IPADDRROW));
|
|
|
|
break;
|
|
|
|
}
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
2003-05-13 06:44:14 +02:00
|
|
|
free(table);
|
2000-07-23 21:28:24 +02:00
|
|
|
|
|
|
|
/************************************************************************/
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-07-23 21:28:24 +02:00
|
|
|
/* Calculate size of out buffer */
|
2003-05-13 06:44:14 +02:00
|
|
|
*pcbResponseInfoLen = sizeof(MIB_IPADDRROW);
|
2000-07-23 21:28:24 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2001-01-05 23:16:11 +01:00
|
|
|
|
2003-05-13 06:44:14 +02:00
|
|
|
/* This call returns the routing table.
|
|
|
|
* No official documentation found, even the name of the command is unknown.
|
|
|
|
* Work is based on
|
|
|
|
* http://www.cyberport.com/~tangent/programming/winsock/articles/wscontrol.html
|
|
|
|
* and testings done with winipcfg.exe, route.exe and ipconfig.exe.
|
|
|
|
* pcommand->toi_entity.tei_instance seems to be the interface number
|
|
|
|
* but route.exe outputs only the information for the last interface
|
|
|
|
* if only the routes for the pcommand->toi_entity.tei_instance
|
|
|
|
* interface are returned. */
|
|
|
|
case IP_MIB_ROUTETABLE_ENTRY_ID: /* FIXME: not real name. Value is 0x101 */
|
|
|
|
{
|
|
|
|
DWORD routeTableSize, numRoutes, ndx;
|
|
|
|
PMIB_IPFORWARDTABLE table;
|
2001-02-28 06:17:44 +01:00
|
|
|
IPRouteEntry *winRouteTable = (IPRouteEntry *) pResponseInfo;
|
|
|
|
|
2003-05-13 06:44:14 +02:00
|
|
|
GetIpForwardTable(NULL, &routeTableSize, FALSE);
|
|
|
|
numRoutes = min(routeTableSize - sizeof(MIB_IPFORWARDTABLE), 0)
|
|
|
|
/ sizeof(MIB_IPFORWARDROW) + 1;
|
|
|
|
if (*pcbResponseInfoLen < sizeof(IPRouteEntry) * numRoutes)
|
|
|
|
{
|
|
|
|
return (STATUS_BUFFER_TOO_SMALL);
|
|
|
|
}
|
|
|
|
table = (PMIB_IPFORWARDTABLE)calloc(1, routeTableSize);
|
|
|
|
if (!table) return -1; /* FIXME: better return value */
|
|
|
|
GetIpForwardTable(table, &routeTableSize, FALSE);
|
|
|
|
|
|
|
|
memset(pResponseInfo, 0, sizeof(IPRouteEntry) * numRoutes);
|
|
|
|
for (ndx = 0; ndx < table->dwNumEntries; ndx++)
|
|
|
|
{
|
|
|
|
winRouteTable->ire_addr =
|
|
|
|
table->table[ndx].dwForwardDest;
|
|
|
|
winRouteTable->ire_index =
|
|
|
|
table->table[ndx].dwForwardIfIndex;
|
|
|
|
winRouteTable->ire_metric =
|
|
|
|
table->table[ndx].dwForwardMetric1;
|
|
|
|
/* winRouteTable->ire_option4 =
|
|
|
|
winRouteTable->ire_option5 =
|
|
|
|
winRouteTable->ire_option6 = */
|
|
|
|
winRouteTable->ire_gw = table->table[ndx].dwForwardNextHop;
|
|
|
|
/* winRouteTable->ire_option8 =
|
|
|
|
winRouteTable->ire_option9 =
|
|
|
|
winRouteTable->ire_option10 = */
|
|
|
|
winRouteTable->ire_mask = table->table[ndx].dwForwardMask;
|
|
|
|
/* winRouteTable->ire_option12 = */
|
|
|
|
winRouteTable++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* calculate the length of the data in the output buffer */
|
|
|
|
*pcbResponseInfoLen = sizeof(IPRouteEntry) *
|
|
|
|
table->dwNumEntries;
|
|
|
|
|
|
|
|
free(table);
|
2001-02-28 06:17:44 +01:00
|
|
|
break;
|
2003-05-13 06:44:14 +02:00
|
|
|
}
|
2000-07-23 21:28:24 +02:00
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
default:
|
2000-07-23 21:28:24 +02:00
|
|
|
{
|
|
|
|
FIXME ("Command ID Not Supported -> toi_id=0x%lx, toi_entity={tei_entity=0x%lx, tei_instance=0x%lx}, toi_class=0x%lx, toi_type=0x%lx\n",
|
2002-06-01 01:06:46 +02:00
|
|
|
pcommand->toi_id, pcommand->toi_entity.tei_entity, pcommand->toi_entity.tei_instance,
|
2000-07-23 21:28:24 +02:00
|
|
|
pcommand->toi_class, pcommand->toi_type);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
return (WSAEOPNOTSUPP);
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-07-23 21:28:24 +02:00
|
|
|
break;
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2000-07-23 21:28:24 +02:00
|
|
|
case WSCNTL_TCPIP_ICMP_ECHO:
|
|
|
|
{
|
|
|
|
unsigned int addr = *(unsigned int*)pRequestInfo;
|
|
|
|
#if 0
|
|
|
|
int timeout= *(unsigned int*)(inbuf+4);
|
|
|
|
short x1 = *(unsigned short*)(inbuf+8);
|
|
|
|
short sendbufsize = *(unsigned short*)(inbuf+10);
|
|
|
|
char x2 = *(unsigned char*)(inbuf+12);
|
|
|
|
char ttl = *(unsigned char*)(inbuf+13);
|
|
|
|
char service = *(unsigned char*)(inbuf+14);
|
|
|
|
char type= *(unsigned char*)(inbuf+15); /* 0x2: don't fragment*/
|
2002-06-01 01:06:46 +02:00
|
|
|
#endif
|
|
|
|
|
2000-07-23 21:28:24 +02:00
|
|
|
FIXME("(ICMP_ECHO) to 0x%08x stub \n", addr);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
FIXME("Protocoll Not Supported -> protocoll=0x%lx, action=0x%lx, Request=%p, RequestLen=%p, Response=%p, ResponseLen=%p\n",
|
|
|
|
protocoll, action, pRequestInfo, pcbRequestInfoLen, pResponseInfo, pcbResponseInfoLen);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
return (WSAEOPNOTSUPP);
|
2000-07-23 21:28:24 +02:00
|
|
|
}
|
|
|
|
}
|
2002-06-01 01:06:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
return (WSCTL_SUCCESS);
|
2000-07-09 13:19:35 +02:00
|
|
|
}
|
|
|
|
|
2000-07-23 21:28:24 +02:00
|
|
|
|
|
|
|
|
2000-12-01 21:48:41 +01:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* WSARecvEx (WSOCK32.1107)
|
2000-12-01 21:48:41 +01:00
|
|
|
*
|
|
|
|
* WSARecvEx is a Microsoft specific extension to winsock that is identical to recv
|
|
|
|
* except that has an in/out argument call flags that has the value MSG_PARTIAL ored
|
|
|
|
* into the flags parameter when a partial packet is read. This only applies to
|
|
|
|
* sockets using the datagram protocol. This method does not seem to be implemented
|
|
|
|
* correctly by microsoft as the winsock implementation does not set the MSG_PARTIAL
|
|
|
|
* flag when a fragmented packet arrives.
|
|
|
|
*/
|
|
|
|
INT WINAPI WSARecvEx(SOCKET s, char *buf, INT len, INT *flags)
|
|
|
|
{
|
|
|
|
FIXME("(WSARecvEx) partial packet return value not set \n");
|
2000-12-03 00:46:10 +01:00
|
|
|
return recv(s, buf, len, *flags);
|
2000-12-01 21:48:41 +01:00
|
|
|
}
|
2000-07-23 21:28:24 +02:00
|
|
|
|
|
|
|
|
2000-07-09 13:19:35 +02:00
|
|
|
/***********************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* s_perror (WSOCK32.1108)
|
2000-07-09 13:19:35 +02:00
|
|
|
*/
|
2001-11-14 22:26:23 +01:00
|
|
|
void WINAPI s_perror(LPCSTR message)
|
2000-07-09 13:19:35 +02:00
|
|
|
{
|
|
|
|
FIXME("(%s): stub\n",message);
|
|
|
|
return;
|
|
|
|
}
|