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
29 #include "wine/debug.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi);
34 /******************************************************************
35 * AddIPAddress (IPHLPAPI.@)
44 * NTEInstance [In/Out]
51 DWORD WINAPI AddIPAddress(IPAddr Address, IPMask IpMask, DWORD IfIndex, PULONG NTEContext, PULONG NTEInstance)
54 /* marking Win2K+ functions not supported */
55 return ERROR_NOT_SUPPORTED;
59 /******************************************************************
60 * CreateIpForwardEntry (IPHLPAPI.@)
72 DWORD WINAPI CreateIpForwardEntry(PMIB_IPFORWARDROW pRoute)
74 /* could use SIOCADDRT, not sure I want to */
80 /******************************************************************
81 * CreateIpNetEntry (IPHLPAPI.@)
93 DWORD WINAPI CreateIpNetEntry(PMIB_IPNETROW pArpEntry)
95 /* could use SIOCSARP on systems that support it, not sure I want to */
101 /******************************************************************
102 * CreateProxyArpEntry (IPHLPAPI.@)
116 DWORD WINAPI CreateProxyArpEntry(DWORD dwAddress, DWORD dwMask, DWORD dwIfIndex)
119 /* marking Win2K+ functions not supported */
120 return ERROR_NOT_SUPPORTED;
124 /******************************************************************
125 * DeleteIPAddress (IPHLPAPI.@)
137 DWORD WINAPI DeleteIPAddress(ULONG NTEContext)
140 /* marking Win2K+ functions not supported */
141 return ERROR_NOT_SUPPORTED;
145 /******************************************************************
146 * DeleteIpForwardEntry (IPHLPAPI.@)
158 DWORD WINAPI DeleteIpForwardEntry(PMIB_IPFORWARDROW pRoute)
160 /* could use SIOCDELRT, not sure I want to */
166 /******************************************************************
167 * DeleteIpNetEntry (IPHLPAPI.@)
179 DWORD WINAPI DeleteIpNetEntry(PMIB_IPNETROW pArpEntry)
181 /* could use SIOCDARP on systems that support it, not sure I want to */
187 /******************************************************************
188 * DeleteProxyArpEntry (IPHLPAPI.@)
202 DWORD WINAPI DeleteProxyArpEntry(DWORD dwAddress, DWORD dwMask, DWORD dwIfIndex)
205 /* marking Win2K+ functions not supported */
206 return ERROR_NOT_SUPPORTED;
210 /******************************************************************
211 * EnableRouter (IPHLPAPI.@)
217 * pOverlapped [In/Out]
224 DWORD WINAPI EnableRouter(HANDLE * pHandle, OVERLAPPED * pOverlapped)
227 /* could echo "1" > /proc/net/sys/net/ipv4/ip_forward, not sure I want to
228 could map EACCESS to ERROR_ACCESS_DENIED, I suppose
229 marking Win2K+ functions not supported */
230 return ERROR_NOT_SUPPORTED;
234 /******************************************************************
235 * FlushIpNetTable (IPHLPAPI.@)
247 DWORD WINAPI FlushIpNetTable(DWORD dwIfIndex)
250 /* this flushes the arp cache of the given index
251 marking Win2K+ functions not supported */
252 return ERROR_NOT_SUPPORTED;
256 /******************************************************************
257 * GetAdapterIndex (IPHLPAPI.@)
262 * AdapterName [In/Out]
270 DWORD WINAPI GetAdapterIndex(LPWSTR AdapterName, PULONG IfIndex)
273 /* marking Win2K+ functions not supported */
274 return ERROR_NOT_SUPPORTED;
278 /******************************************************************
279 * GetAdaptersInfo (IPHLPAPI.@)
284 * pAdapterInfo [In/Out]
285 * pOutBufLen [In/Out]
292 DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
297 ret = ERROR_INVALID_PARAMETER;
299 DWORD numNonLoopbackInterfaces = getNumNonLoopbackInterfaces();
301 if (numNonLoopbackInterfaces > 0) {
302 /* this calculation assumes only one address in the IP_ADDR_STRING lists.
303 that's okay, because:
304 - we don't get multiple addresses per adapter anyway
305 - we don't know about per-adapter gateways
306 - we don't know about DHCP or WINS (and these must be single anyway) */
307 ULONG size = sizeof(IP_ADAPTER_INFO) * numNonLoopbackInterfaces;
309 if (!pAdapterInfo || *pOutBufLen < size) {
311 ret = ERROR_BUFFER_OVERFLOW;
314 InterfaceIndexTable *table = getNonLoopbackInterfaceIndexTable();
317 size = sizeof(IP_ADAPTER_INFO) * table->numIndexes;
318 if (*pOutBufLen < size) {
320 ret = ERROR_INSUFFICIENT_BUFFER;
325 memset(pAdapterInfo, 0, size);
326 for (ndx = 0; ndx < table->numIndexes; ndx++) {
327 PIP_ADAPTER_INFO ptr = &pAdapterInfo[ndx];
328 DWORD addrLen = sizeof(ptr->Address), type;
330 /* on Win98 this is left empty, but whatever */
331 strncpy(ptr->AdapterName,
332 getInterfaceNameByIndex(table->indexes[ndx]),
333 sizeof(ptr->AdapterName));
334 ptr->AdapterName[MAX_ADAPTER_NAME_LENGTH] = '\0';
335 getInterfacePhysicalByIndex(table->indexes[ndx], &addrLen,
336 ptr->Address, &type);
337 /* MS defines address length and type as UINT in some places and
338 DWORD in others, **sigh**. Don't want to assume that PUINT and
339 PDWORD are equiv (64-bit?) */
340 ptr->AddressLength = addrLen;
342 ptr->Index = table->indexes[ndx];
343 toIPAddressString(getInterfaceIPAddrByIndex(table->indexes[ndx]),
344 ptr->IpAddressList.IpAddress.String);
345 toIPAddressString(getInterfaceMaskByIndex(table->indexes[ndx]),
346 ptr->IpAddressList.IpMask.String);
347 if (ndx < table->numIndexes + 1)
348 ptr->Next = &pAdapterInfo[ndx + 1];
355 ret = ERROR_OUTOFMEMORY;
365 /******************************************************************
366 * GetBestInterface (IPHLPAPI.@)
372 * pdwBestIfIndex [In/Out]
379 DWORD WINAPI GetBestInterface(IPAddr dwDestAddr, PDWORD pdwBestIfIndex)
386 /******************************************************************
387 * GetBestRoute (IPHLPAPI.@)
401 DWORD WINAPI GetBestRoute(DWORD dwDestAddr, DWORD dwSourceAddr, PMIB_IPFORWARDROW pBestRoute)
408 /******************************************************************
409 * GetFriendlyIfIndex (IPHLPAPI.@)
421 DWORD WINAPI GetFriendlyIfIndex(DWORD IfIndex)
423 /* windows doesn't validate these, either, just makes sure the top byte is
424 cleared. I assume my ipshared module never gives an index with the top
430 /******************************************************************
431 * GetIcmpStatistics (IPHLPAPI.@)
443 DWORD WINAPI GetIcmpStatistics(PMIB_ICMP pStats)
445 return getICMPStats(pStats);
449 /******************************************************************
450 * GetIfEntry (IPHLPAPI.@)
462 DWORD WINAPI GetIfEntry(PMIB_IFROW pIfRow)
468 return ERROR_INVALID_PARAMETER;
470 name = getInterfaceNameByIndex(pIfRow->dwIndex);
472 ret = getInterfaceEntryByName(name, pIfRow);
474 ret = getInterfaceStatsByName(name, pIfRow);
477 ret = ERROR_INVALID_DATA;
482 /******************************************************************
483 * GetIfTable (IPHLPAPI.@)
497 DWORD WINAPI GetIfTable(PMIB_IFTABLE pIfTable, PULONG pdwSize, BOOL bOrder)
502 ret = ERROR_INVALID_PARAMETER;
504 DWORD numInterfaces = getNumInterfaces();
505 ULONG size = sizeof(MIB_IFTABLE) + (numInterfaces - 1) * sizeof(MIB_IFROW);
507 if (!pIfTable || *pdwSize < size) {
509 ret = ERROR_INSUFFICIENT_BUFFER;
512 InterfaceIndexTable *table = getInterfaceIndexTable();
515 size = sizeof(MIB_IFTABLE) + (table->numIndexes - 1) *
517 if (*pdwSize < size) {
519 ret = ERROR_INSUFFICIENT_BUFFER;
525 FIXME(":order not implemented");
526 pIfTable->dwNumEntries = 0;
527 for (ndx = 0; ndx < table->numIndexes; ndx++) {
528 pIfTable->table[ndx].dwIndex = table->indexes[ndx];
529 GetIfEntry(&pIfTable->table[ndx]);
530 pIfTable->dwNumEntries++;
537 ret = ERROR_OUTOFMEMORY;
544 /******************************************************************
545 * GetInterfaceInfo (IPHLPAPI.@)
551 * dwOutBufLen [In/Out]
558 DWORD WINAPI GetInterfaceInfo(PIP_INTERFACE_INFO pIfTable, PULONG dwOutBufLen)
563 ret = ERROR_INVALID_PARAMETER;
565 DWORD numInterfaces = getNumInterfaces();
566 ULONG size = sizeof(IP_INTERFACE_INFO) + (numInterfaces - 1) *
567 sizeof(IP_ADAPTER_INDEX_MAP);
569 if (!pIfTable || *dwOutBufLen < size) {
571 ret = ERROR_INSUFFICIENT_BUFFER;
574 InterfaceIndexTable *table = getInterfaceIndexTable();
577 size = sizeof(IP_INTERFACE_INFO) + (table->numIndexes - 1) *
578 sizeof(IP_ADAPTER_INDEX_MAP);
579 if (*dwOutBufLen < size) {
581 ret = ERROR_INSUFFICIENT_BUFFER;
586 pIfTable->NumAdapters = 0;
587 for (ndx = 0; ndx < table->numIndexes; ndx++) {
588 const char *walker, *name;
591 pIfTable->Adapter[ndx].Index = table->indexes[ndx];
592 name = getInterfaceNameByIndex(table->indexes[ndx]);
593 for (walker = name, assigner = pIfTable->Adapter[ndx].Name;
595 assigner - pIfTable->Adapter[ndx].Name < MAX_ADAPTER_NAME - 1;
596 walker++, assigner++)
599 pIfTable->NumAdapters++;
606 ret = ERROR_OUTOFMEMORY;
613 /******************************************************************
614 * GetIpAddrTable (IPHLPAPI.@)
619 * pIpAddrTable [In/Out]
628 DWORD WINAPI GetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable, PULONG pdwSize, BOOL bOrder)
633 ret = ERROR_INVALID_PARAMETER;
635 DWORD numInterfaces = getNumInterfaces();
636 ULONG size = sizeof(MIB_IPADDRTABLE) + (numInterfaces - 1) *
637 sizeof(MIB_IPADDRROW);
639 if (!pIpAddrTable || *pdwSize < size) {
641 ret = ERROR_INSUFFICIENT_BUFFER;
644 InterfaceIndexTable *table = getInterfaceIndexTable();
647 size = sizeof(MIB_IPADDRTABLE) + (table->numIndexes - 1) *
648 sizeof(MIB_IPADDRROW);
649 if (*pdwSize < size) {
651 ret = ERROR_INSUFFICIENT_BUFFER;
657 FIXME(":order not implemented");
658 pIpAddrTable->dwNumEntries = 0;
659 for (ndx = 0; ndx < table->numIndexes; ndx++) {
660 pIpAddrTable->table[ndx].dwIndex = table->indexes[ndx];
661 pIpAddrTable->table[ndx].dwAddr =
662 getInterfaceIPAddrByIndex(table->indexes[ndx]);
663 pIpAddrTable->table[ndx].dwMask =
664 getInterfaceMaskByIndex(table->indexes[ndx]);
665 pIpAddrTable->table[ndx].dwBCastAddr =
666 getInterfaceBCastAddrByIndex(table->indexes[ndx]);
667 /* FIXME: hardcoded reasm size, not sure where to get it */
668 pIpAddrTable->table[ndx].dwReasmSize = 65535;
669 pIpAddrTable->table[ndx].unused1 = 0;
670 pIpAddrTable->table[ndx].wType = 0; /* aka unused2 */
671 pIpAddrTable->dwNumEntries++;
678 ret = ERROR_OUTOFMEMORY;
685 /******************************************************************
686 * GetIpForwardTable (IPHLPAPI.@)
691 * pIpForwardTable [In/Out]
700 DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, BOOL bOrder)
705 ret = ERROR_INVALID_PARAMETER;
707 DWORD numRoutes = getNumRoutes();
708 ULONG sizeNeeded = sizeof(MIB_IPFORWARDTABLE) + (numRoutes - 1) *
709 sizeof(MIB_IPFORWARDROW);
711 if (!pIpForwardTable || *pdwSize < sizeNeeded) {
712 *pdwSize = sizeNeeded;
713 ret = ERROR_INSUFFICIENT_BUFFER;
716 RouteTable *table = getRouteTable();
718 sizeNeeded = sizeof(MIB_IPFORWARDTABLE) + (table->numRoutes - 1) *
719 sizeof(MIB_IPFORWARDROW);
720 if (*pdwSize < sizeNeeded) {
721 *pdwSize = sizeNeeded;
722 ret = ERROR_INSUFFICIENT_BUFFER;
728 FIXME(":order not implemented");
729 pIpForwardTable->dwNumEntries = table->numRoutes;
730 for (ndx = 0; ndx < numRoutes; ndx++) {
731 pIpForwardTable->table[ndx].dwForwardIfIndex =
732 table->routes[ndx].ifIndex;
733 pIpForwardTable->table[ndx].dwForwardDest =
734 table->routes[ndx].dest;
735 pIpForwardTable->table[ndx].dwForwardMask =
736 table->routes[ndx].mask;
737 pIpForwardTable->table[ndx].dwForwardPolicy = 0;
738 pIpForwardTable->table[ndx].dwForwardNextHop =
739 table->routes[ndx].gateway;
740 /* FIXME: this type is appropriate for local interfaces; may not
741 always be appropriate */
742 pIpForwardTable->table[ndx].dwForwardType = MIB_IPROUTE_TYPE_DIRECT;
743 /* FIXME: other protos might be appropriate, e.g. the default route
744 is typically set with MIB_IPPROTO_NETMGMT instead */
745 pIpForwardTable->table[ndx].dwForwardProto = MIB_IPPROTO_LOCAL;
746 /* punt on age and AS */
747 pIpForwardTable->table[ndx].dwForwardAge = 0;
748 pIpForwardTable->table[ndx].dwForwardNextHopAS = 0;
749 pIpForwardTable->table[ndx].dwForwardMetric1 =
750 table->routes[ndx].metric;
751 /* rest of the metrics are 0.. */
752 pIpForwardTable->table[ndx].dwForwardMetric2 = 0;
753 pIpForwardTable->table[ndx].dwForwardMetric3 = 0;
754 pIpForwardTable->table[ndx].dwForwardMetric4 = 0;
755 pIpForwardTable->table[ndx].dwForwardMetric5 = 0;
762 ret = ERROR_OUTOFMEMORY;
769 /******************************************************************
770 * GetIpNetTable (IPHLPAPI.@)
775 * pIpNetTable [In/Out]
784 DWORD WINAPI GetIpNetTable(PMIB_IPNETTABLE pIpNetTable, PULONG pdwSize, BOOL bOrder)
789 ret = ERROR_INVALID_PARAMETER;
791 DWORD numEntries = getNumArpEntries();
792 ULONG size = sizeof(MIB_IPNETTABLE) + (numEntries - 1) *
793 sizeof(MIB_IPNETROW);
795 if (!pIpNetTable || *pdwSize < size) {
797 ret = ERROR_INSUFFICIENT_BUFFER;
800 PMIB_IPNETTABLE table = getArpTable();
803 size = sizeof(MIB_IPNETTABLE) + (table->dwNumEntries - 1) *
804 sizeof(MIB_IPNETROW);
805 if (*pdwSize < size) {
807 ret = ERROR_INSUFFICIENT_BUFFER;
811 FIXME(":order not implemented");
812 memcpy(pIpNetTable, table, size);
818 ret = ERROR_OUTOFMEMORY;
825 /******************************************************************
826 * GetIpStatistics (IPHLPAPI.@)
838 DWORD WINAPI GetIpStatistics(PMIB_IPSTATS pStats)
840 return getIPStats(pStats);
844 /******************************************************************
845 * GetNetworkParams (IPHLPAPI.@)
850 * pFixedInfo [In/Out]
851 * pOutBufLen [In/Out]
858 DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
863 return ERROR_INVALID_PARAMETER;
865 size = sizeof(FIXED_INFO) + min(1, (_res.nscount - 1) *
866 sizeof(IP_ADDR_STRING));
867 if (!pFixedInfo || *pOutBufLen < size) {
869 return ERROR_BUFFER_OVERFLOW;
872 memset(pFixedInfo, 0, size);
873 size = sizeof(pFixedInfo->HostName);
874 GetComputerNameExA(ComputerNameDnsHostname, pFixedInfo->HostName, &size);
875 size = sizeof(pFixedInfo->DomainName);
876 GetComputerNameExA(ComputerNameDnsDomain, pFixedInfo->DomainName, &size);
877 if (_res.nscount > 0) {
881 for (i = 0, ptr = &pFixedInfo->DnsServerList; i < _res.nscount;
882 i++, ptr = ptr->Next) {
883 toIPAddressString(_res.nsaddr_list[i].sin_addr.s_addr,
884 ptr->IpAddress.String);
885 ptr->Next = (PIP_ADDR_STRING)((PBYTE)ptr + sizeof(IP_ADDRESS_STRING));
888 /* FIXME: can check whether routing's enabled in /proc/sys/net/ipv4/ip_forward
889 I suppose could also check for a listener on port 53 to set EnableDns */
894 /******************************************************************
895 * GetNumberOfInterfaces (IPHLPAPI.@)
907 DWORD WINAPI GetNumberOfInterfaces(PDWORD pdwNumIf)
912 ret = ERROR_INVALID_PARAMETER;
914 *pdwNumIf = getNumInterfaces();
921 /******************************************************************
922 * GetPerAdapterInfo (IPHLPAPI.@)
928 * pPerAdapterInfo [In/Out]
929 * pOutBufLen [In/Out]
936 DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen)
939 /* marking Win2K+ functions not supported */
940 return ERROR_NOT_SUPPORTED;
944 /******************************************************************
945 * GetRTTAndHopCount (IPHLPAPI.@)
960 BOOL WINAPI GetRTTAndHopCount(IPAddr DestIpAddress, PULONG HopCount, ULONG MaxHops, PULONG RTT)
967 /******************************************************************
968 * GetTcpStatistics (IPHLPAPI.@)
980 DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS pStats)
982 return getTCPStats(pStats);
986 /******************************************************************
987 * GetTcpTable (IPHLPAPI.@)
1001 DWORD WINAPI GetTcpTable(PMIB_TCPTABLE pTcpTable, PDWORD pdwSize, BOOL bOrder)
1006 ret = ERROR_INVALID_PARAMETER;
1008 DWORD numEntries = getNumTcpEntries();
1009 ULONG size = sizeof(MIB_TCPTABLE) + (numEntries - 1) * sizeof(MIB_TCPROW);
1011 if (!pTcpTable || *pdwSize < size) {
1013 ret = ERROR_INSUFFICIENT_BUFFER;
1016 PMIB_TCPTABLE table = getTcpTable();
1019 size = sizeof(MIB_TCPTABLE) + (table->dwNumEntries - 1) *
1021 if (*pdwSize < size) {
1023 ret = ERROR_INSUFFICIENT_BUFFER;
1027 FIXME(":order not implemented");
1028 memcpy(pTcpTable, table, size);
1034 ret = ERROR_OUTOFMEMORY;
1041 /******************************************************************
1042 * GetUdpStatistics (IPHLPAPI.@)
1054 DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS pStats)
1056 return getUDPStats(pStats);
1060 /******************************************************************
1061 * GetUdpTable (IPHLPAPI.@)
1066 * pUdpTable [In/Out]
1075 DWORD WINAPI GetUdpTable(PMIB_UDPTABLE pUdpTable, PDWORD pdwSize, BOOL bOrder)
1080 ret = ERROR_INVALID_PARAMETER;
1082 DWORD numEntries = getNumUdpEntries();
1083 ULONG size = sizeof(MIB_UDPTABLE) + (numEntries - 1) * sizeof(MIB_UDPROW);
1085 if (!pUdpTable || *pdwSize < size) {
1087 ret = ERROR_INSUFFICIENT_BUFFER;
1090 PMIB_UDPTABLE table = getUdpTable();
1093 size = sizeof(MIB_UDPTABLE) + (table->dwNumEntries - 1) *
1095 if (*pdwSize < size) {
1097 ret = ERROR_INSUFFICIENT_BUFFER;
1101 FIXME(":order not implemented");
1102 memcpy(pUdpTable, table, size);
1108 ret = ERROR_OUTOFMEMORY;
1115 /******************************************************************
1116 * GetUniDirectionalAdapterInfo (IPHLPAPI.@)
1121 * pIPIfInfo [In/Out]
1122 * dwOutBufLen [In/Out]
1129 DWORD WINAPI GetUniDirectionalAdapterInfo(PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIPIfInfo, PULONG dwOutBufLen)
1131 /* a unidirectional adapter?? not bloody likely! */
1132 return ERROR_NOT_SUPPORTED;
1136 /******************************************************************
1137 * IpReleaseAddress (IPHLPAPI.@)
1142 * AdapterInfo [In/Out]
1149 DWORD WINAPI IpReleaseAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo)
1151 /* not a stub, never going to support this (and I never mark an adapter as
1152 DHCP enabled, see GetAdaptersInfo, so this should never get called) */
1153 return ERROR_NOT_SUPPORTED;
1157 /******************************************************************
1158 * IpRenewAddress (IPHLPAPI.@)
1163 * AdapterInfo [In/Out]
1170 DWORD WINAPI IpRenewAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo)
1172 /* not a stub, never going to support this (and I never mark an adapter as
1173 DHCP enabled, see GetAdaptersInfo, so this should never get called) */
1174 return ERROR_NOT_SUPPORTED;
1178 /******************************************************************
1179 * NotifyAddrChange (IPHLPAPI.@)
1185 * overlapped [In/Out]
1192 DWORD WINAPI NotifyAddrChange(PHANDLE Handle, LPOVERLAPPED overlapped)
1195 /* marking Win2K+ functions not supported */
1196 return ERROR_NOT_SUPPORTED;
1200 /******************************************************************
1201 * NotifyRouteChange (IPHLPAPI.@)
1207 * overlapped [In/Out]
1214 DWORD WINAPI NotifyRouteChange(PHANDLE Handle, LPOVERLAPPED overlapped)
1217 /* marking Win2K+ functions not supported */
1218 return ERROR_NOT_SUPPORTED;
1222 /******************************************************************
1223 * SendARP (IPHLPAPI.@)
1231 * PhyAddrLen [In/Out]
1238 DWORD WINAPI SendARP(IPAddr DestIP, IPAddr SrcIP, PULONG pMacAddr, PULONG PhyAddrLen)
1241 /* marking Win2K+ functions not supported */
1242 return ERROR_NOT_SUPPORTED;
1246 /******************************************************************
1247 * SetIfEntry (IPHLPAPI.@)
1259 DWORD WINAPI SetIfEntry(PMIB_IFROW pIfRow)
1261 /* this is supposed to set an administratively interface up or down.
1262 Could do SIOCSIFFLAGS and set/clear IFF_UP, but, not sure I want to, and
1263 this sort of down is indistinguishable from other sorts of down (e.g. no
1266 return ERROR_NOT_SUPPORTED;
1270 /******************************************************************
1271 * SetIpForwardEntry (IPHLPAPI.@)
1283 DWORD WINAPI SetIpForwardEntry(PMIB_IPFORWARDROW pRoute)
1285 /* this is to add a route entry, how's it distinguishable from
1286 CreateIpForwardEntry?
1287 could use SIOCADDRT, not sure I want to */
1293 /******************************************************************
1294 * SetIpNetEntry (IPHLPAPI.@)
1299 * pArpEntry [In/Out]
1306 DWORD WINAPI SetIpNetEntry(PMIB_IPNETROW pArpEntry)
1308 /* same as CreateIpNetEntry here, could use SIOCSARP, not sure I want to */
1314 /******************************************************************
1315 * SetIpStatistics (IPHLPAPI.@)
1327 DWORD WINAPI SetIpStatistics(PMIB_IPSTATS pIpStats)
1334 /******************************************************************
1335 * SetIpTTL (IPHLPAPI.@)
1347 DWORD WINAPI SetIpTTL(UINT nTTL)
1349 /* could echo nTTL > /proc/net/sys/net/ipv4/ip_default_ttl, not sure I
1350 want to. Could map EACCESS to ERROR_ACCESS_DENIED, I suppose */
1356 /******************************************************************
1357 * SetTcpEntry (IPHLPAPI.@)
1369 DWORD WINAPI SetTcpEntry(PMIB_TCPROW pTcpRow)
1376 /******************************************************************
1377 * UnenableRouter (IPHLPAPI.@)
1382 * pOverlapped [In/Out]
1383 * lpdwEnableCount [In/Out]
1390 DWORD WINAPI UnenableRouter(OVERLAPPED * pOverlapped, LPDWORD lpdwEnableCount)
1393 /* could echo "0" > /proc/net/sys/net/ipv4/ip_forward, not sure I want to
1394 could map EACCESS to ERROR_ACCESS_DENIED, I suppose
1395 marking Win2K+ functions not supported */
1396 return ERROR_NOT_SUPPORTED;