/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software */ #if !defined(DMRAccessControl_H) #define DMRAccessControl_H #include #include #include "DMRLC.h" class DMRAccessControl { public: static bool validateAccess (unsigned int src_id, unsigned int dst_id, unsigned int slot, bool network); static void init(const std::vector& DstIdBlacklistSlot1RF, const std::vector& DstIdWhitelistSlot1RF, const std::vector& DstIdBlacklistSlot2RF, const std::vector& DstIdWhitelistSlot2RF, const std::vector& DstIdBlacklistSlot1NET, const std::vector& DstIdWhitelistSlot1NET, const std::vector& DstIdBlacklistSlot2NET, const std::vector& DstIdWhitelistSlot2NET, const std::vector& SrcIdBlacklist, bool selfOnly, const std::vector& prefixes,unsigned int id,unsigned int callHang, bool TGRewrteSlot1, bool TGRewrteSlot2); static unsigned int DstIdRewrite(unsigned int id, unsigned int sid,unsigned int slot, bool network, CDMRLC* dmrLC); static void setOverEndTime(); private: static std::vector m_dstBlackListSlot1RF; static std::vector m_dstBlackListSlot2RF; static std::vector m_dstWhiteListSlot1RF; static std::vector m_dstWhiteListSlot2RF; static std::vector m_dstBlackListSlot1NET; static std::vector m_dstBlackListSlot2NET; static std::vector m_dstWhiteListSlot1NET; static std::vector m_dstWhiteListSlot2NET; static std::vector m_SrcIdBlacklist; static std::vector m_prefixes; static unsigned int m_callHang; static bool m_selfOnly; static unsigned int m_id; static bool DstIdBlacklist(unsigned int did,unsigned int slot, bool network); static bool DstIdWhitelist(unsigned int did,unsigned int slot,bool gt4k, bool network); static bool validateSrcId(unsigned int id); static std::time_t m_time; static unsigned int m_dstRewriteID; static unsigned int m_SrcID; static bool m_TGRewriteSlot1; static bool m_TGRewriteSlot2; static CDMRLC* m_lastdmrLC; }; #endif