summaryrefslogtreecommitdiff
path: root/ecp/server/acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'ecp/server/acl.c')
-rw-r--r--ecp/server/acl.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ecp/server/acl.c b/ecp/server/acl.c
index 7561af8..826b292 100644
--- a/ecp/server/acl.c
+++ b/ecp/server/acl.c
@@ -127,6 +127,16 @@ int acl_inlist(ecp_ecdh_public_t *public) {
return (item != NULL);
}
+unsigned int acl_count(void) {
+ unsigned int r = 0;
+
+ pthread_rwlock_rdlock(&acl_ht_rwlock);
+ if (acl_keys) r = ecp_ht_count(acl_keys);
+ pthread_rwlock_unlock(&acl_ht_rwlock);
+
+ return r;
+}
+
int acl_dir_inlist(ecp_ecdh_public_t *public) {
void *item = NULL;
@@ -137,6 +147,16 @@ int acl_dir_inlist(ecp_ecdh_public_t *public) {
return (item != NULL);
}
+unsigned int acl_dir_count(void) {
+ unsigned int r = 0;
+
+ pthread_rwlock_rdlock(&acl_ht_rwlock);
+ if (acl_keys) r = ecp_ht_count(acl_keys_dir);
+ pthread_rwlock_unlock(&acl_ht_rwlock);
+
+ return r;
+}
+
int acl_reset_ht(void) {
int rv = ECP_OK;