2016-07-10 12:47:23 +02:00
|
|
|
/*
|
|
|
|
* 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 <vector>
|
2016-10-13 18:46:02 +02:00
|
|
|
|
2016-09-17 12:07:23 +02:00
|
|
|
#include "DMRLC.h"
|
2016-07-10 12:47:23 +02:00
|
|
|
|
2016-11-10 19:43:54 +01:00
|
|
|
class CDMRAccessControl {
|
2016-07-10 12:47:23 +02:00
|
|
|
public:
|
2016-10-13 18:46:02 +02:00
|
|
|
static bool validateAccess(unsigned int srcId, unsigned int dstId, unsigned int slot, bool network);
|
2016-07-10 12:47:23 +02:00
|
|
|
|
2016-11-10 19:43:54 +01:00
|
|
|
static bool validateSrcId(unsigned int id);
|
|
|
|
|
2016-12-21 19:06:43 +01:00
|
|
|
static void init(const std::vector<unsigned int>& dstIdBlacklistSlot1RF, const std::vector<unsigned int>& dstIdWhitelistSlot1RF, const std::vector<unsigned int>& dstIdBlacklistSlot2RF, const std::vector<unsigned int>& dstIdWhitelistSlot2RF, const std::vector<unsigned int>& dstIdBlacklistSlot1NET, const std::vector<unsigned int>& dstIdWhitelistSlot1NET, const std::vector<unsigned int>& dstIdBlacklistSlot2NET, const std::vector<unsigned int>& dstIdWhitelistSlot2NET, const std::vector<unsigned int>& srcIdBlacklist, bool selfOnly, const std::vector<unsigned int>& prefixes, unsigned int id);
|
2016-09-11 13:15:03 +02:00
|
|
|
|
2016-07-10 12:47:23 +02:00
|
|
|
private:
|
2016-07-10 22:37:11 +02:00
|
|
|
static std::vector<unsigned int> m_dstBlackListSlot1RF;
|
|
|
|
static std::vector<unsigned int> m_dstBlackListSlot2RF;
|
|
|
|
static std::vector<unsigned int> m_dstWhiteListSlot1RF;
|
|
|
|
static std::vector<unsigned int> m_dstWhiteListSlot2RF;
|
|
|
|
|
|
|
|
static std::vector<unsigned int> m_dstBlackListSlot1NET;
|
|
|
|
static std::vector<unsigned int> m_dstBlackListSlot2NET;
|
|
|
|
static std::vector<unsigned int> m_dstWhiteListSlot1NET;
|
|
|
|
static std::vector<unsigned int> m_dstWhiteListSlot2NET;
|
2016-07-11 18:41:53 +02:00
|
|
|
|
2016-10-13 18:46:02 +02:00
|
|
|
static std::vector<unsigned int> m_srcIdBlacklist;
|
2016-07-11 18:41:53 +02:00
|
|
|
|
2016-07-10 17:46:02 +02:00
|
|
|
static std::vector<unsigned int> m_prefixes;
|
2016-09-15 15:19:00 +02:00
|
|
|
|
2016-07-10 17:46:02 +02:00
|
|
|
static bool m_selfOnly;
|
|
|
|
static unsigned int m_id;
|
2016-07-11 18:41:53 +02:00
|
|
|
|
2016-10-13 18:46:02 +02:00
|
|
|
static bool dstIdBlacklist(unsigned int did, unsigned int slot, bool network);
|
|
|
|
static bool dstIdWhitelist(unsigned int did, unsigned int slot, bool gt4k, bool network);
|
2016-07-10 12:47:23 +02:00
|
|
|
};
|
|
|
|
|
2016-07-11 18:41:53 +02:00
|
|
|
#endif
|