26#ifndef TCPS_ESTABLISHED
27# define TCPS_ESTABLISHED TCP_ESTABLISHED
30# define TCPS_SYN_SENT TCP_SYN_SENT
32#ifndef TCPS_SYN_RECEIVED
33# define TCPS_SYN_RECEIVED TCP_SYN_RECV
35#ifndef TCPS_FIN_WAIT_1
36# define TCPS_FIN_WAIT_1 TCP_FIN_WAIT1
38#ifndef TCPS_FIN_WAIT_2
39# define TCPS_FIN_WAIT_2 TCP_FIN_WAIT2
42# define TCPS_TIME_WAIT TCP_TIME_WAIT
45# define TCPS_CLOSED TCP_CLOSE
47#ifndef TCPS_CLOSE_WAIT
48# define TCPS_CLOSE_WAIT TCP_CLOSE_WAIT
51# define TCPS_LAST_ACK TCP_LAST_ACK
54# define TCPS_LISTEN TCP_LISTEN
57# define TCPS_CLOSING TCP_CLOSING
66 DWORD numEntities = 0;
75 for(
i = 0;
i < numEntities;
i++ ) {
77 TRACE(
"Entity %d is an IP Entity\n",
i);
78 if( numRoutes ==
index )
break;
83 if( numRoutes ==
index &&
i < numEntities ) {
84 TRACE(
"Index %lu is entity #%d - %04x:%08x\n",
index,
i,
85 entitySet[
i].tei_entity, entitySet[
i].tei_instance);
86 memcpy( ent, &entitySet[
i],
sizeof(*ent) );
103 TRACE(
"TdiGetMibForIpEntity(tcpFile 0x%p, entityId 0x%x)\n",
120 TRACE(
"TdiGetMibForIpEntity() => status = 0x%08lx, entry = {\n"
121 " ipsi_forwarding ............ %lu\n"
122 " ipsi_defaultttl ............ %lu\n"
123 " ipsi_inreceives ............ %lu\n"
124 " ipsi_indelivers ............ %lu\n"
125 " ipsi_outrequests ........... %lu\n"
126 " ipsi_routingdiscards ....... %lu\n"
127 " ipsi_outdiscards ........... %lu\n"
128 " ipsi_outnoroutes ........... %lu\n"
129 " ipsi_numif ................. %lu\n"
130 " ipsi_numaddr ............... %lu\n"
131 " ipsi_numroutes ............. %lu\n"
134 entry->ipsi_forwarding,
135 entry->ipsi_defaultttl,
136 entry->ipsi_inreceives,
137 entry->ipsi_indelivers,
138 entry->ipsi_outrequests,
139 entry->ipsi_routingdiscards,
140 entry->ipsi_outdiscards,
141 entry->ipsi_outnoroutes,
144 entry->ipsi_numroutes);
153 TRACE(
"TdiGetRoutesForIpEntity(tcpFile 0x%p, entityId 0x%x)\n",
174 TRACE(
"TdiGetIpAddrsForIpEntity(tcpFile 0x%p, entityId 0x%x)\n",
215 fp =
fopen(
"/proc/net/snmp",
"r");
217 const char hdr[] =
"Icmp:";
218 char buf[512] = { 0 }, *
ptr;
368 DWORD numEntities, numRoutes = 0;
379 ERR(
"openTcpFile returned 0x%08lx\n",
status);
385 ERR(
"tdiGetEntityIDSet returned 0x%08lx\n",
status);
390 for (
i = 0;
i < numEntities;
i++) {
393 memset(&isnmp, 0,
sizeof(isnmp));
396 ERR(
"tdiGetMibForIpEntity returned 0x%08lx, for i = %d\n",
status,
i);
404 TRACE(
"numRoutes = %lu\n", numRoutes);
415 for(
i = 0;
i <
Len;
i++ ) {
437 TRACE(
"GETTING ROUTE TABLE\n");
442 if (!out_route_table) {
449 for (
i = 0; routesAdded < out_route_table->
numRoutes;
i++) {
462 TRACE(
"%lu routes in instance %d\n", numRoutes,
i);
466 snmpInfo.ipsi_numroutes);
469 for (
j = 0;
j < numRoutes;
j++) {
470 int routeNum =
j + routesAdded;
485 routesAdded += numRoutes;
489 TRACE(
"status = 0x%08lx, out_route_table = 0x%p\n",
status, out_route_table);
490 return out_route_table;
498 int i, totalNumber = 0;
508 ERR(
"openTcpFile returned 0x%08lx\n",
status);
514 for (
i = 0;
i < numEntities;
i++) {
522 entitySet[
i].tei_instance,
525 (
PVOID *)&IpArpTable,
543 DWORD numEntities, returnSize;
546 int i, totalNumber, TmpIdx, CurrIdx = 0;
558 ERR(
"openTcpFile returned 0x%08lx\n",
status);
571 for (
i = 0;
i < numEntities;
i++) {
579 entitySet[
i].tei_instance,
582 (
PVOID *)&AdapterArpTable,
586 for (TmpIdx = 0; TmpIdx < returnSize; TmpIdx++, CurrIdx++)
587 IpArpTable->
table[CurrIdx] = AdapterArpTable[TmpIdx];
612#define Add2Ptr(PTR, INC) (PVOID)((ULONG_PTR)(PTR) + (INC))
619 int i, totalNumber = 0;
629 ERR(
"openTcpFile returned 0x%08lx\n",
status);
635 for (
i = 0;
i < numEntities;
i++) {
643 entitySet[
i].tei_instance,
646 (
PVOID *)&IpUdpTable,
664 DWORD numEntities, returnSize;
667 int i, totalNumber, TmpIdx, CurrIdx = 0;
679 ERR(
"openTcpFile returned 0x%08lx\n",
status);
692 for (
i = 0;
i < numEntities;
i++) {
700 entitySet[
i].tei_instance,
707 for (TmpIdx = 0; TmpIdx < returnSize; TmpIdx++, CurrIdx++)
727 int i, totalNumber = 0;
737 ERR(
"openTcpFile returned 0x%08lx\n",
status);
743 for (
i = 0;
i < numEntities;
i++) {
751 entitySet[
i].tei_instance,
754 (
PVOID *)&IpTcpTable,
772 DWORD numEntities, returnSize;
775 int i, totalNumber, TmpIdx, CurrIdx = 0;
787 ERR(
"openTcpFile returned 0x%08lx\n",
status);
800 for (
i = 0;
i < numEntities;
i++) {
808 entitySet[
i].tei_instance,
815 for (TmpIdx = 0; TmpIdx < returnSize; TmpIdx++, CurrIdx++)
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
#define IP_MIB_ADDRTABLE_ENTRY_ID
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
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)
#define NT_SUCCESS(StatCode)
#define ERROR_INVALID_PARAMETER
#define _strnicmp(_String1, _String2, _MaxCount)
#define HeapFree(x, y, z)
GLenum GLuint GLenum GLsizei const GLchar * buf
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
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 GLint GLint j
BOOL hasArp(HANDLE tcpFile, TDIEntityID *arp_maybe)
BOOL isInterface(TDIEntityID *if_maybe)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
#define TCP_REQUEST_QUERY_INFORMATION_INIT
enum _CLASS_TABLE CLASS_TABLE
#define Add2Ptr(PTR, INC)
DWORD getInterfaceStatsByIndex(DWORD index, PMIB_IFROW entry)
DWORD getTCPStats(MIB_TCPSTATS *stats, DWORD family)
PVOID getTcpTable(CLASS_TABLE Class)
DWORD getNumUdpEntries(void)
DWORD getICMPStats(MIB_ICMP *stats)
DWORD getUDPStats(MIB_UDPSTATS *stats, DWORD family)
DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry)
VOID HexDump(PCHAR Data, DWORD Len)
BOOL isIpEntity(HANDLE tcpFile, TDIEntityID *ent)
DWORD getNumArpEntries(void)
RouteTable * getRouteTable(void)
PMIB_IPNETTABLE getArpTable(void)
PVOID getUdpTable(CLASS_TABLE Class)
NTSTATUS tdiGetMibForIpEntity(HANDLE tcpFile, TDIEntityID *ent, IPSNMPInfo *entry)
DWORD getNumTcpEntries(void)
DWORD getIPStats(PMIB_IPSTATS stats, DWORD family)
NTSTATUS tdiGetIpAddrsForIpEntity(HANDLE tcpFile, TDIEntityID *ent, IPAddrEntry **addrs, PDWORD numAddrs)
NTSTATUS getNthIpEntity(HANDLE tcpFile, DWORD index, TDIEntityID *ent)
NTSTATUS tdiGetRoutesForIpEntity(HANDLE tcpFile, TDIEntityID *ent, IPRouteEntry **routes, PDWORD numRoutes)
struct _TABLE_CALL UdpTcpTableCall[]
#define memcpy(s1, s2, n)
NTSTATUS tdiGetSetOfThings(HANDLE tcpFile, DWORD toiClass, DWORD toiType, DWORD toiId, DWORD teiEntity, DWORD teiInstance, DWORD fixedPart, DWORD entrySize, PVOID *tdiEntitySet, PDWORD numEntries)
VOID tdiFreeThingSet(PVOID things)
NTSTATUS tdiGetEntityIDSet(HANDLE tcpFile, TDIEntityID **entitySet, PDWORD numEntities)
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
VOID closeTcpFile(HANDLE h)
unsigned long ire_metric1
MIBICMPSTATS icmpOutStats
#define IP_MIB_ARPTABLE_ENTRY_ID
#define INFO_CLASS_PROTOCOL
#define INFO_TYPE_PROVIDER
#define IOCTL_TCP_QUERY_INFORMATION_EX
#define FIELD_OFFSET(t, f)
#define STATUS_UNSUCCESSFUL
struct _MIB_UDPROW_OWNER_MODULE MIB_UDPROW_OWNER_MODULE
struct _MIB_UDPROW_OWNER_PID MIB_UDPROW_OWNER_PID
struct _MIB_UDPROW MIB_UDPROW