Vb vb(oid);
Pdu pdu(&vb, 1);
while (true) {
- if (int c = snmp.get_next(pdu, target) != SNMP_CLASS_SUCCESS) {
+ int c = snmp.get_next(pdu, target);
+ for (size_t i = 0; i < 3 && c != SNMP_CLASS_SUCCESS; ++i) {
+ c = snmp.get_next(pdu, target);
+ }
+ if (c != SNMP_CLASS_SUCCESS) {
logger << "SNMPTable::SNMPTable() - failed to invoke Snmp::get_next (oid: '" << oid.get_printable() << "'). Error message: '" << Snmp::error_msg(c) << "'" << std::endl;
return;
}
pdu += vb;
}
if (int c = _snmp.set(pdu, target) != SNMP_CLASS_SUCCESS) {
- logger << "Switch::dropACLsByTable() - failed to invoke Snmp::set for the switch '" << _ip << "'. Error message: '" << Snmp::error_msg(c) << "'" << std::endl;
- return false;
+ if (c != SNMP_ERROR_TOO_BIG) {
+ logger << "Switch::dropACLsByTable() - failed to invoke Snmp::set for the switch '" << _ip << "'. Error message: '" << Snmp::error_msg(c) << "'" << std::endl;
+ return false;
+ }
}
}
return true;
Pdu pdu;
it->appendPdu(pdu);
if (int c = _snmp.set(pdu, target) != SNMP_CLASS_SUCCESS) {
- logger << "Switch::createACLs() - failed to invoke Snmp::set for the switch '" << _ip << "'. Error message: '" << Snmp::error_msg(c) << "'. Error occured at creation of " << (pos + 1) << " from " << _acls.size() << " ACL's" << std::endl;
- logger << "Switch::createACLs() - ACL dump: " << *it << std::endl;
- return false;
+ if (c != SNMP_ERROR_TOO_BIG) {
+ logger << "Switch::createACLs() - failed to invoke Snmp::set for the switch '" << _ip << "'. Error message: '" << Snmp::error_msg(c) << "'. Error occured at creation of " << (pos + 1) << " from " << _acls.size() << " ACL's" << std::endl;
+ logger << "Switch::createACLs() - ACL dump: " << *it << std::endl;
+ return false;
+ }
}
_aclsCreated = true;
++pos;