ReactOS  0.4.14-dev-50-g13bb5e2
main.c File Reference
#include "config.h"
#include <stdio.h>
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "snmp.h"
#include "wine/debug.h"
Include dependency graph for main.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (snmpapi)
 
static INT asn_any_copy (AsnAny *dst, const AsnAny *src)
 
static void asn_any_free (AsnAny *any)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
DWORD WINAPI SnmpSvcGetUptime (void)
 
VOID WINAPIV SnmpUtilDbgPrint (INT loglevel, LPSTR format,...)
 
LPVOID WINAPI SnmpUtilMemAlloc (UINT nbytes)
 
LPVOID WINAPI SnmpUtilMemReAlloc (LPVOID mem, UINT nbytes)
 
VOID WINAPI SnmpUtilMemFree (LPVOID mem)
 
INT WINAPI SnmpUtilAsnAnyCpy (AsnAny *dst, AsnAny *src)
 
VOID WINAPI SnmpUtilAsnAnyFree (AsnAny *any)
 
INT WINAPI SnmpUtilOctetsCpy (AsnOctetString *dst, AsnOctetString *src)
 
VOID WINAPI SnmpUtilOctetsFree (AsnOctetString *octets)
 
INT WINAPI SnmpUtilOctetsNCmp (AsnOctetString *octets1, AsnOctetString *octets2, UINT count)
 
INT WINAPI SnmpUtilOctetsCmp (AsnOctetString *octets1, AsnOctetString *octets2)
 
INT WINAPI SnmpUtilOidAppend (AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
 
INT WINAPI SnmpUtilOidCpy (AsnObjectIdentifier *dst, AsnObjectIdentifier *src)
 
VOID WINAPI SnmpUtilOidFree (AsnObjectIdentifier *oid)
 
INT WINAPI SnmpUtilOidNCmp (AsnObjectIdentifier *oid1, AsnObjectIdentifier *oid2, UINT count)
 
INT WINAPI SnmpUtilOidCmp (AsnObjectIdentifier *oid1, AsnObjectIdentifier *oid2)
 
INT WINAPI SnmpUtilVarBindCpy (SnmpVarBind *dst, SnmpVarBind *src)
 
VOID WINAPI SnmpUtilVarBindFree (SnmpVarBind *vb)
 
INT WINAPI SnmpUtilVarBindListCpy (SnmpVarBindList *dst, SnmpVarBindList *src)
 
VOID WINAPI SnmpUtilVarBindListFree (SnmpVarBindList *vb)
 
LPSTR WINAPI SnmpUtilIdsToA (UINT *ids, UINT length)
 
LPSTR WINAPI SnmpUtilOidToA (AsnObjectIdentifier *oid)
 
VOID WINAPI SnmpUtilPrintOid (AsnObjectIdentifier *oid)
 
VOID WINAPI SnmpUtilPrintAsnAny (AsnAny *any)
 

Variables

static ULONGLONG startTime
 

Function Documentation

◆ asn_any_copy()

static INT asn_any_copy ( AsnAny dst,
const AsnAny src 
)
static

Definition at line 35 of file main.c.

36 {
37  memset(dst, 0, sizeof(AsnAny));
38  switch (src->asnType)
39  {
40  case ASN_INTEGER32: dst->asnValue.number = src->asnValue.number; break;
41  case ASN_UNSIGNED32: dst->asnValue.unsigned32 = src->asnValue.unsigned32; break;
42  case ASN_COUNTER64: dst->asnValue.counter64 = src->asnValue.counter64; break;
43  case ASN_COUNTER32: dst->asnValue.counter = src->asnValue.counter; break;
44  case ASN_GAUGE32: dst->asnValue.gauge = src->asnValue.gauge; break;
45  case ASN_TIMETICKS: dst->asnValue.ticks = src->asnValue.ticks; break;
46 
47  case ASN_OCTETSTRING:
48  case ASN_BITS:
49  case ASN_SEQUENCE:
50  case ASN_IPADDRESS:
51  case ASN_OPAQUE:
52  {
53  BYTE *stream;
54  UINT length = src->asnValue.string.length;
55 
56  if (!(stream = HeapAlloc(GetProcessHeap(), 0, length))) return SNMPAPI_ERROR;
57  memcpy(stream, src->asnValue.string.stream, length);
58 
59  dst->asnValue.string.stream = stream;
60  dst->asnValue.string.length = length;
61  dst->asnValue.string.dynamic = TRUE;
62  break;
63  }
65  {
66  UINT *ids, i, size = src->asnValue.object.idLength * sizeof(UINT);
67 
68  if (!(ids = HeapAlloc(GetProcessHeap(), 0, size))) return SNMPAPI_ERROR;
69 
70  dst->asnValue.object.ids = ids;
71  dst->asnValue.object.idLength = src->asnValue.object.idLength;
72 
73  for (i = 0; i < dst->asnValue.object.idLength; i++)
74  dst->asnValue.object.ids[i] = src->asnValue.object.ids[i];
75  break;
76  }
77  default:
78  {
79  WARN("unknown ASN type: %d\n", src->asnType);
80  return SNMPAPI_ERROR;
81  }
82  }
83  dst->asnType = src->asnType;
84  return SNMPAPI_NOERROR;
85 }
#define ASN_OBJECTIDENTIFIER
Definition: snmp.h:107
#define TRUE
Definition: types.h:120
#define ASN_OCTETSTRING
Definition: snmp.h:105
#define WARN(fmt,...)
Definition: debug.h:111
#define ASN_COUNTER64
Definition: snmp.h:118
#define SNMPAPI_NOERROR
Definition: snmp.h:204
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
#define ASN_OPAQUE
Definition: snmp.h:117
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define ASN_INTEGER32
Definition: snmp.h:108
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
Definition: snmp.h:54
#define ASN_BITS
Definition: snmp.h:104
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
#define ASN_GAUGE32
Definition: snmp.h:115
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
GLenum src
Definition: glext.h:6340
#define SNMPAPI_ERROR
Definition: snmp.h:205
#define ASN_UNSIGNED32
Definition: snmp.h:119
#define ASN_COUNTER32
Definition: snmp.h:114
GLenum GLenum dst
Definition: glext.h:6340
unsigned int UINT
Definition: ndis.h:50
#define ASN_IPADDRESS
Definition: snmp.h:113
#define ASN_SEQUENCE
Definition: snmp.h:110
#define memset(x, y, z)
Definition: compat.h:39
#define ASN_TIMETICKS
Definition: snmp.h:116

Referenced by SnmpUtilAsnAnyCpy(), and SnmpUtilVarBindCpy().

◆ asn_any_free()

static void asn_any_free ( AsnAny any)
static

Definition at line 87 of file main.c.

88 {
89  switch (any->asnType)
90  {
91  case ASN_OCTETSTRING:
92  case ASN_BITS:
93  case ASN_SEQUENCE:
94  case ASN_IPADDRESS:
95  case ASN_OPAQUE:
96  {
97  if (any->asnValue.string.dynamic)
98  {
100  any->asnValue.string.stream = NULL;
101  }
102  break;
103  }
105  {
107  any->asnValue.object.ids = NULL;
108  break;
109  }
110  default: break;
111  }
112  any->asnType = ASN_NULL;
113 }
#define ASN_OBJECTIDENTIFIER
Definition: snmp.h:107
UINT * ids
Definition: snmp.h:37
#define ASN_OCTETSTRING
Definition: snmp.h:105
BYTE asnType
Definition: snmp.h:55
smooth NULL
Definition: ftsmooth.c:416
#define ASN_OPAQUE
Definition: snmp.h:117
BOOL dynamic
Definition: snmp.h:32
#define GetProcessHeap()
Definition: compat.h:395
union AsnAny::@3100 asnValue
AsnOctetString string
Definition: snmp.h:60
#define ASN_BITS
Definition: snmp.h:104
#define ASN_NULL
Definition: snmp.h:106
AsnObjectIdentifier object
Definition: snmp.h:62
#define ASN_IPADDRESS
Definition: snmp.h:113
#define ASN_SEQUENCE
Definition: snmp.h:110
#define HeapFree(x, y, z)
Definition: compat.h:394
BYTE * stream
Definition: snmp.h:30

Referenced by SnmpUtilAsnAnyFree(), and SnmpUtilVarBindFree().

◆ DllMain()

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

Definition at line 120 of file main.c.

124 {
125  TRACE("(%p,%d,%p)\n", hInstDLL, fdwReason, lpvReserved);
126 
127  switch(fdwReason) {
128  case DLL_WINE_PREATTACH:
129  return FALSE; /* prefer native version */
130  case DLL_PROCESS_ATTACH:
131  DisableThreadLibraryCalls(hInstDLL);
133  break;
134  }
135 
136  return TRUE;
137 }
#define TRUE
Definition: types.h:120
static ULONGLONG startTime
Definition: main.c:115
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
ULONGLONG WINAPI GetTickCount64(VOID)
Definition: GetTickCount64.c:9
static IN DWORD IN LPVOID lpvReserved
#define TRACE(s)
Definition: solgame.cpp:4

◆ SnmpSvcGetUptime()

DWORD WINAPI SnmpSvcGetUptime ( void  )

Definition at line 147 of file main.c.

148 {
150 
151  return (now - startTime) / 10;
152 }
static ULONGLONG startTime
Definition: main.c:115
ULONGLONG WINAPI GetTickCount64(VOID)
Definition: GetTickCount64.c:9
time_t now
Definition: finger.c:65
uint64_t ULONGLONG
Definition: typedefs.h:65

◆ SnmpUtilAsnAnyCpy()

INT WINAPI SnmpUtilAsnAnyCpy ( AsnAny dst,
AsnAny src 
)

Definition at line 199 of file main.c.

200 {
201  TRACE("(%p, %p)\n", dst, src);
202  return asn_any_copy(dst, src);
203 }
#define TRACE(s)
Definition: solgame.cpp:4
GLenum src
Definition: glext.h:6340
static INT asn_any_copy(AsnAny *dst, const AsnAny *src)
Definition: main.c:35
GLenum GLenum dst
Definition: glext.h:6340

Referenced by InitFunctionPtrs(), and setStringValue().

◆ SnmpUtilAsnAnyFree()

VOID WINAPI SnmpUtilAsnAnyFree ( AsnAny any)

Definition at line 208 of file main.c.

209 {
210  TRACE("(%p)\n", any);
211  asn_any_free(any);
212 }
#define TRACE(s)
Definition: solgame.cpp:4
static void asn_any_free(AsnAny *any)
Definition: main.c:87

Referenced by InitFunctionPtrs().

◆ SnmpUtilDbgPrint()

VOID WINAPIV SnmpUtilDbgPrint ( INT  loglevel,
LPSTR  format,
  ... 
)

Definition at line 164 of file main.c.

165 {
166  FIXME("(%d, %s)\n", loglevel, debugstr_a(format));
167 }
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_a
Definition: kernel32.h:31

◆ SnmpUtilIdsToA()

LPSTR WINAPI SnmpUtilIdsToA ( UINT ids,
UINT  length 
)

Definition at line 499 of file main.c.

500 {
501  static char one[10], oid[514], null_oid[] = "<null oid>";
502  unsigned int i, len, left = sizeof(oid) - 1;
503 
504  TRACE("(%p, %d)\n", ids, length);
505 
506  if (!ids || !length) return null_oid;
507 
508  *oid = 0;
509  for (i = 0; i < length; i++)
510  {
511  sprintf(one, "%d", ids[i]);
512  len = strlen(one);
513  if (left >= len)
514  {
515  strcat(oid, one);
516  left -= len;
517  }
518  else return oid;
519 
520  if (i < length - 1)
521  {
522  if (left > 0)
523  {
524  strcat(oid, ".");
525  left--;
526  }
527  else return oid;
528  }
529  }
530  return oid;
531 }
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static double one
Definition: j0_y0.c:80
#define sprintf(buf, format,...)
Definition: sprintf.c:55
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
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
GLint left
Definition: glext.h:7726
GLenum GLsizei len
Definition: glext.h:6722

Referenced by SnmpUtilOidToA().

◆ SnmpUtilMemAlloc()

LPVOID WINAPI SnmpUtilMemAlloc ( UINT  nbytes)

Definition at line 172 of file main.c.

173 {
174  TRACE("(%d)\n", nbytes);
175  return HeapAlloc(GetProcessHeap(), 0, nbytes);
176 }
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)

Referenced by test_SnmpUtilOidAppend().

◆ SnmpUtilMemFree()

VOID WINAPI SnmpUtilMemFree ( LPVOID  mem)

Definition at line 190 of file main.c.

191 {
192  TRACE("(%p)\n", mem);
193  HeapFree(GetProcessHeap(), 0, mem);
194 }
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
Definition: mem.c:156
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ SnmpUtilMemReAlloc()

LPVOID WINAPI SnmpUtilMemReAlloc ( LPVOID  mem,
UINT  nbytes 
)

Definition at line 181 of file main.c.

182 {
183  TRACE("(%p, %d)\n", mem, nbytes);
184  return HeapReAlloc(GetProcessHeap(), 0, mem, nbytes);
185 }
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
#define HeapReAlloc
Definition: compat.h:393
Definition: mem.c:156

◆ SnmpUtilOctetsCmp()

INT WINAPI SnmpUtilOctetsCmp ( AsnOctetString octets1,
AsnOctetString octets2 
)

Definition at line 278 of file main.c.

279 {
280  TRACE("(%p, %p)\n", octets1, octets2);
281 
282  if (octets1->length < octets2->length) return -1;
283  if (octets1->length > octets2->length) return 1;
284 
285  return SnmpUtilOctetsNCmp(octets1, octets2, octets1->length);
286 }
UINT length
Definition: snmp.h:31
#define TRACE(s)
Definition: solgame.cpp:4
INT WINAPI SnmpUtilOctetsNCmp(AsnOctetString *octets1, AsnOctetString *octets2, UINT count)
Definition: main.c:260

Referenced by InitFunctionPtrs().

◆ SnmpUtilOctetsCpy()

INT WINAPI SnmpUtilOctetsCpy ( AsnOctetString dst,
AsnOctetString src 
)

Definition at line 217 of file main.c.

218 {
219  TRACE("(%p, %p)\n", dst, src);
220 
221  if (!dst) return SNMPAPI_ERROR;
222  if (!src)
223  {
224  dst->dynamic = FALSE;
225  dst->length = 0;
226  dst->stream = NULL;
227  return SNMPAPI_NOERROR;
228  }
229  if ((dst->stream = HeapAlloc(GetProcessHeap(), 0, src->length)))
230  {
231  unsigned int i;
232 
233  dst->dynamic = TRUE;
234  dst->length = src->length;
235  for (i = 0; i < dst->length; i++) dst->stream[i] = src->stream[i];
236  return SNMPAPI_NOERROR;
237  }
238  return SNMPAPI_ERROR;
239 }
#define TRUE
Definition: types.h:120
#define SNMPAPI_NOERROR
Definition: snmp.h:204
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
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum src
Definition: glext.h:6340
#define SNMPAPI_ERROR
Definition: snmp.h:205
GLenum GLenum dst
Definition: glext.h:6340

Referenced by InitFunctionPtrs().

◆ SnmpUtilOctetsFree()

VOID WINAPI SnmpUtilOctetsFree ( AsnOctetString octets)

Definition at line 244 of file main.c.

245 {
246  TRACE("(%p)\n", octets);
247 
248  if (octets)
249  {
250  octets->length = 0;
251  if (octets->dynamic) HeapFree(GetProcessHeap(), 0, octets->stream);
252  octets->stream = NULL;
253  octets->dynamic = FALSE;
254  }
255 }
smooth NULL
Definition: ftsmooth.c:416
UINT length
Definition: snmp.h:31
BOOL dynamic
Definition: snmp.h:32
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394
BYTE * stream
Definition: snmp.h:30

Referenced by InitFunctionPtrs().

◆ SnmpUtilOctetsNCmp()

INT WINAPI SnmpUtilOctetsNCmp ( AsnOctetString octets1,
AsnOctetString octets2,
UINT  count 
)

Definition at line 260 of file main.c.

261 {
262  INT ret;
263  unsigned int i;
264 
265  TRACE("(%p, %p, %d)\n", octets1, octets2, count);
266 
267  if (!octets1 || !octets2) return 0;
268 
269  for (i = 0; i < count; i++)
270  if ((ret = octets1->stream[i] - octets2->stream[i])) return ret;
271 
272  return 0;
273 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:56
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
#define TRACE(s)
Definition: solgame.cpp:4
int ret
BYTE * stream
Definition: snmp.h:30

Referenced by InitFunctionPtrs(), and SnmpUtilOctetsCmp().

◆ SnmpUtilOidAppend()

INT WINAPI SnmpUtilOidAppend ( AsnObjectIdentifier dst,
AsnObjectIdentifier src 
)

Definition at line 291 of file main.c.

292 {
293  UINT *ids, i, size;
294 
295  TRACE("(%p, %p)\n", dst, src);
296 
297  if (!dst) return SNMPAPI_ERROR;
298  if (!src) return SNMPAPI_NOERROR;
299 
300  size = (src->idLength + dst->idLength) * sizeof(UINT);
301  if (!(ids = HeapReAlloc(GetProcessHeap(), 0, dst->ids, size)))
302  {
303  if (!(ids = HeapAlloc(GetProcessHeap(), 0, size)))
304  {
306  return SNMPAPI_ERROR;
307  }
308  else memcpy(ids, dst->ids, dst->idLength * sizeof(UINT));
309  }
310 
311  for (i = 0; i < src->idLength; i++) ids[i + dst->idLength] = src->ids[i];
312  dst->idLength = dst->idLength + src->idLength;
313  dst->ids = ids;
314 
315  return SNMPAPI_NOERROR;
316 }
#define SNMP_MEM_ALLOC_ERROR
Definition: snmp.h:191
#define SNMPAPI_NOERROR
Definition: snmp.h:204
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
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define SetLastError(x)
Definition: compat.h:409
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum src
Definition: glext.h:6340
#define SNMPAPI_ERROR
Definition: snmp.h:205
#define HeapReAlloc
Definition: compat.h:393
GLenum GLenum dst
Definition: glext.h:6340
unsigned int UINT
Definition: ndis.h:50

Referenced by mib2UdpEntryQuery(), setOidWithItem(), setOidWithItemAndInteger(), setOidWithItemAndIpAddr(), and test_SnmpUtilOidAppend().

◆ SnmpUtilOidCmp()

INT WINAPI SnmpUtilOidCmp ( AsnObjectIdentifier oid1,
AsnObjectIdentifier oid2 
)

Definition at line 384 of file main.c.

385 {
386  TRACE("(%p, %p)\n", oid1, oid2);
387 
388  if (oid1->idLength < oid2->idLength) return -1;
389  if (oid1->idLength > oid2->idLength) return 1;
390 
391  return SnmpUtilOidNCmp(oid1, oid2, oid1->idLength);
392 }
#define TRACE(s)
Definition: solgame.cpp:4
INT WINAPI SnmpUtilOidNCmp(AsnObjectIdentifier *oid1, AsnObjectIdentifier *oid2, UINT count)
Definition: main.c:360
static char oid1[]
Definition: encode.c:7583

Referenced by test_SnmpUtilOidCmp(), and testQuery().

◆ SnmpUtilOidCpy()

INT WINAPI SnmpUtilOidCpy ( AsnObjectIdentifier dst,
AsnObjectIdentifier src 
)

Definition at line 321 of file main.c.

322 {
323  TRACE("(%p, %p)\n", dst, src);
324 
325  if (!dst) return SNMPAPI_ERROR;
326  if (!src)
327  {
328  dst->idLength = 0;
329  dst->ids = NULL;
330  return SNMPAPI_NOERROR;
331  }
332  if ((dst->ids = HeapAlloc(GetProcessHeap(), 0, src->idLength * sizeof(UINT))))
333  {
334  unsigned int i;
335 
336  dst->idLength = src->idLength;
337  for (i = 0; i < dst->idLength; i++) dst->ids[i] = src->ids[i];
338  return SNMPAPI_NOERROR;
339  }
340  return SNMPAPI_ERROR;
341 }
#define SNMPAPI_NOERROR
Definition: snmp.h:204
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
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum src
Definition: glext.h:6340
#define SNMPAPI_ERROR
Definition: snmp.h:205
GLenum GLenum dst
Definition: glext.h:6340
unsigned int UINT
Definition: ndis.h:50

Referenced by mib2IfNumberQuery(), setOidWithItem(), SnmpExtensionInit(), SnmpExtensionQuery(), test_SnmpUtilOidCpyFree(), and testQuery().

◆ SnmpUtilOidFree()

VOID WINAPI SnmpUtilOidFree ( AsnObjectIdentifier oid)

Definition at line 346 of file main.c.

347 {
348  TRACE("(%p)\n", oid);
349 
350  if (!oid) return;
351 
352  oid->idLength = 0;
353  HeapFree(GetProcessHeap(), 0, oid->ids);
354  oid->ids = NULL;
355 }
UINT * ids
Definition: snmp.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by mib2IfNumberQuery(), setOidWithItem(), SnmpExtensionQuery(), test_SnmpUtilOidAppend(), test_SnmpUtilOidCpyFree(), and testInit().

◆ SnmpUtilOidNCmp()

INT WINAPI SnmpUtilOidNCmp ( AsnObjectIdentifier oid1,
AsnObjectIdentifier oid2,
UINT  count 
)

Definition at line 360 of file main.c.

361 {
362  unsigned int i, len;
363 
364  TRACE("(%p, %p, %d)\n", oid1, oid2, count);
365 
366  if (!oid1 || !oid2) return 0;
367 
368  len = min(count, oid1->idLength);
369  len = min(len, oid2->idLength);
370  for (i = 0; i < len; i++)
371  {
372  if (oid1->ids[i] > oid2->ids[i]) return 1;
373  if (oid1->ids[i] < oid2->ids[i]) return -1;
374  }
375  if (i == count) return 0;
376  if (oid1->idLength < oid2->idLength) return -1;
377  if (oid1->idLength > oid2->idLength) return 1;
378  return 0;
379 }
UINT * ids
Definition: snmp.h:37
GLuint GLuint GLsizei count
Definition: gl.h:1545
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
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLsizei len
Definition: glext.h:6722
#define min(a, b)
Definition: monoChain.cc:55
static char oid1[]
Definition: encode.c:7583

Referenced by findSupportedQuery(), getItemAndInstanceFromTable(), getItemAndIntegerInstanceFromOid(), getItemFromOid(), mib2IfNumberQuery(), SnmpExtensionQuery(), SnmpUtilOidCmp(), test_SnmpUtilOidNCmp(), and testQuery().

◆ SnmpUtilOidToA()

LPSTR WINAPI SnmpUtilOidToA ( AsnObjectIdentifier oid)

Definition at line 536 of file main.c.

537 {
538  static char null_oid[] = "<null oid>";
539 
540  TRACE("(%p)\n", oid);
541 
542  if (oid)
543  return SnmpUtilIdsToA(oid->ids, oid->idLength);
544  else
545  return null_oid;
546 }
UINT * ids
Definition: snmp.h:37
LPSTR WINAPI SnmpUtilIdsToA(UINT *ids, UINT length)
Definition: main.c:499
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by mib2IcmpQuery(), mib2IfEntryQuery(), mib2IfNumberQuery(), mib2IpAddrQuery(), mib2IpNetQuery(), mib2IpRouteQuery(), mib2IpStatsQuery(), mib2TcpQuery(), mib2UdpEntryQuery(), mib2UdpQuery(), SnmpExtensionQuery(), test_SnmpUtilOidToA(), testInit(), and testQuery().

◆ SnmpUtilPrintAsnAny()

VOID WINAPI SnmpUtilPrintAsnAny ( AsnAny any)

Definition at line 570 of file main.c.

571 {
572  unsigned int i;
573 
574  TRACE("(%p)\n", any);
575 
576  switch (any->asnType)
577  {
578  case ASN_NULL: TRACE("Null value\n"); return;
579  case ASN_INTEGER32: TRACE("Integer32 %d\n", any->asnValue.number); return;
580  case ASN_UNSIGNED32: TRACE("Unsigned32 %u\n", any->asnValue.unsigned32); return;
581  case ASN_COUNTER32: TRACE("Counter32 %u\n", any->asnValue.counter); return;
582  case ASN_GAUGE32: TRACE("Gauge32 %u\n", any->asnValue.gauge); return;
583  case ASN_TIMETICKS: TRACE("Timeticks %u\n", any->asnValue.ticks); return;
584  case ASN_COUNTER64:
585  {
586  TRACE("Counter64 %x%08x\n", (DWORD)(any->asnValue.counter64.QuadPart>>32),(DWORD)any->asnValue.counter64.QuadPart);
587  return;
588  }
589  case ASN_OCTETSTRING:
590  {
591  TRACE("String ");
592  for (i = 0; i < any->asnValue.string.length; i++)
593  TRACE("%c", any->asnValue.string.stream[i]);
594  TRACE("\n");
595  return;
596  }
597  case ASN_IPADDRESS:
598  {
599  TRACE("IpAddress ");
600  if (any->asnValue.string.length < 4)
601  {
602  TRACE("Invalid\n");
603  return;
604  }
605  for (i = 0; i < 4; i++)
606  {
607  TRACE("%u", any->asnValue.string.stream[i]);
608  if (i < 3) TRACE(".");
609  }
610  TRACE("\n");
611  return;
612  }
613  case ASN_BITS:
614  {
615  TRACE("Bits ");
616  for (i = 0; i < any->asnValue.string.length; i++)
617  {
618  TRACE("0x%02x", any->asnValue.string.stream[i]);
619  if (i < any->asnValue.object.idLength - 1) TRACE(" ");
620  }
621  TRACE("\n");
622  return;
623  }
624  case ASN_OPAQUE:
625  {
626  TRACE("Opaque ");
627  for (i = 0; i < any->asnValue.string.length; i++)
628  {
629  TRACE("0x%02x", any->asnValue.string.stream[i]);
630  if (i < any->asnValue.object.idLength - 1) TRACE(" ");
631  }
632  TRACE("\n");
633  return;
634  }
636  {
637  TRACE("ObjectID ");
638  for (i = 0; i < any->asnValue.object.idLength; i++)
639  {
640  TRACE("%u", any->asnValue.object.ids[i]);
641  if (i < any->asnValue.object.idLength - 1) TRACE(".");
642  }
643  TRACE("\n");
644  return;
645  }
646  default:
647  {
648  TRACE("Invalid type %d\n", any->asnType);
649  return;
650  }
651  }
652 }
#define ASN_OBJECTIDENTIFIER
Definition: snmp.h:107
UINT * ids
Definition: snmp.h:37
#define ASN_OCTETSTRING
Definition: snmp.h:105
AsnTimeticks ticks
Definition: snmp.h:67
BYTE asnType
Definition: snmp.h:55
AsnCounter32 counter
Definition: snmp.h:65
#define ASN_COUNTER64
Definition: snmp.h:118
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
ULONGLONG QuadPart
Definition: ms-dtyp.idl:185
AsnGauge32 gauge
Definition: snmp.h:66
UINT length
Definition: snmp.h:31
#define ASN_OPAQUE
Definition: snmp.h:117
#define TRACE(s)
Definition: solgame.cpp:4
AsnUnsigned32 unsigned32
Definition: snmp.h:58
#define ASN_INTEGER32
Definition: snmp.h:108
unsigned long DWORD
Definition: ntddk_ex.h:95
union AsnAny::@3100 asnValue
AsnOctetString string
Definition: snmp.h:60
#define ASN_BITS
Definition: snmp.h:104
#define ASN_GAUGE32
Definition: snmp.h:115
#define ASN_NULL
Definition: snmp.h:106
#define ASN_UNSIGNED32
Definition: snmp.h:119
AsnObjectIdentifier object
Definition: snmp.h:62
#define ASN_COUNTER32
Definition: snmp.h:114
#define ASN_IPADDRESS
Definition: snmp.h:113
AsnInteger32 number
Definition: snmp.h:57
#define ASN_TIMETICKS
Definition: snmp.h:116
BYTE * stream
Definition: snmp.h:30
AsnCounter64 counter64
Definition: snmp.h:59

◆ SnmpUtilPrintOid()

VOID WINAPI SnmpUtilPrintOid ( AsnObjectIdentifier oid)

Definition at line 551 of file main.c.

552 {
553  unsigned int i;
554 
555  TRACE("(%p)\n", oid);
556 
557  if (!oid) return;
558 
559  for (i = 0; i < oid->idLength; i++)
560  {
561  TRACE("%u", oid->ids[i]);
562  if (i < oid->idLength - 1) TRACE(".");
563  }
564  TRACE("\n");
565 }
UINT * ids
Definition: snmp.h:37
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
#define TRACE(s)
Definition: solgame.cpp:4

◆ SnmpUtilVarBindCpy()

INT WINAPI SnmpUtilVarBindCpy ( SnmpVarBind dst,
SnmpVarBind src 
)

Definition at line 397 of file main.c.

398 {
399  unsigned int i, size;
400 
401  TRACE("(%p, %p)\n", dst, src);
402 
403  if (!dst) return SNMPAPI_ERROR;
404  if (!src)
405  {
406  dst->value.asnType = ASN_NULL;
407  return SNMPAPI_NOERROR;
408  }
409 
410  size = src->name.idLength * sizeof(UINT);
411  if (!(dst->name.ids = HeapAlloc(GetProcessHeap(), 0, size))) return SNMPAPI_ERROR;
412 
413  for (i = 0; i < src->name.idLength; i++) dst->name.ids[i] = src->name.ids[i];
414  dst->name.idLength = src->name.idLength;
415 
416  if (!asn_any_copy(&dst->value, &src->value))
417  {
418  HeapFree(GetProcessHeap(), 0, dst->name.ids);
419  return SNMPAPI_ERROR;
420  }
421  return SNMPAPI_NOERROR;
422 }
char * name
Definition: wpp.c:36
char * value
Definition: wpp.c:37
#define SNMPAPI_NOERROR
Definition: snmp.h:204
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
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
if(!(yy_init))
Definition: macro.lex.yy.c:714
GLenum src
Definition: glext.h:6340
#define ASN_NULL
Definition: snmp.h:106
#define SNMPAPI_ERROR
Definition: snmp.h:205
static INT asn_any_copy(AsnAny *dst, const AsnAny *src)
Definition: main.c:35
GLenum GLenum dst
Definition: glext.h:6340
unsigned int UINT
Definition: ndis.h:50
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by SnmpUtilVarBindListCpy(), and test_SnmpUtilVarBindCpyFree().

◆ SnmpUtilVarBindFree()

VOID WINAPI SnmpUtilVarBindFree ( SnmpVarBind vb)

Definition at line 427 of file main.c.

428 {
429  TRACE("(%p)\n", vb);
430 
431  if (!vb) return;
432 
433  asn_any_free(&vb->value);
434  HeapFree(GetProcessHeap(), 0, vb->name.ids);
435  vb->name.idLength = 0;
436  vb->name.ids = NULL;
437 }
UINT * ids
Definition: snmp.h:37
AsnObjectName name
Definition: snmp.h:76
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
AsnObjectSyntax value
Definition: snmp.h:77
static void asn_any_free(AsnAny *any)
Definition: main.c:87
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by SnmpUtilVarBindListCpy(), SnmpUtilVarBindListFree(), test_SnmpUtilVarBindCpyFree(), and testQuery().

◆ SnmpUtilVarBindListCpy()

INT WINAPI SnmpUtilVarBindListCpy ( SnmpVarBindList dst,
SnmpVarBindList src 
)

Definition at line 442 of file main.c.

443 {
444  unsigned int i, size;
445  SnmpVarBind *src_entry, *dst_entry;
446 
447  TRACE("(%p, %p)\n", dst, src);
448 
449  if (!src)
450  {
451  dst->list = NULL;
452  dst->len = 0;
453  return SNMPAPI_NOERROR;
454  }
455  size = src->len * sizeof(SnmpVarBind);
456  if (!(dst->list = HeapAlloc(GetProcessHeap(), 0, size)))
457  return SNMPAPI_ERROR;
458 
459  src_entry = src->list;
460  dst_entry = dst->list;
461  for (i = 0; i < src->len; i++)
462  {
463  if (SnmpUtilVarBindCpy(dst_entry, src_entry))
464  {
465  src_entry++;
466  dst_entry++;
467  }
468  else
469  {
470  for (--i; i > 0; i--) SnmpUtilVarBindFree(--dst_entry);
471  HeapFree(GetProcessHeap(), 0, dst->list);
472  return SNMPAPI_ERROR;
473  }
474  }
475  dst->len = src->len;
476  return SNMPAPI_NOERROR;
477 }
#define SNMPAPI_NOERROR
Definition: snmp.h:204
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
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum src
Definition: glext.h:6340
#define SNMPAPI_ERROR
Definition: snmp.h:205
GLenum GLenum dst
Definition: glext.h:6340
VOID WINAPI SnmpUtilVarBindFree(SnmpVarBind *vb)
Definition: main.c:427
#define HeapFree(x, y, z)
Definition: compat.h:394
Definition: tcpcore.h:1672
INT WINAPI SnmpUtilVarBindCpy(SnmpVarBind *dst, SnmpVarBind *src)
Definition: main.c:397

Referenced by test_SnmpUtilVarBindListCpyFree().

◆ SnmpUtilVarBindListFree()

VOID WINAPI SnmpUtilVarBindListFree ( SnmpVarBindList vb)

Definition at line 482 of file main.c.

483 {
484  unsigned int i;
486 
487  TRACE("(%p)\n", vb);
488 
489  entry = vb->list;
490  for (i = 0; i < vb->len; i++) SnmpUtilVarBindFree(entry++);
491  HeapFree(GetProcessHeap(), 0, vb->list);
492  vb->list = NULL;
493  vb->len = 0;
494 }
UINT len
Definition: snmp.h:82
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
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
uint32_t entry
Definition: isohybrid.c:63
SnmpVarBind * list
Definition: snmp.h:81
VOID WINAPI SnmpUtilVarBindFree(SnmpVarBind *vb)
Definition: main.c:427
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by test_SnmpUtilVarBindListCpyFree().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( snmpapi  )

Variable Documentation

◆ startTime