2 * iphlpapi dll implementation
4 * Copyright (C) 2003 Juan Lang
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <sys/types.h>
25 #ifdef HAVE_NETINET_IN_H
26 # include <netinet/in.h>
28 #ifdef HAVE_ARPA_NAMESER_H
29 # include <arpa/nameser.h>
39 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi);
44 /******************************************************************
45 * AddIPAddress (IPHLPAPI.@)
54 * NTEInstance [In/Out]
61 DWORD WINAPI AddIPAddress(IPAddr Address, IPMask IpMask, DWORD IfIndex, PULONG NTEContext, PULONG NTEInstance)
64 /* marking Win2K+ functions not supported */
65 return ERROR_NOT_SUPPORTED;
69 /******************************************************************
70 * CreateIpForwardEntry (IPHLPAPI.@)
82 DWORD WINAPI CreateIpForwardEntry(PMIB_IPFORWARDROW pRoute)
84 /* could use SIOCADDRT, not sure I want to */
90 /******************************************************************
91 * CreateIpNetEntry (IPHLPAPI.@)
103 DWORD WINAPI CreateIpNetEntry(PMIB_IPNETROW pArpEntry)
105 /* could use SIOCSARP on systems that support it, not sure I want to */
111 /******************************************************************
112 * CreateProxyArpEntry (IPHLPAPI.@)
126 DWORD WINAPI CreateProxyArpEntry(DWORD dwAddress, DWORD dwMask, DWORD dwIfIndex)
129 /* marking Win2K+ functions not supported */
130 return ERROR_NOT_SUPPORTED;
134 /******************************************************************
135 * DeleteIPAddress (IPHLPAPI.@)
147 DWORD WINAPI DeleteIPAddress(ULONG NTEContext)
150 /* marking Win2K+ functions not supported */
151 return ERROR_NOT_SUPPORTED;
155 /******************************************************************
156 * DeleteIpForwardEntry (IPHLPAPI.@)
168 DWORD WINAPI DeleteIpForwardEntry(PMIB_IPFORWARDROW pRoute)
170 /* could use SIOCDELRT, not sure I want to */
176 /******************************************************************
177 * DeleteIpNetEntry (IPHLPAPI.@)
189 DWORD WINAPI DeleteIpNetEntry(PMIB_IPNETROW pArpEntry)
191 /* could use SIOCDARP on systems that support it, not sure I want to */
197 /******************************************************************
198 * DeleteProxyArpEntry (IPHLPAPI.@)
212 DWORD WINAPI DeleteProxyArpEntry(DWORD dwAddress, DWORD dwMask, DWORD dwIfIndex)
215 /* marking Win2K+ functions not supported */
216 return ERROR_NOT_SUPPORTED;
220 /******************************************************************
221 * EnableRouter (IPHLPAPI.@)
227 * pOverlapped [In/Out]
234 DWORD WINAPI EnableRouter(HANDLE * pHandle, OVERLAPPED * pOverlapped)
237 /* could echo "1" > /proc/net/sys/net/ipv4/ip_forward, not sure I want to
238 could map EACCESS to ERROR_ACCESS_DENIED, I suppose
239 marking Win2K+ functions not supported */
240 return ERROR_NOT_SUPPORTED;
244 /******************************************************************
245 * FlushIpNetTable (IPHLPAPI.@)
257 DWORD WINAPI FlushIpNetTable(DWORD dwIfIndex)
260 /* this flushes the arp cache of the given index
261 marking Win2K+ functions not supported */
262 return ERROR_NOT_SUPPORTED;
266 /******************************************************************
267 * GetAdapterIndex (IPHLPAPI.@)
272 * AdapterName [In/Out]
280 DWORD WINAPI GetAdapterIndex(LPWSTR AdapterName, PULONG IfIndex)
283 /* marking Win2K+ functions not supported */
284 return ERROR_NOT_SUPPORTED;
288 /******************************************************************
289 * GetAdaptersInfo (IPHLPAPI.@)
294 * pAdapterInfo [In/Out]
295 * pOutBufLen [In/Out]
302 DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
307 ret = ERROR_INVALID_PARAMETER;
309 DWORD numNonLoopbackInterfaces = getNumNonLoopbackInterfaces();
311 if (numNonLoopbackInterfaces > 0) {
312 /* this calculation assumes only one address in the IP_ADDR_STRING lists.
313 that's okay, because:
314 - we don't get multiple addresses per adapter anyway
315 - we don't know about per-adapter gateways
316 - we don't know about DHCP or WINS (and these must be single anyway) */
317 ULONG size = sizeof(IP_ADAPTER_INFO) * numNonLoopbackInterfaces;
319 if (!pAdapterInfo || *pOutBufLen < size) {
321 ret = ERROR_BUFFER_OVERFLOW;
324 InterfaceIndexTable *table = getNonLoopbackInterfaceIndexTable();
327 size = sizeof(IP_ADAPTER_INFO) * table->numIndexes;
328 if (*pOutBufLen < size) {
330 ret = ERROR_INSUFFICIENT_BUFFER;
335 memset(pAdapterInfo, 0, size);
336 for (ndx = 0; ndx < table->numIndexes; ndx++) {
337 PIP_ADAPTER_INFO ptr = &pAdapterInfo[ndx];
338 DWORD addrLen = sizeof(ptr->Address), type;
340 /* on Win98 this is left empty, but whatever */
341 strncpy(ptr->AdapterName,
342 getInterfaceNameByIndex(table->indexes[ndx]),
343 sizeof(ptr->AdapterName));
344 ptr->AdapterName[MAX_ADAPTER_NAME_LENGTH] = '\0';
345 getInterfacePhysicalByIndex(table->indexes[ndx], &addrLen,
346 ptr->Address, &type);
347 /* MS defines address length and type as UINT in some places and
348 DWORD in others, **sigh**. Don't want to assume that PUINT and
349 PDWORD are equiv (64-bit?) */
350 ptr->AddressLength = addrLen;
352 ptr->Index = table->indexes[ndx];
353 toIPAddressString(getInterfaceIPAddrByIndex(table->indexes[ndx]),
354 ptr->IpAddressList.IpAddress.String);
355 toIPAddressString(getInterfaceMaskByIndex(table->indexes[ndx]),
356 ptr->IpAddressList.IpMask.String);
357 if (ndx < table->numIndexes + 1)
358 ptr->Next = (ndx == table->numIndexes - 1) ? NULL : &pAdapterInfo[ndx + 1];
365 ret = ERROR_OUTOFMEMORY;
375 /******************************************************************
376 * GetBestInterface (IPHLPAPI.@)
382 * pdwBestIfIndex [In/Out]
389 DWORD WINAPI GetBestInterface(IPAddr dwDestAddr, PDWORD pdwBestIfIndex)
396 /******************************************************************
397 * GetBestRoute (IPHLPAPI.@)
411 DWORD WINAPI GetBestRoute(DWORD dwDestAddr, DWORD dwSourceAddr, PMIB_IPFORWARDROW pBestRoute)
418 /******************************************************************
419 * GetFriendlyIfIndex (IPHLPAPI.@)
431 DWORD WINAPI GetFriendlyIfIndex(DWORD IfIndex)
433 /* windows doesn't validate these, either, just makes sure the top byte is
434 cleared. I assume my ipshared module never gives an index with the top
440 /******************************************************************
441 * GetIcmpStatistics (IPHLPAPI.@)
453 DWORD WINAPI GetIcmpStatistics(PMIB_ICMP pStats)
455 return getICMPStats(pStats);
459 /******************************************************************
460 * GetIfEntry (IPHLPAPI.@)
472 DWORD WINAPI GetIfEntry(PMIB_IFROW pIfRow)
478 return ERROR_INVALID_PARAMETER;
480 name = getInterfaceNameByIndex(pIfRow->dwIndex);
482 ret = getInterfaceEntryByName(name, pIfRow);
484 ret = getInterfaceStatsByName(name, pIfRow);
487 ret = ERROR_INVALID_DATA;
492 /******************************************************************
493 * GetIfTable (IPHLPAPI.@)
507 DWORD WINAPI GetIfTable(PMIB_IFTABLE pIfTable, PULONG pdwSize, BOOL bOrder)
512 ret = ERROR_INVALID_PARAMETER;
514 DWORD numInterfaces = getNumInterfaces();
515 ULONG size = sizeof(MIB_IFTABLE) + (numInterfaces - 1) * sizeof(MIB_IFROW);
517 if (!pIfTable || *pdwSize < size) {
519 ret = ERROR_INSUFFICIENT_BUFFER;
522 InterfaceIndexTable *table = getInterfaceIndexTable();
525 size = sizeof(MIB_IFTABLE) + (table->numIndexes - 1) *
527 if (*pdwSize < size) {
529 ret = ERROR_INSUFFICIENT_BUFFER;
535 FIXME(":order not implemented");
536 pIfTable->dwNumEntries = 0;
537 for (ndx = 0; ndx < table->numIndexes; ndx++) {
538 pIfTable->table[ndx].dwIndex = table->indexes[ndx];
539 GetIfEntry(&pIfTable->table[ndx]);
540 pIfTable->dwNumEntries++;
547 ret = ERROR_OUTOFMEMORY;
554 /******************************************************************
555 * GetInterfaceInfo (IPHLPAPI.@)
561 * dwOutBufLen [In/Out]
568 DWORD WINAPI GetInterfaceInfo(PIP_INTERFACE_INFO pIfTable, PULONG dwOutBufLen)
573 ret = ERROR_INVALID_PARAMETER;
575 DWORD numInterfaces = getNumInterfaces();
576 ULONG size = sizeof(IP_INTERFACE_INFO) + (numInterfaces - 1) *
577 sizeof(IP_ADAPTER_INDEX_MAP);
579 if (!pIfTable || *dwOutBufLen < size) {
581 ret = ERROR_INSUFFICIENT_BUFFER;
584 InterfaceIndexTable *table = getInterfaceIndexTable();
587 size = sizeof(IP_INTERFACE_INFO) + (table->numIndexes - 1) *
588 sizeof(IP_ADAPTER_INDEX_MAP);
589 if (*dwOutBufLen < size) {
591 ret = ERROR_INSUFFICIENT_BUFFER;
596 pIfTable->NumAdapters = 0;
597 for (ndx = 0; ndx < table->numIndexes; ndx++) {
598 const char *walker, *name;
601 pIfTable->Adapter[ndx].Index = table->indexes[ndx];
602 name = getInterfaceNameByIndex(table->indexes[ndx]);
603 for (walker = name, assigner = pIfTable->Adapter[ndx].Name;
605 assigner - pIfTable->Adapter[ndx].Name < MAX_ADAPTER_NAME - 1;
606 walker++, assigner++)
609 pIfTable->NumAdapters++;
616 ret = ERROR_OUTOFMEMORY;
623 /******************************************************************
624 * GetIpAddrTable (IPHLPAPI.@)
629 * pIpAddrTable [In/Out]
638 DWORD WINAPI GetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable, PULONG pdwSize, BOOL bOrder)
643 ret = ERROR_INVALID_PARAMETER;
645 DWORD numInterfaces = getNumInterfaces();
646 ULONG size = sizeof(MIB_IPADDRTABLE) + (numInterfaces - 1) *
647 sizeof(MIB_IPADDRROW);
649 if (!pIpAddrTable || *pdwSize < size) {
651 ret = ERROR_INSUFFICIENT_BUFFER;
654 InterfaceIndexTable *table = getInterfaceIndexTable();
657 size = sizeof(MIB_IPADDRTABLE) + (table->numIndexes - 1) *
658 sizeof(MIB_IPADDRROW);
659 if (*pdwSize < size) {
661 ret = ERROR_INSUFFICIENT_BUFFER;
667 FIXME(":order not implemented");
668 pIpAddrTable->dwNumEntries = 0;
669 for (ndx = 0; ndx < table->numIndexes; ndx++) {
670 pIpAddrTable->table[ndx].dwIndex = table->indexes[ndx];
671 pIpAddrTable->table[ndx].dwAddr =
672 getInterfaceIPAddrByIndex(table->indexes[ndx]);
673 pIpAddrTable->table[ndx].dwMask =
674 getInterfaceMaskByIndex(table->indexes[ndx]);
675 pIpAddrTable->table[ndx].dwBCastAddr =
676 getInterfaceBCastAddrByIndex(table->indexes[ndx]);
677 /* FIXME: hardcoded reasm size, not sure where to get it */
678 pIpAddrTable->table[ndx].dwReasmSize = 65535;
679 pIpAddrTable->table[ndx].unused1 = 0;
680 pIpAddrTable->table[ndx].wType = 0; /* aka unused2 */
681 pIpAddrTable->dwNumEntries++;
688 ret = ERROR_OUTOFMEMORY;
695 /******************************************************************
696 * GetIpForwardTable (IPHLPAPI.@)
701 * pIpForwardTable [In/Out]
710 DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, BOOL bOrder)
715 ret = ERROR_INVALID_PARAMETER;
717 DWORD numRoutes = getNumRoutes();
718 ULONG sizeNeeded = sizeof(MIB_IPFORWARDTABLE) + (numRoutes - 1) *
719 sizeof(MIB_IPFORWARDROW);
721 if (!pIpForwardTable || *pdwSize < sizeNeeded) {
722 *pdwSize = sizeNeeded;
723 ret = ERROR_INSUFFICIENT_BUFFER;
726 RouteTable *table = getRouteTable();
728 sizeNeeded = sizeof(MIB_IPFORWARDTABLE) + (table->numRoutes - 1) *
729 sizeof(MIB_IPFORWARDROW);
730 if (*pdwSize < sizeNeeded) {
731 *pdwSize = sizeNeeded;
732 ret = ERROR_INSUFFICIENT_BUFFER;
738 FIXME(":order not implemented");
739 pIpForwardTable->dwNumEntries = table->numRoutes;
740 for (ndx = 0; ndx < numRoutes; ndx++) {
741 pIpForwardTable->table[ndx].dwForwardIfIndex =
742 table->routes[ndx].ifIndex;
743 pIpForwardTable->table[ndx].dwForwardDest =
744 table->routes[ndx].dest;
745 pIpForwardTable->table[ndx].dwForwardMask =
746 table->routes[ndx].mask;
747 pIpForwardTable->table[ndx].dwForwardPolicy = 0;
748 pIpForwardTable->table[ndx].dwForwardNextHop =
749 table->routes[ndx].gateway;
750 /* FIXME: this type is appropriate for local interfaces; may not
751 always be appropriate */
752 pIpForwardTable->table[ndx].dwForwardType = MIB_IPROUTE_TYPE_DIRECT;
753 /* FIXME: other protos might be appropriate, e.g. the default route
754 is typically set with MIB_IPPROTO_NETMGMT instead */
755 pIpForwardTable->table[ndx].dwForwardProto = MIB_IPPROTO_LOCAL;
756 /* punt on age and AS */
757 pIpForwardTable->table[ndx].dwForwardAge = 0;
758 pIpForwardTable->table[ndx].dwForwardNextHopAS = 0;
759 pIpForwardTable->table[ndx].dwForwardMetric1 =
760 table->routes[ndx].metric;
761 /* rest of the metrics are 0.. */
762 pIpForwardTable->table[ndx].dwForwardMetric2 = 0;
763 pIpForwardTable->table[ndx].dwForwardMetric3 = 0;
764 pIpForwardTable->table[ndx].dwForwardMetric4 = 0;
765 pIpForwardTable->table[ndx].dwForwardMetric5 = 0;
772 ret = ERROR_OUTOFMEMORY;
779 /******************************************************************
780 * GetIpNetTable (IPHLPAPI.@)
785 * pIpNetTable [In/Out]
794 DWORD WINAPI GetIpNetTable(PMIB_IPNETTABLE pIpNetTable, PULONG pdwSize, BOOL bOrder)
799 ret = ERROR_INVALID_PARAMETER;
801 DWORD numEntries = getNumArpEntries();
802 ULONG size = sizeof(MIB_IPNETTABLE) + (numEntries - 1) *
803 sizeof(MIB_IPNETROW);
805 if (!pIpNetTable || *pdwSize < size) {
807 ret = ERROR_INSUFFICIENT_BUFFER;
810 PMIB_IPNETTABLE table = getArpTable();
813 size = sizeof(MIB_IPNETTABLE) + (table->dwNumEntries - 1) *
814 sizeof(MIB_IPNETROW);
815 if (*pdwSize < size) {
817 ret = ERROR_INSUFFICIENT_BUFFER;
821 FIXME(":order not implemented");
822 memcpy(pIpNetTable, table, size);
828 ret = ERROR_OUTOFMEMORY;
835 /******************************************************************
836 * GetIpStatistics (IPHLPAPI.@)
848 DWORD WINAPI GetIpStatistics(PMIB_IPSTATS pStats)
850 return getIPStats(pStats);
854 /******************************************************************
855 * GetNetworkParams (IPHLPAPI.@)
860 * pFixedInfo [In/Out]
861 * pOutBufLen [In/Out]
868 DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
873 return ERROR_INVALID_PARAMETER;
875 size = sizeof(FIXED_INFO) + min(1, (_res.nscount - 1) *
876 sizeof(IP_ADDR_STRING));
877 if (!pFixedInfo || *pOutBufLen < size) {
879 return ERROR_BUFFER_OVERFLOW;
882 memset(pFixedInfo, 0, size);
883 size = sizeof(pFixedInfo->HostName);
884 GetComputerNameExA(ComputerNameDnsHostname, pFixedInfo->HostName, &size);
885 size = sizeof(pFixedInfo->DomainName);
886 GetComputerNameExA(ComputerNameDnsDomain, pFixedInfo->DomainName, &size);
887 if (_res.nscount > 0) {
891 for (i = 0, ptr = &pFixedInfo->DnsServerList; i < _res.nscount;
892 i++, ptr = ptr->Next) {
893 toIPAddressString(_res.nsaddr_list[i].sin_addr.s_addr,
894 ptr->IpAddress.String);
895 ptr->Next = (PIP_ADDR_STRING)((PBYTE)ptr + sizeof(IP_ADDRESS_STRING));
898 /* FIXME: can check whether routing's enabled in /proc/sys/net/ipv4/ip_forward
899 I suppose could also check for a listener on port 53 to set EnableDns */
904 /******************************************************************
905 * GetNumberOfInterfaces (IPHLPAPI.@)
917 DWORD WINAPI GetNumberOfInterfaces(PDWORD pdwNumIf)
922 ret = ERROR_INVALID_PARAMETER;
924 *pdwNumIf = getNumInterfaces();
931 /******************************************************************
932 * GetPerAdapterInfo (IPHLPAPI.@)
938 * pPerAdapterInfo [In/Out]
939 * pOutBufLen [In/Out]
946 DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen)
949 /* marking Win2K+ functions not supported */
950 return ERROR_NOT_SUPPORTED;
954 /******************************************************************
955 * GetRTTAndHopCount (IPHLPAPI.@)
970 BOOL WINAPI GetRTTAndHopCount(IPAddr DestIpAddress, PULONG HopCount, ULONG MaxHops, PULONG RTT)
977 /******************************************************************
978 * GetTcpStatistics (IPHLPAPI.@)
990 DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS pStats)
992 return getTCPStats(pStats);
996 /******************************************************************
997 * GetTcpTable (IPHLPAPI.@)
1002 * pTcpTable [In/Out]
1011 DWORD WINAPI GetTcpTable(PMIB_TCPTABLE pTcpTable, PDWORD pdwSize, BOOL bOrder)
1016 ret = ERROR_INVALID_PARAMETER;
1018 DWORD numEntries = getNumTcpEntries();
1019 ULONG size = sizeof(MIB_TCPTABLE) + (numEntries - 1) * sizeof(MIB_TCPROW);
1021 if (!pTcpTable || *pdwSize < size) {
1023 ret = ERROR_INSUFFICIENT_BUFFER;
1026 PMIB_TCPTABLE table = getTcpTable();
1029 size = sizeof(MIB_TCPTABLE) + (table->dwNumEntries - 1) *
1031 if (*pdwSize < size) {
1033 ret = ERROR_INSUFFICIENT_BUFFER;
1037 FIXME(":order not implemented");
1038 memcpy(pTcpTable, table, size);
1044 ret = ERROR_OUTOFMEMORY;
1051 /******************************************************************
1052 * GetUdpStatistics (IPHLPAPI.@)
1064 DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS pStats)
1066 return getUDPStats(pStats);
1070 /******************************************************************
1071 * GetUdpTable (IPHLPAPI.@)
1076 * pUdpTable [In/Out]
1085 DWORD WINAPI GetUdpTable(PMIB_UDPTABLE pUdpTable, PDWORD pdwSize, BOOL bOrder)
1090 ret = ERROR_INVALID_PARAMETER;
1092 DWORD numEntries = getNumUdpEntries();
1093 ULONG size = sizeof(MIB_UDPTABLE) + (numEntries - 1) * sizeof(MIB_UDPROW);
1095 if (!pUdpTable || *pdwSize < size) {
1097 ret = ERROR_INSUFFICIENT_BUFFER;
1100 PMIB_UDPTABLE table = getUdpTable();
1103 size = sizeof(MIB_UDPTABLE) + (table->dwNumEntries - 1) *
1105 if (*pdwSize < size) {
1107 ret = ERROR_INSUFFICIENT_BUFFER;
1111 FIXME(":order not implemented");
1112 memcpy(pUdpTable, table, size);
1118 ret = ERROR_OUTOFMEMORY;
1125 /******************************************************************
1126 * GetUniDirectionalAdapterInfo (IPHLPAPI.@)
1131 * pIPIfInfo [In/Out]
1132 * dwOutBufLen [In/Out]
1139 DWORD WINAPI GetUniDirectionalAdapterInfo(PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIPIfInfo, PULONG dwOutBufLen)
1141 /* a unidirectional adapter?? not bloody likely! */
1142 return ERROR_NOT_SUPPORTED;
1146 /******************************************************************
1147 * IpReleaseAddress (IPHLPAPI.@)
1152 * AdapterInfo [In/Out]
1159 DWORD WINAPI IpReleaseAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo)
1161 /* not a stub, never going to support this (and I never mark an adapter as
1162 DHCP enabled, see GetAdaptersInfo, so this should never get called) */
1163 return ERROR_NOT_SUPPORTED;
1167 /******************************************************************
1168 * IpRenewAddress (IPHLPAPI.@)
1173 * AdapterInfo [In/Out]
1180 DWORD WINAPI IpRenewAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo)
1182 /* not a stub, never going to support this (and I never mark an adapter as
1183 DHCP enabled, see GetAdaptersInfo, so this should never get called) */
1184 return ERROR_NOT_SUPPORTED;
1188 /******************************************************************
1189 * NotifyAddrChange (IPHLPAPI.@)
1195 * overlapped [In/Out]
1202 DWORD WINAPI NotifyAddrChange(PHANDLE Handle, LPOVERLAPPED overlapped)
1205 /* marking Win2K+ functions not supported */
1206 return ERROR_NOT_SUPPORTED;
1210 /******************************************************************
1211 * NotifyRouteChange (IPHLPAPI.@)
1217 * overlapped [In/Out]
1224 DWORD WINAPI NotifyRouteChange(PHANDLE Handle, LPOVERLAPPED overlapped)
1227 /* marking Win2K+ functions not supported */
1228 return ERROR_NOT_SUPPORTED;
1232 /******************************************************************
1233 * SendARP (IPHLPAPI.@)
1241 * PhyAddrLen [In/Out]
1248 DWORD WINAPI SendARP(IPAddr DestIP, IPAddr SrcIP, PULONG pMacAddr, PULONG PhyAddrLen)
1251 /* marking Win2K+ functions not supported */
1252 return ERROR_NOT_SUPPORTED;
1256 /******************************************************************
1257 * SetIfEntry (IPHLPAPI.@)
1269 DWORD WINAPI SetIfEntry(PMIB_IFROW pIfRow)
1271 /* this is supposed to set an administratively interface up or down.
1272 Could do SIOCSIFFLAGS and set/clear IFF_UP, but, not sure I want to, and
1273 this sort of down is indistinguishable from other sorts of down (e.g. no
1276 return ERROR_NOT_SUPPORTED;
1280 /******************************************************************
1281 * SetIpForwardEntry (IPHLPAPI.@)
1293 DWORD WINAPI SetIpForwardEntry(PMIB_IPFORWARDROW pRoute)
1295 /* this is to add a route entry, how's it distinguishable from
1296 CreateIpForwardEntry?
1297 could use SIOCADDRT, not sure I want to */
1303 /******************************************************************
1304 * SetIpNetEntry (IPHLPAPI.@)
1309 * pArpEntry [In/Out]
1316 DWORD WINAPI SetIpNetEntry(PMIB_IPNETROW pArpEntry)
1318 /* same as CreateIpNetEntry here, could use SIOCSARP, not sure I want to */
1324 /******************************************************************
1325 * SetIpStatistics (IPHLPAPI.@)
1337 DWORD WINAPI SetIpStatistics(PMIB_IPSTATS pIpStats)
1344 /******************************************************************
1345 * SetIpTTL (IPHLPAPI.@)
1357 DWORD WINAPI SetIpTTL(UINT nTTL)
1359 /* could echo nTTL > /proc/net/sys/net/ipv4/ip_default_ttl, not sure I
1360 want to. Could map EACCESS to ERROR_ACCESS_DENIED, I suppose */
1366 /******************************************************************
1367 * SetTcpEntry (IPHLPAPI.@)
1379 DWORD WINAPI SetTcpEntry(PMIB_TCPROW pTcpRow)
1386 /******************************************************************
1387 * UnenableRouter (IPHLPAPI.@)
1392 * pOverlapped [In/Out]
1393 * lpdwEnableCount [In/Out]
1400 DWORD WINAPI UnenableRouter(OVERLAPPED * pOverlapped, LPDWORD lpdwEnableCount)
1403 /* could echo "0" > /proc/net/sys/net/ipv4/ip_forward, not sure I want to
1404 could map EACCESS to ERROR_ACCESS_DENIED, I suppose
1405 marking Win2K+ functions not supported */
1406 return ERROR_NOT_SUPPORTED;