]> git.stg.codes - ssmd.git/blobdiff - src/acl.cpp
Minor fix
[ssmd.git] / src / acl.cpp
index 08f0405cef24de540f2f0111682ba36e3418bee6..a882182de03917982627ce9f88fc19394a4b9a17 100644 (file)
@@ -106,6 +106,42 @@ void ACL::appendPdu(Pdu & pdu) const
     pdu += vb;*/
 }
 
     pdu += vb;*/
 }
 
+std::ostream & GTS::operator<<(std::ostream & stream, const ACL & acl)
+{
+    std::string oidValue;
+    // MAC
+    if (acl._isUpload) {
+        oidValue = swACLEtherRuleSrcMacAddress;
+        oidValue += acl.getSuffix();
+    } else {
+        oidValue = swACLEtherRuleDstMacAddress;
+        oidValue += acl.getSuffix();
+    }
+    stream << oidValue << ":" << acl._mac << " ";
+
+    // Permit rule
+    oidValue = swACLEtherRulePermit;
+    oidValue += acl.getSuffix();
+    stream << oidValue << ":" << 2 << " ";
+
+    // Port
+    oidValue = swACLEtherRulePort;
+    oidValue += acl.getSuffix();
+    stream << oidValue << ":" << acl._port << " ";
+
+    // Shape
+    oidValue = swACLEtherRuleRxRate;
+    oidValue += acl.getSuffix();
+    stream << oidValue << ":" << acl._shape << " ";
+
+    // Create ACL
+    oidValue = swACLEtherRuleRowStatus;
+    oidValue += acl.getSuffix();
+    stream << oidValue << ":" << 4;
+
+    return stream;
+}
+
 inline
 std::string ACL::getSuffix() const
 {
 inline
 std::string ACL::getSuffix() const
 {