aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/gsm_data.h
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/include/openbsc/gsm_data.h')
-rw-r--r--openbsc/include/openbsc/gsm_data.h90
1 files changed, 76 insertions, 14 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index f229e7499..44a83117e 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -8,6 +8,7 @@
#include <osmocom/crypt/auth.h>
#include <openbsc/rest_octets.h>
+#include <openbsc/xsc.h>
/** annotations for msgb ownership */
#define __uses
@@ -97,7 +98,19 @@ struct neigh_meas_proc {
uint8_t last_seen_nr;
};
-/* the per subscriber data for lchan */
+enum interface_type {
+ IFACE_UNKNOWN = -1,
+ IFACE_A = 0, /* A-interface for 2G */
+ IFACE_IU = 1 /* Iu-interface for UMTS aka 3G (IuCS or IuPS) */
+};
+
+enum integrity_protection_state {
+ INTEGRITY_PROTECTION_NONE = 0,
+ INTEGRITY_PROTECTION_IK = 1,
+ INTEGRITY_PROTECTION_IK_CK = 2,
+};
+
+/* mobile subscriber data */
struct gsm_subscriber_connection {
struct llist_head entry;
@@ -124,18 +137,40 @@ struct gsm_subscriber_connection {
int mncc_rtp_create_pending;
int mncc_rtp_connect_pending;
- /* bsc structures */
- struct osmo_bsc_sccp_con *sccp_con;
-
/* back pointers */
+ struct gsm_network *network;
+
+ /* The BSC used to be an integral part of OsmoNITB. In OsmoCSCN, the
+ * BSC and/or RNC is a separate entity, and no back pointers to the bts
+ * and lchan structures are available. To facilitate separation of the
+ * code paths, I'm explicitly excluding the unavailable structures from
+ * the build. Once separated, this split may become unnecessary. */
+#if COMPILING_LIBMSC
int in_release;
+ uint16_t lac;
+ struct gsm_encr encr;
+
+ /* 2G or 3G? See enum interface_type */
+ int via_iface;
+
+ /* which Iu-CS connection, if any. */
+ struct {
+ struct ue_conn_ctx *ue_ctx;
+ int integrity_protection;
+ } iu;
+
+#else
+ struct gsm_bts *bts;
struct gsm_lchan *lchan;
struct gsm_lchan *ho_lchan;
- struct gsm_bts *bts;
+
+ /* bsc structures */
+ struct osmo_bsc_sccp_con *sccp_con;
/* for assignment handling */
struct osmo_timer_list T10;
struct gsm_lchan *secondary_lchan;
+#endif
};
@@ -207,7 +242,20 @@ enum gsm_auth_policy {
#define GSM_T3113_DEFAULT 60
#define GSM_T3122_DEFAULT 10
+struct gsm_tz {
+ int override; /* if 0, use system's time zone instead. */
+ int hr; /* hour */
+ int mn; /* minute */
+ int dst; /* daylight savings */
+};
+
struct gsm_network {
+ /* TODO MSCSPLIT the gsm_network struct is basically a kitchen sink for
+ * global settings and variables, "madly" mixing BSC and MSC stuff. Split
+ * this in e.g. struct osmo_bsc and struct osmo_msc, with the things
+ * these have in common, like country and network code, put in yet
+ * separate structs and placed as members in osmo_bsc and osmo_msc. */
+
/* global parameters */
uint16_t country_code;
uint16_t network_code;
@@ -290,6 +338,19 @@ struct gsm_network {
/* control interface */
struct ctrl_handle *ctrl;
+
+ /* all active subscriber connections. */
+ struct llist_head subscr_conns;
+
+ /* if override is nonzero, this timezone data is used for all MM
+ * contexts. */
+ /* TODO: in OsmoNITB, tz-override used to be BTS-specific. To enable
+ * BTS|RNC specific timezone overrides for multi-tz networks in
+ * OsmoCSCN, this should be tied to the location area code (LAC). */
+ struct gsm_tz tz;
+
+ /* Periodic location update default value */
+ uint8_t t3212;
};
struct osmo_esme;
@@ -336,13 +397,12 @@ struct gsm_sms {
char text[SMS_TEXT_SIZE];
};
-struct gsm_network *gsm_network_init(uint16_t country_code, uint16_t network_code,
- int (*mncc_recv)(struct gsm_network *, struct msgb *));
-int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type);
+struct gsm_network *gsm_network_init(void *ctx,
+ uint16_t country_code,
+ uint16_t network_code,
+ mncc_recv_cb_t mncc_recv);
-/* Get reference to a neighbor cell on a given BCCH ARFCN */
-struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts,
- uint16_t arfcn, uint8_t bsic);
+int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type);
enum gsm_bts_type parse_btstype(const char *arg);
const char *btstype2str(enum gsm_bts_type type);
@@ -426,13 +486,15 @@ int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode);
int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts);
void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts);
-struct gsm_meas_rep *lchan_next_meas_rep(struct gsm_lchan *lchan);
int gsm_btsmodel_set_feature(struct gsm_bts_model *model, enum gsm_bts_features feat);
int gsm_bts_model_register(struct gsm_bts_model *model);
-struct gsm_subscriber_connection *subscr_con_allocate(struct gsm_lchan *lchan);
-void subscr_con_free(struct gsm_subscriber_connection *conn);
+struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_lchan *lchan);
+void bsc_subscr_con_free(struct gsm_subscriber_connection *conn);
+
+struct gsm_subscriber_connection *msc_subscr_con_allocate(struct gsm_network *network);
+void msc_subscr_con_free(struct gsm_subscriber_connection *conn);
struct gsm_bts *gsm_bts_alloc_register(struct gsm_network *net,
enum gsm_bts_type type,