#ifndef __GTS_SWITCH_H__ #define __GTS_SWITCH_H__ #include #include class Snmp; class CTarget; namespace GTS { 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); bool dropACLsByTable(const CTarget & target, unsigned profileId, const SNMPTable & table); bool createACLs(const CTarget & target); }; } #endif