+// returns requests that fall under a policy
+// if id is -1, returns total requests
+// if non-existent policy, returns -1
+// counters are cumulative
+long int protector::get_requests(int id) const {
+ if (id == -1){
+ return net_requests;
+ }
+
+ std::lock_guard<std::mutex> lck(*(m_access.get()));
+ auto policy_it = policy_list.find(id);
+ if (policy_it == policy_list.end()){
+ return -1;
+ }
+ else{
+ return policy_it->second._req;
+ }
+
+}
+
+// returns requests that fall under a policy
+// if id is -1 , returns total rejects
+// if non-existent policy, returns -1
+// counters are cumulative
+long int protector::get_rejects(int id) const {
+
+ if (id == -1){
+ return net_rejects;
+ }
+
+ std::lock_guard<std::mutex> lck(*(m_access.get()));
+ auto policy_it = policy_list.find(id);
+ if (policy_it == policy_list.end()){
+ return -1;
+ }
+ else{
+ return policy_it->second._rej;
+ }
+
+}
+
+// returns list of active policies in
+// supplied vector (policy is indexed by subscriber profile id)
+void protector::get_active_policies(std::vector<int> & active){
+ std::lock_guard<std::mutex> lck(*(m_access.get()));
+ for (const auto &e : policy_list){
+ active.push_back(e.first);
+ }
+}
+
+// returns true if policy active else false
+bool protector::is_active(int id){
+ auto policy_it = policy_list.find(id);
+ if (policy_it == policy_list.end()){
+ return false;
+ }
+ else{
+ return true;
+ }
+}
+
+// clears counters for all policies