@@ -72,7 +72,7 @@ uint64_t snmp::get_INTEGER(const uint8_t *p, const size_t length)
72
72
uint64_t v = 0 ;
73
73
74
74
if (length > 8 )
75
- DOLOG (logging::ll_error, " SNMP::get_INTEGER" , " -" , " truncated (%zu bytes)\n " , length);
75
+ DOLOG (logging::ll_error, " SNMP::get_INTEGER" , " -" , " truncated (%zu bytes)" , length);
76
76
77
77
for (size_t i=0 ; i<length; i++) {
78
78
v <<= 8 ;
@@ -85,7 +85,7 @@ uint64_t snmp::get_INTEGER(const uint8_t *p, const size_t length)
85
85
bool snmp::get_type_length (const uint8_t *p, const size_t len, uint8_t *const type, uint8_t *const length)
86
86
{
87
87
if (len < 2 ) {
88
- DOLOG (logging::ll_error, " snmp::get_type_length" , " -" , " length < 2\n " );
88
+ DOLOG (logging::ll_error, " snmp::get_type_length" , " -" , " length < 2" );
89
89
return false ;
90
90
}
91
91
@@ -121,7 +121,7 @@ bool snmp::get_OID(const uint8_t *p, const size_t length, std::string *const oid
121
121
}
122
122
123
123
if (v) {
124
- DOLOG (logging::ll_error, " snmp::get_OID" , " -" , " object identifier did not properly terminate\n " );
124
+ DOLOG (logging::ll_error, " snmp::get_OID" , " -" , " object identifier did not properly terminate" );
125
125
return false ;
126
126
}
127
127
@@ -137,7 +137,7 @@ bool snmp::process_PDU(const uint8_t *p, const size_t len, oid_req_t *const oids
137
137
return false ;
138
138
139
139
if (pdu_type != 0x02 ) { // expecting an integer here)
140
- DOLOG (logging::ll_error, " SNMP::process_PDU" , " -" , " ID-type is not integer\n " );
140
+ DOLOG (logging::ll_error, " SNMP::process_PDU" , " -" , " ID-type is not integer" );
141
141
return false ;
142
142
}
143
143
@@ -151,7 +151,7 @@ bool snmp::process_PDU(const uint8_t *p, const size_t len, oid_req_t *const oids
151
151
return false ;
152
152
153
153
if (pdu_type != 0x02 ) { // expecting an integer here)
154
- DOLOG (logging::ll_error, " SNMP::process_PDU" , " -" , " error-type is not integer\n " );
154
+ DOLOG (logging::ll_error, " SNMP::process_PDU" , " -" , " error-type is not integer" );
155
155
return false ;
156
156
}
157
157
@@ -166,7 +166,7 @@ bool snmp::process_PDU(const uint8_t *p, const size_t len, oid_req_t *const oids
166
166
return false ;
167
167
168
168
if (pdu_type != 0x02 ) { // expecting an integer here)
169
- DOLOG (logging::ll_error, " SNMP::process_PDU" , " -" , " error-index is not integer\n " );
169
+ DOLOG (logging::ll_error, " SNMP::process_PDU" , " -" , " error-index is not integer" );
170
170
return false ;
171
171
}
172
172
@@ -179,7 +179,7 @@ bool snmp::process_PDU(const uint8_t *p, const size_t len, oid_req_t *const oids
179
179
// varbind list sequence
180
180
uint8_t type_vb_list = *p++;
181
181
if (type_vb_list != 0x30 ) {
182
- DOLOG (logging::ll_error, " SNMP::process_PDU" , " -" , " expecting varbind list sequence, got %02x\n " , type_vb_list);
182
+ DOLOG (logging::ll_error, " SNMP::process_PDU" , " -" , " expecting varbind list sequence, got %02x" , type_vb_list);
183
183
return false ;
184
184
}
185
185
uint8_t len_vb_list = *p++;
@@ -191,7 +191,7 @@ bool snmp::process_PDU(const uint8_t *p, const size_t len, oid_req_t *const oids
191
191
uint8_t seq_length = *pnt++;
192
192
193
193
if (&pnt[seq_length] > &p[len_vb_list]) {
194
- DOLOG (logging::ll_error, " SNMP::process_PDU" , " -" , " length field out of bounds (PDU)\n " );
194
+ DOLOG (logging::ll_error, " SNMP::process_PDU" , " -" , " length field out of bounds (PDU)" );
195
195
return false ;
196
196
}
197
197
@@ -200,7 +200,7 @@ bool snmp::process_PDU(const uint8_t *p, const size_t len, oid_req_t *const oids
200
200
pnt += seq_length;
201
201
}
202
202
else {
203
- DOLOG (logging::ll_error, " SNMP::process_PDU" , " -" , " unexpected/invalid type %02x\n " , seq_type);
203
+ DOLOG (logging::ll_error, " SNMP::process_PDU" , " -" , " unexpected/invalid type %02x" , seq_type);
204
204
return false ;
205
205
}
206
206
}
@@ -211,7 +211,7 @@ bool snmp::process_PDU(const uint8_t *p, const size_t len, oid_req_t *const oids
211
211
bool snmp::process_BER (const uint8_t *p, const size_t len, oid_req_t *const oids_req, const bool is_getnext, const int is_top)
212
212
{
213
213
if (len < 2 ) {
214
- DOLOG (logging::ll_error, " SNMP::process_BER" , " -" , " BER too small\n " );
214
+ DOLOG (logging::ll_error, " SNMP::process_BER" , " -" , " BER too small" );
215
215
return false ;
216
216
}
217
217
@@ -224,7 +224,7 @@ bool snmp::process_BER(const uint8_t *p, const size_t len, oid_req_t *const oids
224
224
uint8_t length = *pnt++;
225
225
226
226
if (&pnt[length] > &p[len]) {
227
- DOLOG (logging::ll_error, " SNMP::process_BER" , " -" , " length field out of bounds (BER)\n " );
227
+ DOLOG (logging::ll_error, " SNMP::process_BER" , " -" , " length field out of bounds (BER)" );
228
228
return false ;
229
229
}
230
230
@@ -293,7 +293,7 @@ bool snmp::process_BER(const uint8_t *p, const size_t len, oid_req_t *const oids
293
293
pnt += length;
294
294
}
295
295
else {
296
- DOLOG (logging::ll_error, " SNMP::process_BER" , " -" , " invalid type %02x\n " , type);
296
+ DOLOG (logging::ll_error, " SNMP::process_BER" , " -" , " invalid type %02x" , type);
297
297
return false ;
298
298
}
299
299
}
@@ -332,7 +332,7 @@ void snmp::gen_reply(oid_req_t & oids_req, uint8_t **const packet_out, size_t *c
332
332
333
333
varbind->add (new snmp_oid (e));
334
334
335
- DOLOG (logging::ll_error , " SNMP:process_BER" , " -" , " requested: %s\n " , e.c_str ());
335
+ DOLOG (logging::ll_debug , " SNMP:process_BER" , " -" , " requested: %s" , e.c_str ());
336
336
337
337
std::optional<snmp_elem *> rc = sd->find_by_oid (e);
338
338
@@ -351,7 +351,7 @@ void snmp::gen_reply(oid_req_t & oids_req, uint8_t **const packet_out, size_t *c
351
351
varbind->add (new snmp_null ());
352
352
}
353
353
else {
354
- DOLOG (logging::ll_error , " SNMP::process_BER" , " -" , " requested %s not found, returning null\n " , e.c_str ());
354
+ DOLOG (logging::ll_info , " SNMP::process_BER" , " -" , " requested %s not found, returning null" , e.c_str ());
355
355
356
356
// FIXME snmp_null?
357
357
varbind->add (new snmp_null ());
0 commit comments