[1166] | 1 | /**
|
---|
| 2 | * This file is part of the mingw-w64 runtime package.
|
---|
| 3 | * No warranty is given; refer to the file DISCLAIMER within this package.
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | #ifndef __IPHLPAPI_H__
|
---|
| 7 | #define __IPHLPAPI_H__
|
---|
| 8 |
|
---|
| 9 | #include <winapifamily.h>
|
---|
| 10 |
|
---|
| 11 | #ifdef __cplusplus
|
---|
| 12 | extern "C" {
|
---|
| 13 | #endif
|
---|
| 14 |
|
---|
| 15 | #include <iprtrmib.h>
|
---|
| 16 | #include <ipexport.h>
|
---|
| 17 | #include <iptypes.h>
|
---|
| 18 | #include <tcpestats.h>
|
---|
| 19 |
|
---|
| 20 | #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= 0x0A00
|
---|
| 21 |
|
---|
| 22 | #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
|
---|
| 23 |
|
---|
| 24 | DWORD WINAPI GetNumberOfInterfaces (PDWORD pdwNumIf);
|
---|
| 25 | DWORD WINAPI GetIfEntry (PMIB_IFROW pIfRow);
|
---|
| 26 | DWORD WINAPI GetIfTable (PMIB_IFTABLE pIfTable, PULONG pdwSize, WINBOOL bOrder);
|
---|
| 27 | DWORD WINAPI GetIpAddrTable (PMIB_IPADDRTABLE pIpAddrTable, PULONG pdwSize, WINBOOL bOrder);
|
---|
| 28 | ULONG WINAPI GetIpNetTable (PMIB_IPNETTABLE IpNetTable, PULONG SizePointer, WINBOOL Order);
|
---|
| 29 | DWORD WINAPI GetIpForwardTable (PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, WINBOOL bOrder);
|
---|
| 30 | ULONG WINAPI GetTcpTable (PMIB_TCPTABLE TcpTable, PULONG SizePointer, WINBOOL Order);
|
---|
| 31 | DWORD WINAPI GetExtendedTcpTable (PVOID pTcpTable, PDWORD pdwSize, WINBOOL bOrder, ULONG ulAf, TCP_TABLE_CLASS TableClass, ULONG Reserved);
|
---|
| 32 | DWORD WINAPI GetOwnerModuleFromTcpEntry (PMIB_TCPROW_OWNER_MODULE pTcpEntry, TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID pBuffer, PDWORD pdwSize);
|
---|
| 33 | ULONG WINAPI GetUdpTable (PMIB_UDPTABLE UdpTable, PULONG SizePointer, WINBOOL Order);
|
---|
| 34 | DWORD WINAPI GetExtendedUdpTable (PVOID pUdpTable, PDWORD pdwSize, WINBOOL bOrder, ULONG ulAf, UDP_TABLE_CLASS TableClass, ULONG Reserved);
|
---|
| 35 | DWORD WINAPI GetOwnerModuleFromUdpEntry (PMIB_UDPROW_OWNER_MODULE pUdpEntry, TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID pBuffer, PDWORD pdwSize);
|
---|
| 36 | #if NTDDI_VERSION < 0x06000000
|
---|
| 37 | DWORD AllocateAndGetTcpExTableFromStack (PVOID *ppTcpTable, WINBOOL bOrder, HANDLE hHeap, DWORD dwFlags, DWORD dwFamily);
|
---|
| 38 | DWORD AllocateAndGetUdpExTableFromStack (PVOID *ppUdpTable, WINBOOL bOrder, HANDLE hHeap, DWORD dwFlags, DWORD dwFamily);
|
---|
| 39 | #else
|
---|
| 40 | ULONG WINAPI GetTcpTable2 (PMIB_TCPTABLE2 TcpTable, PULONG SizePointer, WINBOOL Order);
|
---|
| 41 | #endif
|
---|
| 42 |
|
---|
| 43 | #ifdef _WS2IPDEF_
|
---|
| 44 |
|
---|
| 45 | #if NTDDI_VERSION >= 0x06000000
|
---|
| 46 | ULONG WINAPI GetTcp6Table (PMIB_TCP6TABLE TcpTable, PULONG SizePointer, WINBOOL Order);
|
---|
| 47 | ULONG WINAPI GetTcp6Table2 (PMIB_TCP6TABLE2 TcpTable, PULONG SizePointer, WINBOOL Order);
|
---|
| 48 | ULONG WINAPI GetPerTcpConnectionEStats (PMIB_TCPROW Row, TCP_ESTATS_TYPE EstatsType, PUCHAR Rw, ULONG RwVersion, ULONG RwSize, PUCHAR Ros, ULONG RosVersion, ULONG RosSize, PUCHAR Rod, ULONG RodVersion, ULONG RodSize);
|
---|
| 49 | ULONG WINAPI SetPerTcpConnectionEStats (PMIB_TCPROW Row, TCP_ESTATS_TYPE EstatsType, PUCHAR Rw, ULONG RwVersion, ULONG RwSize, ULONG Offset);
|
---|
| 50 | ULONG WINAPI GetPerTcp6ConnectionEStats (PMIB_TCP6ROW Row, TCP_ESTATS_TYPE EstatsType, PUCHAR Rw, ULONG RwVersion, ULONG RwSize, PUCHAR Ros, ULONG RosVersion, ULONG RosSize, PUCHAR Rod, ULONG RodVersion, ULONG RodSize);
|
---|
| 51 | ULONG WINAPI SetPerTcp6ConnectionEStats (PMIB_TCP6ROW Row, TCP_ESTATS_TYPE EstatsType, PUCHAR Rw, ULONG RwVersion, ULONG RwSize, ULONG Offset);
|
---|
| 52 | ULONG WINAPI GetUdp6Table (PMIB_UDP6TABLE Udp6Table, PULONG SizePointer, WINBOOL Order);
|
---|
| 53 | #endif
|
---|
| 54 | DWORD WINAPI GetOwnerModuleFromTcp6Entry (PMIB_TCP6ROW_OWNER_MODULE pTcpEntry, TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID pBuffer, PDWORD pdwSize);
|
---|
| 55 | DWORD WINAPI GetOwnerModuleFromUdp6Entry (PMIB_UDP6ROW_OWNER_MODULE pUdpEntry, TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID pBuffer, PDWORD pdwSize);
|
---|
| 56 | #endif
|
---|
| 57 | DWORD GetOwnerModuleFromPidAndInfo (ULONG ulPid, ULONGLONG *pInfo, TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID pBuffer, PDWORD pdwSize);
|
---|
| 58 | ULONG WINAPI GetIpStatistics (PMIB_IPSTATS Statistics);
|
---|
| 59 | ULONG WINAPI GetIcmpStatistics (PMIB_ICMP Statistics);
|
---|
| 60 | ULONG WINAPI GetTcpStatistics (PMIB_TCPSTATS Statistics);
|
---|
| 61 | ULONG WINAPI GetUdpStatistics (PMIB_UDPSTATS Stats);
|
---|
| 62 | ULONG WINAPI GetIpStatisticsEx (PMIB_IPSTATS Statistics, ULONG Family);
|
---|
| 63 | ULONG WINAPI SetIpStatisticsEx (PMIB_IPSTATS Statistics, ULONG Family);
|
---|
| 64 | ULONG WINAPI GetIcmpStatisticsEx (PMIB_ICMP_EX Statistics, ULONG Family);
|
---|
| 65 | ULONG WINAPI GetTcpStatisticsEx (PMIB_TCPSTATS Statistics, ULONG Family);
|
---|
| 66 | ULONG WINAPI GetUdpStatisticsEx (PMIB_UDPSTATS Statistics, ULONG Family);
|
---|
| 67 | DWORD WINAPI SetIfEntry (PMIB_IFROW pIfRow);
|
---|
| 68 | DWORD WINAPI CreateIpForwardEntry (PMIB_IPFORWARDROW pRoute);
|
---|
| 69 | DWORD WINAPI SetIpForwardEntry (PMIB_IPFORWARDROW pRoute);
|
---|
| 70 | DWORD WINAPI DeleteIpForwardEntry (PMIB_IPFORWARDROW pRoute);
|
---|
| 71 | DWORD WINAPI SetIpStatistics (PMIB_IPSTATS pIpStats);
|
---|
| 72 | DWORD WINAPI SetIpTTL (UINT nTTL);
|
---|
| 73 | DWORD WINAPI CreateIpNetEntry (PMIB_IPNETROW pArpEntry);
|
---|
| 74 | DWORD WINAPI SetIpNetEntry (PMIB_IPNETROW pArpEntry);
|
---|
| 75 | DWORD WINAPI DeleteIpNetEntry (PMIB_IPNETROW pArpEntry);
|
---|
| 76 | DWORD WINAPI FlushIpNetTable (DWORD dwIfIndex);
|
---|
| 77 | DWORD WINAPI CreateProxyArpEntry (DWORD dwAddress, DWORD dwMask, DWORD dwIfIndex);
|
---|
| 78 | DWORD WINAPI DeleteProxyArpEntry (DWORD dwAddress, DWORD dwMask, DWORD dwIfIndex);
|
---|
| 79 | DWORD WINAPI SetTcpEntry (PMIB_TCPROW pTcpRow);
|
---|
| 80 | DWORD WINAPI GetInterfaceInfo (PIP_INTERFACE_INFO pIfTable, PULONG dwOutBufLen);
|
---|
| 81 | DWORD WINAPI GetUniDirectionalAdapterInfo (PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIPIfInfo, PULONG dwOutBufLen);
|
---|
| 82 | #ifndef NHPALLOCATEANDGETINTERFACEINFOFROMSTACK_DEFINED
|
---|
| 83 | #define NHPALLOCATEANDGETINTERFACEINFOFROMSTACK_DEFINED
|
---|
| 84 | DWORD WINAPI NhpAllocateAndGetInterfaceInfoFromStack (IP_INTERFACE_NAME_INFO **ppTable, PDWORD pdwCount, WINBOOL bOrder, HANDLE hHeap, DWORD dwFlags);
|
---|
| 85 | #endif
|
---|
| 86 | DWORD WINAPI GetBestInterface (IPAddr dwDestAddr, PDWORD pdwBestIfIndex);
|
---|
| 87 | DWORD WINAPI GetBestInterfaceEx (struct sockaddr *pDestAddr, PDWORD pdwBestIfIndex);
|
---|
| 88 | DWORD WINAPI GetBestRoute (DWORD dwDestAddr, DWORD dwSourceAddr, PMIB_IPFORWARDROW pBestRoute);
|
---|
| 89 | DWORD WINAPI NotifyAddrChange (PHANDLE Handle, LPOVERLAPPED overlapped);
|
---|
| 90 | DWORD WINAPI NotifyRouteChange (PHANDLE Handle, LPOVERLAPPED overlapped);
|
---|
| 91 | WINBOOL WINAPI CancelIPChangeNotify (LPOVERLAPPED notifyOverlapped);
|
---|
| 92 | DWORD WINAPI GetAdapterIndex (LPWSTR AdapterName, PULONG IfIndex);
|
---|
| 93 | DWORD WINAPI AddIPAddress (IPAddr Address, IPMask IpMask, DWORD IfIndex, PULONG NTEContext, PULONG NTEInstance);
|
---|
| 94 | DWORD WINAPI DeleteIPAddress (ULONG NTEContext);
|
---|
| 95 | DWORD WINAPI GetNetworkParams (PFIXED_INFO pFixedInfo, PULONG pOutBufLen);
|
---|
| 96 | ULONG WINAPI GetAdaptersInfo (PIP_ADAPTER_INFO AdapterInfo, PULONG SizePointer);
|
---|
| 97 | PIP_ADAPTER_ORDER_MAP WINAPI GetAdapterOrderMap (VOID);
|
---|
| 98 |
|
---|
| 99 | #endif /* WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) */
|
---|
| 100 |
|
---|
| 101 | #ifdef _WINSOCK2API_
|
---|
| 102 | ULONG WINAPI GetAdaptersAddresses (ULONG Family, ULONG Flags, PVOID Reserved, PIP_ADAPTER_ADDRESSES AdapterAddresses, PULONG SizePointer);
|
---|
| 103 | #endif
|
---|
| 104 |
|
---|
| 105 | DWORD WINAPI GetPerAdapterInfo (ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen);
|
---|
| 106 | DWORD WINAPI IpReleaseAddress (PIP_ADAPTER_INDEX_MAP AdapterInfo);
|
---|
| 107 | DWORD WINAPI IpRenewAddress (PIP_ADAPTER_INDEX_MAP AdapterInfo);
|
---|
| 108 | DWORD WINAPI SendARP (IPAddr DestIP, IPAddr SrcIP, PVOID pMacAddr, PULONG PhyAddrLen);
|
---|
| 109 | WINBOOL WINAPI GetRTTAndHopCount (IPAddr DestIpAddress, PULONG HopCount, ULONG MaxHops, PULONG RTT);
|
---|
| 110 | DWORD WINAPI GetFriendlyIfIndex (DWORD IfIndex);
|
---|
| 111 | DWORD WINAPI EnableRouter (HANDLE *pHandle, OVERLAPPED *pOverlapped);
|
---|
| 112 | DWORD WINAPI UnenableRouter (OVERLAPPED *pOverlapped, LPDWORD lpdwEnableCount);
|
---|
| 113 | DWORD WINAPI DisableMediaSense (HANDLE *pHandle, OVERLAPPED *pOverLapped);
|
---|
| 114 | DWORD WINAPI RestoreMediaSense (OVERLAPPED *pOverlapped, LPDWORD lpdwEnableCount);
|
---|
| 115 |
|
---|
| 116 | #if NTDDI_VERSION >= 0x06000000
|
---|
| 117 | #define NET_STRING_IPV4_ADDRESS 0x00000001
|
---|
| 118 | #define NET_STRING_IPV4_SERVICE 0x00000002
|
---|
| 119 | #define NET_STRING_IPV4_NETWORK 0x00000004
|
---|
| 120 | #define NET_STRING_IPV6_ADDRESS 0x00000008
|
---|
| 121 | #define NET_STRING_IPV6_ADDRESS_NO_SCOPE 0x00000010
|
---|
| 122 | #define NET_STRING_IPV6_SERVICE 0x00000020
|
---|
| 123 | #define NET_STRING_IPV6_SERVICE_NO_SCOPE 0x00000040
|
---|
| 124 | #define NET_STRING_IPV6_NETWORK 0x00000080
|
---|
| 125 | #define NET_STRING_NAMED_ADDRESS 0x00000100
|
---|
| 126 | #define NET_STRING_NAMED_SERVICE 0x00000200
|
---|
| 127 |
|
---|
| 128 | #define NET_STRING_IP_ADDRESS (NET_STRING_IPV4_ADDRESS | NET_STRING_IPV6_ADDRESS)
|
---|
| 129 | #define NET_STRING_IP_ADDRESS_NO_SCOPE (NET_STRING_IPV4_ADDRESS | NET_STRING_IPV6_ADDRESS_NO_SCOPE)
|
---|
| 130 | #define NET_STRING_IP_SERVICE (NET_STRING_IPV4_SERVICE | NET_STRING_IPV6_SERVICE)
|
---|
| 131 | #define NET_STRING_IP_SERVICE_NO_SCOPE (NET_STRING_IPV4_SERVICE | NET_STRING_IPV6_SERVICE_NO_SCOPE)
|
---|
| 132 | #define NET_STRING_IP_NETWORK (NET_STRING_IPV4_NETWORK | NET_STRING_IPV6_NETWORK)
|
---|
| 133 | #define NET_STRING_ANY_ADDRESS (NET_STRING_NAMED_ADDRESS | NET_STRING_IP_ADDRESS)
|
---|
| 134 | #define NET_STRING_ANY_ADDRESS_NO_SCOPE (NET_STRING_NAMED_ADDRESS | NET_STRING_IP_ADDRESS_NO_SCOPE)
|
---|
| 135 | #define NET_STRING_ANY_SERVICE (NET_STRING_NAMED_SERVICE | NET_STRING_IP_SERVICE)
|
---|
| 136 | #define NET_STRING_ANY_SERVICE_NO_SCOPE (NET_STRING_NAMED_SERVICE | NET_STRING_IP_SERVICE_NO_SCOPE)
|
---|
| 137 |
|
---|
| 138 | typedef enum NET_ADDRESS_FORMAT_ {
|
---|
| 139 | NET_ADDRESS_FORMAT_UNSPECIFIED = 0,
|
---|
| 140 | NET_ADDRESS_DNS_NAME,
|
---|
| 141 | NET_ADDRESS_IPV4,
|
---|
| 142 | NET_ADDRESS_IPV6
|
---|
| 143 | } NET_ADDRESS_FORMAT;
|
---|
| 144 |
|
---|
| 145 | #if defined (_WS2DEF_) && defined (_WS2IPDEF_) && defined (_WINDNS_INCLUDED_)
|
---|
| 146 | typedef struct NET_ADDRESS_INFO_ {
|
---|
| 147 | NET_ADDRESS_FORMAT Format;
|
---|
| 148 | __C89_NAMELESS union {
|
---|
| 149 | struct {
|
---|
| 150 | WCHAR Address[DNS_MAX_NAME_BUFFER_LENGTH];
|
---|
| 151 | WCHAR Port[6];
|
---|
| 152 | } NamedAddress;
|
---|
| 153 | SOCKADDR_IN Ipv4Address;
|
---|
| 154 | SOCKADDR_IN6 Ipv6Address;
|
---|
| 155 | SOCKADDR IpAddress;
|
---|
| 156 | };
|
---|
| 157 | } NET_ADDRESS_INFO,*PNET_ADDRESS_INFO;
|
---|
| 158 |
|
---|
| 159 | DWORD WINAPI ParseNetworkString (CONST WCHAR *NetworkString, DWORD Types, PNET_ADDRESS_INFO AddressInfo, USHORT *PortNumber, BYTE *PrefixLength);
|
---|
| 160 | #endif
|
---|
| 161 | DWORD WINAPI GetIpErrorString (IP_STATUS ErrorCode, PWSTR Buffer, PDWORD Size);
|
---|
| 162 | #ifdef _WS2DEF_
|
---|
| 163 | ULONG WINAPI ResolveNeighbor (SOCKADDR *NetworkAddress, PVOID PhysicalAddress, PULONG PhysicalAddressLength);
|
---|
| 164 | #endif
|
---|
| 165 | ULONG WINAPI CreatePersistentTcpPortReservation (USHORT StartPort, USHORT NumberOfPorts, PULONG64 Token);
|
---|
| 166 | ULONG WINAPI CreatePersistentUdpPortReservation (USHORT StartPort, USHORT NumberOfPorts, PULONG64 Token);
|
---|
| 167 | ULONG WINAPI DeletePersistentTcpPortReservation (USHORT StartPort, USHORT NumberOfPorts);
|
---|
| 168 | ULONG WINAPI DeletePersistentUdpPortReservation (USHORT StartPort, USHORT NumberOfPorts);
|
---|
| 169 | ULONG WINAPI LookupPersistentTcpPortReservation (USHORT StartPort, USHORT NumberOfPorts, PULONG64 Token);
|
---|
| 170 | ULONG WINAPI LookupPersistentUdpPortReservation (USHORT StartPort, USHORT NumberOfPorts, PULONG64 Token);
|
---|
| 171 | #endif
|
---|
| 172 |
|
---|
| 173 | #if NTDDI_VERSION >= 0x06000000
|
---|
| 174 | #include <netioapi.h>
|
---|
| 175 | #endif
|
---|
| 176 |
|
---|
| 177 | #endif /* WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= 0x0A00 */
|
---|
| 178 |
|
---|
| 179 | #ifdef __cplusplus
|
---|
| 180 | }
|
---|
| 181 | #endif
|
---|
| 182 |
|
---|
| 183 | #endif
|
---|