X-Git-Url: https://git.stg.codes/ssmd.git/blobdiff_plain/ae26516a8828d54ab7c0e0bca92031a54a15ed62..5042f0be451ee5b0cc29188ae9b310f39670d502:/src/acl.cpp diff --git a/src/acl.cpp b/src/acl.cpp index 08f0405..a882182 100644 --- a/src/acl.cpp +++ b/src/acl.cpp @@ -106,6 +106,42 @@ void ACL::appendPdu(Pdu & pdu) const 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 {