aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc
diff options
context:
space:
mode:
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r--openbsc/include/openbsc/Makefile.am1
-rw-r--r--openbsc/include/openbsc/gsm_04_08.h2
-rw-r--r--openbsc/include/openbsc/gsm_data.h30
-rw-r--r--openbsc/include/openbsc/gsm_subscriber.h25
-rw-r--r--openbsc/include/openbsc/msc_ifaces.h47
-rw-r--r--openbsc/include/openbsc/osmo_msc.h5
6 files changed, 99 insertions, 11 deletions
diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am
index b903782b3..1091e8a04 100644
--- a/openbsc/include/openbsc/Makefile.am
+++ b/openbsc/include/openbsc/Makefile.am
@@ -54,6 +54,7 @@ noinst_HEADERS = \
misdn.h \
mncc.h \
mncc_int.h \
+ msc_ifaces.h \
nat_rewrite_trie.h \
network_listen.h \
oap_client.h \
diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h
index ceaed7c5a..bf3f84236 100644
--- a/openbsc/include/openbsc/gsm_04_08.h
+++ b/openbsc/include/openbsc/gsm_04_08.h
@@ -79,6 +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);
+
+/* TODO MSCSPLIT remove gsm48_handle_paging_resp() */
int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn,
struct msgb *msg, struct bsc_subscr *bsub);
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index f2b7fa307..da61070f8 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -26,6 +26,7 @@ struct gsm_subscriber_group;
struct bsc_subscr;
struct vlr_instance;
struct vlr_subscr;
+struct ue_conn_ctx;
#define OBSC_LINKID_CB(__msgb) (__msgb)->cb[3]
@@ -110,6 +111,12 @@ struct gsm_classmark {
uint8_t classmark3[14];
};
+enum integrity_protection_state {
+ INTEGRITY_PROTECTION_NONE = 0,
+ INTEGRITY_PROTECTION_IK = 1,
+ INTEGRITY_PROTECTION_IK_CK = 2,
+};
+
/* active radio connection of a mobile subscriber */
struct gsm_subscriber_connection {
/* global linked list of subscriber_connections */
@@ -169,6 +176,15 @@ struct gsm_subscriber_connection {
enum ran_type via_ran;
struct gsm_classmark classmark;
+
+ uint16_t lac;
+ struct gsm_encr encr;
+
+ /* which Iu-CS connection, if any. */
+ struct {
+ struct ue_conn_ctx *ue_ctx;
+ int integrity_protection;
+ } iu;
};
@@ -304,6 +320,12 @@ struct gsm_tz {
};
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;
@@ -414,6 +436,9 @@ struct gsm_network {
uint16_t gsup_server_port;
struct vlr_instance *vlr;
+
+ /* Periodic location update default value */
+ uint8_t t3212;
};
struct osmo_esme;
@@ -464,10 +489,6 @@ extern void talloc_ctx_init(void *ctx_root);
int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type);
-/* 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);
-
enum gsm_bts_type parse_btstype(const char *arg);
const char *btstype2str(enum gsm_bts_type type);
struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac,
@@ -550,7 +571,6 @@ 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);
diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h
index c65b8a315..4124e0624 100644
--- a/openbsc/include/openbsc/gsm_subscriber.h
+++ b/openbsc/include/openbsc/gsm_subscriber.h
@@ -19,8 +19,6 @@
#define GSM_SUBSCRIBER_NO_EXPIRATION 0x0
-struct subscr_request;
-
enum gsm_subscriber_field {
GSM_SUBSCRIBER_IMSI,
GSM_SUBSCRIBER_TMSI,
@@ -34,14 +32,29 @@ enum gsm_subscriber_update_reason {
GSM_SUBSCRIBER_UPDATE_EQUIPMENT,
};
-int subscr_update(struct vlr_subscr *vsub, struct gsm_bts *bts, int reason);
+/*
+ * Struct for pending channel requests. This is managed in the
+ * llist_head requests of each subscriber. The reference counting
+ * should work in such a way that a subscriber with a pending request
+ * remains in memory.
+ */
+struct subscr_request {
+ struct llist_head entry;
+
+ /* the callback data */
+ gsm_cbfn *cbfn;
+ void *param;
+};
+
+int subscr_update(struct vlr_subscr *vsub, int reason);
/*
* Paging handling with authentication
*/
-struct subscr_request *subscr_request_channel(struct vlr_subscr *vsub,
- int channel_type,
- gsm_cbfn *cbfn, void *param);
+struct subscr_request *subscr_request_conn(struct vlr_subscr *vsub,
+ int channel_type,
+ gsm_cbfn *cbfn, void *param);
+
void subscr_remove_request(struct subscr_request *req);
int subscr_paging_dispatch(unsigned int hooknum, unsigned int event,
diff --git a/openbsc/include/openbsc/msc_ifaces.h b/openbsc/include/openbsc/msc_ifaces.h
new file mode 100644
index 000000000..83aad92a4
--- /dev/null
+++ b/openbsc/include/openbsc/msc_ifaces.h
@@ -0,0 +1,47 @@
+#pragma once
+
+#include <osmocom/core/msgb.h>
+#include <openbsc/gsm_data.h>
+
+/* These are the interfaces of the MSC layer towards (from?) the BSC and RNC,
+ * i.e. in the direction towards the mobile device (MS aka UE).
+ *
+ * 2G will use the A-interface,
+ * 3G aka UMTS will use the Iu-interface (for the MSC, it's IuCS).
+ *
+ * To allow linking parts of the MSC code without having to include entire
+ * infrastructures of external libraries, the core transmitting and receiving
+ * functions are left unimplemented. For example, a unit test does not need to
+ * link against external ASN1 libraries if it is never going to encode actual
+ * outgoing messages. It is up to each building scope to implement real world
+ * functions or to plug mere dummy implementations.
+ *
+ * For example, msc_tx_dtap(conn, msg), depending on conn->via_iface, will call
+ * either iu_tx() or a_tx() [note: at time of writing, the A-interface is not
+ * yet implemented]. When you try to link against libmsc, you will find that
+ * the compiler complains about an undefined reference to iu_tx(). If you,
+ * however, link against libiu as well as the osmo-iuh libs (etc.), iu_tx() is
+ * available. A unit test may instead simply implement a dummy iu_tx() function
+ * and not link against osmo-iuh.
+ */
+
+/* Each main linkage must implement this function (see comment above). */
+extern int iu_tx(struct msgb *msg, uint8_t sapi);
+
+/* So far this is a dummy implemented in libmsc/a_iface.c. When A-interface
+ * gets implemented, it should be in a separate lib (like libiu), this function
+ * should move there, and the following comment should remain here: "
+ * Each main linkage must implement this function (see comment above).
+ * " */
+extern int a_tx(struct msgb *msg);
+
+int msc_tx_dtap(struct gsm_subscriber_connection *conn,
+ struct msgb *msg);
+
+int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn);
+int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn,
+ enum gsm48_reject_value value);
+
+/* TODO: specific to A interface, move this away */
+int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int cipher,
+ const uint8_t *key, int len, int include_imeisv);
diff --git a/openbsc/include/openbsc/osmo_msc.h b/openbsc/include/openbsc/osmo_msc.h
index 166732ebf..6096e0b3e 100644
--- a/openbsc/include/openbsc/osmo_msc.h
+++ b/openbsc/include/openbsc/osmo_msc.h
@@ -50,6 +50,11 @@ static inline const char *subscr_conn_from_name(enum subscr_conn_from val)
return get_value_string(subscr_conn_from_names, val);
}
+enum msc_compl_l3_rc {
+ MSC_CONN_ACCEPT = 0,
+ MSC_CONN_REJECT = 1,
+};
+
struct bsc_api *msc_bsc_api();