Max has uploaded this change for review. ( https://gerrit.osmocom.org/12223


Change subject: Add sgsn_acl_count()
......................................................................

Add sgsn_acl_count()

This is necessary to properly test ACLs in follow-up patches.

Change-Id: Ia7c5b36d07672ea43bfa2b531b9b6c56ba65161d
---
M include/osmocom/sgsn/gprs_sgsn.h
M src/gprs/sgsn_auth.c
2 files changed, 7 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/23/12223/1

diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h
index b6afe69..5d08d66 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/gprs_sgsn.h
@@ -463,6 +463,8 @@
 struct imsi_acl_entry *sgsn_acl_lookup(const char *imsi, const struct 
sgsn_config *cfg);
 int sgsn_acl_add(const char *imsi, struct sgsn_config *cfg);
 int sgsn_acl_del(const char *imsi, struct sgsn_config *cfg);
+size_t sgsn_acl_count(const struct sgsn_config *cfg);
+
 /* Request authorization */
 int sgsn_auth_request(struct sgsn_mm_ctx *mm);
 enum sgsn_auth_state sgsn_auth_state(struct sgsn_mm_ctx *mm);
diff --git a/src/gprs/sgsn_auth.c b/src/gprs/sgsn_auth.c
index b8d8035..0a39da4 100644
--- a/src/gprs/sgsn_auth.c
+++ b/src/gprs/sgsn_auth.c
@@ -53,6 +53,11 @@
        return NULL;
 }

+size_t sgsn_acl_count(const struct sgsn_config *cfg)
+{
+       return llist_count(&cfg->imsi_acl);
+}
+
 int sgsn_acl_add(const char *imsi, struct sgsn_config *cfg)
 {
        struct imsi_acl_entry *acl;

--
To view, visit https://gerrit.osmocom.org/12223
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7c5b36d07672ea43bfa2b531b9b6c56ba65161d
Gerrit-Change-Number: 12223
Gerrit-PatchSet: 1
Gerrit-Owner: Max <[email protected]>

Reply via email to