aboutsummaryrefslogtreecommitdiffstats
path: root/include/openbsc/gsm_subscriber.h
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2009-01-01 18:02:05 +0000
committerHolger Freyther <zecke@selfish.org>2009-01-01 18:02:05 +0000
commit12aa50d5a26aefa739da4f1e95c0e2921e704842 (patch)
treeb58f6be9a0fd9c39517e9e3534b7a364becc39f8 /include/openbsc/gsm_subscriber.h
parent67b4b9a017647b7d28343a352778920633ebf575 (diff)
Change the subscriber and database backend
gsm_subscriber is now refcounted, the db backend is leaking a lot less, db_get_subscriber will allocate the subscr record now, subscr_* will look up a subscriber in the list of currently active subscribers and add an ref to this one. The db test cases pass, more testing will be when next to the bts
Diffstat (limited to 'include/openbsc/gsm_subscriber.h')
-rw-r--r--include/openbsc/gsm_subscriber.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/openbsc/gsm_subscriber.h b/include/openbsc/gsm_subscriber.h
index 97c7665e..90117d3e 100644
--- a/include/openbsc/gsm_subscriber.h
+++ b/include/openbsc/gsm_subscriber.h
@@ -3,6 +3,7 @@
#include <sys/types.h>
#include "gsm_data.h"
+#include "linuxlist.h"
#define GSM_IMEI_LENGTH 17
#define GSM_IMSI_LENGTH 17
@@ -18,6 +19,10 @@ struct gsm_subscriber {
char name[GSM_NAME_LENGTH];
char extension[GSM_EXTENSION_LENGTH];
int authorized;
+
+ /* for internal management */
+ int use_count;
+ struct llist_head entry;
};
enum gsm_subscriber_field {
@@ -25,4 +30,8 @@ enum gsm_subscriber_field {
GSM_SUBSCRIBER_TMSI,
};
+struct gsm_subscriber *subscr_alloc();
+struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr);
+struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr);
+
#endif /* _GSM_SUBSCR_H */