78 for (ndx = 0; ndx < numRoutes; ndx++)
80 if ((
table->routes[ndx].ifIndex == (
index)) && (
table->routes[ndx].dest == 0))
81 retVal =
table->routes[ndx].gateway;
105 TRACE(
"ppIfTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx\n", ppIfTable,
145 TRACE(
"ppIpAddrTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx\n",
152 *ppIpAddrTable =
NULL;
159 *ppIpAddrTable =
NULL;
185 TRACE(
"ppIpForwardTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx\n",
187 if (!ppIpForwardTable)
192 *ppIpForwardTable =
NULL;
199 *ppIpForwardTable =
NULL;
225 TRACE(
"ppIpNetTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx\n",
232 *ppIpNetTable =
NULL;
239 *ppIpNetTable =
NULL;
265 TRACE(
"ppTcpTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx\n",
306 TRACE(
"ppTcpTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx, family 0x%08lx\n",
348 TRACE(
"ppTcpTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx, family %ld, class %ld\n",
388 TRACE(
"ppUdpTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx\n",
429 TRACE(
"ppUdpTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx, family 0x%08lx\n",
471 TRACE(
"ppUdpTable %p, bOrder %ld, heap 0x%p, flags 0x%08lx, family %ld, class %ld\n",
520 TRACE(
"pArpEntry %p\n", pArpEntry);
540 TRACE(
"dwAddress 0x%08lx, dwMask 0x%08lx, dwIfIndex 0x%08lx\n", dwAddress,
559 TRACE(
"NTEContext %ld\n", NTEContext);
590 TRACE(
"pArpEntry %p\n", pArpEntry);
610 TRACE(
"dwAddress 0x%08lx, dwMask 0x%08lx, dwIfIndex 0x%08lx\n", dwAddress,
629 TRACE(
"pHandle %p, pOverlapped %p\n", pHandle, pOverlapped);
649 TRACE(
"dwIfIndex 0x%08lx\n", dwIfIndex);
692 TRACE(
"pAdapterInfo %p, pOutBufLen %p\n", pAdapterInfo, pOutBufLen);
698 if (numNonLoopbackInterfaces > 0) {
706 if (!pAdapterInfo || *pOutBufLen <
size) {
744 TRACE(
"num of index is %lu\n",
table->numIndexes);
745 for (ndx = 0; ndx <
table->numIndexes; ndx++) {
764 ptr->AddressLength = addrLen;
768 ptr->IpAddressList.IpAddress.String);
770 ptr->IpAddressList.IpMask.String);
771 ptr->IpAddressList.Context =
ptr->Index;
773 ptr->GatewayList.IpAddress.String);
775 &dhcpServer, &
ptr->LeaseObtained,
777 ptr->DhcpEnabled = (
DWORD) dhcpEnabled;
779 ptr->DhcpServer.IpAddress.String);
782 memcpy(
ptr->PrimaryWinsServer.IpAddress.String,
784 memcpy(
ptr->SecondaryWinsServer.IpAddress.String,
787 if (ndx < table->numIndexes - 1)
788 ptr->Next = &pAdapterInfo[ndx + 1];
822 TRACE(
"dwDestAddr 0x%08lx, pdwBestIfIndex %p\n", dwDestAddr, pdwBestIfIndex);
853 TRACE(
"dwDestAddr 0x%08lx, dwSourceAddr 0x%08lx, pBestRoute %p\n", dwDestAddr,
854 dwSourceAddr, pBestRoute);
860 DWORD ndx, minMaskSize, matchedNdx = 0;
862 for (ndx = 0, minMaskSize = 255; ndx <
table->dwNumEntries; ndx++) {
863 if ((dwDestAddr &
table->table[ndx].dwForwardMask) ==
864 (
table->table[ndx].dwForwardDest &
table->table[ndx].dwForwardMask)) {
871 if (hostMaskSize < minMaskSize) {
872 minMaskSize = hostMaskSize;
952 if (
size > *pdwSize || !pTheirTcpTable)
987 if (
size > *pdwSize || !pTheirTcpTable)
1032 if (
size > *pdwSize || !pTheirTcpTable)
1069 if (
size > *pdwSize || !pTheirTcpTable)
1105 if (
size > *pdwSize || !pTheirTcpTable)
1151 if (
size > *pdwSize || !pTheirTcpTable)
1189 if (
size > *pdwSize || !pTheirTcpTable)
1225 if (
size > *pdwSize || !pTheirTcpTable)
1271 if (
size > *pdwSize || !pTheirTcpTable)
1368 if (
size > *pdwSize || !pTheirUdpTable)
1395 if (
size > *pdwSize || !pTheirUdpTable)
1422 if (
size > *pdwSize || !pTheirUdpTable)
1464 TRACE(
"returning %ld\n", IfIndex);
1482 TRACE(
"pStats %p\n", pStats);
1503 TRACE(
"pIfRow %p\n", pIfRow);
1548 TRACE(
"pIfTable %p, pdwSize %p, bOrder %ld\n", pdwSize, pdwSize,
1555 TRACE(
"GetIfTable: numInterfaces = %d\n", (
int)numInterfaces);
1558 if (!pIfTable || *pdwSize <
size) {
1568 if (*pdwSize <
size) {
1576 for (ndx = 0; ndx <
table->numIndexes; ndx++) {
1611 TRACE(
"pIfTable %p, dwOutBufLen %p\n", pIfTable, dwOutBufLen);
1617 TRACE(
"numNonLoopbackInterfaces == 0x%x\n", numNonLoopbackInterfaces);
1621 if (!pIfTable || *dwOutBufLen <
size) {
1622 *dwOutBufLen =
size;
1629 TRACE(
"table->numIndexes == 0x%x\n",
table->numIndexes);
1632 if (*dwOutBufLen <
size) {
1633 *dwOutBufLen =
size;
1640 for (ndx = 0; ndx <
table->numIndexes; ndx++) {
1641 const char *walker, *
name;
1648 walker && *walker &&
1650 walker++, assigner++)
1651 *assigner = *walker;
1696 TRACE(
"pIpAddrTable %p, pdwSize %p, bOrder %ld\n", pIpAddrTable, pdwSize,
1705 if (!pIpAddrTable || *pdwSize <
size) {
1715 if (*pdwSize <
size) {
1723 for (ndx = 0; ndx <
table->numIndexes; ndx++) {
1735 (bcast & pIpAddrTable->
table[ndx].
dwMask) ? 1 : 0;
1796 TRACE(
"pIpForwardTable %p, pdwSize %p, bOrder %ld\n", pIpForwardTable,
1797 pdwSize, (
DWORD)bOrder);
1805 if (!pIpForwardTable || *pdwSize < sizeNeeded) {
1806 *pdwSize = sizeNeeded;
1814 if (*pdwSize < sizeNeeded) {
1815 *pdwSize = sizeNeeded;
1822 for (ndx = 0; ndx < numRoutes; ndx++) {
1824 table->routes[ndx].ifIndex;
1826 table->routes[ndx].dest;
1828 table->routes[ndx].mask;
1831 table->routes[ndx].gateway;
1842 table->routes[ndx].metric;
1892 TRACE(
"pIpNetTable %p, pdwSize %p, bOrder %d\n", pIpNetTable, pdwSize,
1902 if (!pIpNetTable || *pdwSize <
size) {
1910 if (
table->dwNumEntries > 1)
1912 if (*pdwSize <
size) {
1961 TRACE(
"pStats %p\n", pStats);
1984 TRACE(
"pFixedInfo %p, pOutBufLen %p\n", pFixedInfo, pOutBufLen);
1994 if (!pFixedInfo || *pOutBufLen <
size) {
2003 "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
2093 "SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP", 0,
KEY_READ, &
hKey);
2096 "SYSTEM\\CurrentControlSet\\Services\\NetBT\\Parameters", 0,
KEY_READ,
2129 TRACE(
"pdwNumIf %p\n", pdwNumIf);
2178 PathLen *=
sizeof(
WCHAR);
2179 FileLen *=
sizeof(
WCHAR);
2190 PathLen =
sizeof(
L"System");
2191 FileLen =
sizeof(
L"System");
2254 if (hAdvapi32 ==
NULL)
2261 if (_I_QueryTagInformation ==
NULL)
2267 ServiceQuery.ProcessId = OwningPid;
2268 ServiceQuery.ServiceTag = OwningTag;
2269 ServiceQuery.TagType = 0;
2270 ServiceQuery.Buffer =
NULL;
2273 Res = _I_QueryTagInformation(
NULL, 1, &ServiceQuery);
2376 Context->pData->DnsServerList.IpAddress.String[15] =
'\0';
2388 Context->pLastAddr->Next = pNext;
2413 WCHAR keyname[200] =
L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\";
2436 Context.uSizeAvailable = *pOutBufLen;
2438 Context.pData = pPerAdapterInfo;
2447 *pOutBufLen =
Context.uSizeRequired;
2480 TRACE(
"DestIpAddress 0x%08lx, HopCount %p, MaxHops %ld, RTT %p\n",
2481 DestIpAddress, HopCount, MaxHops, RTT);
2501 TRACE(
"pStats %p\n", pStats);
2564 TRACE(
"pStats %p\n", pStats);
2622 TRACE(
"pIPIfInfo %p, dwOutBufLen %p\n", pIPIfInfo, dwOutBufLen);
2790 FIXME(
"(pIfRow %p): stub\n", pIfRow);
2896 FIXME(
"(pIpStats %p): stub\n", pIpStats);
2918 FIXME(
"(nTTL %d): stub\n", nTTL);
2940 FIXME(
"(pTcpRow %p): stub\n", pTcpRow);
2964 FIXME(
"(pOverlapped %p, lpdwEnableCount %p): stub\n", pOverlapped,
2988#ifdef GetAdaptersAddressesV1
3021 requiredSize +=
sizeof(IP_ADAPTER_ADDRESSES);
3032 requiredSize +=
sizeof(IP_ADAPTER_UNICAST_ADDRESS);
3037 requiredSize += 2 *
sizeof(
WCHAR);
3042 TRACE(
"size: %d, requiredSize: %d\n", *pOutBufLen, requiredSize);
3043 if (!pAdapterAddresses || *pOutBufLen < requiredSize)
3045 *pOutBufLen = requiredSize;
3054 currentAddress = pAdapterAddresses;
3062 currentLocation = (
PUCHAR)currentAddress + (
ULONG_PTR)
sizeof(IP_ADAPTER_ADDRESSES);
3067 currentAddress->FriendlyName = (
PVOID)currentLocation;
3068 currentLocation +=
sizeof(
WCHAR);
3072 currentAddress->AdapterName = (
PVOID)currentLocation;
3078 currentAddress->FirstUnicastAddress = (
PVOID)currentLocation;
3079 currentLocation +=
sizeof(IP_ADAPTER_UNICAST_ADDRESS);
3080 currentAddress->FirstUnicastAddress->Address.lpSockaddr = (
PVOID)currentLocation;
3081 currentLocation +=
sizeof(
struct sockaddr);
3087 currentAddress->DnsSuffix = (
PVOID)currentLocation;
3088 currentLocation +=
sizeof(
WCHAR);
3090 currentAddress->Description = (
PVOID)currentLocation;
3091 currentLocation +=
sizeof(
WCHAR);
3093 currentAddress->Next = (
PVOID)currentLocation;
3096 currentAddress->Next =
NULL;
3100 currentAddress = currentAddress->Next;
3106 currentAddress = pAdapterAddresses;
3118 currentAddress->Length =
sizeof(IP_ADAPTER_ADDRESSES);
3119 currentAddress->IfIndex = indexTable->
indexes[
i];
3127 currentAddress->FirstUnicastAddress->Length =
sizeof(IP_ADAPTER_UNICAST_ADDRESS);
3128 currentAddress->FirstUnicastAddress->Flags = 0;
3129 currentAddress->FirstUnicastAddress->Next =
NULL;
3130 currentAddress->FirstUnicastAddress->Address.lpSockaddr->sa_family =
AF_INET;
3131 memcpy(currentAddress->FirstUnicastAddress->Address.lpSockaddr->sa_data,
3134 currentAddress->FirstUnicastAddress->Address.iSockaddrLength =
sizeof(ifInfo.
ip_addr.
iae_addr) +
sizeof(
USHORT);
3138 currentAddress->FirstUnicastAddress->ValidLifetime = 0xFFFFFFFF;
3139 currentAddress->FirstUnicastAddress->PreferredLifetime = 0xFFFFFFFF;
3140 currentAddress->FirstUnicastAddress->LeaseLifetime = 0xFFFFFFFF;
3144 currentAddress->FirstAnycastAddress =
NULL;
3145 currentAddress->FirstMulticastAddress =
NULL;
3146 currentAddress->FirstDnsServerAddress =
NULL;
3158 currentAddress->Flags = 0;
3175 currentAddress = currentAddress->Next;
3232 FIXME(
"SetIpForwardEntryToStack() stub\n");
3246 if (pInterfaceGUID ==
NULL || pOutBufLen ==
NULL)
3257 hr =
StringCbPrintfW(szKeyName,
sizeof(szKeyName),
L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection",
GuidString.Buffer);
3301 if (pInterfaceName ==
NULL)
PRTL_UNICODE_STRING_BUFFER Path
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
ULONG WSAAPI inet_addr(IN CONST CHAR FAR *cp)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define RegCloseKey(hKey)
#define ERROR_NOT_ENOUGH_MEMORY
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
void WINAPI DhcpCApiCleanup(void)
DWORD APIENTRY DhcpCApiInitialize(LPDWORD Version)
DWORD APIENTRY DhcpReleaseIpAddressLease(DWORD AdapterIndex)
DWORD APIENTRY DhcpRenewIpAddressLease(DWORD AdapterIndex)
#define NT_SUCCESS(StatCode)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define ERROR_INVALID_PARAMETER
#define GetModuleFileNameExW(w, x, y, z)
#define DLL_PROCESS_ATTACH
#define DLL_PROCESS_DETACH
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define ERROR_NOT_SUPPORTED
#define HeapFree(x, y, z)
#define WideCharToMultiByte
#define MultiByteToWideChar
DWORD getDhcpInfoForAdapter(DWORD AdapterIndex, PBOOL DhcpEnabled, PDWORD DhcpServer, time_t *LeaseObtained, time_t *LeaseExpires)
DWORD deleteIpForwardEntry(PMIB_IPFORWARDROW pRoute)
DWORD setIpForwardEntry(PMIB_IPFORWARDROW pRoute)
DWORD createIpForwardEntry(PMIB_IPFORWARDROW pRoute)
BOOL NTAPI IsBadWritePtr(IN LPVOID lp, IN UINT_PTR ucb)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
DWORD WINAPI GetModuleBaseNameW(HANDLE hProcess, HMODULE hModule, LPWSTR lpBaseName, DWORD nSize)
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLboolean GLboolean GLboolean b
GLenum const GLvoid * addr
GLboolean GLboolean GLboolean GLboolean a
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
HLOCAL NTAPI LocalFree(HLOCAL hMem)
void interfaceMapFree(void)
DWORD getInterfacePhysicalByIndex(DWORD index, PDWORD len, PBYTE addr, PDWORD type)
DWORD getNumNonLoopbackInterfaces(void)
DWORD getNumInterfaces(void)
DWORD getInterfaceMaskByIndex(DWORD index)
InterfaceIndexTable * getNonLoopbackInterfaceIndexTable(void)
DWORD getInterfaceEntryByIndex(DWORD index, PMIB_IFROW entry)
const char * getInterfaceNameByIndex(DWORD index)
DWORD getInterfaceBCastAddrByIndex(DWORD index)
void interfaceMapInit(void)
InterfaceIndexTable * getInterfaceIndexTable(void)
char * toIPAddressString(unsigned int addr, char string[16])
NTSTATUS addIPAddress(IPAddr Address, IPMask Mask, DWORD IfIndex, PULONG NteContext, PULONG NteInstance)
DWORD getInterfaceIPAddrByIndex(DWORD index)
NTSTATUS deleteIpAddress(ULONG NteContext)
void consumeInterfaceName(const char *ifname)
NTSTATUS getIPAddrEntryForIf(HANDLE tcpFile, char *name, DWORD index, IFInfo *ifInfo)
struct _MIB_IFTABLE * PMIB_IFTABLE
struct _MIB_IFROW * PMIB_IFROW
struct _MIB_IFTABLE MIB_IFTABLE
#define MAX_INTERFACE_NAME_LEN
struct _MIB_IFROW MIB_IFROW
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define PROCESS_QUERY_INFORMATION
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
unsigned char _BitScanForward(unsigned long *_Index, unsigned long _Mask)
struct _IP_ADAPTER_INDEX_MAP IP_ADAPTER_INDEX_MAP
struct _IP_INTERFACE_INFO IP_INTERFACE_INFO
static PIP_ADAPTER_ADDRESSES
DWORD WINAPI NotifyAddrChange(PHANDLE Handle, LPOVERLAPPED overlapped)
DWORD WINAPI GetIpErrorString(IP_STATUS ErrorCode, PWCHAR Buffer, PDWORD Size)
DWORD WINAPI NhpAllocateAndGetInterfaceInfoFromStack(IP_INTERFACE_NAME_INFO **ppTable, PDWORD pdwCount, BOOL bOrder, HANDLE hHeap, DWORD dwFlags)
DWORD WINAPI SetTcpEntry(PMIB_TCPROW pTcpRow)
DWORD WINAPI EnableRouter(HANDLE *pHandle, OVERLAPPED *pOverlapped)
DWORD WINAPI GetBestInterfaceEx(struct sockaddr *pDestAddr, PDWORD pdwBestIfIndex)
DWORD WINAPI GetBestInterface(IPAddr dwDestAddr, PDWORD pdwBestIfIndex)
BOOL WINAPI GetRTTAndHopCount(IPAddr DestIpAddress, PULONG HopCount, ULONG MaxHops, PULONG RTT)
DWORD WINAPI SetIpStatistics(PMIB_IPSTATS pIpStats)
DWORD WINAPI GetFriendlyIfIndex(DWORD IfIndex)
DWORD WINAPI GetIcmpStatisticsEx(PMIB_ICMP_EX pStats, DWORD dwFamily)
DWORD WINAPI GetExtendedUdpTable(PVOID pUdpTable, PDWORD pdwSize, BOOL bOrder, ULONG ulAf, UDP_TABLE_CLASS TableClass, ULONG Reserved)
DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable, BOOL bOrder, HANDLE heap, DWORD flags)
DWORD WINAPI SetIfEntry(PMIB_IFROW pIfRow)
static int TcpTableSorter(const void *a, const void *b)
static int IpNetTableSorter(const void *a, const void *b)
DWORD WINAPI AllocateAndGetIpAddrTableFromStack(PMIB_IPADDRTABLE *ppIpAddrTable, BOOL bOrder, HANDLE heap, DWORD flags)
DWORD WINAPI GetIfTable(PMIB_IFTABLE pIfTable, PULONG pdwSize, BOOL bOrder)
DWORD WINAPI NotifyRouteChange(PHANDLE Handle, LPOVERLAPPED overlapped)
DWORD WINAPI UnenableRouter(OVERLAPPED *pOverlapped, LPDWORD lpdwEnableCount)
DWORD GetInterfaceNameInternal(_In_ const GUID *pInterfaceGUID, _Out_writes_bytes_to_(*pOutBufLen, *pOutBufLen) PWCHAR pInterfaceName, _Inout_ PULONG pOutBufLen)
DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable, BOOL bOrder, HANDLE heap, DWORD flags)
DWORD WINAPI AddIPAddress(IPAddr Address, IPMask Netmask, DWORD IfIndex, PULONG NteContext, PULONG NteInstance)
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
DWORD WINAPI CreateProxyArpEntry(DWORD dwAddress, DWORD dwMask, DWORD dwIfIndex)
static int IpAddrTableSorter(const void *a, const void *b)
DWORD WINAPI IpReleaseAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo)
DWORD WINAPI CreateIpNetEntry(PMIB_IPNETROW pArpEntry)
DWORD WINAPI DeleteIpNetEntry(PMIB_IPNETROW pArpEntry)
DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, BOOL bOrder)
DWORD WINAPI GetExtendedTcpTable(PVOID pTcpTable, PDWORD pdwSize, BOOL bOrder, ULONG ulAf, TCP_TABLE_CLASS TableClass, ULONG Reserved)
DWORD WINAPI SetIpForwardEntry(PMIB_IPFORWARDROW pRoute)
PIP_ADAPTER_ORDER_MAP WINAPI GetAdapterOrderMap(VOID)
DWORD WINAPI GetIpStatistics(PMIB_IPSTATS pStats)
struct _NAME_SERVER_LIST_CONTEXT NAME_SERVER_LIST_CONTEXT
DWORD WINAPI FlushIpNetTable(DWORD dwIfIndex)
DWORD WINAPI GetIpNetTable(PMIB_IPNETTABLE pIpNetTable, PULONG pdwSize, BOOL bOrder)
DWORD WINAPI AllocateAndGetUdpExTable2FromStack(PVOID *ppUdpTable, BOOL bOrder, HANDLE heap, DWORD flags, DWORD family, UDP_TABLE_CLASS class)
DWORD WINAPI DeleteIpForwardEntry(PMIB_IPFORWARDROW pRoute)
DWORD WINAPI GetIfEntry(PMIB_IFROW pIfRow)
static DWORD GetOwnerModuleFromPidEntry(DWORD OwningPid, TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID Buffer, PDWORD pdwSize)
DWORD WINAPI GetIcmpStatistics(PMIB_ICMP pStats)
DWORD WINAPI GetInterfaceInfo(PIP_INTERFACE_INFO pIfTable, PULONG dwOutBufLen)
DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
DWORD WINAPI GetTcpStatisticsEx(PMIB_TCPSTATS pStats, DWORD dwFamily)
DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
BOOL WINAPI CancelIPChangeNotify(LPOVERLAPPED notifyOverlapped)
DWORD WINAPI SetIpNetEntry(PMIB_IPNETROW pArpEntry)
DWORD WINAPI GetOwnerModuleFromUdpEntry(PMIB_UDPROW_OWNER_MODULE pUdpEntry, TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID Buffer, PDWORD pdwSize)
DWORD WINAPI AllocateAndGetTcpExTableFromStack(PVOID *ppTcpTable, BOOL bOrder, HANDLE heap, DWORD flags, DWORD family)
DWORD getInterfaceGatewayByIndex(DWORD index)
static int IfTableSorter(const void *a, const void *b)
DWORD WINAPI GetPerAdapterInfo(ULONG IfIndex, PIP_PER_ADAPTER_INFO pPerAdapterInfo, PULONG pOutBufLen)
DWORD WINAPI CreateIpForwardEntry(PMIB_IPFORWARDROW pRoute)
static DWORD GetOwnerModuleFromTagEntry(DWORD OwningPid, DWORD OwningTag, TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID Buffer, PDWORD pdwSize)
DWORD WINAPI GetUniDirectionalAdapterInfo(PIP_UNIDIRECTIONAL_ADAPTER_ADDRESS pIPIfInfo, PULONG dwOutBufLen)
DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS pStats)
DWORD WINAPI SetIpForwardEntryToStack(PMIB_IPFORWARDROW pRoute)
DWORD WINAPI SetIpTTL(UINT nTTL)
DWORD WINAPI GetUdpStatisticsEx(PMIB_UDPSTATS pStats, DWORD dwFamily)
static int IpForwardTableSorter(const void *a, const void *b)
DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE *ppTcpTable, BOOL bOrder, HANDLE heap, DWORD flags)
DWORD WINAPI GetOwnerModuleFromTcpEntry(PMIB_TCPROW_OWNER_MODULE pTcpEntry, TCPIP_OWNER_MODULE_INFO_CLASS Class, PVOID Buffer, PDWORD pdwSize)
DWORD WINAPI GetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable, PULONG pdwSize, BOOL bOrder)
DWORD WINAPI AllocateAndGetUdpExTableFromStack(PVOID *ppUdpTable, BOOL bOrder, HANDLE heap, DWORD flags, DWORD family)
DWORD WINAPI NhGetInterfaceNameFromDeviceGuid(_In_ const GUID *pInterfaceGUID, _Out_writes_bytes_to_(*pOutBufLen, *pOutBufLen) PWCHAR pInterfaceName, _Inout_ PULONG pOutBufLen, DWORD dwUnknown4, DWORD dwUnknown5)
DWORD WINAPI DeleteIPAddress(ULONG NTEContext)
DWORD WINAPI GetBestRoute(DWORD dwDestAddr, DWORD dwSourceAddr, PMIB_IPFORWARDROW pBestRoute)
DWORD WINAPI AllocateAndGetIfTableFromStack(PMIB_IFTABLE *ppIfTable, BOOL bOrder, HANDLE heap, DWORD flags)
struct _NAME_SERVER_LIST_CONTEXT * PNAME_SERVER_LIST_CONTEXT
DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS pStats)
DWORD WINAPI GetUdpTable(PMIB_UDPTABLE pUdpTable, PDWORD pdwSize, BOOL bOrder)
static int UdpTableSorter(const void *a, const void *b)
DWORD WINAPI SendARP(IPAddr DestIP, IPAddr SrcIP, PULONG pMacAddr, PULONG PhyAddrLen)
DWORD WINAPI GetNumberOfInterfaces(PDWORD pdwNumIf)
static void CreateNameServerListEnumNamesFunc(PWCHAR Interface, PWCHAR Server, PVOID Data)
DWORD WINAPI NhGetInterfaceNameFromGuid(_In_ const GUID *pInterfaceGUID, _Out_writes_bytes_to_(*pOutBufLen, *pOutBufLen) PWCHAR pInterfaceName, _Inout_ PULONG pOutBufLen, DWORD dwUnknown4, DWORD dwUnknown5)
DWORD WINAPI AllocateAndGetIpForwardTableFromStack(PMIB_IPFORWARDTABLE *ppIpForwardTable, BOOL bOrder, HANDLE heap, DWORD flags)
DWORD WINAPI GetTcpTable(PMIB_TCPTABLE pTcpTable, PDWORD pdwSize, BOOL bOrder)
DWORD WINAPI GetAdapterIndex(LPWSTR AdapterName, PULONG IfIndex)
DWORD WINAPI DeleteProxyArpEntry(DWORD dwAddress, DWORD dwMask, DWORD dwIfIndex)
DWORD WINAPI AllocateAndGetTcpExTable2FromStack(PVOID *ppTcpTable, BOOL bOrder, HANDLE heap, DWORD flags, DWORD family, TCP_TABLE_CLASS class)
DWORD WINAPI GetIpStatisticsEx(PMIB_IPSTATS pStats, DWORD dwFamily)
DWORD WINAPI IpRenewAddress(PIP_ADAPTER_INDEX_MAP AdapterInfo)
#define GAA_FLAG_SKIP_FRIENDLY_NAME
#define GAA_FLAG_SKIP_UNICAST
LSTATUS EnumNameServers(HKEY RegHandle, LPWSTR Interface, PVOID Data, EnumNameServersFunc cb)
DWORD TCPSendIoctl(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, PULONG pInBufferSize, LPVOID lpOutBuffer, PULONG pOutBufferSize)
NTSTATUS getNthIpEntity(HANDLE tcpFile, DWORD index, TDIEntityID *ent)
#define TCP_REQUEST_SET_INFORMATION_INIT
@ IF_OPER_STATUS_CONNECTING
struct _MIB_IPFORWARDTABLE * PMIB_IPFORWARDTABLE
@ MIB_IPROUTE_TYPE_DIRECT
struct _MIB_IPNETTABLE * PMIB_IPNETTABLE
struct _MIB_IPNETROW MIB_IPNETROW
struct _MIB_IPADDRROW MIB_IPADDRROW
struct _MIB_IPFORWARDTABLE MIB_IPFORWARDTABLE
struct _MIB_IPADDRTABLE MIB_IPADDRTABLE
struct _MIB_IPNETROW * PMIB_IPNETROW
struct _MIB_IPNETTABLE MIB_IPNETTABLE
struct _MIB_IPFORWARDROW * PMIB_IPFORWARDROW
struct _MIB_IPFORWARDROW MIB_IPFORWARDROW
struct _MIB_IPADDRTABLE * PMIB_IPADDRTABLE
struct _MIB_IPADDRROW * PMIB_IPADDRROW
struct _TCPIP_OWNER_MODULE_BASIC_INFO TCPIP_OWNER_MODULE_BASIC_INFO
enum _TCP_TABLE_CLASS TCP_TABLE_CLASS
@ TCP_TABLE_OWNER_MODULE_CONNECTIONS
@ TCP_TABLE_BASIC_CONNECTIONS
@ TCP_TABLE_BASIC_LISTENER
@ TCP_TABLE_OWNER_MODULE_ALL
@ TCP_TABLE_OWNER_PID_LISTENER
@ TCP_TABLE_OWNER_PID_ALL
@ TCP_TABLE_OWNER_PID_CONNECTIONS
@ TCP_TABLE_OWNER_MODULE_LISTENER
enum _TCPIP_OWNER_MODULE_INFO_CLASS TCPIP_OWNER_MODULE_INFO_CLASS
enum _UDP_TABLE_CLASS UDP_TABLE_CLASS
DWORD getTCPStats(MIB_TCPSTATS *stats, DWORD family)
PVOID getTcpTable(CLASS_TABLE Class)
DWORD getICMPStats(MIB_ICMP *stats)
DWORD getUDPStats(MIB_UDPSTATS *stats, DWORD family)
DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry)
DWORD getNumArpEntries(void)
RouteTable * getRouteTable(void)
PMIB_IPNETTABLE getArpTable(void)
PVOID getUdpTable(CLASS_TABLE Class)
DWORD getIPStats(PMIB_IPSTATS stats, DWORD family)
#define MAX_ADAPTER_NAME_LENGTH
struct _IP_PER_ADAPTER_INFO IP_PER_ADAPTER_INFO
struct _IP_ADAPTER_INFO IP_ADAPTER_INFO
struct _IP_ADDR_STRING IP_ADDR_STRING
static IN DWORD IN LPVOID lpvReserved
#define memcpy(s1, s2, n)
#define ERROR_FILE_NOT_FOUND
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
_In_ NDIS_ERROR_CODE ErrorCode
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT _In_ UINT _In_ NDIS_HANDLE _In_ NDIS_HANDLE _In_ PNDIS_STRING AdapterName
#define _Out_writes_bytes_to_(s, c)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
VOID disposeResInfo(PIPHLP_RES_INFO InfoPtr)
PIPHLP_RES_INFO getResInfo()
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define DECLSPEC_HOTPATCH
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
VOID closeTcpFile(HANDLE h)
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED * overlapped
static void Server(int port)
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
IP_ADDR_STRING DnsServerList
char HostName[MAX_HOSTNAME_LEN+4]
char ScopeId[MAX_SCOPE_ID_LEN+4]
char DomainName[MAX_DOMAIN_NAME_LEN+4]
UCHAR if_physaddr[MAX_PHYSADDR_SIZE]
IFEntrySafelySized if_info
WCHAR Name[MAX_ADAPTER_NAME]
struct _IP_ADDR_STRING * Next
IP_ADDRESS_STRING IpAddress
IP_ADAPTER_INDEX_MAP Adapter[1]
IF_INDEX dwForwardIfIndex
MIB_IPFORWARDROW table[1]
ULONGLONG OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE]
MIB_TCPROW_OWNER_MODULE table[1]
MIB_TCPROW_OWNER_PID table[1]
ULONGLONG OwningModuleInfo[TCPIP_OWNING_MODULE_SIZE]
MIB_UDPROW_OWNER_MODULE table[1]
MIB_UDPROW_OWNER_PID table[1]
PIP_PER_ADAPTER_INFO pData
IP_ADDR_STRING * pLastAddr
#define IP_MIB_ARPTABLE_ENTRY_ID
#define IOCTL_QUERY_IP_HW_ADDRESS
struct _MIB_TCPROW * PMIB_TCPROW
struct _MIB_TCPROW MIB_TCPROW
struct _MIB_TCPTABLE_OWNER_PID * PMIB_TCPTABLE_OWNER_PID
struct _MIB_TCPTABLE * PMIB_TCPTABLE
struct _MIB_TCPROW_OWNER_PID MIB_TCPROW_OWNER_PID
struct _MIB_TCPROW_OWNER_MODULE MIB_TCPROW_OWNER_MODULE
#define INFO_CLASS_PROTOCOL
#define INFO_TYPE_PROVIDER
#define IOCTL_TCP_SET_INFORMATION_EX
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
struct _MIB_UDPTABLE_OWNER_PID * PMIB_UDPTABLE_OWNER_PID
struct _MIB_UDPROW_OWNER_MODULE MIB_UDPROW_OWNER_MODULE
struct _MIB_UDPROW * PMIB_UDPROW
struct _MIB_UDPROW_OWNER_PID MIB_UDPROW_OWNER_PID
struct _MIB_UDPROW MIB_UDPROW
struct _MIB_UDPTABLE * PMIB_UDPTABLE
TCP_REQUEST_SET_INFORMATION_EX Req
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
DWORD WINAPI GetLastError(void)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
_Reserved_ PVOID Reserved
#define ERROR_PARTIAL_COPY
#define ERROR_BUFFER_OVERFLOW
#define ERROR_PATH_NOT_FOUND
#define ERROR_PROC_NOT_FOUND
#define ERROR_INVALID_DATA
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
_Must_inspect_result_ _In_ ULONG Flags