37 #ifdef SNMP_PP_NAMESPACE
46 #define SNMP_SECURITY_MODEL_ANY 0
47 #define SNMP_SECURITY_MODEL_V1 1
48 #define SNMP_SECURITY_MODEL_V2 2
49 #define SNMP_SECURITY_MODEL_USM 3
83 const unsigned char *
data,
const unsigned int len);
86 #define debughexprintf(db_level, data, len) \
87 debughexcprintf(db_level, NULL, data, len);
92 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
93 #define debugprintf(db_level,format...)
95 void debugprintf(
int db_level,
const char *format, ...);
99 #pragma warning(disable:4002)
100 #define debugprintf(db_level,format)
103 #define debughexprintf( db_level, data, len)
104 #define debughexcprintf(db_level, comment, data, len)
110 #define MAXLENGTH_ENGINEID 32
111 #define MAXLENGTH_CONTEXT_NAME 32
112 #define MAXLENGTH_FILENAME 255
113 #define MAXLENGTH_GLOBALDATA 42 // (2 + 1) + 7 + 7 + 3 + 7 + security
115 #define oidV3SnmpEngine "1.3.6.1.6.3.10.2.1"
116 #define oidV3SnmpEngineID "1.3.6.1.6.3.10.2.1.1.0"
117 #define oidV3SnmpEngineBoots "1.3.6.1.6.3.10.2.1.2.0"
118 #define oidV3SnmpEngineTime "1.3.6.1.6.3.10.2.1.3.0"
119 #define oidV3SnmpEngineMaxMessageSize "1.3.6.1.6.3.10.2.1.4.0"
122 #ifndef oidSnmpUnavailableContexts
123 #define oidSnmpUnavailableContexts "1.3.6.1.6.3.12.1.4.0"
124 #define oidSnmpUnknownContexts "1.3.6.1.6.3.12.1.5.0"
133 #define SNMPv3_NO_ENTRY_ERROR -1
134 #define SNMPv3_FILEOPEN_ERROR -2
135 #define SNMPv3_TOO_LONG_ERROR -3
136 #define SNMPv3_FILE_ERROR -4
137 #define SNMPv3_FILECREATE_ERROR -5
138 #define SNMPv3_FILERENAME_ERROR -6
152 const long int ptr1len,
153 const unsigned char *str2,
154 const long int ptr2len);
166 DLLOPT unsigned char *
v3strcpy(
const unsigned char *src,
const int srclen);
204 const OctetStr &engineId,
unsigned int &boot);
218 const OctetStr &engineId,
const unsigned int boot);
242 if (ptr)
delete [] ptr;
255 memset(ptr, 0, len *
sizeof(T));
264 #define SecurityModel_any SNMP_SECURITY_MODEL_ANY
265 #define SecurityModel_v1 SNMP_SECURITY_MODEL_V1
266 #define SecurityModel_v2 SNMP_SECURITY_MODEL_V2
267 #define SecurityModel_USM SNMP_SECURITY_MODEL_USM
269 #ifdef SNMP_PP_NAMESPACE
DLLOPT int getBootCounter(const char *fileName, const OctetStr &engineId, unsigned int &boot)
Read the bootCounter of the given engineID stored in the given file.
DLLOPT void decodeString(const unsigned char *in, const int in_length, char *out)
Decode the given encoded string into the output buffer.
DLLOPT int unsignedCharCompare(const unsigned char *str1, const long int ptr1len, const unsigned char *str2, const long int ptr2len)
Compare two strings.
void clear()
Overwrite the buffer space with zero.
Tool class for easy allocation of buffer space.
DLLOPT int saveBootCounter(const char *fileName, const OctetStr &engineId, const unsigned int boot)
Store the bootCounter of the given engineID in the given file.
unsigned long len() const
Get the length of the string.
~Buffer()
Destructor: Free allocated buffer.
T * get_ptr()
Get the buffer pointer.
DLLOPT void debugprintf(int db_level, const char *format,...)
SNMP++ logging function.
unsigned char * data() const
Get a pointer to internal data.
DLLOPT void encodeString(const unsigned char *in, const int in_length, char *out)
Encode the given string into the output buffer.
DLLOPT unsigned char * v3strcpy(const unsigned char *src, const int srclen)
String copy function.
DLLOPT void debughexcprintf(int db_level, const char *comment, const unsigned char *data, const unsigned int len)
SNMP++ logging function for hex strings.
Buffer(const unsigned int size)
Constructor: Allocate a buffer for size objects.
DLLOPT void debug_set_level(const int db_level)
Set the amount of log messages you want to get.