- Pdu pdu;
- SNMPList::const_iterator it;
- for (it = aclsList.begin(); it != aclsList.end(); ++it) {
- int id;
- if (it->get_value(id) != SNMP_CLASS_SUCCESS) {
- return false;
+ SNMPList::const_iterator it(aclsList.begin());
+ size_t chunks = aclsList.size() / _settings.maxACLPerPDU() + 1;
+ for (size_t i = 0; i < chunks && it != aclsList.end(); ++i) {
+ Pdu pdu;
+ for (size_t j = 0; j < _settings.maxACLPerPDU() && it != aclsList.end(); ++j, ++it) {
+ int id;
+ if (int c = it->get_value(id) != SNMP_CLASS_SUCCESS) {
+ logger << "Switch::dropACLsByTable() - failed to get ACL id for the switch '" << _ip << "'. Error message: '" << Snmp::error_msg(c) << "'" << std::endl;
+ return false;
+ }
+ std::string dropACLOid(dropACLOidPrefix);
+ dropACLOid += ".";
+ dropACLOid += boost::lexical_cast<std::string>(id);
+ Vb vb(Oid(dropACLOid.c_str()));
+ vb.set_value(int(6));
+ pdu += vb;
+ }
+ if (int c = _snmp.set(pdu, target) != SNMP_CLASS_SUCCESS) {
+ 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;
+ }