ReactOS  0.4.14-dev-833-g5f692ed
main.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <limits.h>
#include "windef.h"
#include "winbase.h"
#include "snmp.h"
#include "iphlpapi.h"
#include "wine/debug.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

struct  structToAsnValue
 
struct  mibImplementation
 
struct  GenericTable
 

Macros

#define NONAMELESSUNION
 

Typedefs

typedef DWORD(* copyValueFunc) (AsnAny *value, void *src)
 
typedef BOOL(* varqueryfunc) (BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
 
typedef void(* oidToKeyFunc) (AsnObjectIdentifier *oid, void *dst)
 
typedef int(__cdeclcompareFunc) (const void *key, const void *value)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (inetmib1)
 
static DWORD copyInt (AsnAny *value, void *src)
 
static void setStringValue (AsnAny *value, BYTE type, DWORD len, BYTE *str)
 
static AsnInteger32 mapStructEntryToValue (struct structToAsnValue *map, UINT mapLen, void *record, UINT id, SnmpVarBind *pVarBind)
 
static DWORD copyIpAddr (AsnAny *value, void *src)
 
static void mib2IfNumberInit (void)
 
static void mib2IfNumberCleanup (void)
 
static BOOL mib2IfNumberQuery (BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
 
static DWORD copyOperStatus (AsnAny *value, void *src)
 
static AsnInteger32 getItemAndIntegerInstanceFromOid (AsnObjectIdentifier *oid, AsnObjectIdentifier *base, BYTE bPduType, UINT *item, UINT *instance)
 
static AsnInteger32 getItemFromOid (AsnObjectIdentifier *oid, AsnObjectIdentifier *base, BYTE bPduType, UINT *item)
 
static DWORD oidToIpAddr (AsnObjectIdentifier *oid)
 
static UINT findValueInTable (const void *key, struct GenericTable *table, size_t tableEntrySize, compareFunc compare)
 
static UINT findOidInTable (AsnObjectIdentifier *oid, struct GenericTable *table, size_t tableEntrySize, oidToKeyFunc makeKey, compareFunc compare)
 
static UINT findNextOidInTable (AsnObjectIdentifier *oid, struct GenericTable *table, size_t tableEntrySize, oidToKeyFunc makeKey, compareFunc compare)
 
static AsnInteger32 getItemAndInstanceFromTable (AsnObjectIdentifier *oid, AsnObjectIdentifier *base, UINT instanceLen, BYTE bPduType, struct GenericTable *table, size_t tableEntrySize, oidToKeyFunc makeKey, compareFunc compare, UINT *item, UINT *instance)
 
static INT setOidWithItem (AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item)
 
static INT setOidWithItemAndIpAddr (AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item, DWORD addr)
 
static INT setOidWithItemAndInteger (AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item, UINT instance)
 
static DWORD copyIfRowDescr (AsnAny *value, void *src)
 
static DWORD copyIfRowPhysAddr (AsnAny *value, void *src)
 
static BOOL mib2IfEntryQuery (BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
 
static void mib2IpStatsInit (void)
 
static BOOL mib2IpStatsQuery (BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
 
static void mib2IpAddrInit (void)
 
static void mib2IpAddrCleanup (void)
 
static void oidToIpAddrRow (AsnObjectIdentifier *oid, void *dst)
 
static int __cdecl compareIpAddrRow (const void *a, const void *b)
 
static BOOL mib2IpAddrQuery (BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
 
static void mib2IpRouteInit (void)
 
static void mib2IpRouteCleanup (void)
 
static void oidToIpForwardRow (AsnObjectIdentifier *oid, void *dst)
 
static int __cdecl compareIpForwardRow (const void *a, const void *b)
 
static BOOL mib2IpRouteQuery (BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
 
static DWORD copyIpNetPhysAddr (AsnAny *value, void *src)
 
static void mib2IpNetInit (void)
 
static void mib2IpNetCleanup (void)
 
static BOOL mib2IpNetQuery (BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
 
static void mib2IcmpInit (void)
 
static BOOL mib2IcmpQuery (BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
 
static void mib2TcpInit (void)
 
static BOOL mib2TcpQuery (BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
 
static void mib2UdpInit (void)
 
static BOOL mib2UdpQuery (BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
 
static void mib2UdpEntryInit (void)
 
static void mib2UdpEntryCleanup (void)
 
static void oidToUdpRow (AsnObjectIdentifier *oid, void *dst)
 
static int __cdecl compareUdpRow (const void *a, const void *b)
 
static BOOL mib2UdpEntryQuery (BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
 
BOOL WINAPI SnmpExtensionInit (DWORD dwUptimeReference, HANDLE *phSubagentTrapEvent, AsnObjectIdentifier *pFirstSupportedRegion)
 
static void cleanup (void)
 
static struct mibImplementationfindSupportedQuery (UINT *ids, UINT idLength, UINT *matchingIndex)
 
BOOL WINAPI SnmpExtensionQuery (BYTE bPduType, SnmpVarBindList *pVarBindList, AsnInteger32 *pErrorStatus, AsnInteger32 *pErrorIndex)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
 

Variables

static UINT mib2 [] = { 1,3,6,1,2,1 }
 
static UINT mib2System [] = { 1,3,6,1,2,1,1 }
 
static UINT mib2IfNumber [] = { 1,3,6,1,2,1,2,1 }
 
static PMIB_IFTABLE ifTable
 
static struct structToAsnValue mib2IfEntryMap []
 
static UINT mib2IfEntry [] = { 1,3,6,1,2,1,2,2,1 }
 
static UINT mib2Ip [] = { 1,3,6,1,2,1,4 }
 
static MIB_IPSTATS ipStats
 
static struct structToAsnValue mib2IpMap []
 
static UINT mib2IpAddr [] = { 1,3,6,1,2,1,4,20,1 }
 
static PMIB_IPADDRTABLE ipAddrTable
 
static struct structToAsnValue mib2IpAddrMap []
 
static UINT mib2IpRoute [] = { 1,3,6,1,2,1,4,21,1 }
 
static PMIB_IPFORWARDTABLE ipRouteTable
 
static struct structToAsnValue mib2IpRouteMap []
 
static UINT mib2IpNet [] = { 1,3,6,1,2,1,4,22,1 }
 
static PMIB_IPNETTABLE ipNetTable
 
static struct structToAsnValue mib2IpNetMap []
 
static UINT mib2Icmp [] = { 1,3,6,1,2,1,5 }
 
static MIB_ICMP icmpStats
 
static struct structToAsnValue mib2IcmpMap []
 
static UINT mib2Tcp [] = { 1,3,6,1,2,1,6 }
 
static MIB_TCPSTATS tcpStats
 
static struct structToAsnValue mib2TcpMap []
 
static UINT mib2Udp [] = { 1,3,6,1,2,1,7 }
 
static MIB_UDPSTATS udpStats
 
static struct structToAsnValue mib2UdpMap []
 
static UINT mib2UdpEntry [] = { 1,3,6,1,2,1,7,5,1 }
 
static PMIB_UDPTABLE udpTable
 
static struct structToAsnValue mib2UdpEntryMap []
 
static struct mibImplementation supportedIDs []
 
static UINT minSupportedIDLength
 

Macro Definition Documentation

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 24 of file main.c.

Typedef Documentation

◆ compareFunc

typedef int(__cdecl * compareFunc) (const void *key, const void *value)

Definition at line 321 of file main.c.

◆ copyValueFunc

typedef DWORD(* copyValueFunc) (AsnAny *value, void *src)

Definition at line 55 of file main.c.

◆ oidToKeyFunc

typedef void(* oidToKeyFunc) (AsnObjectIdentifier *oid, void *dst)

Definition at line 320 of file main.c.

◆ varqueryfunc

typedef BOOL(* varqueryfunc) (BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)

Definition at line 86 of file main.c.

Function Documentation

◆ cleanup()

static void cleanup ( void  )
static

Definition at line 1335 of file main.c.

1336 {
1337  UINT i;
1338 
1339  for (i = 0; i < ARRAY_SIZE(supportedIDs); i++)
1340  if (supportedIDs[i].cleanup)
1341  supportedIDs[i].cleanup();
1342 }
static struct mibImplementation supportedIDs[]
Definition: main.c:1292
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
Definition: glfuncs.h:248
static void cleanup(void)
Definition: main.c:1335
#define ARRAY_SIZE(a)
Definition: main.h:24
unsigned int UINT
Definition: ndis.h:50

Referenced by DllMain().

◆ compareIpAddrRow()

static int __cdecl compareIpAddrRow ( const void a,
const void b 
)
static

Definition at line 772 of file main.c.

773 {
774  const MIB_IPADDRROW *key = a, *value = b;
775 
776  return key->dwAddr - value->dwAddr;
777 }
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79
Definition: path.c:41

Referenced by mib2IpAddrQuery().

◆ compareIpForwardRow()

static int __cdecl compareIpForwardRow ( const void a,
const void b 
)
static

Definition at line 865 of file main.c.

866 {
867  const MIB_IPFORWARDROW *key = a, *value = b;
868 
869  return key->dwForwardDest - value->dwForwardDest;
870 }
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79
Definition: path.c:41

Referenced by mib2IpRouteQuery().

◆ compareUdpRow()

static int __cdecl compareUdpRow ( const void a,
const void b 
)
static

Definition at line 1223 of file main.c.

1224 {
1225  const MIB_UDPROW *key = a, *value = b;
1226  int ret;
1227 
1228  ret = key->dwLocalAddr - value->dwLocalAddr;
1229  if (ret == 0)
1230  ret = key->dwLocalPort - value->dwLocalPort;
1231  return ret;
1232 }
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79
int ret
Definition: path.c:41

Referenced by mib2UdpEntryQuery().

◆ copyIfRowDescr()

static DWORD copyIfRowDescr ( AsnAny value,
void src 
)
static

Definition at line 550 of file main.c.

551 {
552  PMIB_IFROW row = (PMIB_IFROW)((BYTE *)src -
553  FIELD_OFFSET(MIB_IFROW, dwDescrLen));
554  DWORD ret;
555 
556  if (row->dwDescrLen)
557  {
558  setStringValue(value, ASN_OCTETSTRING, row->dwDescrLen, row->bDescr);
560  }
561  else
563  return ret;
564 }
static void setStringValue(AsnAny *value, BYTE type, DWORD len, BYTE *str)
Definition: main.c:44
#define ASN_OCTETSTRING
Definition: snmp.h:105
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
struct _MIB_IFROW * PMIB_IFROW
unsigned char BYTE
Definition: mem.h:68
GLenum src
Definition: glext.h:6340
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

◆ copyIfRowPhysAddr()

static DWORD copyIfRowPhysAddr ( AsnAny value,
void src 
)
static

Definition at line 566 of file main.c.

567 {
568  PMIB_IFROW row = (PMIB_IFROW)((BYTE *)src -
569  FIELD_OFFSET(MIB_IFROW, dwPhysAddrLen));
570  DWORD ret;
571 
572  if (row->dwPhysAddrLen)
573  {
574  setStringValue(value, ASN_OCTETSTRING, row->dwPhysAddrLen,
575  row->bPhysAddr);
577  }
578  else
580  return ret;
581 }
static void setStringValue(AsnAny *value, BYTE type, DWORD len, BYTE *str)
Definition: main.c:44
#define ASN_OCTETSTRING
Definition: snmp.h:105
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
struct _MIB_IFROW * PMIB_IFROW
unsigned char BYTE
Definition: mem.h:68
GLenum src
Definition: glext.h:6340
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

◆ copyInt()

static DWORD copyInt ( AsnAny value,
void src 
)
static

Utility functions

Definition at line 37 of file main.c.

38 {
39  value->asnType = ASN_INTEGER;
40  value->asnValue.number = *(DWORD *)src;
42 }
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum src
Definition: glext.h:6340
#define ASN_INTEGER
Definition: snmp.h:103

Referenced by mib2IfNumberQuery().

◆ copyIpAddr()

static DWORD copyIpAddr ( AsnAny value,
void src 
)
static

Definition at line 77 of file main.c.

78 {
81 }
static void setStringValue(AsnAny *value, BYTE type, DWORD len, BYTE *str)
Definition: main.c:44
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum src
Definition: glext.h:6340
#define ASN_IPADDRESS
Definition: snmp.h:113

◆ copyIpNetPhysAddr()

static DWORD copyIpNetPhysAddr ( AsnAny value,
void src 
)
static

Definition at line 916 of file main.c.

917 {
919  dwPhysAddrLen));
920 
921  setStringValue(value, ASN_OCTETSTRING, row->dwPhysAddrLen, row->bPhysAddr);
923 }
static void setStringValue(AsnAny *value, BYTE type, DWORD len, BYTE *str)
Definition: main.c:44
struct _MIB_IPNETROW * PMIB_IPNETROW
#define ASN_OCTETSTRING
Definition: snmp.h:105
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
unsigned char BYTE
Definition: mem.h:68
GLenum src
Definition: glext.h:6340
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

◆ copyOperStatus()

static DWORD copyOperStatus ( AsnAny value,
void src 
)
static

Definition at line 167 of file main.c.

168 {
169  value->asnType = ASN_INTEGER;
170  /* The IPHlpApi definition of operational status differs from the MIB2 one,
171  * so map it to the MIB2 value.
172  */
173  switch (*(DWORD *)src)
174  {
176  value->asnValue.number = MIB_IF_ADMIN_STATUS_UP;
177  break;
180  value->asnValue.number = MIB_IF_ADMIN_STATUS_TESTING;
181  break;
182  default:
183  value->asnValue.number = MIB_IF_ADMIN_STATUS_DOWN;
184  };
186 }
#define MIB_IF_ADMIN_STATUS_DOWN
Definition: ipifcons.h:233
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
#define MIB_IF_ADMIN_STATUS_UP
Definition: ipifcons.h:232
#define MIB_IF_OPER_STATUS_CONNECTING
Definition: ipifcons.h:249
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum src
Definition: glext.h:6340
#define MIB_IF_ADMIN_STATUS_TESTING
Definition: ipifcons.h:234
#define MIB_IF_OPER_STATUS_CONNECTED
Definition: ipifcons.h:250
#define ASN_INTEGER
Definition: snmp.h:103
#define MIB_IF_OPER_STATUS_OPERATIONAL
Definition: ipifcons.h:251

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

Definition at line 1446 of file main.c.

1447 {
1448  TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
1449 
1450  switch (fdwReason)
1451  {
1452  case DLL_PROCESS_ATTACH:
1453  DisableThreadLibraryCalls(hinstDLL);
1454  break;
1455  case DLL_PROCESS_DETACH:
1456  if (lpvReserved) break;
1457  cleanup();
1458  break;
1459  }
1460 
1461  return TRUE;
1462 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
static IN DWORD IN LPVOID lpvReserved
static void cleanup(void)
Definition: main.c:1335
#define DLL_PROCESS_DETACH
Definition: compat.h:119
#define TRACE(s)
Definition: solgame.cpp:4

◆ findNextOidInTable()

static UINT findNextOidInTable ( AsnObjectIdentifier oid,
struct GenericTable table,
size_t  tableEntrySize,
oidToKeyFunc  makeKey,
compareFunc  compare 
)
static

Definition at line 365 of file main.c.

368 {
369  UINT index = 0;
370  void *key = HeapAlloc(GetProcessHeap(), 0, tableEntrySize);
371 
372  if (key)
373  {
374  makeKey(oid, key);
375  index = findValueInTable(key, table, tableEntrySize, compare);
376  if (index == 0)
377  {
378  /* Not found in table. If it's less than the first entry, return
379  * the first index. Otherwise just return 0 and let the caller
380  * handle finding the successor.
381  */
382  if (compare(key, table->entries) < 0)
383  index = 1;
384  }
385  else
386  {
387  /* Skip any entries that match the same key. This enumeration will
388  * be incomplete, but it's what Windows appears to do if there are
389  * multiple entries with the same index in a table, and it avoids
390  * an infinite loop.
391  */
392  for (++index; index <= table->numEntries && compare(key,
393  &table->entries[tableEntrySize * (index - 1)]) == 0; ++index)
394  ;
395  }
396  HeapFree(GetProcessHeap(), 0, key);
397  }
398  return index;
399 }
Definition: bug.cpp:7
static UINT findValueInTable(const void *key, struct GenericTable *table, size_t tableEntrySize, compareFunc compare)
Definition: main.c:326
GLuint index
Definition: glext.h:6031
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define index(s, c)
Definition: various.h:29
unsigned int UINT
Definition: ndis.h:50
#define compare
#define HeapFree(x, y, z)
Definition: compat.h:402
Definition: path.c:41

Referenced by getItemAndInstanceFromTable().

◆ findOidInTable()

static UINT findOidInTable ( AsnObjectIdentifier oid,
struct GenericTable table,
size_t  tableEntrySize,
oidToKeyFunc  makeKey,
compareFunc  compare 
)
static

Definition at line 343 of file main.c.

346 {
347  UINT index = 0;
348  void *key = HeapAlloc(GetProcessHeap(), 0, tableEntrySize);
349 
350  if (key)
351  {
352  makeKey(oid, key);
353  index = findValueInTable(key, table, tableEntrySize, compare);
354  HeapFree(GetProcessHeap(), 0, key);
355  }
356  return index;
357 }
Definition: bug.cpp:7
static UINT findValueInTable(const void *key, struct GenericTable *table, size_t tableEntrySize, compareFunc compare)
Definition: main.c:326
GLuint index
Definition: glext.h:6031
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define index(s, c)
Definition: various.h:29
unsigned int UINT
Definition: ndis.h:50
#define HeapFree(x, y, z)
Definition: compat.h:402
Definition: path.c:41

Referenced by getItemAndInstanceFromTable().

◆ findSupportedQuery()

static struct mibImplementation* findSupportedQuery ( UINT ids,
UINT  idLength,
UINT matchingIndex 
)
static

Definition at line 1344 of file main.c.

1346 {
1347  int indexHigh = DEFINE_SIZEOF(supportedIDs) - 1, indexLow = 0;
1348  AsnObjectIdentifier oid1 = { idLength, ids};
1349 
1350  if (!idLength)
1351  return NULL;
1352 
1353  while (indexLow <= indexHigh)
1354  {
1355  INT cmp, i = (indexLow + indexHigh) / 2;
1356  if (!(cmp = SnmpUtilOidNCmp(&oid1, &supportedIDs[i].name, idLength)))
1357  {
1358  *matchingIndex = i;
1359  return &supportedIDs[i];
1360  }
1361  if (cmp > 0)
1362  indexLow = i + 1;
1363  else
1364  indexHigh = i - 1;
1365  }
1366  return NULL;
1367 }
static struct mibImplementation supportedIDs[]
Definition: main.c:1292
#define cmp(status, error)
Definition: error.c:114
int32_t INT
Definition: typedefs.h:56
GLuint * ids
Definition: glext.h:5907
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
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
INT WINAPI SnmpUtilOidNCmp(AsnObjectIdentifier *oid1, AsnObjectIdentifier *oid2, UINT count)
Definition: main.c:358
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179
Definition: name.c:38
static char oid1[]
Definition: encode.c:7583

Referenced by SnmpExtensionQuery().

◆ findValueInTable()

static UINT findValueInTable ( const void key,
struct GenericTable table,
size_t  tableEntrySize,
compareFunc  compare 
)
static

Definition at line 326 of file main.c.

328 {
329  UINT index = 0;
330  void *value;
331 
332  value = bsearch(key, table->entries, table->numEntries, tableEntrySize,
333  compare);
334  if (value)
335  index = ((BYTE *)value - (BYTE *)table->entries) / tableEntrySize + 1;
336  return index;
337 }
Definition: bug.cpp:7
GLuint index
Definition: glext.h:6031
#define index(s, c)
Definition: various.h:29
unsigned char BYTE
Definition: mem.h:68
GLsizei const GLfloat * value
Definition: glext.h:6069
unsigned int UINT
Definition: ndis.h:50
Definition: path.c:41
#define bsearch

Referenced by findNextOidInTable(), and findOidInTable().

◆ getItemAndInstanceFromTable()

static AsnInteger32 getItemAndInstanceFromTable ( AsnObjectIdentifier oid,
AsnObjectIdentifier base,
UINT  instanceLen,
BYTE  bPduType,
struct GenericTable table,
size_t  tableEntrySize,
oidToKeyFunc  makeKey,
compareFunc  compare,
UINT item,
UINT instance 
)
static

Definition at line 410 of file main.c.

414 {
416 
417  if (!table)
419 
420  switch (bPduType)
421  {
422  case SNMP_PDU_GETNEXT:
423  if (SnmpUtilOidNCmp(oid, base, base->idLength) < 0)
424  {
425  /* Return the first item and instance from the table */
426  *item = 1;
427  *instance = 1;
428  }
429  else if (!SnmpUtilOidNCmp(oid, base, base->idLength) &&
430  oid->idLength < base->idLength + instanceLen + 1)
431  {
432  /* Either the table or an item is specified, but the instance is
433  * not.
434  */
435  *instance = 1;
436  if (oid->idLength >= base->idLength + 1)
437  {
438  *item = oid->ids[base->idLength];
439  if (!*item)
440  *item = 1;
441  }
442  else
443  *item = 1;
444  }
445  else if (!SnmpUtilOidNCmp(oid, base, base->idLength) &&
446  oid->idLength == base->idLength + instanceLen + 1)
447  {
448  *item = oid->ids[base->idLength];
449  if (!*item)
450  {
451  *instance = 1;
452  *item = 1;
453  }
454  else
455  {
456  AsnObjectIdentifier instanceOid = { instanceLen,
457  oid->ids + base->idLength + 1 };
458 
459  *instance = findNextOidInTable(&instanceOid, table,
460  tableEntrySize, makeKey, compare);
461  if (!*instance || *instance > table->numEntries)
463  }
464  }
465  else
467  break;
468  default:
469  if (!SnmpUtilOidNCmp(oid, base, base->idLength) &&
470  oid->idLength == base->idLength + instanceLen + 1)
471  {
472  *item = oid->ids[base->idLength];
473  if (!*item)
475  else
476  {
477  AsnObjectIdentifier instanceOid = { instanceLen,
478  oid->ids + base->idLength + 1 };
479 
480  *instance = findOidInTable(&instanceOid, table, tableEntrySize,
481  makeKey, compare);
482  if (!*instance)
484  }
485  }
486  else
488  }
489  return ret;
490 }
Definition: bug.cpp:7
LONG AsnInteger32
Definition: snmp.h:40
UINT * ids
Definition: snmp.h:37
static UINT findNextOidInTable(AsnObjectIdentifier *oid, struct GenericTable *table, size_t tableEntrySize, oidToKeyFunc makeKey, compareFunc compare)
Definition: main.c:365
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
INT WINAPI SnmpUtilOidNCmp(AsnObjectIdentifier *oid1, AsnObjectIdentifier *oid2, UINT count)
Definition: main.c:358
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
static UINT findOidInTable(AsnObjectIdentifier *oid, struct GenericTable *table, size_t tableEntrySize, oidToKeyFunc makeKey, compareFunc compare)
Definition: main.c:343
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
static ATOM item
Definition: dde.c:856
static HINSTANCE instance
Definition: main.c:40

Referenced by mib2IpAddrQuery(), mib2IpRouteQuery(), and mib2UdpEntryQuery().

◆ getItemAndIntegerInstanceFromOid()

static AsnInteger32 getItemAndIntegerInstanceFromOid ( AsnObjectIdentifier oid,
AsnObjectIdentifier base,
BYTE  bPduType,
UINT item,
UINT instance 
)
static

Definition at line 196 of file main.c.

198 {
200 
201  switch (bPduType)
202  {
203  case SNMP_PDU_GETNEXT:
204  if (SnmpUtilOidNCmp(oid, base, base->idLength) < 0)
205  {
206  *item = 1;
207  *instance = 1;
208  }
209  else if (!SnmpUtilOidNCmp(oid, base, base->idLength))
210  {
211  if (oid->idLength == base->idLength ||
212  oid->idLength == base->idLength + 1)
213  {
214  /* Either the table or an item within the table is specified,
215  * but the instance is not. Get the first instance.
216  */
217  *instance = 1;
218  if (oid->idLength == base->idLength + 1)
219  *item = oid->ids[base->idLength];
220  else
221  *item = 1;
222  }
223  else
224  {
225  *item = oid->ids[base->idLength];
226  *instance = oid->ids[base->idLength + 1] + 1;
227  }
228  }
229  else
231  break;
232  default:
233  if (!SnmpUtilOidNCmp(oid, base, base->idLength))
234  {
235  if (oid->idLength == base->idLength ||
236  oid->idLength == base->idLength + 1)
237  {
238  /* Either the table or an item within the table is specified,
239  * but the instance is not.
240  */
242  }
243  else
244  {
245  *item = oid->ids[base->idLength];
246  *instance = oid->ids[base->idLength + 1];
247  }
248  }
249  else
251  }
252  return ret;
253 }
LONG AsnInteger32
Definition: snmp.h:40
UINT * ids
Definition: snmp.h:37
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
INT WINAPI SnmpUtilOidNCmp(AsnObjectIdentifier *oid1, AsnObjectIdentifier *oid2, UINT count)
Definition: main.c:358
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
static ATOM item
Definition: dde.c:856
static HINSTANCE instance
Definition: main.c:40

Referenced by mib2IfEntryQuery(), and mib2IpNetQuery().

◆ getItemFromOid()

static AsnInteger32 getItemFromOid ( AsnObjectIdentifier oid,
AsnObjectIdentifier base,
BYTE  bPduType,
UINT item 
)
static

Definition at line 262 of file main.c.

264 {
266 
267  switch (bPduType)
268  {
269  case SNMP_PDU_GETNEXT:
270  if (SnmpUtilOidNCmp(oid, base, base->idLength) < 0)
271  *item = 1;
272  else if (!SnmpUtilOidNCmp(oid, base, base->idLength))
273  {
274  if (oid->idLength == base->idLength)
275  {
276  /* The item is missing, assume the first item */
277  *item = 1;
278  }
279  else
280  *item = oid->ids[base->idLength] + 1;
281  }
282  else
284  break;
285  default:
286  if (!SnmpUtilOidNCmp(oid, base, base->idLength))
287  {
288  if (oid->idLength == base->idLength)
289  {
290  /* The item is missing */
292  }
293  else
294  {
295  *item = oid->ids[base->idLength];
296  if (!*item)
298  }
299  }
300  else
302  }
303  return ret;
304 }
LONG AsnInteger32
Definition: snmp.h:40
UINT * ids
Definition: snmp.h:37
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
INT WINAPI SnmpUtilOidNCmp(AsnObjectIdentifier *oid1, AsnObjectIdentifier *oid2, UINT count)
Definition: main.c:358
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
static ATOM item
Definition: dde.c:856

Referenced by mib2IcmpQuery(), mib2IpStatsQuery(), mib2TcpQuery(), and mib2UdpQuery().

◆ mapStructEntryToValue()

static AsnInteger32 mapStructEntryToValue ( struct structToAsnValue map,
UINT  mapLen,
void record,
UINT  id,
SnmpVarBind pVarBind 
)
static

Definition at line 63 of file main.c.

65 {
66  /* OIDs are 1-based */
67  if (!id)
69  --id;
70  if (id >= mapLen)
72  if (!map[id].copy)
74  return map[id].copy(&pVarBind->value, (BYTE *)record + map[id].offset);
75 }
AsnObjectSyntax value
Definition: snmp.h:77
Definition: _map.h:44
unsigned char BYTE
Definition: mem.h:68
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
int id
Definition: main.c:4907

Referenced by mib2IcmpQuery(), mib2IfEntryQuery(), mib2IpAddrQuery(), mib2IpNetQuery(), mib2IpRouteQuery(), mib2IpStatsQuery(), mib2TcpQuery(), mib2UdpEntryQuery(), and mib2UdpQuery().

◆ mib2IcmpInit()

static void mib2IcmpInit ( void  )
static

Definition at line 1005 of file main.c.

1006 {
1008 }
static MIB_ICMP icmpStats
Definition: main.c:1003
DWORD WINAPI GetIcmpStatistics(PMIB_ICMP pStats)

◆ mib2IcmpQuery()

static BOOL mib2IcmpQuery ( BYTE  bPduType,
SnmpVarBind pVarBind,
AsnInteger32 pErrorStatus 
)
static

Definition at line 1039 of file main.c.

1041 {
1043  UINT item = 0;
1044  BOOL ret = TRUE;
1045 
1046  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
1047  pErrorStatus);
1048 
1049  switch (bPduType)
1050  {
1051  case SNMP_PDU_GET:
1052  case SNMP_PDU_GETNEXT:
1053  *pErrorStatus = getItemFromOid(&pVarBind->name, &myOid, bPduType,
1054  &item);
1055  if (!*pErrorStatus)
1056  {
1057  *pErrorStatus = mapStructEntryToValue(mib2IcmpMap,
1059  pVarBind);
1060  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
1061  ret = setOidWithItem(&pVarBind->name, &myOid, item);
1062  }
1063  break;
1064  case SNMP_PDU_SET:
1065  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
1066  ret = FALSE;
1067  break;
1068  default:
1069  FIXME("0x%02x: unsupported PDU type\n", bPduType);
1070  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
1071  }
1072  return ret;
1073 }
#define SNMP_ERRORSTATUS_READONLY
Definition: snmp.h:137
#define TRUE
Definition: types.h:120
static struct structToAsnValue mib2IcmpMap[]
Definition: main.c:1010
AsnObjectName name
Definition: snmp.h:76
static MIB_ICMP icmpStats
Definition: main.c:1003
#define SNMP_PDU_GET
Definition: snmp.h:94
static UINT mib2Icmp[]
Definition: main.c:1002
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:534
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SNMP_PDU_SET
Definition: snmp.h:97
#define FIXME(fmt,...)
Definition: debug.h:110
static AsnInteger32 mapStructEntryToValue(struct structToAsnValue *map, UINT mapLen, void *record, UINT id, SnmpVarBind *pVarBind)
Definition: main.c:63
#define TRACE(s)
Definition: solgame.cpp:4
#define DEFINE_OID(x)
Definition: snmp.h:180
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
static ATOM item
Definition: dde.c:856
static INT setOidWithItem(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item)
Definition: main.c:492
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179
static AsnInteger32 getItemFromOid(AsnObjectIdentifier *oid, AsnObjectIdentifier *base, BYTE bPduType, UINT *item)
Definition: main.c:262

◆ mib2IfEntryQuery()

static BOOL mib2IfEntryQuery ( BYTE  bPduType,
SnmpVarBind pVarBind,
AsnInteger32 pErrorStatus 
)
static

Definition at line 609 of file main.c.

611 {
613  BOOL ret = TRUE;
614 
615  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
616  pErrorStatus);
617 
618  switch (bPduType)
619  {
620  case SNMP_PDU_GET:
621  case SNMP_PDU_GETNEXT:
622  if (!ifTable)
623  {
624  /* There is no interface present, so let the caller deal
625  * with finding the successor.
626  */
627  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
628  }
629  else
630  {
631  UINT tableIndex = 0, item = 0;
632 
633  *pErrorStatus = getItemAndIntegerInstanceFromOid(&pVarBind->name,
634  &entryOid, bPduType, &item, &tableIndex);
635  if (!*pErrorStatus)
636  {
637  assert(tableIndex);
638  assert(item);
639  if (tableIndex > ifTable->dwNumEntries)
640  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
641  else
642  {
643  *pErrorStatus = mapStructEntryToValue(mib2IfEntryMap,
645  &ifTable->table[tableIndex - 1], item,
646  pVarBind);
647  if (bPduType == SNMP_PDU_GETNEXT)
648  ret = setOidWithItemAndInteger(&pVarBind->name,
649  &entryOid, item, tableIndex);
650  }
651  }
652  }
653  break;
654  case SNMP_PDU_SET:
655  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
656  ret = FALSE;
657  break;
658  default:
659  FIXME("0x%02x: unsupported PDU type\n", bPduType);
660  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
661  }
662  return ret;
663 }
MIB_IFROW table[1]
Definition: ifmib.h:66
#define SNMP_ERRORSTATUS_READONLY
Definition: snmp.h:137
#define TRUE
Definition: types.h:120
static UINT mib2IfEntry[]
Definition: main.c:607
AsnObjectName name
Definition: snmp.h:76
static AsnInteger32 getItemAndIntegerInstanceFromOid(AsnObjectIdentifier *oid, AsnObjectIdentifier *base, BYTE bPduType, UINT *item, UINT *instance)
Definition: main.c:196
#define assert(x)
Definition: debug.h:53
#define SNMP_PDU_GET
Definition: snmp.h:94
static INT setOidWithItemAndInteger(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item, UINT instance)
Definition: main.c:534
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:534
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SNMP_PDU_SET
Definition: snmp.h:97
#define FIXME(fmt,...)
Definition: debug.h:110
static AsnInteger32 mapStructEntryToValue(struct structToAsnValue *map, UINT mapLen, void *record, UINT id, SnmpVarBind *pVarBind)
Definition: main.c:63
#define TRACE(s)
Definition: solgame.cpp:4
static struct structToAsnValue mib2IfEntryMap[]
Definition: main.c:583
#define DEFINE_OID(x)
Definition: snmp.h:180
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
static ATOM item
Definition: dde.c:856
DWORD dwNumEntries
Definition: ifmib.h:65
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179
static PMIB_IFTABLE ifTable
Definition: main.c:98

◆ mib2IfNumberCleanup()

static void mib2IfNumberCleanup ( void  )
static

Definition at line 115 of file main.c.

116 {
118 }
#define GetProcessHeap()
Definition: compat.h:403
static PMIB_IFTABLE ifTable
Definition: main.c:98
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ mib2IfNumberInit()

static void mib2IfNumberInit ( void  )
static

Definition at line 100 of file main.c.

101 {
102  DWORD size = 0, ret = GetIfTable(NULL, &size, FALSE);
103 
105  {
107  if (table)
108  {
109  if (!GetIfTable(table, &size, FALSE)) ifTable = table;
110  else HeapFree(GetProcessHeap(), 0, table );
111  }
112  }
113 }
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
DWORD WINAPI GetIfTable(PMIB_IFTABLE pIfTable, PULONG pdwSize, BOOL bOrder)
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static PMIB_IFTABLE ifTable
Definition: main.c:98
#define HeapFree(x, y, z)
Definition: compat.h:402
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

◆ mib2IfNumberQuery()

static BOOL mib2IfNumberQuery ( BYTE  bPduType,
SnmpVarBind pVarBind,
AsnInteger32 pErrorStatus 
)
static

Definition at line 120 of file main.c.

122 {
124  BOOL ret = TRUE;
125 
126  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
127  pErrorStatus);
128 
129  switch (bPduType)
130  {
131  case SNMP_PDU_GET:
132  case SNMP_PDU_GETNEXT:
133  if ((bPduType == SNMP_PDU_GET &&
134  !SnmpUtilOidNCmp(&pVarBind->name, &numberOid, numberOid.idLength))
135  || SnmpUtilOidNCmp(&pVarBind->name, &numberOid, numberOid.idLength)
136  < 0)
137  {
138  DWORD numIfs = ifTable ? ifTable->dwNumEntries : 0;
139 
140  copyInt(&pVarBind->value, &numIfs);
141  if (bPduType == SNMP_PDU_GETNEXT)
142  {
143  SnmpUtilOidFree(&pVarBind->name);
144  SnmpUtilOidCpy(&pVarBind->name, &numberOid);
145  }
146  *pErrorStatus = SNMP_ERRORSTATUS_NOERROR;
147  }
148  else
149  {
150  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
151  /* Caller deals with OID if bPduType == SNMP_PDU_GETNEXT, so don't
152  * need to set it here.
153  */
154  }
155  break;
156  case SNMP_PDU_SET:
157  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
158  ret = FALSE;
159  break;
160  default:
161  FIXME("0x%02x: unsupported PDU type\n", bPduType);
162  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
163  }
164  return ret;
165 }
#define SNMP_ERRORSTATUS_READONLY
Definition: snmp.h:137
#define TRUE
Definition: types.h:120
static DWORD copyInt(AsnAny *value, void *src)
Definition: main.c:37
AsnObjectName name
Definition: snmp.h:76
#define SNMP_PDU_GET
Definition: snmp.h:94
VOID WINAPI SnmpUtilOidFree(AsnObjectIdentifier *oid)
Definition: main.c:344
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:534
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SNMP_PDU_SET
Definition: snmp.h:97
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
INT WINAPI SnmpUtilOidNCmp(AsnObjectIdentifier *oid1, AsnObjectIdentifier *oid2, UINT count)
Definition: main.c:358
#define DEFINE_OID(x)
Definition: snmp.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
AsnObjectSyntax value
Definition: snmp.h:77
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
DWORD dwNumEntries
Definition: ifmib.h:65
static PMIB_IFTABLE ifTable
Definition: main.c:98
INT WINAPI SnmpUtilOidCpy(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:319
static UINT mib2IfNumber[]
Definition: main.c:97

◆ mib2IpAddrCleanup()

static void mib2IpAddrCleanup ( void  )
static

Definition at line 760 of file main.c.

761 {
763 }
static PMIB_IPADDRTABLE ipAddrTable
Definition: main.c:735
#define GetProcessHeap()
Definition: compat.h:403
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ mib2IpAddrInit()

static void mib2IpAddrInit ( void  )
static

Definition at line 745 of file main.c.

746 {
748 
750  {
752  if (table)
753  {
755  else HeapFree(GetProcessHeap(), 0, table );
756  }
757  }
758 }
static PMIB_IPADDRTABLE ipAddrTable
Definition: main.c:735
#define TRUE
Definition: types.h:120
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
DWORD WINAPI GetIpAddrTable(PMIB_IPADDRTABLE pIpAddrTable, PULONG pdwSize, BOOL bOrder)
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define HeapFree(x, y, z)
Definition: compat.h:402
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

◆ mib2IpAddrQuery()

static BOOL mib2IpAddrQuery ( BYTE  bPduType,
SnmpVarBind pVarBind,
AsnInteger32 pErrorStatus 
)
static

Definition at line 779 of file main.c.

781 {
783  UINT tableIndex = 0, item = 0;
784  BOOL ret = TRUE;
785 
786  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
787  pErrorStatus);
788 
789  switch (bPduType)
790  {
791  case SNMP_PDU_GET:
792  case SNMP_PDU_GETNEXT:
793  *pErrorStatus = getItemAndInstanceFromTable(&pVarBind->name,
794  &myOid, 4, bPduType, (struct GenericTable *)ipAddrTable,
796  &tableIndex);
797  if (!*pErrorStatus)
798  {
799  assert(tableIndex);
800  assert(item);
801  *pErrorStatus = mapStructEntryToValue(mib2IpAddrMap,
803  &ipAddrTable->table[tableIndex - 1], item, pVarBind);
804  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
805  ret = setOidWithItemAndIpAddr(&pVarBind->name, &myOid, item,
806  ipAddrTable->table[tableIndex - 1].dwAddr);
807  }
808  break;
809  case SNMP_PDU_SET:
810  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
811  ret = FALSE;
812  break;
813  default:
814  FIXME("0x%02x: unsupported PDU type\n", bPduType);
815  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
816  }
817  return ret;
818 }
static INT setOidWithItemAndIpAddr(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item, DWORD addr)
Definition: main.c:511
static PMIB_IPADDRTABLE ipAddrTable
Definition: main.c:735
#define SNMP_ERRORSTATUS_READONLY
Definition: snmp.h:137
#define TRUE
Definition: types.h:120
AsnObjectName name
Definition: snmp.h:76
#define assert(x)
Definition: debug.h:53
#define SNMP_PDU_GET
Definition: snmp.h:94
static int __cdecl compareIpAddrRow(const void *a, const void *b)
Definition: main.c:772
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:534
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SNMP_PDU_SET
Definition: snmp.h:97
#define FIXME(fmt,...)
Definition: debug.h:110
static AsnInteger32 mapStructEntryToValue(struct structToAsnValue *map, UINT mapLen, void *record, UINT id, SnmpVarBind *pVarBind)
Definition: main.c:63
static struct structToAsnValue mib2IpAddrMap[]
Definition: main.c:737
#define TRACE(s)
Definition: solgame.cpp:4
#define DEFINE_OID(x)
Definition: snmp.h:180
static AsnInteger32 getItemAndInstanceFromTable(AsnObjectIdentifier *oid, AsnObjectIdentifier *base, UINT instanceLen, BYTE bPduType, struct GenericTable *table, size_t tableEntrySize, oidToKeyFunc makeKey, compareFunc compare, UINT *item, UINT *instance)
Definition: main.c:410
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
static void oidToIpAddrRow(AsnObjectIdentifier *oid, void *dst)
Definition: main.c:765
static ATOM item
Definition: dde.c:856
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179
static UINT mib2IpAddr[]
Definition: main.c:734
DWORD dwAddr
Definition: ipmib.h:36
MIB_IPADDRROW table[1]
Definition: ipmib.h:48

◆ mib2IpNetCleanup()

static void mib2IpNetCleanup ( void  )
static

Definition at line 947 of file main.c.

948 {
950 }
#define GetProcessHeap()
Definition: compat.h:403
static PMIB_IPNETTABLE ipNetTable
Definition: main.c:914
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ mib2IpNetInit()

static void mib2IpNetInit ( void  )
static

Definition at line 932 of file main.c.

933 {
935 
937  {
939  if (table)
940  {
942  else HeapFree(GetProcessHeap(), 0, table );
943  }
944  }
945 }
DWORD WINAPI GetIpNetTable(PMIB_IPNETTABLE pIpNetTable, PULONG pdwSize, BOOL bOrder)
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static PMIB_IPNETTABLE ipNetTable
Definition: main.c:914
#define HeapFree(x, y, z)
Definition: compat.h:402
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

◆ mib2IpNetQuery()

static BOOL mib2IpNetQuery ( BYTE  bPduType,
SnmpVarBind pVarBind,
AsnInteger32 pErrorStatus 
)
static

Definition at line 952 of file main.c.

954 {
956  BOOL ret = TRUE;
957 
958  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
959  pErrorStatus);
960 
961  switch (bPduType)
962  {
963  case SNMP_PDU_GET:
964  case SNMP_PDU_GETNEXT:
965  if (!ipNetTable)
966  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
967  else
968  {
969  UINT tableIndex = 0, item = 0;
970 
971  *pErrorStatus = getItemAndIntegerInstanceFromOid(&pVarBind->name,
972  &myOid, bPduType, &item, &tableIndex);
973  if (!*pErrorStatus)
974  {
975  assert(tableIndex);
976  assert(item);
977  if (tableIndex > ipNetTable->dwNumEntries)
978  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
979  else
980  {
981  *pErrorStatus = mapStructEntryToValue(mib2IpNetMap,
983  &ipNetTable[tableIndex - 1], item, pVarBind);
984  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
985  ret = setOidWithItemAndInteger(&pVarBind->name, &myOid,
986  item, tableIndex);
987  }
988  }
989  }
990  break;
991  case SNMP_PDU_SET:
992  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
993  ret = FALSE;
994  break;
995  default:
996  FIXME("0x%02x: unsupported PDU type\n", bPduType);
997  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
998  }
999  return ret;
1000 }
#define SNMP_ERRORSTATUS_READONLY
Definition: snmp.h:137
#define TRUE
Definition: types.h:120
AsnObjectName name
Definition: snmp.h:76
static AsnInteger32 getItemAndIntegerInstanceFromOid(AsnObjectIdentifier *oid, AsnObjectIdentifier *base, BYTE bPduType, UINT *item, UINT *instance)
Definition: main.c:196
#define assert(x)
Definition: debug.h:53
#define SNMP_PDU_GET
Definition: snmp.h:94
static INT setOidWithItemAndInteger(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item, UINT instance)
Definition: main.c:534
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:534
unsigned int BOOL
Definition: ntddk_ex.h:94
static struct structToAsnValue mib2IpNetMap[]
Definition: main.c:925
#define SNMP_PDU_SET
Definition: snmp.h:97
#define FIXME(fmt,...)
Definition: debug.h:110
static AsnInteger32 mapStructEntryToValue(struct structToAsnValue *map, UINT mapLen, void *record, UINT id, SnmpVarBind *pVarBind)
Definition: main.c:63
static UINT mib2IpNet[]
Definition: main.c:913
#define TRACE(s)
Definition: solgame.cpp:4
#define DEFINE_OID(x)
Definition: snmp.h:180
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
static ATOM item
Definition: dde.c:856
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179
static PMIB_IPNETTABLE ipNetTable
Definition: main.c:914
DWORD dwNumEntries
Definition: ipmib.h:127

◆ mib2IpRouteCleanup()

static void mib2IpRouteCleanup ( void  )
static

Definition at line 853 of file main.c.

854 {
856 }
static PMIB_IPFORWARDTABLE ipRouteTable
Definition: main.c:821
#define GetProcessHeap()
Definition: compat.h:403
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ mib2IpRouteInit()

static void mib2IpRouteInit ( void  )
static

Definition at line 838 of file main.c.

839 {
841 
843  {
845  if (table)
846  {
848  else HeapFree(GetProcessHeap(), 0, table );
849  }
850  }
851 }
static PMIB_IPFORWARDTABLE ipRouteTable
Definition: main.c:821
#define TRUE
Definition: types.h:120
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, BOOL bOrder)
#define HeapFree(x, y, z)
Definition: compat.h:402
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

◆ mib2IpRouteQuery()

static BOOL mib2IpRouteQuery ( BYTE  bPduType,
SnmpVarBind pVarBind,
AsnInteger32 pErrorStatus 
)
static

Definition at line 872 of file main.c.

874 {
876  UINT tableIndex = 0, item = 0;
877  BOOL ret = TRUE;
878 
879  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
880  pErrorStatus);
881 
882  switch (bPduType)
883  {
884  case SNMP_PDU_GET:
885  case SNMP_PDU_GETNEXT:
886  *pErrorStatus = getItemAndInstanceFromTable(&pVarBind->name,
887  &myOid, 4, bPduType, (struct GenericTable *)ipRouteTable,
889  &item, &tableIndex);
890  if (!*pErrorStatus)
891  {
892  assert(tableIndex);
893  assert(item);
894  *pErrorStatus = mapStructEntryToValue(mib2IpRouteMap,
896  &ipRouteTable->table[tableIndex - 1], item, pVarBind);
897  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
898  ret = setOidWithItemAndIpAddr(&pVarBind->name, &myOid, item,
899  ipRouteTable->table[tableIndex - 1].dwForwardDest);
900  }
901  break;
902  case SNMP_PDU_SET:
903  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
904  ret = FALSE;
905  break;
906  default:
907  FIXME("0x%02x: unsupported PDU type\n", bPduType);
908  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
909  }
910  return ret;
911 }
static PMIB_IPFORWARDTABLE ipRouteTable
Definition: main.c:821
static INT setOidWithItemAndIpAddr(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item, DWORD addr)
Definition: main.c:511
#define SNMP_ERRORSTATUS_READONLY
Definition: snmp.h:137
#define TRUE
Definition: types.h:120
AsnObjectName name
Definition: snmp.h:76
#define assert(x)
Definition: debug.h:53
#define SNMP_PDU_GET
Definition: snmp.h:94
static UINT mib2IpRoute[]
Definition: main.c:820
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:534
static int __cdecl compareIpForwardRow(const void *a, const void *b)
Definition: main.c:865
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SNMP_PDU_SET
Definition: snmp.h:97
#define FIXME(fmt,...)
Definition: debug.h:110
static AsnInteger32 mapStructEntryToValue(struct structToAsnValue *map, UINT mapLen, void *record, UINT id, SnmpVarBind *pVarBind)
Definition: main.c:63
static void oidToIpForwardRow(AsnObjectIdentifier *oid, void *dst)
Definition: main.c:858
#define TRACE(s)
Definition: solgame.cpp:4
#define DEFINE_OID(x)
Definition: snmp.h:180
DWORD dwForwardDest
Definition: ipmib.h:71
static AsnInteger32 getItemAndInstanceFromTable(AsnObjectIdentifier *oid, AsnObjectIdentifier *base, UINT instanceLen, BYTE bPduType, struct GenericTable *table, size_t tableEntrySize, oidToKeyFunc makeKey, compareFunc compare, UINT *item, UINT *instance)
Definition: main.c:410
MIB_IPFORWARDROW table[1]
Definition: ipmib.h:98
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
static struct structToAsnValue mib2IpRouteMap[]
Definition: main.c:823
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
static ATOM item
Definition: dde.c:856
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179

◆ mib2IpStatsInit()

static void mib2IpStatsInit ( void  )
static

Definition at line 668 of file main.c.

669 {
671 }
DWORD WINAPI GetIpStatistics(PMIB_IPSTATS pStats)
static MIB_IPSTATS ipStats
Definition: main.c:666

◆ mib2IpStatsQuery()

static BOOL mib2IpStatsQuery ( BYTE  bPduType,
SnmpVarBind pVarBind,
AsnInteger32 pErrorStatus 
)
static

Definition at line 699 of file main.c.

701 {
703  UINT item = 0;
704  BOOL ret = TRUE;
705 
706  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
707  pErrorStatus);
708 
709  switch (bPduType)
710  {
711  case SNMP_PDU_GET:
712  case SNMP_PDU_GETNEXT:
713  *pErrorStatus = getItemFromOid(&pVarBind->name, &myOid, bPduType,
714  &item);
715  if (!*pErrorStatus)
716  {
717  *pErrorStatus = mapStructEntryToValue(mib2IpMap,
718  DEFINE_SIZEOF(mib2IpMap), &ipStats, item, pVarBind);
719  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
720  ret = setOidWithItem(&pVarBind->name, &myOid, item);
721  }
722  break;
723  case SNMP_PDU_SET:
724  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
725  ret = FALSE;
726  break;
727  default:
728  FIXME("0x%02x: unsupported PDU type\n", bPduType);
729  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
730  }
731  return ret;
732 }
#define SNMP_ERRORSTATUS_READONLY
Definition: snmp.h:137
#define TRUE
Definition: types.h:120
static UINT mib2Ip[]
Definition: main.c:665
AsnObjectName name
Definition: snmp.h:76
#define SNMP_PDU_GET
Definition: snmp.h:94
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:534
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SNMP_PDU_SET
Definition: snmp.h:97
#define FIXME(fmt,...)
Definition: debug.h:110
static AsnInteger32 mapStructEntryToValue(struct structToAsnValue *map, UINT mapLen, void *record, UINT id, SnmpVarBind *pVarBind)
Definition: main.c:63
#define TRACE(s)
Definition: solgame.cpp:4
#define DEFINE_OID(x)
Definition: snmp.h:180
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
static ATOM item
Definition: dde.c:856
static INT setOidWithItem(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item)
Definition: main.c:492
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179
static struct structToAsnValue mib2IpMap[]
Definition: main.c:673
static AsnInteger32 getItemFromOid(AsnObjectIdentifier *oid, AsnObjectIdentifier *base, BYTE bPduType, UINT *item)
Definition: main.c:262
static MIB_IPSTATS ipStats
Definition: main.c:666

◆ mib2TcpInit()

static void mib2TcpInit ( void  )
static

Definition at line 1078 of file main.c.

1079 {
1081 }
static MIB_TCPSTATS tcpStats
Definition: main.c:1076
DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS pStats)

◆ mib2TcpQuery()

static BOOL mib2TcpQuery ( BYTE  bPduType,
SnmpVarBind pVarBind,
AsnInteger32 pErrorStatus 
)
static

Definition at line 1101 of file main.c.

1103 {
1105  UINT item = 0;
1106  BOOL ret = TRUE;
1107 
1108  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
1109  pErrorStatus);
1110 
1111  switch (bPduType)
1112  {
1113  case SNMP_PDU_GET:
1114  case SNMP_PDU_GETNEXT:
1115  *pErrorStatus = getItemFromOid(&pVarBind->name, &myOid, bPduType,
1116  &item);
1117  if (!*pErrorStatus)
1118  {
1119  *pErrorStatus = mapStructEntryToValue(mib2TcpMap,
1120  DEFINE_SIZEOF(mib2TcpMap), &tcpStats, item, pVarBind);
1121  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
1122  ret = setOidWithItem(&pVarBind->name, &myOid, item);
1123  }
1124  break;
1125  case SNMP_PDU_SET:
1126  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
1127  ret = FALSE;
1128  break;
1129  default:
1130  FIXME("0x%02x: unsupported PDU type\n", bPduType);
1131  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
1132  }
1133  return ret;
1134 }
#define SNMP_ERRORSTATUS_READONLY
Definition: snmp.h:137
#define TRUE
Definition: types.h:120
AsnObjectName name
Definition: snmp.h:76
#define SNMP_PDU_GET
Definition: snmp.h:94
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:534
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SNMP_PDU_SET
Definition: snmp.h:97
#define FIXME(fmt,...)
Definition: debug.h:110
static AsnInteger32 mapStructEntryToValue(struct structToAsnValue *map, UINT mapLen, void *record, UINT id, SnmpVarBind *pVarBind)
Definition: main.c:63
static struct structToAsnValue mib2TcpMap[]
Definition: main.c:1083
#define TRACE(s)
Definition: solgame.cpp:4
#define DEFINE_OID(x)
Definition: snmp.h:180
static MIB_TCPSTATS tcpStats
Definition: main.c:1076
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
static ATOM item
Definition: dde.c:856
static INT setOidWithItem(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item)
Definition: main.c:492
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179
static AsnInteger32 getItemFromOid(AsnObjectIdentifier *oid, AsnObjectIdentifier *base, BYTE bPduType, UINT *item)
Definition: main.c:262
static UINT mib2Tcp[]
Definition: main.c:1075

◆ mib2UdpEntryCleanup()

static void mib2UdpEntryCleanup ( void  )
static

Definition at line 1204 of file main.c.

1205 {
1207 }
#define GetProcessHeap()
Definition: compat.h:403
static PMIB_UDPTABLE udpTable
Definition: main.c:1187
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ mib2UdpEntryInit()

static void mib2UdpEntryInit ( void  )
static

Definition at line 1189 of file main.c.

1190 {
1191  DWORD size = 0, ret = GetUdpTable(NULL, &size, TRUE);
1192 
1194  {
1196  if (table)
1197  {
1198  if (!GetUdpTable(table, &size, TRUE)) udpTable = table;
1199  else HeapFree(GetProcessHeap(), 0, table);
1200  }
1201  }
1202 }
DWORD WINAPI GetUdpTable(PMIB_UDPTABLE pUdpTable, PDWORD pdwSize, BOOL bOrder)
#define TRUE
Definition: types.h:120
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static PMIB_UDPTABLE udpTable
Definition: main.c:1187
#define HeapFree(x, y, z)
Definition: compat.h:402
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

◆ mib2UdpEntryQuery()

static BOOL mib2UdpEntryQuery ( BYTE  bPduType,
SnmpVarBind pVarBind,
AsnInteger32 pErrorStatus 
)
static

Definition at line 1234 of file main.c.

1236 {
1238  BOOL ret = TRUE;
1239 
1240  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
1241  pErrorStatus);
1242 
1243  switch (bPduType)
1244  {
1245  case SNMP_PDU_GET:
1246  case SNMP_PDU_GETNEXT:
1247  if (!udpTable)
1248  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
1249  else
1250  {
1251  UINT tableIndex = 0, item = 0;
1252 
1253  *pErrorStatus = getItemAndInstanceFromTable(&pVarBind->name, &myOid,
1254  5, bPduType, (struct GenericTable *)udpTable,
1256  &tableIndex);
1257  if (!*pErrorStatus)
1258  {
1259  assert(tableIndex);
1260  assert(item);
1261  *pErrorStatus = mapStructEntryToValue(mib2UdpEntryMap,
1263  &udpTable->table[tableIndex - 1], item, pVarBind);
1264  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
1265  {
1266  AsnObjectIdentifier oid;
1267 
1268  ret = setOidWithItemAndIpAddr(&pVarBind->name, &myOid, item,
1269  udpTable->table[tableIndex - 1].dwLocalAddr);
1270  if (ret)
1271  {
1272  oid.idLength = 1;
1273  oid.ids = &udpTable->table[tableIndex - 1].dwLocalPort;
1274  ret = SnmpUtilOidAppend(&pVarBind->name, &oid);
1275  }
1276  }
1277  }
1278  }
1279  break;
1280  case SNMP_PDU_SET:
1281  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
1282  ret = FALSE;
1283  break;
1284  default:
1285  FIXME("0x%02x: unsupported PDU type\n", bPduType);
1286  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
1287  }
1288  return ret;
1289 }
static INT setOidWithItemAndIpAddr(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item, DWORD addr)
Definition: main.c:511
#define SNMP_ERRORSTATUS_READONLY
Definition: snmp.h:137
#define TRUE
Definition: types.h:120
UINT * ids
Definition: snmp.h:37
AsnObjectName name
Definition: snmp.h:76
DWORD dwLocalAddr
Definition: udpmib.h:28
#define assert(x)
Definition: debug.h:53
#define SNMP_PDU_GET
Definition: snmp.h:94
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:534
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SNMP_PDU_SET
Definition: snmp.h:97
#define FIXME(fmt,...)
Definition: debug.h:110
static AsnInteger32 mapStructEntryToValue(struct structToAsnValue *map, UINT mapLen, void *record, UINT id, SnmpVarBind *pVarBind)
Definition: main.c:63
#define TRACE(s)
Definition: solgame.cpp:4
MIB_UDPROW table[1]
Definition: udpmib.h:35
static int __cdecl compareUdpRow(const void *a, const void *b)
Definition: main.c:1223
#define DEFINE_OID(x)
Definition: snmp.h:180
static AsnInteger32 getItemAndInstanceFromTable(AsnObjectIdentifier *oid, AsnObjectIdentifier *base, UINT instanceLen, BYTE bPduType, struct GenericTable *table, size_t tableEntrySize, oidToKeyFunc makeKey, compareFunc compare, UINT *item, UINT *instance)
Definition: main.c:410
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
static UINT mib2UdpEntry[]
Definition: main.c:1186
static PMIB_UDPTABLE udpTable
Definition: main.c:1187
static void oidToUdpRow(AsnObjectIdentifier *oid, void *dst)
Definition: main.c:1214
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
static ATOM item
Definition: dde.c:856
static struct structToAsnValue mib2UdpEntryMap[]
Definition: main.c:1209
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179
DWORD dwLocalPort
Definition: udpmib.h:29
INT WINAPI SnmpUtilOidAppend(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:289

◆ mib2UdpInit()

static void mib2UdpInit ( void  )
static

Definition at line 1139 of file main.c.

1140 {
1142 }
DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS pStats)
static MIB_UDPSTATS udpStats
Definition: main.c:1137

◆ mib2UdpQuery()

static BOOL mib2UdpQuery ( BYTE  bPduType,
SnmpVarBind pVarBind,
AsnInteger32 pErrorStatus 
)
static

Definition at line 1151 of file main.c.

1153 {
1155  UINT item;
1156  BOOL ret = TRUE;
1157 
1158  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
1159  pErrorStatus);
1160 
1161  switch (bPduType)
1162  {
1163  case SNMP_PDU_GET:
1164  case SNMP_PDU_GETNEXT:
1165  *pErrorStatus = getItemFromOid(&pVarBind->name, &myOid, bPduType,
1166  &item);
1167  if (!*pErrorStatus)
1168  {
1169  *pErrorStatus = mapStructEntryToValue(mib2UdpMap,
1170  DEFINE_SIZEOF(mib2UdpMap), &udpStats, item, pVarBind);
1171  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
1172  ret = setOidWithItem(&pVarBind->name, &myOid, item);
1173  }
1174  break;
1175  case SNMP_PDU_SET:
1176  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
1177  ret = FALSE;
1178  break;
1179  default:
1180  FIXME("0x%02x: unsupported PDU type\n", bPduType);
1181  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
1182  }
1183  return ret;
1184 }
#define SNMP_ERRORSTATUS_READONLY
Definition: snmp.h:137
#define TRUE
Definition: types.h:120
AsnObjectName name
Definition: snmp.h:76
#define SNMP_PDU_GET
Definition: snmp.h:94
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:534
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SNMP_PDU_SET
Definition: snmp.h:97
#define FIXME(fmt,...)
Definition: debug.h:110
static AsnInteger32 mapStructEntryToValue(struct structToAsnValue *map, UINT mapLen, void *record, UINT id, SnmpVarBind *pVarBind)
Definition: main.c:63
#define TRACE(s)
Definition: solgame.cpp:4
static MIB_UDPSTATS udpStats
Definition: main.c:1137
#define DEFINE_OID(x)
Definition: snmp.h:180
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
static struct structToAsnValue mib2UdpMap[]
Definition: main.c:1144
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
static ATOM item
Definition: dde.c:856
static INT setOidWithItem(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item)
Definition: main.c:492
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179
static UINT mib2Udp[]
Definition: main.c:1136
static AsnInteger32 getItemFromOid(AsnObjectIdentifier *oid, AsnObjectIdentifier *base, BYTE bPduType, UINT *item)
Definition: main.c:262

◆ oidToIpAddr()

static DWORD oidToIpAddr ( AsnObjectIdentifier oid)
static

Definition at line 312 of file main.c.

313 {
314  assert(oid && oid->idLength >= 4);
315  /* Map the IDs to an IP address in little-endian order */
316  return (BYTE)oid->ids[3] << 24 | (BYTE)oid->ids[2] << 16 |
317  (BYTE)oid->ids[1] << 8 | (BYTE)oid->ids[0];
318 }
UINT * ids
Definition: snmp.h:37
#define assert(x)
Definition: debug.h:53
unsigned char BYTE
Definition: mem.h:68

Referenced by oidToIpAddrRow(), oidToIpForwardRow(), and oidToUdpRow().

◆ oidToIpAddrRow()

static void oidToIpAddrRow ( AsnObjectIdentifier oid,
void dst 
)
static

Definition at line 765 of file main.c.

766 {
767  MIB_IPADDRROW *row = dst;
768 
769  row->dwAddr = oidToIpAddr(oid);
770 }
static DWORD oidToIpAddr(AsnObjectIdentifier *oid)
Definition: main.c:312
GLenum GLenum dst
Definition: glext.h:6340
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

Referenced by mib2IpAddrQuery().

◆ oidToIpForwardRow()

static void oidToIpForwardRow ( AsnObjectIdentifier oid,
void dst 
)
static

Definition at line 858 of file main.c.

859 {
861 
862  row->dwForwardDest = oidToIpAddr(oid);
863 }
static DWORD oidToIpAddr(AsnObjectIdentifier *oid)
Definition: main.c:312
GLenum GLenum dst
Definition: glext.h:6340
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

Referenced by mib2IpRouteQuery().

◆ oidToUdpRow()

static void oidToUdpRow ( AsnObjectIdentifier oid,
void dst 
)
static

Definition at line 1214 of file main.c.

1215 {
1216  MIB_UDPROW *row = dst;
1217 
1218  assert(oid && oid->idLength >= 5);
1219  row->dwLocalAddr = oidToIpAddr(oid);
1220  row->dwLocalPort = oid->ids[4];
1221 }
UINT * ids
Definition: snmp.h:37
#define assert(x)
Definition: debug.h:53
static DWORD oidToIpAddr(AsnObjectIdentifier *oid)
Definition: main.c:312
GLenum GLenum dst
Definition: glext.h:6340
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

Referenced by mib2UdpEntryQuery().

◆ setOidWithItem()

static INT setOidWithItem ( AsnObjectIdentifier dst,
AsnObjectIdentifier base,
UINT  item 
)
static

Definition at line 492 of file main.c.

494 {
495  UINT id;
497  INT ret;
498 
501  if (ret)
502  {
503  oid.idLength = 1;
504  oid.ids = &id;
505  id = item;
506  ret = SnmpUtilOidAppend(dst, &oid);
507  }
508  return ret;
509 }
UINT * ids
Definition: snmp.h:37
int32_t INT
Definition: typedefs.h:56
VOID WINAPI SnmpUtilOidFree(AsnObjectIdentifier *oid)
Definition: main.c:344
int ret
static ATOM item
Definition: dde.c:856
GLenum GLenum dst
Definition: glext.h:6340
unsigned int UINT
Definition: ndis.h:50
int id
Definition: main.c:4907
INT WINAPI SnmpUtilOidAppend(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:289
INT WINAPI SnmpUtilOidCpy(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:319

Referenced by mib2IcmpQuery(), mib2IpStatsQuery(), mib2TcpQuery(), mib2UdpQuery(), setOidWithItemAndInteger(), and setOidWithItemAndIpAddr().

◆ setOidWithItemAndInteger()

static INT setOidWithItemAndInteger ( AsnObjectIdentifier dst,
AsnObjectIdentifier base,
UINT  item,
UINT  instance 
)
static

Definition at line 534 of file main.c.

536 {
538  INT ret;
539 
541  if (ret)
542  {
543  oid.idLength = 1;
544  oid.ids = &instance;
545  ret = SnmpUtilOidAppend(dst, &oid);
546  }
547  return ret;
548 }
UINT * ids
Definition: snmp.h:37
int32_t INT
Definition: typedefs.h:56
int ret
static ATOM item
Definition: dde.c:856
static HINSTANCE instance
Definition: main.c:40
GLenum GLenum dst
Definition: glext.h:6340
static INT setOidWithItem(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item)
Definition: main.c:492
INT WINAPI SnmpUtilOidAppend(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:289

Referenced by mib2IfEntryQuery(), and mib2IpNetQuery().

◆ setOidWithItemAndIpAddr()

static INT setOidWithItemAndIpAddr ( AsnObjectIdentifier dst,
AsnObjectIdentifier base,
UINT  item,
DWORD  addr 
)
static

Definition at line 511 of file main.c.

513 {
514  UINT id;
515  BYTE *ptr;
517  INT ret;
518 
520  if (ret)
521  {
522  oid.idLength = 1;
523  oid.ids = &id;
524  for (ptr = (BYTE *)&addr; ret && ptr < (BYTE *)&addr + sizeof(DWORD);
525  ptr++)
526  {
527  id = *ptr;
528  ret = SnmpUtilOidAppend(dst, &oid);
529  }
530  }
531  return ret;
532 }
UINT * ids
Definition: snmp.h:37
int32_t INT
Definition: typedefs.h:56
static PVOID ptr
Definition: dispmode.c:27
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum const GLvoid * addr
Definition: glext.h:9621
unsigned char BYTE
Definition: mem.h:68
static ATOM item
Definition: dde.c:856
GLenum GLenum dst
Definition: glext.h:6340
static INT setOidWithItem(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item)
Definition: main.c:492
unsigned int UINT
Definition: ndis.h:50
int id
Definition: main.c:4907
INT WINAPI SnmpUtilOidAppend(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:289

Referenced by mib2IpAddrQuery(), mib2IpRouteQuery(), and mib2UdpEntryQuery().

◆ setStringValue()

static void setStringValue ( AsnAny value,
BYTE  type,
DWORD  len,
BYTE str 
)
static

Definition at line 44 of file main.c.

45 {
46  AsnAny strValue;
47 
48  strValue.asnType = type;
49  strValue.asnValue.string.stream = str;
50  strValue.asnValue.string.length = len;
51  strValue.asnValue.string.dynamic = FALSE;
52  SnmpUtilAsnAnyCpy(value, &strValue);
53 }
BYTE asnType
Definition: snmp.h:55
INT WINAPI SnmpUtilAsnAnyCpy(AsnAny *dst, AsnAny *src)
Definition: main.c:197
const WCHAR * str
UINT length
Definition: snmp.h:31
BOOL dynamic
Definition: snmp.h:32
union AsnAny::@3119 asnValue
AsnOctetString string
Definition: snmp.h:60
Definition: snmp.h:54
GLenum GLsizei len
Definition: glext.h:6722
int type
Definition: main.c:85
BYTE * stream
Definition: snmp.h:30

Referenced by copyIfRowDescr(), copyIfRowPhysAddr(), copyIpAddr(), and copyIpNetPhysAddr().

◆ SnmpExtensionInit()

BOOL WINAPI SnmpExtensionInit ( DWORD  dwUptimeReference,
HANDLE phSubagentTrapEvent,
AsnObjectIdentifier pFirstSupportedRegion 
)

Definition at line 1313 of file main.c.

1315 {
1317  UINT i;
1318 
1319  TRACE("(%d, %p, %p)\n", dwUptimeReference, phSubagentTrapEvent,
1320  pFirstSupportedRegion);
1321 
1323  for (i = 0; i < ARRAY_SIZE(supportedIDs); i++)
1324  {
1325  if (supportedIDs[i].init)
1326  supportedIDs[i].init();
1327  if (supportedIDs[i].name.idLength < minSupportedIDLength)
1328  minSupportedIDLength = supportedIDs[i].name.idLength;
1329  }
1330  *phSubagentTrapEvent = NULL;
1331  SnmpUtilOidCpy(pFirstSupportedRegion, &myOid);
1332  return TRUE;
1333 }
#define TRUE
Definition: types.h:120
static struct mibImplementation supportedIDs[]
Definition: main.c:1292
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
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
static UINT mib2System[]
Definition: main.c:84
#define TRACE(s)
Definition: solgame.cpp:4
#define DEFINE_OID(x)
Definition: snmp.h:180
static BOOL init(void)
Definition: main.c:59
#define UINT_MAX
Definition: limits.h:41
#define ARRAY_SIZE(a)
Definition: main.h:24
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:38
INT WINAPI SnmpUtilOidCpy(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:319
static UINT minSupportedIDLength
Definition: main.c:1308

◆ SnmpExtensionQuery()

BOOL WINAPI SnmpExtensionQuery ( BYTE  bPduType,
SnmpVarBindList pVarBindList,
AsnInteger32 pErrorStatus,
AsnInteger32 pErrorIndex 
)

Definition at line 1372 of file main.c.

1374 {
1375  AsnObjectIdentifier mib2oid = DEFINE_OID(mib2);
1376  AsnInteger32 error = SNMP_ERRORSTATUS_NOERROR, errorIndex = 0;
1377  UINT i;
1378  BOOL ret = TRUE;
1379 
1380  TRACE("(0x%02x, %p, %p, %p)\n", bPduType, pVarBindList,
1381  pErrorStatus, pErrorIndex);
1382 
1383  for (i = 0; !error && i < pVarBindList->len; i++)
1384  {
1385  /* Ignore any OIDs not in MIB2 */
1386  if (!SnmpUtilOidNCmp(&pVarBindList->list[i].name, &mib2oid,
1387  mib2oid.idLength))
1388  {
1389  struct mibImplementation *impl = NULL;
1390  UINT len, matchingIndex = 0;
1391 
1392  TRACE("%s\n", SnmpUtilOidToA(&pVarBindList->list[i].name));
1393  /* Search for an implementation matching as many octets as possible
1394  */
1395  for (len = pVarBindList->list[i].name.idLength;
1396  len >= minSupportedIDLength && !impl; len--)
1397  impl = findSupportedQuery(pVarBindList->list[i].name.ids, len,
1398  &matchingIndex);
1399  if (impl && impl->query)
1400  ret = impl->query(bPduType, &pVarBindList->list[i], &error);
1401  else
1404  bPduType == SNMP_PDU_GETNEXT)
1405  {
1406  /* GetNext is special: it finds the successor to the given OID,
1407  * so we have to continue until an implementation handles the
1408  * query or we exhaust the table of supported OIDs.
1409  */
1410  for (matchingIndex++; error == SNMP_ERRORSTATUS_NOSUCHNAME &&
1411  matchingIndex < DEFINE_SIZEOF(supportedIDs);
1412  matchingIndex++)
1413  {
1415  impl = &supportedIDs[matchingIndex];
1416  if (impl->query)
1417  ret = impl->query(bPduType, &pVarBindList->list[i],
1418  &error);
1419  else
1421  }
1422  /* If the query still isn't resolved, set the OID to the
1423  * successor to the last entry in the table.
1424  */
1426  {
1427  SnmpUtilOidFree(&pVarBindList->list[i].name);
1428  ret = SnmpUtilOidCpy(&pVarBindList->list[i].name,
1429  &supportedIDs[matchingIndex - 1].name);
1430  pVarBindList->list[i].name.ids[
1431  pVarBindList->list[i].name.idLength - 1] += 1;
1432  }
1433  }
1434  if (error)
1435  errorIndex = i + 1;
1436  }
1437  }
1438  *pErrorStatus = error;
1439  *pErrorIndex = errorIndex;
1440  return ret;
1441 }
LONG AsnInteger32
Definition: snmp.h:40
#define TRUE
Definition: types.h:120
UINT * ids
Definition: snmp.h:37
#define error(str)
Definition: mkdosfs.c:1605
AsnObjectName name
Definition: snmp.h:76
static struct mibImplementation supportedIDs[]
Definition: main.c:1292
UINT len
Definition: snmp.h:82
static UINT mib2[]
Definition: main.c:83
VOID WINAPI SnmpUtilOidFree(AsnObjectIdentifier *oid)
Definition: main.c:344
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:534
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
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
varqueryfunc query
Definition: main.c:93
#define TRACE(s)
Definition: solgame.cpp:4
INT WINAPI SnmpUtilOidNCmp(AsnObjectIdentifier *oid1, AsnObjectIdentifier *oid2, UINT count)
Definition: main.c:358
#define DEFINE_OID(x)
Definition: snmp.h:180
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
SnmpVarBind * list
Definition: snmp.h:81
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179
static struct mibImplementation * findSupportedQuery(UINT *ids, UINT idLength, UINT *matchingIndex)
Definition: main.c:1344
INT WINAPI SnmpUtilOidCpy(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:319
static UINT minSupportedIDLength
Definition: main.c:1308

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( inetmib1  )

Variable Documentation

◆ icmpStats

MIB_ICMP icmpStats
static

Definition at line 1003 of file main.c.

Referenced by mib2IcmpInit(), and mib2IcmpQuery().

◆ ifTable

PMIB_IFTABLE ifTable
static

Definition at line 98 of file main.c.

Referenced by mib2IfEntryQuery(), mib2IfNumberCleanup(), mib2IfNumberInit(), and mib2IfNumberQuery().

◆ ipAddrTable

PMIB_IPADDRTABLE ipAddrTable
static

Definition at line 735 of file main.c.

Referenced by mib2IpAddrCleanup(), mib2IpAddrInit(), and mib2IpAddrQuery().

◆ ipNetTable

PMIB_IPNETTABLE ipNetTable
static

Definition at line 914 of file main.c.

Referenced by mib2IpNetCleanup(), mib2IpNetInit(), and mib2IpNetQuery().

◆ ipRouteTable

PMIB_IPFORWARDTABLE ipRouteTable
static

Definition at line 821 of file main.c.

Referenced by mib2IpRouteCleanup(), mib2IpRouteInit(), and mib2IpRouteQuery().

◆ ipStats

MIB_IPSTATS ipStats
static

Definition at line 666 of file main.c.

Referenced by mib2IpStatsInit(), and mib2IpStatsQuery().

◆ mib2

UINT mib2[] = { 1,3,6,1,2,1 }
static

Definition at line 83 of file main.c.

Referenced by SnmpExtensionQuery().

◆ mib2Icmp

UINT mib2Icmp[] = { 1,3,6,1,2,1,5 }
static

Definition at line 1002 of file main.c.

Referenced by mib2IcmpQuery().

◆ mib2IcmpMap

struct structToAsnValue mib2IcmpMap[]
static
Initial value:
= {
{ FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwMsgs), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwErrors), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwDestUnreachs), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwTimeExcds), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwParmProbs), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwSrcQuenchs), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwRedirects), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwEchos), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwEchoReps), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwTimestamps), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwTimestampReps), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwAddrMasks), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpInStats.dwAddrMaskReps), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwMsgs), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwErrors), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwDestUnreachs), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwTimeExcds), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwParmProbs), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwSrcQuenchs), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwRedirects), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwEchos), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwEchoReps), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwTimestamps), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwTimestampReps), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwAddrMasks), copyInt },
{ FIELD_OFFSET(MIBICMPINFO, icmpOutStats.dwAddrMaskReps), copyInt },
}
static DWORD copyInt(AsnAny *value, void *src)
Definition: main.c:37
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 1010 of file main.c.

Referenced by mib2IcmpQuery().

◆ mib2IfEntry

UINT mib2IfEntry[] = { 1,3,6,1,2,1,2,2,1 }
static

Definition at line 607 of file main.c.

Referenced by mib2IfEntryQuery().

◆ mib2IfEntryMap

struct structToAsnValue mib2IfEntryMap[]
static
Initial value:
= {
{ FIELD_OFFSET(MIB_IFROW, dwIndex), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwSpeed), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwAdminStatus), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwOperStatus), copyOperStatus },
{ FIELD_OFFSET(MIB_IFROW, dwLastChange), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwInOctets), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwInUcastPkts), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwInNUcastPkts), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwInDiscards), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwInErrors), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwInUnknownProtos), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwOutOctets), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwOutUcastPkts), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwOutNUcastPkts), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwOutDiscards), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwOutErrors), copyInt },
{ FIELD_OFFSET(MIB_IFROW, dwOutQLen), copyInt },
}
static DWORD copyInt(AsnAny *value, void *src)
Definition: main.c:37
static DWORD copyOperStatus(AsnAny *value, void *src)
Definition: main.c:167
static DWORD copyIfRowDescr(AsnAny *value, void *src)
Definition: main.c:550
static DWORD copyIfRowPhysAddr(AsnAny *value, void *src)
Definition: main.c:566
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 583 of file main.c.

Referenced by mib2IfEntryQuery().

◆ mib2IfNumber

UINT mib2IfNumber[] = { 1,3,6,1,2,1,2,1 }
static

Definition at line 97 of file main.c.

Referenced by mib2IfNumberQuery().

◆ mib2Ip

UINT mib2Ip[] = { 1,3,6,1,2,1,4 }
static

Definition at line 665 of file main.c.

Referenced by mib2IpStatsQuery().

◆ mib2IpAddr

UINT mib2IpAddr[] = { 1,3,6,1,2,1,4,20,1 }
static

Definition at line 734 of file main.c.

Referenced by mib2IpAddrQuery(), and testQuery().

◆ mib2IpAddrMap

struct structToAsnValue mib2IpAddrMap[]
static
Initial value:
= {
{ FIELD_OFFSET(MIB_IPADDRROW, dwBCastAddr), copyInt },
{ FIELD_OFFSET(MIB_IPADDRROW, dwReasmSize), copyInt },
}
static DWORD copyInt(AsnAny *value, void *src)
Definition: main.c:37
static DWORD copyIpAddr(AsnAny *value, void *src)
Definition: main.c:77
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 737 of file main.c.

Referenced by mib2IpAddrQuery().

◆ mib2IpMap

struct structToAsnValue mib2IpMap[]
static
Initial value:
= {
{ FIELD_OFFSET(MIB_IPSTATS, u.dwForwarding), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwDefaultTTL), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwInReceives), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwInHdrErrors), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwInAddrErrors), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwForwDatagrams), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwInUnknownProtos), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwInDiscards), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwInDelivers), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwOutRequests), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwOutDiscards), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwOutNoRoutes), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwReasmTimeout), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwReasmReqds), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwReasmOks), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwReasmFails), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwFragOks), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwFragFails), copyInt },
{ FIELD_OFFSET(MIB_IPSTATS, dwFragCreates), copyInt },
{ 0, NULL },
{ 0, NULL },
{ 0, NULL },
{ FIELD_OFFSET(MIB_IPSTATS, dwRoutingDiscards), copyInt },
}
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 * u
Definition: glfuncs.h:240
static DWORD copyInt(AsnAny *value, void *src)
Definition: main.c:37
smooth NULL
Definition: ftsmooth.c:416
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 673 of file main.c.

Referenced by mib2IpStatsQuery().

◆ mib2IpNet

UINT mib2IpNet[] = { 1,3,6,1,2,1,4,22,1 }
static

Definition at line 913 of file main.c.

Referenced by mib2IpNetQuery().

◆ mib2IpNetMap

struct structToAsnValue mib2IpNetMap[]
static
Initial value:
= {
}
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 * u
Definition: glfuncs.h:240
static DWORD copyInt(AsnAny *value, void *src)
Definition: main.c:37
static DWORD copyIpAddr(AsnAny *value, void *src)
Definition: main.c:77
static DWORD copyIpNetPhysAddr(AsnAny *value, void *src)
Definition: main.c:916
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 925 of file main.c.

Referenced by mib2IpNetQuery().

◆ mib2IpRoute

UINT mib2IpRoute[] = { 1,3,6,1,2,1,4,21,1 }
static

Definition at line 820 of file main.c.

Referenced by mib2IpRouteQuery().

◆ mib2IpRouteMap

struct structToAsnValue mib2IpRouteMap[]
static
Initial value:
= {
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardIfIndex), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric1), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric2), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric3), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric4), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardNextHop), copyIpAddr },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardAge), copyInt },
{ FIELD_OFFSET(MIB_IPFORWARDROW, dwForwardMetric5), copyInt },
}
GLdouble GLdouble u2
Definition: glext.h:8308
static DWORD copyInt(AsnAny *value, void *src)
Definition: main.c:37
DWORD dwForwardType
Definition: ipmib.h:78
GLdouble u1
Definition: glext.h:8308
static DWORD copyIpAddr(AsnAny *value, void *src)
Definition: main.c:77
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
DWORD dwForwardProto
Definition: ipmib.h:83

Definition at line 823 of file main.c.

Referenced by mib2IpRouteQuery().

◆ mib2System

UINT mib2System[] = { 1,3,6,1,2,1,1 }
static

Definition at line 84 of file main.c.

Referenced by SnmpExtensionInit(), and testQuery().

◆ mib2Tcp

UINT mib2Tcp[] = { 1,3,6,1,2,1,6 }
static

Definition at line 1075 of file main.c.

Referenced by mib2TcpQuery().

◆ mib2TcpMap

struct structToAsnValue mib2TcpMap[]
static
Initial value:
= {
{ FIELD_OFFSET(MIB_TCPSTATS, u.dwRtoAlgorithm), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwMaxConn), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwActiveOpens), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwPassiveOpens), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwAttemptFails), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwEstabResets), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwCurrEstab), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwOutSegs), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwRetransSegs), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwOutRsts), copyInt },
{ FIELD_OFFSET(MIB_TCPSTATS, dwNumConns), copyInt },
}
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 * u
Definition: glfuncs.h:240
static DWORD copyInt(AsnAny *value, void *src)
Definition: main.c:37
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 1083 of file main.c.

Referenced by mib2TcpQuery().

◆ mib2Udp

UINT mib2Udp[] = { 1,3,6,1,2,1,7 }
static

Definition at line 1136 of file main.c.

Referenced by mib2UdpQuery().

◆ mib2UdpEntry

UINT mib2UdpEntry[] = { 1,3,6,1,2,1,7,5,1 }
static

Definition at line 1186 of file main.c.

Referenced by mib2UdpEntryQuery().

◆ mib2UdpEntryMap

struct structToAsnValue mib2UdpEntryMap[]
static
Initial value:
= {
{ FIELD_OFFSET(MIB_UDPROW, dwLocalAddr), copyIpAddr },
{ FIELD_OFFSET(MIB_UDPROW, dwLocalPort), copyInt },
}
static DWORD copyInt(AsnAny *value, void *src)
Definition: main.c:37
static DWORD copyIpAddr(AsnAny *value, void *src)
Definition: main.c:77
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 1209 of file main.c.

Referenced by mib2UdpEntryQuery().

◆ mib2UdpMap

struct structToAsnValue mib2UdpMap[]
static
Initial value:
= {
{ FIELD_OFFSET(MIB_UDPSTATS, dwInDatagrams), copyInt },
{ FIELD_OFFSET(MIB_UDPSTATS, dwNoPorts), copyInt },
{ FIELD_OFFSET(MIB_UDPSTATS, dwInErrors), copyInt },
{ FIELD_OFFSET(MIB_UDPSTATS, dwOutDatagrams), copyInt },
}
static DWORD copyInt(AsnAny *value, void *src)
Definition: main.c:37
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 1144 of file main.c.

Referenced by mib2UdpQuery().

◆ minSupportedIDLength

UINT minSupportedIDLength
static

Definition at line 1308 of file main.c.

Referenced by SnmpExtensionInit(), and SnmpExtensionQuery().

◆ supportedIDs

struct mibImplementation supportedIDs[]
static
Initial value:
= {
}
static void mib2IpAddrInit(void)
Definition: main.c:745
static void mib2IcmpInit(void)
Definition: main.c:1005
static BOOL mib2TcpQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:1101
static void mib2UdpEntryCleanup(void)
Definition: main.c:1204
static UINT mib2IfEntry[]
Definition: main.c:607
static UINT mib2Ip[]
Definition: main.c:665
static BOOL mib2IpAddrQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:779
static BOOL mib2IpNetQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:952
static void mib2IpRouteInit(void)
Definition: main.c:838
static UINT mib2Icmp[]
Definition: main.c:1002
static UINT mib2IpRoute[]
Definition: main.c:820
static void mib2IfNumberCleanup(void)
Definition: main.c:115
static BOOL mib2IcmpQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:1039
static void mib2IpStatsInit(void)
Definition: main.c:668
smooth NULL
Definition: ftsmooth.c:416
static void mib2UdpInit(void)
Definition: main.c:1139
static UINT mib2IpNet[]
Definition: main.c:913
#define DEFINE_OID(x)
Definition: snmp.h:180
static BOOL mib2UdpQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:1151
static UINT mib2UdpEntry[]
Definition: main.c:1186
static BOOL mib2IfNumberQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:120
static void mib2IpAddrCleanup(void)
Definition: main.c:760
static BOOL mib2UdpEntryQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:1234
static BOOL mib2IpStatsQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:699
static void mib2IpRouteCleanup(void)
Definition: main.c:853
static void mib2IfNumberInit(void)
Definition: main.c:100
static void mib2IpNetInit(void)
Definition: main.c:932
static UINT mib2Udp[]
Definition: main.c:1136
static void mib2IpNetCleanup(void)
Definition: main.c:947
static UINT mib2IpAddr[]
Definition: main.c:734
static void mib2UdpEntryInit(void)
Definition: main.c:1189
static BOOL mib2IpRouteQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:872
static BOOL mib2IfEntryQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:609
static UINT mib2IfNumber[]
Definition: main.c:97
static void mib2TcpInit(void)
Definition: main.c:1078
static UINT mib2Tcp[]
Definition: main.c:1075

Definition at line 1292 of file main.c.

Referenced by cleanup(), findSupportedQuery(), SnmpExtensionInit(), and SnmpExtensionQuery().

◆ tcpStats

MIB_TCPSTATS tcpStats
static

Definition at line 1076 of file main.c.

Referenced by mib2TcpInit(), mib2TcpQuery(), and ShowTcpStatistics().

◆ udpStats

MIB_UDPSTATS udpStats
static

Definition at line 1137 of file main.c.

Referenced by mib2UdpInit(), mib2UdpQuery(), and ShowUdpStatistics().

◆ udpTable

PMIB_UDPTABLE udpTable
static

Definition at line 1187 of file main.c.

Referenced by mib2UdpEntryCleanup(), mib2UdpEntryInit(), mib2UdpEntryQuery(), and ShowUdpTable().