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
25 #include <sys/types.h>
26 #ifdef HAVE_NETINET_IN_H
27 # include <netinet/in.h>
29 #ifdef HAVE_ARPA_NAMESER_H
30 # include <arpa/nameser.h>
41 #include "wine/debug.h"
43 WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi
);
46 /******************************************************************
47 * AddIPAddress (IPHLPAPI.@)
56 * NTEInstance [In/Out]
63 DWORD WINAPI
AddIPAddress(IPAddr Address
, IPMask IpMask
, DWORD IfIndex
, PULONG NTEContext
, PULONG NTEInstance
)
66 /* marking Win2K+ functions not supported */
67 return ERROR_NOT_SUPPORTED
;
71 /******************************************************************
72 * CreateIpForwardEntry (IPHLPAPI.@)
84 DWORD WINAPI
CreateIpForwardEntry(PMIB_IPFORWARDROW pRoute
)
86 /* could use SIOCADDRT, not sure I want to */
92 /******************************************************************
93 * CreateIpNetEntry (IPHLPAPI.@)
105 DWORD WINAPI
CreateIpNetEntry(PMIB_IPNETROW pArpEntry
)
107 /* could use SIOCSARP on systems that support it, not sure I want to */
113 /******************************************************************
114 * CreateProxyArpEntry (IPHLPAPI.@)
128 DWORD WINAPI
CreateProxyArpEntry(DWORD dwAddress
, DWORD dwMask
, DWORD dwIfIndex
)
131 /* marking Win2K+ functions not supported */
132 return ERROR_NOT_SUPPORTED
;
136 /******************************************************************
137 * DeleteIPAddress (IPHLPAPI.@)
149 DWORD WINAPI
DeleteIPAddress(ULONG NTEContext
)
152 /* marking Win2K+ functions not supported */
153 return ERROR_NOT_SUPPORTED
;
157 /******************************************************************
158 * DeleteIpForwardEntry (IPHLPAPI.@)
170 DWORD WINAPI
DeleteIpForwardEntry(PMIB_IPFORWARDROW pRoute
)
172 /* could use SIOCDELRT, not sure I want to */
178 /******************************************************************
179 * DeleteIpNetEntry (IPHLPAPI.@)
191 DWORD WINAPI
DeleteIpNetEntry(PMIB_IPNETROW pArpEntry
)
193 /* could use SIOCDARP on systems that support it, not sure I want to */
199 /******************************************************************
200 * DeleteProxyArpEntry (IPHLPAPI.@)
214 DWORD WINAPI
DeleteProxyArpEntry(DWORD dwAddress
, DWORD dwMask
, DWORD dwIfIndex
)
217 /* marking Win2K+ functions not supported */
218 return ERROR_NOT_SUPPORTED
;
222 /******************************************************************
223 * EnableRouter (IPHLPAPI.@)
229 * pOverlapped [In/Out]
236 DWORD WINAPI
EnableRouter(HANDLE
* pHandle
, OVERLAPPED
* pOverlapped
)
239 /* could echo "1" > /proc/net/sys/net/ipv4/ip_forward, not sure I want to
240 could map EACCESS to ERROR_ACCESS_DENIED, I suppose
241 marking Win2K+ functions not supported */
242 return ERROR_NOT_SUPPORTED
;
246 /******************************************************************
247 * FlushIpNetTable (IPHLPAPI.@)
259 DWORD WINAPI
FlushIpNetTable(DWORD dwIfIndex
)
262 /* this flushes the arp cache of the given index
263 marking Win2K+ functions not supported */
264 return ERROR_NOT_SUPPORTED
;
268 /******************************************************************
269 * GetAdapterIndex (IPHLPAPI.@)
274 * AdapterName [In/Out]
282 DWORD WINAPI
GetAdapterIndex(LPWSTR AdapterName
, PULONG IfIndex
)
285 /* marking Win2K+ functions not supported */
286 return ERROR_NOT_SUPPORTED
;
290 /******************************************************************
291 * GetAdaptersInfo (IPHLPAPI.@)
296 * pAdapterInfo [In/Out]
297 * pOutBufLen [In/Out]
304 DWORD WINAPI
GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo
, PULONG pOutBufLen
)
309 ret
= ERROR_INVALID_PARAMETER
;
311 DWORD numNonLoopbackInterfaces
= getNumNonLoopbackInterfaces();
313 if (numNonLoopbackInterfaces
> 0) {
314 /* this calculation assumes only one address in the IP_ADDR_STRING lists.
315 that's okay, because:
316 - we don't get multiple addresses per adapter anyway
317 - we don't know about per-adapter gateways
318 - we don't know about DHCP or WINS (and these must be single anyway) */
319 ULONG size
= sizeof(IP_ADAPTER_INFO
) * numNonLoopbackInterfaces
;
321 if (!pAdapterInfo
|| *pOutBufLen
< size
) {
323 ret
= ERROR_BUFFER_OVERFLOW
;
326 InterfaceIndexTable
*table
= getNonLoopbackInterfaceIndexTable();
329 size
= sizeof(IP_ADAPTER_INFO
) * table
->numIndexes
;
330 if (*pOutBufLen
< size
) {
332 ret
= ERROR_INSUFFICIENT_BUFFER
;
337 memset(pAdapterInfo
, 0, size
);
338 for (ndx
= 0; ndx
< table
->numIndexes
; ndx
++) {
339 PIP_ADAPTER_INFO ptr
= &pAdapterInfo
[ndx
];
340 DWORD addrLen
= sizeof(ptr
->Address
), type
;
342 /* on Win98 this is left empty, but whatever */
343 strncpy(ptr
->AdapterName
,
344 getInterfaceNameByIndex(table
->indexes
[ndx
]),
345 sizeof(ptr
->AdapterName
));
346 ptr
->AdapterName
[MAX_ADAPTER_NAME_LENGTH
] = '\0';
347 getInterfacePhysicalByIndex(table
->indexes
[ndx
], &addrLen
,
348 ptr
->Address
, &type
);
349 /* MS defines address length and type as UINT in some places and
350 DWORD in others, **sigh**. Don't want to assume that PUINT and
351 PDWORD are equiv (64-bit?) */
352 ptr
->AddressLength
= addrLen
;
354 ptr
->Index
= table
->indexes
[ndx
];
355 toIPAddressString(getInterfaceIPAddrByIndex(table
->indexes
[ndx
]),
356 ptr
->IpAddressList
.IpAddress
.String
);
357 toIPAddressString(getInterfaceMaskByIndex(table
->indexes
[ndx
]),
358 ptr
->IpAddressList
.IpMask
.String
);
359 if (ndx
< table
->numIndexes
+ 1)
360 ptr
->Next
= (ndx
== table
->numIndexes
- 1) ? NULL
: &pAdapterInfo
[ndx
+ 1];
367 ret
= ERROR_OUTOFMEMORY
;
377 /******************************************************************
378 * GetBestInterface (IPHLPAPI.@)
384 * pdwBestIfIndex [In/Out]
391 DWORD WINAPI
GetBestInterface(IPAddr dwDestAddr
, PDWORD pdwBestIfIndex
)
398 /******************************************************************
399 * GetBestRoute (IPHLPAPI.@)
413 DWORD WINAPI
GetBestRoute(DWORD dwDestAddr
, DWORD dwSourceAddr
, PMIB_IPFORWARDROW pBestRoute
)
420 /******************************************************************
421 * GetFriendlyIfIndex (IPHLPAPI.@)
433 DWORD WINAPI
GetFriendlyIfIndex(DWORD IfIndex
)
435 /* windows doesn't validate these, either, just makes sure the top byte is
436 cleared. I assume my ipshared module never gives an index with the top
442 /******************************************************************
443 * GetIcmpStatistics (IPHLPAPI.@)
455 DWORD WINAPI
GetIcmpStatistics(PMIB_ICMP pStats
)
457 return getICMPStats(pStats
);
461 /******************************************************************
462 * GetIfEntry (IPHLPAPI.@)
474 DWORD WINAPI
GetIfEntry(PMIB_IFROW pIfRow
)
480 return ERROR_INVALID_PARAMETER
;
482 name
= getInterfaceNameByIndex(pIfRow
->dwIndex
);
484 ret
= getInterfaceEntryByName(name
, pIfRow
);
486 ret
= getInterfaceStatsByName(name
, pIfRow
);
489 ret
= ERROR_INVALID_DATA
;
494 /******************************************************************
495 * GetIfTable (IPHLPAPI.@)
509 DWORD WINAPI
GetIfTable(PMIB_IFTABLE pIfTable
, PULONG pdwSize
, BOOL bOrder
)
514 ret
= ERROR_INVALID_PARAMETER
;
516 DWORD numInterfaces
= getNumInterfaces();
517 ULONG size
= sizeof(MIB_IFTABLE
) + (numInterfaces
- 1) * sizeof(MIB_IFROW
);
519 if (!pIfTable
|| *pdwSize
< size
) {
521 ret
= ERROR_INSUFFICIENT_BUFFER
;
524 InterfaceIndexTable
*table
= getInterfaceIndexTable();
527 size
= sizeof(MIB_IFTABLE
) + (table
->numIndexes
- 1) *
529 if (*pdwSize
< size
) {
531 ret
= ERROR_INSUFFICIENT_BUFFER
;
537 FIXME(":order not implemented");
538 pIfTable
->dwNumEntries
= 0;
539 for (ndx
= 0; ndx
< table
->numIndexes
; ndx
++) {
540 pIfTable
->table
[ndx
].dwIndex
= table
->indexes
[ndx
];
541 GetIfEntry(&pIfTable
->table
[ndx
]);
542 pIfTable
->dwNumEntries
++;
549 ret
= ERROR_OUTOFMEMORY
;
556 /******************************************************************
557 * GetInterfaceInfo (IPHLPAPI.@)
563 * dwOutBufLen [In/Out]
570 DWORD WINAPI
GetInterfaceInfo(PIP_INTERFACE_INFO pIfTable
, PULONG dwOutBufLen
)
575 ret
= ERROR_INVALID_PARAMETER
;
577 DWORD numInterfaces
= getNumInterfaces();
578 ULONG size
= sizeof(IP_INTERFACE_INFO
) + (numInterfaces
- 1) *
579 sizeof(IP_ADAPTER_INDEX_MAP
);
581 if (!pIfTable
|| *dwOutBufLen
< size
) {
583 ret
= ERROR_INSUFFICIENT_BUFFER
;
586 InterfaceIndexTable
*table
= getInterfaceIndexTable();
589 size
= sizeof(IP_INTERFACE_INFO
) + (table
->numIndexes
- 1) *
590 sizeof(IP_ADAPTER_INDEX_MAP
);
591 if (*dwOutBufLen
< size
) {
593 ret
= ERROR_INSUFFICIENT_BUFFER
;
598 pIfTable
->NumAdapters
= 0;
599 for (ndx
= 0; ndx
< table
->numIndexes
; ndx
++) {
600 const char *walker
, *name
;
603 pIfTable
->Adapter
[ndx
].Index
= table
->indexes
[ndx
];
604 name
= getInterfaceNameByIndex(table
->indexes
[ndx
]);
605 for (walker
= name
, assigner
= pIfTable
->Adapter
[ndx
].Name
;
607 assigner
- pIfTable
->Adapter
[ndx
].Name
< MAX_ADAPTER_NAME
- 1;
608 walker
++, assigner
++)
611 pIfTable
->NumAdapters
++;
618 ret
= ERROR_OUTOFMEMORY
;
625 /******************************************************************
626 * GetIpAddrTable (IPHLPAPI.@)
631 * pIpAddrTable [In/Out]
640 DWORD WINAPI
GetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable
, PULONG pdwSize
, BOOL bOrder
)
645 ret
= ERROR_INVALID_PARAMETER
;
647 DWORD numInterfaces
= getNumInterfaces();
648 ULONG size
= sizeof(MIB_IPADDRTABLE
) + (numInterfaces
- 1) *
649 sizeof(MIB_IPADDRROW
);
651 if (!pIpAddrTable
|| *pdwSize
< size
) {
653 ret
= ERROR_INSUFFICIENT_BUFFER
;
656 InterfaceIndexTable
*table
= getInterfaceIndexTable();
659 size
= sizeof(MIB_IPADDRTABLE
) + (table
->numIndexes
- 1) *
660 sizeof(MIB_IPADDRROW
);
661 if (*pdwSize
< size
) {
663 ret
= ERROR_INSUFFICIENT_BUFFER
;
669 FIXME(":order not implemented");
670 pIpAddrTable
->dwNumEntries
= 0;
671 for (ndx
= 0; ndx
< table
->numIndexes
; ndx
++) {
672 pIpAddrTable
->table
[ndx
].dwIndex
= table
->indexes
[ndx
];
673 pIpAddrTable
->table
[ndx
].dwAddr
=
674 getInterfaceIPAddrByIndex(table
->indexes
[ndx
]);
675 pIpAddrTable
->table
[ndx
].dwMask
=
676 getInterfaceMaskByIndex(table
->indexes
[ndx
]);
677 pIpAddrTable
->table
[ndx
].dwBCastAddr
=
678 getInterfaceBCastAddrByIndex(table
->indexes
[ndx
]);
679 /* FIXME: hardcoded reasm size, not sure where to get it */
680 pIpAddrTable
->table
[ndx
].dwReasmSize
= 65535;
681 pIpAddrTable
->table
[ndx
].unused1
= 0;
682 pIpAddrTable
->table
[ndx
].wType
= 0; /* aka unused2 */
683 pIpAddrTable
->dwNumEntries
++;
690 ret
= ERROR_OUTOFMEMORY
;
697 /******************************************************************
698 * GetIpForwardTable (IPHLPAPI.@)
703 * pIpForwardTable [In/Out]
712 DWORD WINAPI
GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable
, PULONG pdwSize
, BOOL bOrder
)
717 ret
= ERROR_INVALID_PARAMETER
;
719 DWORD numRoutes
= getNumRoutes();
720 ULONG sizeNeeded
= sizeof(MIB_IPFORWARDTABLE
) + (numRoutes
- 1) *
721 sizeof(MIB_IPFORWARDROW
);
723 if (!pIpForwardTable
|| *pdwSize
< sizeNeeded
) {
724 *pdwSize
= sizeNeeded
;
725 ret
= ERROR_INSUFFICIENT_BUFFER
;
728 RouteTable
*table
= getRouteTable();
730 sizeNeeded
= sizeof(MIB_IPFORWARDTABLE
) + (table
->numRoutes
- 1) *
731 sizeof(MIB_IPFORWARDROW
);
732 if (*pdwSize
< sizeNeeded
) {
733 *pdwSize
= sizeNeeded
;
734 ret
= ERROR_INSUFFICIENT_BUFFER
;
740 FIXME(":order not implemented");
741 pIpForwardTable
->dwNumEntries
= table
->numRoutes
;
742 for (ndx
= 0; ndx
< numRoutes
; ndx
++) {
743 pIpForwardTable
->table
[ndx
].dwForwardIfIndex
=
744 table
->routes
[ndx
].ifIndex
;
745 pIpForwardTable
->table
[ndx
].dwForwardDest
=
746 table
->routes
[ndx
].dest
;
747 pIpForwardTable
->table
[ndx
].dwForwardMask
=
748 table
->routes
[ndx
].mask
;
749 pIpForwardTable
->table
[ndx
].dwForwardPolicy
= 0;
750 pIpForwardTable
->table
[ndx
].dwForwardNextHop
=
751 table
->routes
[ndx
].gateway
;
752 /* FIXME: this type is appropriate for local interfaces; may not
753 always be appropriate */
754 pIpForwardTable
->table
[ndx
].dwForwardType
= MIB_IPROUTE_TYPE_DIRECT
;
755 /* FIXME: other protos might be appropriate, e.g. the default route
756 is typically set with MIB_IPPROTO_NETMGMT instead */
757 pIpForwardTable
->table
[ndx
].dwForwardProto
= MIB_IPPROTO_LOCAL
;
758 /* punt on age and AS */
759 pIpForwardTable
->table
[ndx
].dwForwardAge
= 0;
760 pIpForwardTable
->table
[ndx
].dwForwardNextHopAS
= 0;
761 pIpForwardTable
->table
[ndx
].dwForwardMetric1
=
762 table
->routes
[ndx
].metric
;
763 /* rest of the metrics are 0.. */
764 pIpForwardTable
->table
[ndx
].dwForwardMetric2
= 0;
765 pIpForwardTable
->table
[ndx
].dwForwardMetric3
= 0;
766 pIpForwardTable
->table
[ndx
].dwForwardMetric4
= 0;
767 pIpForwardTable
->table
[ndx
].dwForwardMetric5
= 0;
774 ret
= ERROR_OUTOFMEMORY
;
781 /******************************************************************
782 * GetIpNetTable (IPHLPAPI.@)
787 * pIpNetTable [In/Out]
796 DWORD WINAPI
GetIpNetTable(PMIB_IPNETTABLE pIpNetTable
, PULONG pdwSize
, BOOL bOrder
)
801 ret
= ERROR_INVALID_PARAMETER
;
803 DWORD numEntries
= getNumArpEntries();
804 ULONG size
= sizeof(MIB_IPNETTABLE
) + (numEntries
- 1) *
805 sizeof(MIB_IPNETROW
);
807 if (!pIpNetTable
|| *pdwSize
< size
) {
809 ret
= ERROR_INSUFFICIENT_BUFFER
;
812 PMIB_IPNETTABLE table
= getArpTable();
815 size
= sizeof(MIB_IPNETTABLE
) + (table
->dwNumEntries
- 1) *
816 sizeof(MIB_IPNETROW
);
817 if (*pdwSize
< size
) {
819 ret
= ERROR_INSUFFICIENT_BUFFER
;
823 FIXME(":order not implemented");
824 memcpy(pIpNetTable
, table
, size
);
830 ret
= ERROR_OUTOFMEMORY
;
837 /******************************************************************
838 * GetIpStatistics (IPHLPAPI.@)
850 DWORD WINAPI
GetIpStatistics(PMIB_IPSTATS pStats
)
852 return getIPStats(pStats
);
856 /******************************************************************
857 * GetNetworkParams (IPHLPAPI.@)
862 * pFixedInfo [In/Out]
863 * pOutBufLen [In/Out]
870 DWORD WINAPI
GetNetworkParams(PFIXED_INFO pFixedInfo
, PULONG pOutBufLen
)
875 return ERROR_INVALID_PARAMETER
;
877 size
= sizeof(FIXED_INFO
) + min(1, (_res
.nscount
- 1) *
878 sizeof(IP_ADDR_STRING
));
879 if (!pFixedInfo
|| *pOutBufLen
< size
) {
881 return ERROR_BUFFER_OVERFLOW
;
884 memset(pFixedInfo
, 0, size
);
885 size
= sizeof(pFixedInfo
->HostName
);
886 GetComputerNameExA(ComputerNameDnsHostname
, pFixedInfo
->HostName
, &size
);
887 size
= sizeof(pFixedInfo
->DomainName
);
888 GetComputerNameExA(ComputerNameDnsDomain
, pFixedInfo
->DomainName
, &size
);
889 if (_res
.nscount
> 0) {
893 for (i
= 0, ptr
= &pFixedInfo
->DnsServerList
; i
< _res
.nscount
;
894 i
++, ptr
= ptr
->Next
) {
895 toIPAddressString(_res
.nsaddr_list
[i
].sin_addr
.s_addr
,
896 ptr
->IpAddress
.String
);
897 ptr
->Next
= (PIP_ADDR_STRING
)((PBYTE
)ptr
+ sizeof(IP_ADDRESS_STRING
));
900 /* FIXME: can check whether routing's enabled in /proc/sys/net/ipv4/ip_forward
901 I suppose could also check for a listener on port 53 to set EnableDns */
906 /******************************************************************
907 * GetNumberOfInterfaces (IPHLPAPI.@)
919 DWORD WINAPI
GetNumberOfInterfaces(PDWORD pdwNumIf
)
924 ret
= ERROR_INVALID_PARAMETER
;
926 *pdwNumIf
= getNumInterfaces();
933 /******************************************************************
934 * GetPerAdapterInfo (IPHLPAPI.@)
940 * pPerAdapterInfo [In/Out]
941 * pOutBufLen [In/Out]
948 DWORD WINAPI
GetPerAdapterInfo(ULONG IfIndex
, PIP_PER_ADAPTER_INFO pPerAdapterInfo
, PULONG pOutBufLen
)
951 /* marking Win2K+ functions not supported */
952 return ERROR_NOT_SUPPORTED
;
956 /******************************************************************
957 * GetRTTAndHopCount (IPHLPAPI.@)
972 BOOL WINAPI
GetRTTAndHopCount(IPAddr DestIpAddress
, PULONG HopCount
, ULONG MaxHops
, PULONG RTT
)
979 /******************************************************************
980 * GetTcpStatistics (IPHLPAPI.@)
992 DWORD WINAPI
GetTcpStatistics(PMIB_TCPSTATS pStats
)
994 return getTCPStats(pStats
);
998 /******************************************************************
999 * GetTcpTable (IPHLPAPI.@)
1004 * pTcpTable [In/Out]
1013 DWORD WINAPI
GetTcpTable(PMIB_TCPTABLE pTcpTable
, PDWORD pdwSize
, BOOL bOrder
)
1018 ret
= ERROR_INVALID_PARAMETER
;
1020 DWORD numEntries
= getNumTcpEntries();
1021 ULONG size
= sizeof(MIB_TCPTABLE
) + (numEntries
- 1) * sizeof(MIB_TCPROW
);
1023 if (!pTcpTable
|| *pdwSize
< size
) {
1025 ret
= ERROR_INSUFFICIENT_BUFFER
;
1028 PMIB_TCPTABLE table
= getTcpTable();
1031 size
= sizeof(MIB_TCPTABLE
) + (table
->dwNumEntries
- 1) *
1033 if (*pdwSize
< size
) {
1035 ret
= ERROR_INSUFFICIENT_BUFFER
;
1039 FIXME(":order not implemented");
1040 memcpy(pTcpTable
, table
, size
);
1046 ret
= ERROR_OUTOFMEMORY
;
1053 /******************************************************************
1054 * GetUdpStatistics (IPHLPAPI.@)
1066 DWORD WINAPI
GetUdpStatistics(PMIB_UDPSTATS pStats
)
1068 return getUDPStats(pStats
);
1072 /******************************************************************
1073 * GetUdpTable (IPHLPAPI.@)
1078 * pUdpTable [In/Out]
1087 DWORD WINAPI
GetUdpTable(PMIB_UDPTABLE pUdpTable
, PDWORD pdwSize
, BOOL bOrder
)
1092 ret
= ERROR_INVALID_PARAMETER
;
1094 DWORD numEntries
= getNumUdpEntries();
1095 ULONG size
= sizeof(MIB_UDPTABLE
) + (numEntries
- 1) * sizeof(MIB_UDPROW
);
1097 if (!pUdpTable
|| *pdwSize
< size
) {
1099 ret
= ERROR_INSUFFICIENT_BUFFER
;
1102 PMIB_UDPTABLE table
= getUdpTable();
1105 size
= sizeof(MIB_UDPTABLE
) + (table
->dwNumEntries
- 1) *
1107 if (*pdwSize
< size
) {
1109 ret
= ERROR_INSUFFICIENT_BUFFER
;
1113 FIXME(":order not implemented");
1114 memcpy(pUdpTable
, table
, size
);
1120 ret
= ERROR_OUTOFMEMORY
;
1127 /******************************************************************
1128 * GetUniDirectionalAdapterInfo (IPHLPAPI.@)
1133 * pIPIfInfo [In/Out]
1134 * dwOutBufLen [In/Out]
1141 DWORD WINAPI
GetUniDirectionalAdapterInfo(PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIPIfInfo
, PULONG dwOutBufLen
)
1143 /* a unidirectional adapter?? not bloody likely! */
1144 return ERROR_NOT_SUPPORTED
;
1148 /******************************************************************
1149 * IpReleaseAddress (IPHLPAPI.@)
1154 * AdapterInfo [In/Out]
1161 DWORD WINAPI
IpReleaseAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo
)
1163 /* not a stub, never going to support this (and I never mark an adapter as
1164 DHCP enabled, see GetAdaptersInfo, so this should never get called) */
1165 return ERROR_NOT_SUPPORTED
;
1169 /******************************************************************
1170 * IpRenewAddress (IPHLPAPI.@)
1175 * AdapterInfo [In/Out]
1182 DWORD WINAPI
IpRenewAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo
)
1184 /* not a stub, never going to support this (and I never mark an adapter as
1185 DHCP enabled, see GetAdaptersInfo, so this should never get called) */
1186 return ERROR_NOT_SUPPORTED
;
1190 /******************************************************************
1191 * NotifyAddrChange (IPHLPAPI.@)
1197 * overlapped [In/Out]
1204 DWORD WINAPI
NotifyAddrChange(PHANDLE Handle
, LPOVERLAPPED overlapped
)
1207 /* marking Win2K+ functions not supported */
1208 return ERROR_NOT_SUPPORTED
;
1212 /******************************************************************
1213 * NotifyRouteChange (IPHLPAPI.@)
1219 * overlapped [In/Out]
1226 DWORD WINAPI
NotifyRouteChange(PHANDLE Handle
, LPOVERLAPPED overlapped
)
1229 /* marking Win2K+ functions not supported */
1230 return ERROR_NOT_SUPPORTED
;
1234 /******************************************************************
1235 * SendARP (IPHLPAPI.@)
1243 * PhyAddrLen [In/Out]
1250 DWORD WINAPI
SendARP(IPAddr DestIP
, IPAddr SrcIP
, PULONG pMacAddr
, PULONG PhyAddrLen
)
1253 /* marking Win2K+ functions not supported */
1254 return ERROR_NOT_SUPPORTED
;
1258 /******************************************************************
1259 * SetIfEntry (IPHLPAPI.@)
1271 DWORD WINAPI
SetIfEntry(PMIB_IFROW pIfRow
)
1273 /* this is supposed to set an administratively interface up or down.
1274 Could do SIOCSIFFLAGS and set/clear IFF_UP, but, not sure I want to, and
1275 this sort of down is indistinguishable from other sorts of down (e.g. no
1278 return ERROR_NOT_SUPPORTED
;
1282 /******************************************************************
1283 * SetIpForwardEntry (IPHLPAPI.@)
1295 DWORD WINAPI
SetIpForwardEntry(PMIB_IPFORWARDROW pRoute
)
1297 /* this is to add a route entry, how's it distinguishable from
1298 CreateIpForwardEntry?
1299 could use SIOCADDRT, not sure I want to */
1305 /******************************************************************
1306 * SetIpNetEntry (IPHLPAPI.@)
1311 * pArpEntry [In/Out]
1318 DWORD WINAPI
SetIpNetEntry(PMIB_IPNETROW pArpEntry
)
1320 /* same as CreateIpNetEntry here, could use SIOCSARP, not sure I want to */
1326 /******************************************************************
1327 * SetIpStatistics (IPHLPAPI.@)
1339 DWORD WINAPI
SetIpStatistics(PMIB_IPSTATS pIpStats
)
1346 /******************************************************************
1347 * SetIpTTL (IPHLPAPI.@)
1359 DWORD WINAPI
SetIpTTL(UINT nTTL
)
1361 /* could echo nTTL > /proc/net/sys/net/ipv4/ip_default_ttl, not sure I
1362 want to. Could map EACCESS to ERROR_ACCESS_DENIED, I suppose */
1368 /******************************************************************
1369 * SetTcpEntry (IPHLPAPI.@)
1381 DWORD WINAPI
SetTcpEntry(PMIB_TCPROW pTcpRow
)
1388 /******************************************************************
1389 * UnenableRouter (IPHLPAPI.@)
1394 * pOverlapped [In/Out]
1395 * lpdwEnableCount [In/Out]
1402 DWORD WINAPI
UnenableRouter(OVERLAPPED
* pOverlapped
, LPDWORD lpdwEnableCount
)
1405 /* could echo "0" > /proc/net/sys/net/ipv4/ip_forward, not sure I want to
1406 could map EACCESS to ERROR_ACCESS_DENIED, I suppose
1407 marking Win2K+ functions not supported */
1408 return ERROR_NOT_SUPPORTED
;