#ifndef __SSMD_SWITCH_H__ #define __SSMD_SWITCH_H__ #include #include #include class Snmp; class CTarget; namespace SSMD { class Settings; class Subscriber; class ACL; class SNMPTable; class Switch { public: Switch(const Settings & settings, Snmp & snmp, const std::string & ip, const std::string & readCommunity, const std::string & writeCommunity, unsigned uplinkPort); Switch(const Switch & rvalue); ~Switch(); Switch & operator=(const Switch & rvalue); const std::string & getIP() const { return _ip; } const std::string & getReadCommunity() const { return _readCommunity; } const std::string & getWriteCommunity() const { return _writeCommunity; } unsigned getUplinkPort() const { return _uplinkPort; } void addSubscriber(const Subscriber & subscriber); void sync(); private: const Settings & _settings; Snmp & _snmp; std::string _ip; std::string _readCommunity; std::string _writeCommunity; unsigned _uplinkPort; unsigned _nextUpACL; unsigned _nextDownACL; std::vector _acls; bool _aclsCreated; bool checkProfiles(const CTarget & target); bool dropACLs(const CTarget & target, std::ostream & stream); bool dropACLsByTable(const CTarget & target, unsigned profileId, const SNMPTable & table, std::ostream & stream); bool createACLs(const CTarget & target, std::ostream & stream); }; } #endif