ReactOS  0.4.14-dev-77-gd9e7c48
main.c File Reference
#include "config.h"
#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(* compareFunc) (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 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 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 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 25 of file main.c.

Typedef Documentation

◆ compareFunc

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

Definition at line 322 of file main.c.

◆ copyValueFunc

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

Definition at line 56 of file main.c.

◆ oidToKeyFunc

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

Definition at line 321 of file main.c.

◆ varqueryfunc

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

Definition at line 87 of file main.c.

Function Documentation

◆ cleanup()

static void cleanup ( void  )
static

Definition at line 1336 of file main.c.

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

Referenced by DllMain().

◆ compareIpAddrRow()

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

Definition at line 773 of file main.c.

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

Referenced by mib2IpAddrQuery().

◆ compareIpForwardRow()

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

Definition at line 866 of file main.c.

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

Referenced by mib2IpRouteQuery().

◆ compareUdpRow()

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

Definition at line 1224 of file main.c.

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

Referenced by mib2UdpEntryQuery().

◆ copyIfRowDescr()

static DWORD copyIfRowDescr ( AsnAny value,
void src 
)
static

Definition at line 551 of file main.c.

552 {
553  PMIB_IFROW row = (PMIB_IFROW)((BYTE *)src -
554  FIELD_OFFSET(MIB_IFROW, dwDescrLen));
555  DWORD ret;
556 
557  if (row->dwDescrLen)
558  {
559  setStringValue(value, ASN_OCTETSTRING, row->dwDescrLen, row->bDescr);
561  }
562  else
564  return ret;
565 }
static void setStringValue(AsnAny *value, BYTE type, DWORD len, BYTE *str)
Definition: main.c:45
#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 567 of file main.c.

568 {
569  PMIB_IFROW row = (PMIB_IFROW)((BYTE *)src -
570  FIELD_OFFSET(MIB_IFROW, dwPhysAddrLen));
571  DWORD ret;
572 
573  if (row->dwPhysAddrLen)
574  {
575  setStringValue(value, ASN_OCTETSTRING, row->dwPhysAddrLen,
576  row->bPhysAddr);
578  }
579  else
581  return ret;
582 }
static void setStringValue(AsnAny *value, BYTE type, DWORD len, BYTE *str)
Definition: main.c:45
#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 38 of file main.c.

39 {
40  value->asnType = ASN_INTEGER;
41  value->asnValue.number = *(DWORD *)src;
43 }
#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 78 of file main.c.

79 {
82 }
static void setStringValue(AsnAny *value, BYTE type, DWORD len, BYTE *str)
Definition: main.c:45
#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 917 of file main.c.

918 {
920  dwPhysAddrLen));
921 
922  setStringValue(value, ASN_OCTETSTRING, row->dwPhysAddrLen, row->bPhysAddr);
924 }
static void setStringValue(AsnAny *value, BYTE type, DWORD len, BYTE *str)
Definition: main.c:45
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 168 of file main.c.

169 {
170  value->asnType = ASN_INTEGER;
171  /* The IPHlpApi definition of operational status differs from the MIB2 one,
172  * so map it to the MIB2 value.
173  */
174  switch (*(DWORD *)src)
175  {
177  value->asnValue.number = MIB_IF_ADMIN_STATUS_UP;
178  break;
181  value->asnValue.number = MIB_IF_ADMIN_STATUS_TESTING;
182  break;
183  default:
184  value->asnValue.number = MIB_IF_ADMIN_STATUS_DOWN;
185  };
187 }
#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 1447 of file main.c.

1448 {
1449  TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved);
1450 
1451  switch (fdwReason)
1452  {
1453  case DLL_PROCESS_ATTACH:
1454  DisableThreadLibraryCalls(hinstDLL);
1455  break;
1456  case DLL_PROCESS_DETACH:
1457  if (lpvReserved) break;
1458  cleanup();
1459  break;
1460  }
1461 
1462  return TRUE;
1463 }
#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:1336
#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 366 of file main.c.

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

Referenced by getItemAndInstanceFromTable().

◆ findOidInTable()

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

Definition at line 344 of file main.c.

347 {
348  UINT index = 0;
349  void *key = HeapAlloc(GetProcessHeap(), 0, tableEntrySize);
350 
351  if (key)
352  {
353  makeKey(oid, key);
354  index = findValueInTable(key, table, tableEntrySize, compare);
355  HeapFree(GetProcessHeap(), 0, key);
356  }
357  return index;
358 }
Definition: bug.cpp:7
static UINT findValueInTable(const void *key, struct GenericTable *table, size_t tableEntrySize, compareFunc compare)
Definition: main.c:327
GLuint index
Definition: glext.h:6031
#define GetProcessHeap()
Definition: compat.h:395
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:394
Definition: path.c:42

Referenced by getItemAndInstanceFromTable().

◆ findSupportedQuery()

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

Definition at line 1345 of file main.c.

1347 {
1348  int indexHigh = DEFINE_SIZEOF(supportedIDs) - 1, indexLow = 0;
1349  AsnObjectIdentifier oid1 = { idLength, ids};
1350 
1351  if (!idLength)
1352  return NULL;
1353 
1354  while (indexLow <= indexHigh)
1355  {
1356  INT cmp, i = (indexLow + indexHigh) / 2;
1357  if (!(cmp = SnmpUtilOidNCmp(&oid1, &supportedIDs[i].name, idLength)))
1358  {
1359  *matchingIndex = i;
1360  return &supportedIDs[i];
1361  }
1362  if (cmp > 0)
1363  indexLow = i + 1;
1364  else
1365  indexHigh = i - 1;
1366  }
1367  return NULL;
1368 }
static struct mibImplementation supportedIDs[]
Definition: main.c:1293
#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:360
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179
Definition: name.c:36
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 327 of file main.c.

329 {
330  UINT index = 0;
331  void *value;
332 
333  value = bsearch(key, table->entries, table->numEntries, tableEntrySize,
334  compare);
335  if (value)
336  index = ((BYTE *)value - (BYTE *)table->entries) / tableEntrySize + 1;
337  return index;
338 }
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:42
#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 411 of file main.c.

415 {
417 
418  if (!table)
420 
421  switch (bPduType)
422  {
423  case SNMP_PDU_GETNEXT:
424  if (SnmpUtilOidNCmp(oid, base, base->idLength) < 0)
425  {
426  /* Return the first item and instance from the table */
427  *item = 1;
428  *instance = 1;
429  }
430  else if (!SnmpUtilOidNCmp(oid, base, base->idLength) &&
431  oid->idLength < base->idLength + instanceLen + 1)
432  {
433  /* Either the table or an item is specified, but the instance is
434  * not.
435  */
436  *instance = 1;
437  if (oid->idLength >= base->idLength + 1)
438  {
439  *item = oid->ids[base->idLength];
440  if (!*item)
441  *item = 1;
442  }
443  else
444  *item = 1;
445  }
446  else if (!SnmpUtilOidNCmp(oid, base, base->idLength) &&
447  oid->idLength == base->idLength + instanceLen + 1)
448  {
449  *item = oid->ids[base->idLength];
450  if (!*item)
451  {
452  *instance = 1;
453  *item = 1;
454  }
455  else
456  {
457  AsnObjectIdentifier instanceOid = { instanceLen,
458  oid->ids + base->idLength + 1 };
459 
460  *instance = findNextOidInTable(&instanceOid, table,
461  tableEntrySize, makeKey, compare);
462  if (!*instance || *instance > table->numEntries)
464  }
465  }
466  else
468  break;
469  default:
470  if (!SnmpUtilOidNCmp(oid, base, base->idLength) &&
471  oid->idLength == base->idLength + instanceLen + 1)
472  {
473  *item = oid->ids[base->idLength];
474  if (!*item)
476  else
477  {
478  AsnObjectIdentifier instanceOid = { instanceLen,
479  oid->ids + base->idLength + 1 };
480 
481  *instance = findOidInTable(&instanceOid, table, tableEntrySize,
482  makeKey, compare);
483  if (!*instance)
485  }
486  }
487  else
489  }
490  return ret;
491 }
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:366
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
INT WINAPI SnmpUtilOidNCmp(AsnObjectIdentifier *oid1, AsnObjectIdentifier *oid2, UINT count)
Definition: main.c:360
#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:344
#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 197 of file main.c.

199 {
201 
202  switch (bPduType)
203  {
204  case SNMP_PDU_GETNEXT:
205  if (SnmpUtilOidNCmp(oid, base, base->idLength) < 0)
206  {
207  *item = 1;
208  *instance = 1;
209  }
210  else if (!SnmpUtilOidNCmp(oid, base, base->idLength))
211  {
212  if (oid->idLength == base->idLength ||
213  oid->idLength == base->idLength + 1)
214  {
215  /* Either the table or an item within the table is specified,
216  * but the instance is not. Get the first instance.
217  */
218  *instance = 1;
219  if (oid->idLength == base->idLength + 1)
220  *item = oid->ids[base->idLength];
221  else
222  *item = 1;
223  }
224  else
225  {
226  *item = oid->ids[base->idLength];
227  *instance = oid->ids[base->idLength + 1] + 1;
228  }
229  }
230  else
232  break;
233  default:
234  if (!SnmpUtilOidNCmp(oid, base, base->idLength))
235  {
236  if (oid->idLength == base->idLength ||
237  oid->idLength == base->idLength + 1)
238  {
239  /* Either the table or an item within the table is specified,
240  * but the instance is not.
241  */
243  }
244  else
245  {
246  *item = oid->ids[base->idLength];
247  *instance = oid->ids[base->idLength + 1];
248  }
249  }
250  else
252  }
253  return ret;
254 }
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:360
#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 263 of file main.c.

265 {
267 
268  switch (bPduType)
269  {
270  case SNMP_PDU_GETNEXT:
271  if (SnmpUtilOidNCmp(oid, base, base->idLength) < 0)
272  *item = 1;
273  else if (!SnmpUtilOidNCmp(oid, base, base->idLength))
274  {
275  if (oid->idLength == base->idLength)
276  {
277  /* The item is missing, assume the first item */
278  *item = 1;
279  }
280  else
281  *item = oid->ids[base->idLength] + 1;
282  }
283  else
285  break;
286  default:
287  if (!SnmpUtilOidNCmp(oid, base, base->idLength))
288  {
289  if (oid->idLength == base->idLength)
290  {
291  /* The item is missing */
293  }
294  else
295  {
296  *item = oid->ids[base->idLength];
297  if (!*item)
299  }
300  }
301  else
303  }
304  return ret;
305 }
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:360
#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 64 of file main.c.

66 {
67  /* OIDs are 1-based */
68  if (!id)
70  --id;
71  if (id >= mapLen)
73  if (!map[id].copy)
75  return map[id].copy(&pVarBind->value, (BYTE *)record + map[id].offset);
76 }
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:4909

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

◆ mib2IcmpInit()

static void mib2IcmpInit ( void  )
static

Definition at line 1006 of file main.c.

1007 {
1009 }
static MIB_ICMP icmpStats
Definition: main.c:1004
DWORD WINAPI GetIcmpStatistics(PMIB_ICMP pStats)

◆ mib2IcmpQuery()

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

Definition at line 1040 of file main.c.

1042 {
1044  UINT item = 0;
1045  BOOL ret = TRUE;
1046 
1047  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
1048  pErrorStatus);
1049 
1050  switch (bPduType)
1051  {
1052  case SNMP_PDU_GET:
1053  case SNMP_PDU_GETNEXT:
1054  *pErrorStatus = getItemFromOid(&pVarBind->name, &myOid, bPduType,
1055  &item);
1056  if (!*pErrorStatus)
1057  {
1058  *pErrorStatus = mapStructEntryToValue(mib2IcmpMap,
1060  pVarBind);
1061  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
1062  ret = setOidWithItem(&pVarBind->name, &myOid, item);
1063  }
1064  break;
1065  case SNMP_PDU_SET:
1066  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
1067  ret = FALSE;
1068  break;
1069  default:
1070  FIXME("0x%02x: unsupported PDU type\n", bPduType);
1071  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
1072  }
1073  return ret;
1074 }
#define SNMP_ERRORSTATUS_READONLY
Definition: snmp.h:137
#define TRUE
Definition: types.h:120
static struct structToAsnValue mib2IcmpMap[]
Definition: main.c:1011
AsnObjectName name
Definition: snmp.h:76
static MIB_ICMP icmpStats
Definition: main.c:1004
#define SNMP_PDU_GET
Definition: snmp.h:94
static UINT mib2Icmp[]
Definition: main.c:1003
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:536
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:64
#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:493
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:263

◆ mib2IfEntryQuery()

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

Definition at line 610 of file main.c.

612 {
614  BOOL ret = TRUE;
615 
616  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
617  pErrorStatus);
618 
619  switch (bPduType)
620  {
621  case SNMP_PDU_GET:
622  case SNMP_PDU_GETNEXT:
623  if (!ifTable)
624  {
625  /* There is no interface present, so let the caller deal
626  * with finding the successor.
627  */
628  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
629  }
630  else
631  {
632  UINT tableIndex = 0, item = 0;
633 
634  *pErrorStatus = getItemAndIntegerInstanceFromOid(&pVarBind->name,
635  &entryOid, bPduType, &item, &tableIndex);
636  if (!*pErrorStatus)
637  {
638  assert(tableIndex);
639  assert(item);
640  if (tableIndex > ifTable->dwNumEntries)
641  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
642  else
643  {
644  *pErrorStatus = mapStructEntryToValue(mib2IfEntryMap,
646  &ifTable->table[tableIndex - 1], item,
647  pVarBind);
648  if (bPduType == SNMP_PDU_GETNEXT)
649  ret = setOidWithItemAndInteger(&pVarBind->name,
650  &entryOid, item, tableIndex);
651  }
652  }
653  }
654  break;
655  case SNMP_PDU_SET:
656  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
657  ret = FALSE;
658  break;
659  default:
660  FIXME("0x%02x: unsupported PDU type\n", bPduType);
661  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
662  }
663  return ret;
664 }
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:608
AsnObjectName name
Definition: snmp.h:76
static AsnInteger32 getItemAndIntegerInstanceFromOid(AsnObjectIdentifier *oid, AsnObjectIdentifier *base, BYTE bPduType, UINT *item, UINT *instance)
Definition: main.c:197
#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:535
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:536
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:64
#define TRACE(s)
Definition: solgame.cpp:4
static struct structToAsnValue mib2IfEntryMap[]
Definition: main.c:584
#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:99

◆ mib2IfNumberCleanup()

static void mib2IfNumberCleanup ( void  )
static

Definition at line 116 of file main.c.

117 {
119 }
#define GetProcessHeap()
Definition: compat.h:395
static PMIB_IFTABLE ifTable
Definition: main.c:99
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ mib2IfNumberInit()

static void mib2IfNumberInit ( void  )
static

Definition at line 101 of file main.c.

102 {
103  DWORD size = 0, ret = GetIfTable(NULL, &size, FALSE);
104 
106  {
108  if (table)
109  {
110  if (!GetIfTable(table, &size, FALSE)) ifTable = table;
111  else HeapFree(GetProcessHeap(), 0, table );
112  }
113  }
114 }
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:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static PMIB_IFTABLE ifTable
Definition: main.c:99
#define HeapFree(x, y, z)
Definition: compat.h:394
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

◆ mib2IfNumberQuery()

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

Definition at line 121 of file main.c.

123 {
125  BOOL ret = TRUE;
126 
127  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
128  pErrorStatus);
129 
130  switch (bPduType)
131  {
132  case SNMP_PDU_GET:
133  case SNMP_PDU_GETNEXT:
134  if ((bPduType == SNMP_PDU_GET &&
135  !SnmpUtilOidNCmp(&pVarBind->name, &numberOid, numberOid.idLength))
136  || SnmpUtilOidNCmp(&pVarBind->name, &numberOid, numberOid.idLength)
137  < 0)
138  {
139  DWORD numIfs = ifTable ? ifTable->dwNumEntries : 0;
140 
141  copyInt(&pVarBind->value, &numIfs);
142  if (bPduType == SNMP_PDU_GETNEXT)
143  {
144  SnmpUtilOidFree(&pVarBind->name);
145  SnmpUtilOidCpy(&pVarBind->name, &numberOid);
146  }
147  *pErrorStatus = SNMP_ERRORSTATUS_NOERROR;
148  }
149  else
150  {
151  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
152  /* Caller deals with OID if bPduType == SNMP_PDU_GETNEXT, so don't
153  * need to set it here.
154  */
155  }
156  break;
157  case SNMP_PDU_SET:
158  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
159  ret = FALSE;
160  break;
161  default:
162  FIXME("0x%02x: unsupported PDU type\n", bPduType);
163  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
164  }
165  return ret;
166 }
#define SNMP_ERRORSTATUS_READONLY
Definition: snmp.h:137
#define TRUE
Definition: types.h:120
static DWORD copyInt(AsnAny *value, void *src)
Definition: main.c:38
AsnObjectName name
Definition: snmp.h:76
#define SNMP_PDU_GET
Definition: snmp.h:94
VOID WINAPI SnmpUtilOidFree(AsnObjectIdentifier *oid)
Definition: main.c:346
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:536
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:360
#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:99
INT WINAPI SnmpUtilOidCpy(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:321
static UINT mib2IfNumber[]
Definition: main.c:98

◆ mib2IpAddrCleanup()

static void mib2IpAddrCleanup ( void  )
static

Definition at line 761 of file main.c.

762 {
764 }
static PMIB_IPADDRTABLE ipAddrTable
Definition: main.c:736
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ mib2IpAddrInit()

static void mib2IpAddrInit ( void  )
static

Definition at line 746 of file main.c.

747 {
749 
751  {
753  if (table)
754  {
756  else HeapFree(GetProcessHeap(), 0, table );
757  }
758  }
759 }
static PMIB_IPADDRTABLE ipAddrTable
Definition: main.c:736
#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:395
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:394
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

◆ mib2IpAddrQuery()

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

Definition at line 780 of file main.c.

782 {
784  UINT tableIndex = 0, item = 0;
785  BOOL ret = TRUE;
786 
787  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
788  pErrorStatus);
789 
790  switch (bPduType)
791  {
792  case SNMP_PDU_GET:
793  case SNMP_PDU_GETNEXT:
794  *pErrorStatus = getItemAndInstanceFromTable(&pVarBind->name,
795  &myOid, 4, bPduType, (struct GenericTable *)ipAddrTable,
797  &tableIndex);
798  if (!*pErrorStatus)
799  {
800  assert(tableIndex);
801  assert(item);
802  *pErrorStatus = mapStructEntryToValue(mib2IpAddrMap,
804  &ipAddrTable->table[tableIndex - 1], item, pVarBind);
805  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
806  ret = setOidWithItemAndIpAddr(&pVarBind->name, &myOid, item,
807  ipAddrTable->table[tableIndex - 1].dwAddr);
808  }
809  break;
810  case SNMP_PDU_SET:
811  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
812  ret = FALSE;
813  break;
814  default:
815  FIXME("0x%02x: unsupported PDU type\n", bPduType);
816  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
817  }
818  return ret;
819 }
static INT setOidWithItemAndIpAddr(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item, DWORD addr)
Definition: main.c:512
static PMIB_IPADDRTABLE ipAddrTable
Definition: main.c:736
#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 compareIpAddrRow(const void *a, const void *b)
Definition: main.c:773
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:536
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:64
static struct structToAsnValue mib2IpAddrMap[]
Definition: main.c:738
#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:411
#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:766
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:735
DWORD dwAddr
Definition: ipmib.h:36
MIB_IPADDRROW table[1]
Definition: ipmib.h:48

◆ mib2IpNetCleanup()

static void mib2IpNetCleanup ( void  )
static

Definition at line 948 of file main.c.

949 {
951 }
#define GetProcessHeap()
Definition: compat.h:395
static PMIB_IPNETTABLE ipNetTable
Definition: main.c:915
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ mib2IpNetInit()

static void mib2IpNetInit ( void  )
static

Definition at line 933 of file main.c.

934 {
936 
938  {
940  if (table)
941  {
943  else HeapFree(GetProcessHeap(), 0, table );
944  }
945  }
946 }
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:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static PMIB_IPNETTABLE ipNetTable
Definition: main.c:915
#define HeapFree(x, y, z)
Definition: compat.h:394
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

◆ mib2IpNetQuery()

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

Definition at line 953 of file main.c.

955 {
957  BOOL ret = TRUE;
958 
959  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
960  pErrorStatus);
961 
962  switch (bPduType)
963  {
964  case SNMP_PDU_GET:
965  case SNMP_PDU_GETNEXT:
966  if (!ipNetTable)
967  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
968  else
969  {
970  UINT tableIndex = 0, item = 0;
971 
972  *pErrorStatus = getItemAndIntegerInstanceFromOid(&pVarBind->name,
973  &myOid, bPduType, &item, &tableIndex);
974  if (!*pErrorStatus)
975  {
976  assert(tableIndex);
977  assert(item);
978  if (tableIndex > ipNetTable->dwNumEntries)
979  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
980  else
981  {
982  *pErrorStatus = mapStructEntryToValue(mib2IpNetMap,
984  &ipNetTable[tableIndex - 1], item, pVarBind);
985  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
986  ret = setOidWithItemAndInteger(&pVarBind->name, &myOid,
987  item, tableIndex);
988  }
989  }
990  }
991  break;
992  case SNMP_PDU_SET:
993  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
994  ret = FALSE;
995  break;
996  default:
997  FIXME("0x%02x: unsupported PDU type\n", bPduType);
998  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
999  }
1000  return ret;
1001 }
#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:197
#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:535
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:536
unsigned int BOOL
Definition: ntddk_ex.h:94
static struct structToAsnValue mib2IpNetMap[]
Definition: main.c:926
#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:64
static UINT mib2IpNet[]
Definition: main.c:914
#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:915
DWORD dwNumEntries
Definition: ipmib.h:127

◆ mib2IpRouteCleanup()

static void mib2IpRouteCleanup ( void  )
static

Definition at line 854 of file main.c.

855 {
857 }
static PMIB_IPFORWARDTABLE ipRouteTable
Definition: main.c:822
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ mib2IpRouteInit()

static void mib2IpRouteInit ( void  )
static

Definition at line 839 of file main.c.

840 {
842 
844  {
846  if (table)
847  {
849  else HeapFree(GetProcessHeap(), 0, table );
850  }
851  }
852 }
static PMIB_IPFORWARDTABLE ipRouteTable
Definition: main.c:822
#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:395
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:394
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

◆ mib2IpRouteQuery()

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

Definition at line 873 of file main.c.

875 {
877  UINT tableIndex = 0, item = 0;
878  BOOL ret = TRUE;
879 
880  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
881  pErrorStatus);
882 
883  switch (bPduType)
884  {
885  case SNMP_PDU_GET:
886  case SNMP_PDU_GETNEXT:
887  *pErrorStatus = getItemAndInstanceFromTable(&pVarBind->name,
888  &myOid, 4, bPduType, (struct GenericTable *)ipRouteTable,
890  &item, &tableIndex);
891  if (!*pErrorStatus)
892  {
893  assert(tableIndex);
894  assert(item);
895  *pErrorStatus = mapStructEntryToValue(mib2IpRouteMap,
897  &ipRouteTable->table[tableIndex - 1], item, pVarBind);
898  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
899  ret = setOidWithItemAndIpAddr(&pVarBind->name, &myOid, item,
900  ipRouteTable->table[tableIndex - 1].dwForwardDest);
901  }
902  break;
903  case SNMP_PDU_SET:
904  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
905  ret = FALSE;
906  break;
907  default:
908  FIXME("0x%02x: unsupported PDU type\n", bPduType);
909  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
910  }
911  return ret;
912 }
static PMIB_IPFORWARDTABLE ipRouteTable
Definition: main.c:822
static INT setOidWithItemAndIpAddr(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item, DWORD addr)
Definition: main.c:512
#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:821
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:536
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:64
static void oidToIpForwardRow(AsnObjectIdentifier *oid, void *dst)
Definition: main.c:859
#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:411
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:824
static int compareIpForwardRow(const void *a, const void *b)
Definition: main.c:866
#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 669 of file main.c.

670 {
672 }
DWORD WINAPI GetIpStatistics(PMIB_IPSTATS pStats)
static MIB_IPSTATS ipStats
Definition: main.c:667

◆ mib2IpStatsQuery()

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

Definition at line 700 of file main.c.

702 {
704  UINT item = 0;
705  BOOL ret = TRUE;
706 
707  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
708  pErrorStatus);
709 
710  switch (bPduType)
711  {
712  case SNMP_PDU_GET:
713  case SNMP_PDU_GETNEXT:
714  *pErrorStatus = getItemFromOid(&pVarBind->name, &myOid, bPduType,
715  &item);
716  if (!*pErrorStatus)
717  {
718  *pErrorStatus = mapStructEntryToValue(mib2IpMap,
719  DEFINE_SIZEOF(mib2IpMap), &ipStats, item, pVarBind);
720  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
721  ret = setOidWithItem(&pVarBind->name, &myOid, item);
722  }
723  break;
724  case SNMP_PDU_SET:
725  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
726  ret = FALSE;
727  break;
728  default:
729  FIXME("0x%02x: unsupported PDU type\n", bPduType);
730  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
731  }
732  return ret;
733 }
#define SNMP_ERRORSTATUS_READONLY
Definition: snmp.h:137
#define TRUE
Definition: types.h:120
static UINT mib2Ip[]
Definition: main.c:666
AsnObjectName name
Definition: snmp.h:76
#define SNMP_PDU_GET
Definition: snmp.h:94
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:536
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:64
#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:493
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179
static struct structToAsnValue mib2IpMap[]
Definition: main.c:674
static AsnInteger32 getItemFromOid(AsnObjectIdentifier *oid, AsnObjectIdentifier *base, BYTE bPduType, UINT *item)
Definition: main.c:263
static MIB_IPSTATS ipStats
Definition: main.c:667

◆ mib2TcpInit()

static void mib2TcpInit ( void  )
static

Definition at line 1079 of file main.c.

1080 {
1082 }
static MIB_TCPSTATS tcpStats
Definition: main.c:1077
DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS pStats)

◆ mib2TcpQuery()

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

Definition at line 1102 of file main.c.

1104 {
1106  UINT item = 0;
1107  BOOL ret = TRUE;
1108 
1109  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
1110  pErrorStatus);
1111 
1112  switch (bPduType)
1113  {
1114  case SNMP_PDU_GET:
1115  case SNMP_PDU_GETNEXT:
1116  *pErrorStatus = getItemFromOid(&pVarBind->name, &myOid, bPduType,
1117  &item);
1118  if (!*pErrorStatus)
1119  {
1120  *pErrorStatus = mapStructEntryToValue(mib2TcpMap,
1121  DEFINE_SIZEOF(mib2TcpMap), &tcpStats, item, pVarBind);
1122  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
1123  ret = setOidWithItem(&pVarBind->name, &myOid, item);
1124  }
1125  break;
1126  case SNMP_PDU_SET:
1127  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
1128  ret = FALSE;
1129  break;
1130  default:
1131  FIXME("0x%02x: unsupported PDU type\n", bPduType);
1132  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
1133  }
1134  return ret;
1135 }
#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:536
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:64
static struct structToAsnValue mib2TcpMap[]
Definition: main.c:1084
#define TRACE(s)
Definition: solgame.cpp:4
#define DEFINE_OID(x)
Definition: snmp.h:180
static MIB_TCPSTATS tcpStats
Definition: main.c:1077
#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:493
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:263
static UINT mib2Tcp[]
Definition: main.c:1076

◆ mib2UdpEntryCleanup()

static void mib2UdpEntryCleanup ( void  )
static

Definition at line 1205 of file main.c.

1206 {
1208 }
#define GetProcessHeap()
Definition: compat.h:395
static PMIB_UDPTABLE udpTable
Definition: main.c:1188
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ mib2UdpEntryInit()

static void mib2UdpEntryInit ( void  )
static

Definition at line 1190 of file main.c.

1191 {
1192  DWORD size = 0, ret = GetUdpTable(NULL, &size, TRUE);
1193 
1195  {
1197  if (table)
1198  {
1199  if (!GetUdpTable(table, &size, TRUE)) udpTable = table;
1200  else HeapFree(GetProcessHeap(), 0, table);
1201  }
1202  }
1203 }
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:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
static PMIB_UDPTABLE udpTable
Definition: main.c:1188
#define HeapFree(x, y, z)
Definition: compat.h:394
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

◆ mib2UdpEntryQuery()

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

Definition at line 1235 of file main.c.

1237 {
1239  BOOL ret = TRUE;
1240 
1241  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
1242  pErrorStatus);
1243 
1244  switch (bPduType)
1245  {
1246  case SNMP_PDU_GET:
1247  case SNMP_PDU_GETNEXT:
1248  if (!udpTable)
1249  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
1250  else
1251  {
1252  UINT tableIndex = 0, item = 0;
1253 
1254  *pErrorStatus = getItemAndInstanceFromTable(&pVarBind->name, &myOid,
1255  5, bPduType, (struct GenericTable *)udpTable,
1257  &tableIndex);
1258  if (!*pErrorStatus)
1259  {
1260  assert(tableIndex);
1261  assert(item);
1262  *pErrorStatus = mapStructEntryToValue(mib2UdpEntryMap,
1264  &udpTable->table[tableIndex - 1], item, pVarBind);
1265  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
1266  {
1267  AsnObjectIdentifier oid;
1268 
1269  ret = setOidWithItemAndIpAddr(&pVarBind->name, &myOid, item,
1270  udpTable->table[tableIndex - 1].dwLocalAddr);
1271  if (ret)
1272  {
1273  oid.idLength = 1;
1274  oid.ids = &udpTable->table[tableIndex - 1].dwLocalPort;
1275  ret = SnmpUtilOidAppend(&pVarBind->name, &oid);
1276  }
1277  }
1278  }
1279  }
1280  break;
1281  case SNMP_PDU_SET:
1282  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
1283  ret = FALSE;
1284  break;
1285  default:
1286  FIXME("0x%02x: unsupported PDU type\n", bPduType);
1287  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
1288  }
1289  return ret;
1290 }
static INT setOidWithItemAndIpAddr(AsnObjectIdentifier *dst, AsnObjectIdentifier *base, UINT item, DWORD addr)
Definition: main.c:512
#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:536
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:64
#define TRACE(s)
Definition: solgame.cpp:4
MIB_UDPROW table[1]
Definition: udpmib.h:35
#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:411
#define SNMP_PDU_GETNEXT
Definition: snmp.h:95
int ret
static UINT mib2UdpEntry[]
Definition: main.c:1187
static PMIB_UDPTABLE udpTable
Definition: main.c:1188
static void oidToUdpRow(AsnObjectIdentifier *oid, void *dst)
Definition: main.c:1215
#define SNMP_ERRORSTATUS_NOSUCHNAME
Definition: snmp.h:135
static ATOM item
Definition: dde.c:856
static struct structToAsnValue mib2UdpEntryMap[]
Definition: main.c:1210
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:291
static int compareUdpRow(const void *a, const void *b)
Definition: main.c:1224

◆ mib2UdpInit()

static void mib2UdpInit ( void  )
static

Definition at line 1140 of file main.c.

1141 {
1143 }
DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS pStats)
static MIB_UDPSTATS udpStats
Definition: main.c:1138

◆ mib2UdpQuery()

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

Definition at line 1152 of file main.c.

1154 {
1156  UINT item;
1157  BOOL ret = TRUE;
1158 
1159  TRACE("(0x%02x, %s, %p)\n", bPduType, SnmpUtilOidToA(&pVarBind->name),
1160  pErrorStatus);
1161 
1162  switch (bPduType)
1163  {
1164  case SNMP_PDU_GET:
1165  case SNMP_PDU_GETNEXT:
1166  *pErrorStatus = getItemFromOid(&pVarBind->name, &myOid, bPduType,
1167  &item);
1168  if (!*pErrorStatus)
1169  {
1170  *pErrorStatus = mapStructEntryToValue(mib2UdpMap,
1171  DEFINE_SIZEOF(mib2UdpMap), &udpStats, item, pVarBind);
1172  if (!*pErrorStatus && bPduType == SNMP_PDU_GETNEXT)
1173  ret = setOidWithItem(&pVarBind->name, &myOid, item);
1174  }
1175  break;
1176  case SNMP_PDU_SET:
1177  *pErrorStatus = SNMP_ERRORSTATUS_READONLY;
1178  ret = FALSE;
1179  break;
1180  default:
1181  FIXME("0x%02x: unsupported PDU type\n", bPduType);
1182  *pErrorStatus = SNMP_ERRORSTATUS_NOSUCHNAME;
1183  }
1184  return ret;
1185 }
#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:536
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:64
#define TRACE(s)
Definition: solgame.cpp:4
static MIB_UDPSTATS udpStats
Definition: main.c:1138
#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:1145
#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:493
unsigned int UINT
Definition: ndis.h:50
#define DEFINE_SIZEOF(x)
Definition: snmp.h:179
static UINT mib2Udp[]
Definition: main.c:1137
static AsnInteger32 getItemFromOid(AsnObjectIdentifier *oid, AsnObjectIdentifier *base, BYTE bPduType, UINT *item)
Definition: main.c:263

◆ oidToIpAddr()

static DWORD oidToIpAddr ( AsnObjectIdentifier oid)
static

Definition at line 313 of file main.c.

314 {
315  assert(oid && oid->idLength >= 4);
316  /* Map the IDs to an IP address in little-endian order */
317  return (BYTE)oid->ids[3] << 24 | (BYTE)oid->ids[2] << 16 |
318  (BYTE)oid->ids[1] << 8 | (BYTE)oid->ids[0];
319 }
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 766 of file main.c.

767 {
768  MIB_IPADDRROW *row = dst;
769 
770  row->dwAddr = oidToIpAddr(oid);
771 }
static DWORD oidToIpAddr(AsnObjectIdentifier *oid)
Definition: main.c:313
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 859 of file main.c.

860 {
862 
863  row->dwForwardDest = oidToIpAddr(oid);
864 }
static DWORD oidToIpAddr(AsnObjectIdentifier *oid)
Definition: main.c:313
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 1215 of file main.c.

1216 {
1217  MIB_UDPROW *row = dst;
1218 
1219  assert(oid && oid->idLength >= 5);
1220  row->dwLocalAddr = oidToIpAddr(oid);
1221  row->dwLocalPort = oid->ids[4];
1222 }
UINT * ids
Definition: snmp.h:37
#define assert(x)
Definition: debug.h:53
static DWORD oidToIpAddr(AsnObjectIdentifier *oid)
Definition: main.c:313
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 493 of file main.c.

495 {
496  UINT id;
498  INT ret;
499 
502  if (ret)
503  {
504  oid.idLength = 1;
505  oid.ids = &id;
506  id = item;
507  ret = SnmpUtilOidAppend(dst, &oid);
508  }
509  return ret;
510 }
UINT * ids
Definition: snmp.h:37
int32_t INT
Definition: typedefs.h:56
VOID WINAPI SnmpUtilOidFree(AsnObjectIdentifier *oid)
Definition: main.c:346
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:4909
INT WINAPI SnmpUtilOidAppend(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:291
INT WINAPI SnmpUtilOidCpy(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:321

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 535 of file main.c.

537 {
539  INT ret;
540 
542  if (ret)
543  {
544  oid.idLength = 1;
545  oid.ids = &instance;
546  ret = SnmpUtilOidAppend(dst, &oid);
547  }
548  return ret;
549 }
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:493
INT WINAPI SnmpUtilOidAppend(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:291

Referenced by mib2IfEntryQuery(), and mib2IpNetQuery().

◆ setOidWithItemAndIpAddr()

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

Definition at line 512 of file main.c.

514 {
515  UINT id;
516  BYTE *ptr;
518  INT ret;
519 
521  if (ret)
522  {
523  oid.idLength = 1;
524  oid.ids = &id;
525  for (ptr = (BYTE *)&addr; ret && ptr < (BYTE *)&addr + sizeof(DWORD);
526  ptr++)
527  {
528  id = *ptr;
529  ret = SnmpUtilOidAppend(dst, &oid);
530  }
531  }
532  return ret;
533 }
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:493
unsigned int UINT
Definition: ndis.h:50
int id
Definition: main.c:4909
INT WINAPI SnmpUtilOidAppend(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:291

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

◆ setStringValue()

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

Definition at line 45 of file main.c.

46 {
47  AsnAny strValue;
48 
49  strValue.asnType = type;
50  strValue.asnValue.string.stream = str;
51  strValue.asnValue.string.length = len;
52  strValue.asnValue.string.dynamic = FALSE;
53  SnmpUtilAsnAnyCpy(value, &strValue);
54 }
BYTE asnType
Definition: snmp.h:55
INT WINAPI SnmpUtilAsnAnyCpy(AsnAny *dst, AsnAny *src)
Definition: main.c:199
const WCHAR * str
UINT length
Definition: snmp.h:31
BOOL dynamic
Definition: snmp.h:32
union AsnAny::@3100 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 1314 of file main.c.

1316 {
1318  UINT i;
1319 
1320  TRACE("(%d, %p, %p)\n", dwUptimeReference, phSubagentTrapEvent,
1321  pFirstSupportedRegion);
1322 
1324  for (i = 0; i < ARRAY_SIZE(supportedIDs); i++)
1325  {
1326  if (supportedIDs[i].init)
1327  supportedIDs[i].init();
1328  if (supportedIDs[i].name.idLength < minSupportedIDLength)
1329  minSupportedIDLength = supportedIDs[i].name.idLength;
1330  }
1331  *phSubagentTrapEvent = NULL;
1332  SnmpUtilOidCpy(pFirstSupportedRegion, &myOid);
1333  return TRUE;
1334 }
#define TRUE
Definition: types.h:120
static struct mibImplementation supportedIDs[]
Definition: main.c:1293
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:85
#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:36
INT WINAPI SnmpUtilOidCpy(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:321
static UINT minSupportedIDLength
Definition: main.c:1309

◆ SnmpExtensionQuery()

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

Definition at line 1373 of file main.c.

1375 {
1376  AsnObjectIdentifier mib2oid = DEFINE_OID(mib2);
1377  AsnInteger32 error = SNMP_ERRORSTATUS_NOERROR, errorIndex = 0;
1378  UINT i;
1379  BOOL ret = TRUE;
1380 
1381  TRACE("(0x%02x, %p, %p, %p)\n", bPduType, pVarBindList,
1382  pErrorStatus, pErrorIndex);
1383 
1384  for (i = 0; !error && i < pVarBindList->len; i++)
1385  {
1386  /* Ignore any OIDs not in MIB2 */
1387  if (!SnmpUtilOidNCmp(&pVarBindList->list[i].name, &mib2oid,
1388  mib2oid.idLength))
1389  {
1390  struct mibImplementation *impl = NULL;
1391  UINT len, matchingIndex = 0;
1392 
1393  TRACE("%s\n", SnmpUtilOidToA(&pVarBindList->list[i].name));
1394  /* Search for an implementation matching as many octets as possible
1395  */
1396  for (len = pVarBindList->list[i].name.idLength;
1397  len >= minSupportedIDLength && !impl; len--)
1398  impl = findSupportedQuery(pVarBindList->list[i].name.ids, len,
1399  &matchingIndex);
1400  if (impl && impl->query)
1401  ret = impl->query(bPduType, &pVarBindList->list[i], &error);
1402  else
1405  bPduType == SNMP_PDU_GETNEXT)
1406  {
1407  /* GetNext is special: it finds the successor to the given OID,
1408  * so we have to continue until an implementation handles the
1409  * query or we exhaust the table of supported OIDs.
1410  */
1411  for (matchingIndex++; error == SNMP_ERRORSTATUS_NOSUCHNAME &&
1412  matchingIndex < DEFINE_SIZEOF(supportedIDs);
1413  matchingIndex++)
1414  {
1416  impl = &supportedIDs[matchingIndex];
1417  if (impl->query)
1418  ret = impl->query(bPduType, &pVarBindList->list[i],
1419  &error);
1420  else
1422  }
1423  /* If the query still isn't resolved, set the OID to the
1424  * successor to the last entry in the table.
1425  */
1427  {
1428  SnmpUtilOidFree(&pVarBindList->list[i].name);
1429  ret = SnmpUtilOidCpy(&pVarBindList->list[i].name,
1430  &supportedIDs[matchingIndex - 1].name);
1431  pVarBindList->list[i].name.ids[
1432  pVarBindList->list[i].name.idLength - 1] += 1;
1433  }
1434  }
1435  if (error)
1436  errorIndex = i + 1;
1437  }
1438  }
1439  *pErrorStatus = error;
1440  *pErrorIndex = errorIndex;
1441  return ret;
1442 }
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:1293
UINT len
Definition: snmp.h:82
static UINT mib2[]
Definition: main.c:84
VOID WINAPI SnmpUtilOidFree(AsnObjectIdentifier *oid)
Definition: main.c:346
#define SNMP_ERRORSTATUS_NOERROR
Definition: snmp.h:133
LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *oid)
Definition: main.c:536
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:94
#define TRACE(s)
Definition: solgame.cpp:4
INT WINAPI SnmpUtilOidNCmp(AsnObjectIdentifier *oid1, AsnObjectIdentifier *oid2, UINT count)
Definition: main.c:360
#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:1345
INT WINAPI SnmpUtilOidCpy(AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
Definition: main.c:321
static UINT minSupportedIDLength
Definition: main.c:1309

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( inetmib1  )

Variable Documentation

◆ icmpStats

MIB_ICMP icmpStats
static

Definition at line 1004 of file main.c.

Referenced by mib2IcmpInit(), and mib2IcmpQuery().

◆ ifTable

PMIB_IFTABLE ifTable
static

Definition at line 99 of file main.c.

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

◆ ipAddrTable

PMIB_IPADDRTABLE ipAddrTable
static

Definition at line 736 of file main.c.

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

◆ ipNetTable

PMIB_IPNETTABLE ipNetTable
static

Definition at line 915 of file main.c.

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

◆ ipRouteTable

PMIB_IPFORWARDTABLE ipRouteTable
static

Definition at line 822 of file main.c.

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

◆ ipStats

MIB_IPSTATS ipStats
static

Definition at line 667 of file main.c.

Referenced by mib2IpStatsInit(), and mib2IpStatsQuery().

◆ mib2

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

Definition at line 84 of file main.c.

Referenced by SnmpExtensionQuery().

◆ mib2Icmp

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

Definition at line 1003 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:38
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 1011 of file main.c.

Referenced by mib2IcmpQuery().

◆ mib2IfEntry

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

Definition at line 608 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:38
static DWORD copyOperStatus(AsnAny *value, void *src)
Definition: main.c:168
static DWORD copyIfRowDescr(AsnAny *value, void *src)
Definition: main.c:551
static DWORD copyIfRowPhysAddr(AsnAny *value, void *src)
Definition: main.c:567
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 584 of file main.c.

Referenced by mib2IfEntryQuery().

◆ mib2IfNumber

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

Definition at line 98 of file main.c.

Referenced by mib2IfNumberQuery().

◆ mib2Ip

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

Definition at line 666 of file main.c.

Referenced by mib2IpStatsQuery().

◆ mib2IpAddr

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

Definition at line 735 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:38
static DWORD copyIpAddr(AsnAny *value, void *src)
Definition: main.c:78
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 738 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:38
smooth NULL
Definition: ftsmooth.c:416
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 674 of file main.c.

Referenced by mib2IpStatsQuery().

◆ mib2IpNet

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

Definition at line 914 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:38
static DWORD copyIpAddr(AsnAny *value, void *src)
Definition: main.c:78
static DWORD copyIpNetPhysAddr(AsnAny *value, void *src)
Definition: main.c:917
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 926 of file main.c.

Referenced by mib2IpNetQuery().

◆ mib2IpRoute

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

Definition at line 821 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:38
DWORD dwForwardType
Definition: ipmib.h:78
GLdouble u1
Definition: glext.h:8308
static DWORD copyIpAddr(AsnAny *value, void *src)
Definition: main.c:78
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
DWORD dwForwardProto
Definition: ipmib.h:83

Definition at line 824 of file main.c.

Referenced by mib2IpRouteQuery().

◆ mib2System

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

Definition at line 85 of file main.c.

Referenced by SnmpExtensionInit(), and testQuery().

◆ mib2Tcp

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

Definition at line 1076 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:38
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 1084 of file main.c.

Referenced by mib2TcpQuery().

◆ mib2Udp

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

Definition at line 1137 of file main.c.

Referenced by mib2UdpQuery().

◆ mib2UdpEntry

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

Definition at line 1187 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:38
static DWORD copyIpAddr(AsnAny *value, void *src)
Definition: main.c:78
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 1210 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:38
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254

Definition at line 1145 of file main.c.

Referenced by mib2UdpQuery().

◆ minSupportedIDLength

UINT minSupportedIDLength
static

Definition at line 1309 of file main.c.

Referenced by SnmpExtensionInit(), and SnmpExtensionQuery().

◆ supportedIDs

struct mibImplementation supportedIDs[]
static
Initial value:
= {
}
static void mib2IpAddrInit(void)
Definition: main.c:746
static void mib2IcmpInit(void)
Definition: main.c:1006
static BOOL mib2TcpQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:1102
static void mib2UdpEntryCleanup(void)
Definition: main.c:1205
static UINT mib2IfEntry[]
Definition: main.c:608
static UINT mib2Ip[]
Definition: main.c:666
static BOOL mib2IpAddrQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:780
static BOOL mib2IpNetQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:953
static void mib2IpRouteInit(void)
Definition: main.c:839
static UINT mib2Icmp[]
Definition: main.c:1003
static UINT mib2IpRoute[]
Definition: main.c:821
static void mib2IfNumberCleanup(void)
Definition: main.c:116
static BOOL mib2IcmpQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:1040
static void mib2IpStatsInit(void)
Definition: main.c:669
smooth NULL
Definition: ftsmooth.c:416
static void mib2UdpInit(void)
Definition: main.c:1140
static UINT mib2IpNet[]
Definition: main.c:914
#define DEFINE_OID(x)
Definition: snmp.h:180
static BOOL mib2UdpQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:1152
static UINT mib2UdpEntry[]
Definition: main.c:1187
static BOOL mib2IfNumberQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:121
static void mib2IpAddrCleanup(void)
Definition: main.c:761
static BOOL mib2UdpEntryQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:1235
static BOOL mib2IpStatsQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:700
static void mib2IpRouteCleanup(void)
Definition: main.c:854
static void mib2IfNumberInit(void)
Definition: main.c:101
static void mib2IpNetInit(void)
Definition: main.c:933
static UINT mib2Udp[]
Definition: main.c:1137
static void mib2IpNetCleanup(void)
Definition: main.c:948
static UINT mib2IpAddr[]
Definition: main.c:735
static void mib2UdpEntryInit(void)
Definition: main.c:1190
static BOOL mib2IpRouteQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:873
static BOOL mib2IfEntryQuery(BYTE bPduType, SnmpVarBind *pVarBind, AsnInteger32 *pErrorStatus)
Definition: main.c:610
static UINT mib2IfNumber[]
Definition: main.c:98
static void mib2TcpInit(void)
Definition: main.c:1079
static UINT mib2Tcp[]
Definition: main.c:1076

Definition at line 1293 of file main.c.

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

◆ tcpStats

MIB_TCPSTATS tcpStats
static

Definition at line 1077 of file main.c.

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

◆ udpStats

MIB_UDPSTATS udpStats
static

Definition at line 1138 of file main.c.

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

◆ udpTable

PMIB_UDPTABLE udpTable
static

Definition at line 1188 of file main.c.

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