aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/include')
-rw-r--r--openbsc/include/openbsc/Makefile.am1
-rw-r--r--openbsc/include/openbsc/bsc_subscriber.h43
-rw-r--r--openbsc/include/openbsc/debug.h3
-rw-r--r--openbsc/include/openbsc/gsm_04_08.h4
-rw-r--r--openbsc/include/openbsc/gsm_data.h12
-rw-r--r--openbsc/include/openbsc/osmo_bsc_grace.h6
-rw-r--r--openbsc/include/openbsc/paging.h17
7 files changed, 75 insertions, 11 deletions
diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am
index 30c1191d7..7ddf323cd 100644
--- a/openbsc/include/openbsc/Makefile.am
+++ b/openbsc/include/openbsc/Makefile.am
@@ -10,6 +10,7 @@ noinst_HEADERS = \
bsc_nat_callstats.h \
bsc_nat_sccp.h \
bsc_rll.h \
+ bsc_subscriber.h \
bss.h \
bts_ipaccess_nanobts_omlattr.h \
chan_alloc.h \
diff --git a/openbsc/include/openbsc/bsc_subscriber.h b/openbsc/include/openbsc/bsc_subscriber.h
new file mode 100644
index 000000000..324734f9a
--- /dev/null
+++ b/openbsc/include/openbsc/bsc_subscriber.h
@@ -0,0 +1,43 @@
+/* GSM subscriber details for use in BSC land */
+
+#pragma once
+
+#include <stdint.h>
+
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/gsm/protocol/gsm_23_003.h>
+
+struct log_target;
+
+struct bsc_subscr {
+ struct llist_head entry;
+ int use_count;
+
+ char imsi[GSM23003_IMSI_MAX_DIGITS+1];
+ uint32_t tmsi;
+ uint16_t lac;
+};
+
+const char *bsc_subscr_name(struct bsc_subscr *bsub);
+
+struct bsc_subscr *bsc_subscr_find_or_create_by_imsi(struct llist_head *list,
+ const char *imsi);
+struct bsc_subscr *bsc_subscr_find_or_create_by_tmsi(struct llist_head *list,
+ uint32_t tmsi);
+
+struct bsc_subscr *bsc_subscr_find_by_imsi(struct llist_head *list,
+ const char *imsi);
+struct bsc_subscr *bsc_subscr_find_by_tmsi(struct llist_head *list,
+ uint32_t tmsi);
+
+void bsc_subscr_set_imsi(struct bsc_subscr *bsub, const char *imsi);
+
+struct bsc_subscr *_bsc_subscr_get(struct bsc_subscr *bsub,
+ const char *file, int line);
+struct bsc_subscr *_bsc_subscr_put(struct bsc_subscr *bsub,
+ const char *file, int line);
+#define bsc_subscr_get(bsub) _bsc_subscr_get(bsub, __BASE_FILE__, __LINE__)
+#define bsc_subscr_put(bsub) _bsc_subscr_put(bsub, __BASE_FILE__, __LINE__)
+
+void log_set_filter_bsc_subscr(struct log_target *target,
+ struct bsc_subscr *bsub);
diff --git a/openbsc/include/openbsc/debug.h b/openbsc/include/openbsc/debug.h
index 63000201d..74db72397 100644
--- a/openbsc/include/openbsc/debug.h
+++ b/openbsc/include/openbsc/debug.h
@@ -42,6 +42,7 @@ enum {
struct gsm_subscriber;
-void log_set_imsi_filter(struct log_target *target, struct gsm_subscriber *subscr);
+void log_set_filter_vlr_subscr(struct log_target *target,
+ struct gsm_subscriber *vlr_subscr);
extern const struct log_info log_info;
diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h
index cb632f632..bdf4ed2a6 100644
--- a/openbsc/include/openbsc/gsm_04_08.h
+++ b/openbsc/include/openbsc/gsm_04_08.h
@@ -15,6 +15,7 @@ struct gsm_trans;
struct gsm_subscriber_connection;
struct amr_multirate_conf;
struct amr_mode;
+struct bsc_subscr;
#define GSM48_ALLOC_SIZE 2048
#define GSM48_ALLOC_HEADROOM 256
@@ -78,7 +79,8 @@ int decode_bcd_number(char *output, int output_len, const uint8_t *bcd_lv,
int send_siemens_mrpci(struct gsm_lchan *lchan, uint8_t *classmark2_lv);
int gsm48_extract_mi(uint8_t *classmark2, int length, char *mi_string, uint8_t *mi_type);
int gsm48_paging_extract_mi(struct gsm48_pag_resp *pag, int length, char *mi_string, uint8_t *mi_type);
-int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, struct msgb *msg, struct gsm_subscriber *subscr);
+int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn,
+ struct msgb *msg, struct bsc_subscr *bsub);
int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t lchan_mode);
int gsm48_rx_rr_modif_ack(struct msgb *msg);
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 620b6e4e0..a36083ada 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -23,6 +23,7 @@
struct mncc_sock_state;
struct gsm_subscriber_group;
+struct bsc_subscr;
#define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3]
@@ -119,6 +120,9 @@ struct gsm_subscriber_connection {
/* To whom we are allocated at the moment */
struct gsm_subscriber *subscr;
+ /* libbsc subscriber information */
+ struct bsc_subscr *bsub;
+
/* LU expiration handling */
uint8_t expire_timer_stopped;
/* SMS helpers for libmsc */
@@ -391,6 +395,14 @@ struct gsm_network {
* BTS|RNC specific timezone overrides for multi-tz networks in
* OsmoMSC, this should be tied to the location area code (LAC). */
struct gsm_tz tz;
+
+ /* List of all struct bsc_subscr used in libbsc. This llist_head is
+ * allocated so that the llist_head pointer itself can serve as a
+ * talloc context (useful to not have to pass the entire gsm_network
+ * struct to the bsc_subscr_* API, and for bsc_susbscr unit tests to
+ * not require gsm_data.h). In an MSC-without-BSC environment, this
+ * pointer is NULL to indicate absence of a bsc_subscribers list. */
+ struct llist_head *bsc_subscribers;
};
struct osmo_esme;
diff --git a/openbsc/include/openbsc/osmo_bsc_grace.h b/openbsc/include/openbsc/osmo_bsc_grace.h
index ea5e4e2ab..5a81cd137 100644
--- a/openbsc/include/openbsc/osmo_bsc_grace.h
+++ b/openbsc/include/openbsc/osmo_bsc_grace.h
@@ -22,10 +22,14 @@
#define OSMO_BSC_GRACE_H
#include <openbsc/gsm_data.h>
+#include <openbsc/signal.h>
struct bsc_msc_data;
int bsc_grace_allow_new_connection(struct gsm_network *net, struct gsm_bts *bts);
-int bsc_grace_paging_request(struct gsm_subscriber *sub, int type, struct bsc_msc_data *msc);
+int bsc_grace_paging_request(enum signal_rf rf_policy,
+ struct bsc_subscr *subscr,
+ int chan_needed,
+ struct bsc_msc_data *msc);
#endif
diff --git a/openbsc/include/openbsc/paging.h b/openbsc/include/openbsc/paging.h
index 689ff5173..7dd8500ac 100644
--- a/openbsc/include/openbsc/paging.h
+++ b/openbsc/include/openbsc/paging.h
@@ -27,7 +27,7 @@
#include <osmocom/core/timer.h>
#include <openbsc/gsm_data.h>
-#include <openbsc/gsm_subscriber.h>
+#include <openbsc/bsc_subscriber.h>
/**
* A pending paging request
@@ -36,8 +36,8 @@ struct gsm_paging_request {
/* list_head for list of all paging requests */
struct llist_head entry;
/* the subscriber which we're paging. Later gsm_paging_request
- * should probably become a part of the gsm_subscriber struct? */
- struct gsm_subscriber *subscr;
+ * should probably become a part of the bsc_subsrc struct? */
+ struct bsc_subscr *bsub;
/* back-pointer to the BTS on which we are paging */
struct gsm_bts *bts;
/* what kind of channel type do we ask the MS to establish */
@@ -55,13 +55,14 @@ struct gsm_paging_request {
};
/* schedule paging request */
-int paging_request(struct gsm_network *network, struct gsm_subscriber *subscr,
+int paging_request(struct gsm_network *network, struct bsc_subscr *bsub,
int type, gsm_cbfn *cbfn, void *data);
-int paging_request_bts(struct gsm_bts *bts, struct gsm_subscriber *subscr,
- int type, gsm_cbfn *cbfn, void *data);
+int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub,
+ int type, gsm_cbfn *cbfn, void *data);
/* stop paging requests */
-void paging_request_stop(struct gsm_bts *bts, struct gsm_subscriber *subscr,
+void paging_request_stop(struct llist_head *bts_list,
+ struct gsm_bts *_bts, struct bsc_subscr *bsub,
struct gsm_subscriber_connection *conn,
struct msgb *msg);
@@ -71,6 +72,6 @@ void paging_update_buffer_space(struct gsm_bts *bts, uint16_t);
/* pending paging requests */
unsigned int paging_pending_requests_nr(struct gsm_bts *bts);
-void *paging_get_data(struct gsm_bts *bts, struct gsm_subscriber *subscr);
+void *paging_get_data(struct gsm_bts *bts, struct bsc_subscr *bsub);
#endif