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>
36 #include "wine/debug.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi);
41 /******************************************************************
42 * AddIPAddress (IPHLPAPI.@)
51 * NTEInstance [In/Out]
58 DWORD WINAPI AddIPAddress(IPAddr Address, IPMask IpMask, DWORD IfIndex, PULONG NTEContext, PULONG NTEInstance)
61 /* marking Win2K+ functions not supported */
62 return ERROR_NOT_SUPPORTED;
66 /******************************************************************
67 * CreateIpForwardEntry (IPHLPAPI.@)
79 DWORD WINAPI CreateIpForwardEntry(PMIB_IPFORWARDROW pRoute)
81 /* could use SIOCADDRT, not sure I want to */
87 /******************************************************************
88 * CreateIpNetEntry (IPHLPAPI.@)
100 DWORD WINAPI CreateIpNetEntry(PMIB_IPNETROW pArpEntry)
102 /* could use SIOCSARP on systems that support it, not sure I want to */
108 /******************************************************************
109 * CreateProxyArpEntry (IPHLPAPI.@)
123 DWORD WINAPI CreateProxyArpEntry(DWORD dwAddress, DWORD dwMask, DWORD dwIfIndex)
126 /* marking Win2K+ functions not supported */
127 return ERROR_NOT_SUPPORTED;
131 /******************************************************************
132 * DeleteIPAddress (IPHLPAPI.@)
144 DWORD WINAPI DeleteIPAddress(ULONG NTEContext)
147 /* marking Win2K+ functions not supported */
148 return ERROR_NOT_SUPPORTED;
152 /******************************************************************
153 * DeleteIpForwardEntry (IPHLPAPI.@)
165 DWORD WINAPI DeleteIpForwardEntry(PMIB_IPFORWARDROW pRoute)
167 /* could use SIOCDELRT, not sure I want to */
173 /******************************************************************
174 * DeleteIpNetEntry (IPHLPAPI.@)
186 DWORD WINAPI DeleteIpNetEntry(PMIB_IPNETROW pArpEntry)
188 /* could use SIOCDARP on systems that support it, not sure I want to */
194 /******************************************************************
195 * DeleteProxyArpEntry (IPHLPAPI.@)
209 DWORD WINAPI DeleteProxyArpEntry(DWORD dwAddress, DWORD dwMask, DWORD dwIfIndex)
212 /* marking Win2K+ functions not supported */
213 return ERROR_NOT_SUPPORTED;
217 /******************************************************************
218 * EnableRouter (IPHLPAPI.@)
224 * pOverlapped [In/Out]
231 DWORD WINAPI EnableRouter(HANDLE * pHandle, OVERLAPPED * pOverlapped)
234 /* could echo "1" > /proc/net/sys/net/ipv4/ip_forward, not sure I want to
235 could map EACCESS to ERROR_ACCESS_DENIED, I suppose
236 marking Win2K+ functions not supported */
237 return ERROR_NOT_SUPPORTED;
241 /******************************************************************
242 * FlushIpNetTable (IPHLPAPI.@)
254 DWORD WINAPI FlushIpNetTable(DWORD dwIfIndex)
257 /* this flushes the arp cache of the given index
258 marking Win2K+ functions not supported */
259 return ERROR_NOT_SUPPORTED;
263 /******************************************************************
264 * GetAdapterIndex (IPHLPAPI.@)
269 * AdapterName [In/Out]
277 DWORD WINAPI GetAdapterIndex(LPWSTR AdapterName, PULONG IfIndex)
280 /* marking Win2K+ functions not supported */
281 return ERROR_NOT_SUPPORTED;
285 /******************************************************************
286 * GetAdaptersInfo (IPHLPAPI.@)
291 * pAdapterInfo [In/Out]
292 * pOutBufLen [In/Out]
299 DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
304 ret = ERROR_INVALID_PARAMETER;
306 DWORD numNonLoopbackInterfaces = getNumNonLoopbackInterfaces();
308 if (numNonLoopbackInterfaces > 0) {
309 /* this calculation assumes only one address in the IP_ADDR_STRING lists.
310 that's okay, because:
311 - we don't get multiple addresses per adapter anyway
312 - we don't know about per-adapter gateways
313 - we don't know about DHCP or WINS (and these must be single anyway) */
314 ULONG size = sizeof(IP_ADAPTER_INFO) * numNonLoopbackInterfaces;
316 if (!pAdapterInfo || *pOutBufLen < size) {
318 ret = ERROR_BUFFER_OVERFLOW;
321 InterfaceIndexTable *table = getNonLoopbackInterfaceIndexTable();
324 size = sizeof(IP_ADAPTER_INFO) * table->numIndexes;
325 if (*pOutBufLen < size) {
327 ret = ERROR_INSUFFICIENT_BUFFER;
332 memset(pAdapterInfo, 0, size);
333 for (ndx = 0; ndx < table->numIndexes; ndx++) {
334 PIP_ADAPTER_INFO ptr = &pAdapterInfo[ndx];
335 DWORD addrLen = sizeof(ptr->Address), type;
337 /* on Win98 this is left empty, but whatever */
338 strncpy(ptr->AdapterName,
339 getInterfaceNameByIndex(table->indexes[ndx]),
340 sizeof(ptr->AdapterName));
341 ptr->AdapterName[MAX_ADAPTER_NAME_LENGTH] = '\0';
342 getInterfacePhysicalByIndex(table->indexes[ndx], &addrLen,
343 ptr->Address, &type);
344 /* MS defines address length and type as UINT in some places and
345 DWORD in others, **sigh**. Don't want to assume that PUINT and
346 PDWORD are equiv (64-bit?) */
347 ptr->AddressLength = addrLen;
349 ptr->Index = table->indexes[ndx];
350 toIPAddressString(getInterfaceIPAddrByIndex(table->indexes[ndx]),
351 ptr->IpAddressList.IpAddress.String);
352 toIPAddressString(getInterfaceMaskByIndex(table->indexes[ndx]),
353 ptr->IpAddressList.IpMask.String);
354 if (ndx < table->numIndexes + 1)
355 ptr->Next = &pAdapterInfo[ndx + 1];
362 ret = ERROR_OUTOFMEMORY;
372 /******************************************************************
373 * GetBestInterface (IPHLPAPI.@)
379 * pdwBestIfIndex [In/Out]
386 DWORD WINAPI GetBestInterface(IPAddr dwDestAddr, PDWORD pdwBestIfIndex)
393 /******************************************************************
394 * GetBestRoute (IPHLPAPI.@)
408 DWORD WINAPI GetBestRoute(DWORD dwDestAddr, DWORD dwSourceAddr, PMIB_IPFORWARDROW pBestRoute)
415 /******************************************************************
416 * GetFriendlyIfIndex (IPHLPAPI.@)
428 DWORD WINAPI GetFriendlyIfIndex(DWORD IfIndex)
430 /* windows doesn't validate these, either, just makes sure the top byte is
431 cleared. I assume my ipshared module never gives an index with the top
437 /******************************************************************
438 * GetIcmpStatistics (IPHLPAPI.@)
450 DWORD WINAPI GetIcmpStatistics(PMIB_ICMP pStats)
452 return getICMPStats(pStats);
456 /******************************************************************
457 * GetIfEntry (IPHLPAPI.@)
469 DWORD WINAPI GetIfEntry(PMIB_IFROW pIfRow)
475 return ERROR_INVALID_PARAMETER;
477 name = getInterfaceNameByIndex(pIfRow->dwIndex);
479 ret = getInterfaceEntryByName(name, pIfRow);
481 ret = getInterfaceStatsByName(name, pIfRow);
484 ret = ERROR_INVALID_DATA;
489 /******************************************************************
490 * GetIfTable (IPHLPAPI.@)
504 DWORD WINAPI GetIfTable(PMIB_IFTABLE pIfTable, PULONG pdwSize, BOOL bOrder)
509 ret = ERROR_INVALID_PARAMETER;
511 DWORD numInterfaces = getNumInterfaces();
512 ULONG size = sizeof(MIB_IFTABLE) + (numInterfaces - 1) * sizeof(MIB_IFROW);
514 if (!pIfTable || *pdwSize < size) {
516 ret = ERROR_INSUFFICIENT_BUFFER;
519 InterfaceIndexTable *table = getInterfaceIndexTable();
522 size = sizeof(MIB_IFTABLE) + (table->numIndexes - 1) *
524 if (*pdwSize < size) {
526 ret = ERROR_INSUFFICIENT_BUFFER;
532 FIXME(":order not implemented");
533 pIfTable->dwNumEntries = 0;
534 for (ndx = 0; ndx < table->numIndexes; ndx++) {
535 pIfTable->table[ndx].dwIndex = table->indexes[ndx];
536 GetIfEntry(&pIfTable->table[ndx]);
537 pIfTable->dwNumEntries++;
544 ret = ERROR_OUTOFMEMORY;
551 /******************************************************************
552 * GetInterfaceInfo (IPHLPAPI.@)
558 * dwOutBufLen [In/Out]
565 DWORD WINAPI GetInterfaceInfo(PIP_INTERFACE_INFO pIfTable, PULONG dwOutBufLen)
570 ret = ERROR_INVALID_PARAMETER;
572 DWORD numInterfaces = getNumInterfaces();
573 ULONG size = sizeof(IP_INTERFACE_INFO) + (numInterfaces - 1) *
574 sizeof(IP_ADAPTER_INDEX_MAP);
576 if (!pIfTable || *dwOutBufLen < size) {
578 ret = ERROR_INSUFFICIENT_BUFFER;
581 InterfaceIndexTable *table = getInterfaceIndexTable();
584 size = sizeof(IP_INTERFACE_INFO) + (table->numIndexes - 1) *
585 sizeof(IP_ADAPTER_INDEX_MAP);
586 if (*dwOutBufLen < size) {
588 ret = ERROR_INSUFFICIENT_BUFFER;
593 pIfTable->NumAdapters = 0;
594 for (ndx = 0; ndx < table->numIndexes; ndx++) {
595 const char *walker, *name;
598 pIfTable->Adapter[ndx].Index = table->indexes[ndx];
599 name = getInterfaceNameByIndex(table->indexes[ndx]);
600 for (walker = name, assigner = pIfTable->Adapter[ndx].Name;
602 assigner - pIfTable->Adapter[ndx].Name < MAX_ADAPTER_NAME - 1;
603 walker++, assigner++)
606 pIfTable->NumAdapters++;
613 ret = ERROR_OUTOFMEMORY;
620 /******************************************************************
621 * GetIpAddrTable (IPHLPAPI.@)
626 * pIpAddrTable [In/Out]
635 DWORD WINAPI GetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable, PULONG pdwSize, BOOL bOrder)
640 ret = ERROR_INVALID_PARAMETER;
642 DWORD numInterfaces = getNumInterfaces();
643 ULONG size = sizeof(MIB_IPADDRTABLE) + (numInterfaces - 1) *
644 sizeof(MIB_IPADDRROW);
646 if (!pIpAddrTable || *pdwSize < size) {
648 ret = ERROR_INSUFFICIENT_BUFFER;
651 InterfaceIndexTable *table = getInterfaceIndexTable();
654 size = sizeof(MIB_IPADDRTABLE) + (table->numIndexes - 1) *
655 sizeof(MIB_IPADDRROW);
656 if (*pdwSize < size) {
658 ret = ERROR_INSUFFICIENT_BUFFER;
664 FIXME(":order not implemented");
665 pIpAddrTable->dwNumEntries = 0;
666 for (ndx = 0; ndx < table->numIndexes; ndx++) {
667 pIpAddrTable->table[ndx].dwIndex = table->indexes[ndx];
668 pIpAddrTable->table[ndx].dwAddr =
669 getInterfaceIPAddrByIndex(table->indexes[ndx]);
670 pIpAddrTable->table[ndx].dwMask =
671 getInterfaceMaskByIndex(table->indexes[ndx]);
672 pIpAddrTable->table[ndx].dwBCastAddr =
673 getInterfaceBCastAddrByIndex(table->indexes[ndx]);
674 /* FIXME: hardcoded reasm size, not sure where to get it */
675 pIpAddrTable->table[ndx].dwReasmSize = 65535;
676 pIpAddrTable->table[ndx].unused1 = 0;
677 pIpAddrTable->table[ndx].wType = 0; /* aka unused2 */
678 pIpAddrTable->dwNumEntries++;
685 ret = ERROR_OUTOFMEMORY;
692 /******************************************************************
693 * GetIpForwardTable (IPHLPAPI.@)
698 * pIpForwardTable [In/Out]
707 DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, BOOL bOrder)
712 ret = ERROR_INVALID_PARAMETER;
714 DWORD numRoutes = getNumRoutes();
715 ULONG sizeNeeded = sizeof(MIB_IPFORWARDTABLE) + (numRoutes - 1) *
716 sizeof(MIB_IPFORWARDROW);
718 if (!pIpForwardTable || *pdwSize < sizeNeeded) {
719 *pdwSize = sizeNeeded;
720 ret = ERROR_INSUFFICIENT_BUFFER;
723 RouteTable *table = getRouteTable();
725 sizeNeeded = sizeof(MIB_IPFORWARDTABLE) + (table->numRoutes - 1) *
726 sizeof(MIB_IPFORWARDROW);
727 if (*pdwSize < sizeNeeded) {
728 *pdwSize = sizeNeeded;
729 ret = ERROR_INSUFFICIENT_BUFFER;
735 FIXME(":order not implemented");
736 pIpForwardTable->dwNumEntries = table->numRoutes;
737 for (ndx = 0; ndx < numRoutes; ndx++) {
738 pIpForwardTable->table[ndx].dwForwardIfIndex =
739 table->routes[ndx].ifIndex;
740 pIpForwardTable->table[ndx].dwForwardDest =
741 table->routes[ndx].dest;
742 pIpForwardTable->table[ndx].dwForwardMask =
743 table->routes[ndx].mask;
744 pIpForwardTable->table[ndx].dwForwardPolicy = 0;
745 pIpForwardTable->table[ndx].dwForwardNextHop =
746 table->routes[ndx].gateway;
747 /* FIXME: this type is appropriate for local interfaces; may not
748 always be appropriate */
749 pIpForwardTable->table[ndx].dwForwardType = MIB_IPROUTE_TYPE_DIRECT;
750 /* FIXME: other protos might be appropriate, e.g. the default route
751 is typically set with MIB_IPPROTO_NETMGMT instead */
752 pIpForwardTable->table[ndx].dwForwardProto = MIB_IPPROTO_LOCAL;
753 /* punt on age and AS */
754 pIpForwardTable->table[ndx].dwForwardAge = 0;
755 pIpForwardTable->table[ndx].dwForwardNextHopAS = 0;
756 pIpForwardTable->table[ndx].dwForwardMetric1 =
757 table->routes[ndx].metric;
758 /* rest of the metrics are 0.. */
759 pIpForwardTable->table[ndx].dwForwardMetric2 = 0;
760 pIpForwardTable->table[ndx].dwForwardMetric3 = 0;
761 pIpForwardTable->table[ndx].dwForwardMetric4 = 0;
762 pIpForwardTable->table[ndx].dwForwardMetric5 = 0;
769 ret = ERROR_OUTOFMEMORY;
776 /******************************************************************
777 * GetIpNetTable (IPHLPAPI.@)
782 * pIpNetTable [In/Out]
791 DWORD WINAPI GetIpNetTable(PMIB_IPNETTABLE pIpNetTable, PULONG pdwSize, BOOL bOrder)
796 ret = ERROR_INVALID_PARAMETER;
798 DWORD numEntries = getNumArpEntries();
799 ULONG size = sizeof(MIB_IPNETTABLE) + (numEntries - 1) *
800 sizeof(MIB_IPNETROW);
802 if (!pIpNetTable || *pdwSize < size) {
804 ret = ERROR_INSUFFICIENT_BUFFER;
807 PMIB_IPNETTABLE table = getArpTable();
810 size = sizeof(MIB_IPNETTABLE) + (table->dwNumEntries - 1) *
811 sizeof(MIB_IPNETROW);
812 if (*pdwSize < size) {
814 ret = ERROR_INSUFFICIENT_BUFFER;
818 FIXME(":order not implemented");
819 memcpy(pIpNetTable, table, size);
825 ret = ERROR_OUTOFMEMORY;
832 /******************************************************************
833 * GetIpStatistics (IPHLPAPI.@)
845 DWORD WINAPI GetIpStatistics(PMIB_IPSTATS pStats)
847 return getIPStats(pStats);
851 /******************************************************************
852 * GetNetworkParams (IPHLPAPI.@)
857 * pFixedInfo [In/Out]
858 * pOutBufLen [In/Out]
865 DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
870 return ERROR_INVALID_PARAMETER;
872 size = sizeof(FIXED_INFO) + min(1, (_res.nscount - 1) *
873 sizeof(IP_ADDR_STRING));
874 if (!pFixedInfo || *pOutBufLen < size) {
876 return ERROR_BUFFER_OVERFLOW;
879 memset(pFixedInfo, 0, size);
880 size = sizeof(pFixedInfo->HostName);
881 GetComputerNameExA(ComputerNameDnsHostname, pFixedInfo->HostName, &size);
882 size = sizeof(pFixedInfo->DomainName);
883 GetComputerNameExA(ComputerNameDnsDomain, pFixedInfo->DomainName, &size);
884 if (_res.nscount > 0) {
888 for (i = 0, ptr = &pFixedInfo->DnsServerList; i < _res.nscount;
889 i++, ptr = ptr->Next) {
890 toIPAddressString(_res.nsaddr_list[i].sin_addr.s_addr,
891 ptr->IpAddress.String);
892 ptr->Next = (PIP_ADDR_STRING)((PBYTE)ptr + sizeof(IP_ADDRESS_STRING));
895 /* FIXME: can check whether routing's enabled in /proc/sys/net/ipv4/ip_forward
896 I suppose could also check for a listener on port 53 to set EnableDns */
901 /******************************************************************
902 * GetNumberOfInterfaces (IPHLPAPI.@)
914 DWORD WINAPI GetNumberOfInterfaces(PDWORD pdwNumIf)
919 ret = ERROR_INVALID_PARAMETER;
921 *pdwNumIf = getNumInterfaces();
928 /******************************************************************
929 * GetPerAdapterInfo (IPHLPAPI.@)
935 * pPerAdapterInfo [In/Out]
936 * pOutBufLen [In/Out]
943 DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen)
946 /* marking Win2K+ functions not supported */
947 return ERROR_NOT_SUPPORTED;
951 /******************************************************************
952 * GetRTTAndHopCount (IPHLPAPI.@)
967 BOOL WINAPI GetRTTAndHopCount(IPAddr DestIpAddress, PULONG HopCount, ULONG MaxHops, PULONG RTT)
974 /******************************************************************
975 * GetTcpStatistics (IPHLPAPI.@)
987 DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS pStats)
989 return getTCPStats(pStats);
993 /******************************************************************
994 * GetTcpTable (IPHLPAPI.@)
1008 DWORD WINAPI GetTcpTable(PMIB_TCPTABLE pTcpTable, PDWORD pdwSize, BOOL bOrder)
1013 ret = ERROR_INVALID_PARAMETER;
1015 DWORD numEntries = getNumTcpEntries();
1016 ULONG size = sizeof(MIB_TCPTABLE) + (numEntries - 1) * sizeof(MIB_TCPROW);
1018 if (!pTcpTable || *pdwSize < size) {
1020 ret = ERROR_INSUFFICIENT_BUFFER;
1023 PMIB_TCPTABLE table = getTcpTable();
1026 size = sizeof(MIB_TCPTABLE) + (table->dwNumEntries - 1) *
1028 if (*pdwSize < size) {
1030 ret = ERROR_INSUFFICIENT_BUFFER;
1034 FIXME(":order not implemented");
1035 memcpy(pTcpTable, table, size);
1041 ret = ERROR_OUTOFMEMORY;
1048 /******************************************************************
1049 * GetUdpStatistics (IPHLPAPI.@)
1061 DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS pStats)
1063 return getUDPStats(pStats);
1067 /******************************************************************
1068 * GetUdpTable (IPHLPAPI.@)
1073 * pUdpTable [In/Out]
1082 DWORD WINAPI GetUdpTable(PMIB_UDPTABLE pUdpTable, PDWORD pdwSize, BOOL bOrder)
1087 ret = ERROR_INVALID_PARAMETER;
1089 DWORD numEntries = getNumUdpEntries();
1090 ULONG size = sizeof(MIB_UDPTABLE) + (numEntries - 1) * sizeof(MIB_UDPROW);
1092 if (!pUdpTable || *pdwSize < size) {
1094 ret = ERROR_INSUFFICIENT_BUFFER;
1097 PMIB_UDPTABLE table = getUdpTable();
1100 size = sizeof(MIB_UDPTABLE) + (table->dwNumEntries - 1) *
1102 if (*pdwSize < size) {
1104 ret = ERROR_INSUFFICIENT_BUFFER;
1108 FIXME(":order not implemented");
1109 memcpy(pUdpTable, table, size);
1115 ret = ERROR_OUTOFMEMORY;
1122 /******************************************************************
1123 * GetUniDirectionalAdapterInfo (IPHLPAPI.@)
1128 * pIPIfInfo [In/Out]
1129 * dwOutBufLen [In/Out]
1136 DWORD WINAPI GetUniDirectionalAdapterInfo(PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIPIfInfo, PULONG dwOutBufLen)
1138 /* a unidirectional adapter?? not bloody likely! */
1139 return ERROR_NOT_SUPPORTED;
1143 /******************************************************************
1144 * IpReleaseAddress (IPHLPAPI.@)
1149 * AdapterInfo [In/Out]
1156 DWORD WINAPI IpReleaseAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo)
1158 /* not a stub, never going to support this (and I never mark an adapter as
1159 DHCP enabled, see GetAdaptersInfo, so this should never get called) */
1160 return ERROR_NOT_SUPPORTED;
1164 /******************************************************************
1165 * IpRenewAddress (IPHLPAPI.@)
1170 * AdapterInfo [In/Out]
1177 DWORD WINAPI IpRenewAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo)
1179 /* not a stub, never going to support this (and I never mark an adapter as
1180 DHCP enabled, see GetAdaptersInfo, so this should never get called) */
1181 return ERROR_NOT_SUPPORTED;
1185 /******************************************************************
1186 * NotifyAddrChange (IPHLPAPI.@)
1192 * overlapped [In/Out]
1199 DWORD WINAPI NotifyAddrChange(PHANDLE Handle, LPOVERLAPPED overlapped)
1202 /* marking Win2K+ functions not supported */
1203 return ERROR_NOT_SUPPORTED;
1207 /******************************************************************
1208 * NotifyRouteChange (IPHLPAPI.@)
1214 * overlapped [In/Out]
1221 DWORD WINAPI NotifyRouteChange(PHANDLE Handle, LPOVERLAPPED overlapped)
1224 /* marking Win2K+ functions not supported */
1225 return ERROR_NOT_SUPPORTED;
1229 /******************************************************************
1230 * SendARP (IPHLPAPI.@)
1238 * PhyAddrLen [In/Out]
1245 DWORD WINAPI SendARP(IPAddr DestIP, IPAddr SrcIP, PULONG pMacAddr, PULONG PhyAddrLen)
1248 /* marking Win2K+ functions not supported */
1249 return ERROR_NOT_SUPPORTED;
1253 /******************************************************************
1254 * SetIfEntry (IPHLPAPI.@)
1266 DWORD WINAPI SetIfEntry(PMIB_IFROW pIfRow)
1268 /* this is supposed to set an administratively interface up or down.
1269 Could do SIOCSIFFLAGS and set/clear IFF_UP, but, not sure I want to, and
1270 this sort of down is indistinguishable from other sorts of down (e.g. no
1273 return ERROR_NOT_SUPPORTED;
1277 /******************************************************************
1278 * SetIpForwardEntry (IPHLPAPI.@)
1290 DWORD WINAPI SetIpForwardEntry(PMIB_IPFORWARDROW pRoute)
1292 /* this is to add a route entry, how's it distinguishable from
1293 CreateIpForwardEntry?
1294 could use SIOCADDRT, not sure I want to */
1300 /******************************************************************
1301 * SetIpNetEntry (IPHLPAPI.@)
1306 * pArpEntry [In/Out]
1313 DWORD WINAPI SetIpNetEntry(PMIB_IPNETROW pArpEntry)
1315 /* same as CreateIpNetEntry here, could use SIOCSARP, not sure I want to */
1321 /******************************************************************
1322 * SetIpStatistics (IPHLPAPI.@)
1334 DWORD WINAPI SetIpStatistics(PMIB_IPSTATS pIpStats)
1341 /******************************************************************
1342 * SetIpTTL (IPHLPAPI.@)
1354 DWORD WINAPI SetIpTTL(UINT nTTL)
1356 /* could echo nTTL > /proc/net/sys/net/ipv4/ip_default_ttl, not sure I
1357 want to. Could map EACCESS to ERROR_ACCESS_DENIED, I suppose */
1363 /******************************************************************
1364 * SetTcpEntry (IPHLPAPI.@)
1376 DWORD WINAPI SetTcpEntry(PMIB_TCPROW pTcpRow)
1383 /******************************************************************
1384 * UnenableRouter (IPHLPAPI.@)
1389 * pOverlapped [In/Out]
1390 * lpdwEnableCount [In/Out]
1397 DWORD WINAPI UnenableRouter(OVERLAPPED * pOverlapped, LPDWORD lpdwEnableCount)
1400 /* could echo "0" > /proc/net/sys/net/ipv4/ip_forward, not sure I want to
1401 could map EACCESS to ERROR_ACCESS_DENIED, I suppose
1402 marking Win2K+ functions not supported */
1403 return ERROR_NOT_SUPPORTED;