]> git.stg.codes - ssmd.git/blobdiff - src/switch.cpp
Fix compilation issues with new cURL
[ssmd.git] / src / switch.cpp
index 43c83da2ad8d14c45770b95504c6020198c82f7e..b70540294d9c1fa6ad4246366c17d9b99bb6e284 100644 (file)
@@ -178,7 +178,8 @@ bool Switch::dropACLsByTable(const CTarget & target, unsigned profileId, const S
     SNMPList::const_iterator it;
     for (it = aclsList.begin(); it != aclsList.end(); ++it) {
         int id;
-        if (it->get_value(id) != SNMP_CLASS_SUCCESS) {
+        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);
@@ -188,8 +189,8 @@ bool Switch::dropACLsByTable(const CTarget & target, unsigned profileId, const S
         vb.set_value(int(6));
         pdu += vb;
     }
-    if (_snmp.set(pdu, target) != SNMP_CLASS_SUCCESS) {
-        logger << "Switch::dropACLsByTable() - failed to invoke Snmp::set for the switch '" << _ip << "'" << std::endl;
+    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;
     }
     return true;
@@ -201,8 +202,8 @@ bool Switch::createACLs(const CTarget & target)
     for (it = _acls.begin(); it != _acls.end(); ++it) {
         Pdu pdu;
         it->appendPdu(pdu);
-        if (_snmp.set(pdu, target) != SNMP_CLASS_SUCCESS) {
-            logger << "Switch::createACLs() - failed to invoke Snmp::set for the switch '" << _ip << "'" << std::endl;
+        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) << "'" << std::endl;
             return false;
         }
     }