diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/openbsc/Makefile.am | 1 | ||||
-rw-r--r-- | include/openbsc/gsm_04_08.h | 2 | ||||
-rw-r--r-- | include/openbsc/gsm_data.h | 30 | ||||
-rw-r--r-- | include/openbsc/gsm_subscriber.h | 28 | ||||
-rw-r--r-- | include/openbsc/mncc.h | 4 | ||||
-rw-r--r-- | include/openbsc/msc_ifaces.h | 47 | ||||
-rw-r--r-- | include/openbsc/osmo_msc.h | 5 |
7 files changed, 100 insertions, 17 deletions
diff --git a/include/openbsc/Makefile.am b/include/openbsc/Makefile.am index 456a4a2d2..1dfe6c314 100644 --- a/include/openbsc/Makefile.am +++ b/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/include/openbsc/gsm_04_08.h b/include/openbsc/gsm_04_08.h index c40d96d65..6d6ead183 100644 --- a/include/openbsc/gsm_04_08.h +++ b/include/openbsc/gsm_04_08.h @@ -65,8 +65,6 @@ 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 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/include/openbsc/gsm_data.h b/include/openbsc/gsm_data.h index fa2fed778..17b3d7172 100644 --- a/include/openbsc/gsm_data.h +++ b/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] @@ -117,6 +118,12 @@ struct gsm_classmark { uint8_t classmark3[14]; /* if cm3 gets extended by spec, it will be truncated */ }; +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 */ @@ -176,6 +183,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; }; @@ -311,6 +327,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; @@ -416,6 +438,9 @@ struct gsm_network { uint16_t gsup_server_port; struct vlr_instance *vlr; + + /* Periodic location update default value */ + uint8_t t3212; }; struct osmo_esme; @@ -471,10 +496,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, @@ -557,7 +578,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/include/openbsc/gsm_subscriber.h b/include/openbsc/gsm_subscriber.h index c65b8a315..60eb0cd65 100644 --- a/include/openbsc/gsm_subscriber.h +++ b/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,17 +32,35 @@ 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, struct msgb *msg, void *data, void *param); +int msc_fake_paging_request(struct vlr_subscr *vsub); +void msc_fake_paging_request_stop(struct vlr_subscr *vsub); + #endif /* _GSM_SUBSCR_H */ diff --git a/include/openbsc/mncc.h b/include/openbsc/mncc.h index 49f0c8b83..881e0418e 100644 --- a/include/openbsc/mncc.h +++ b/include/openbsc/mncc.h @@ -155,9 +155,6 @@ struct gsm_mncc { int notify; /* 0..127 */ int emergency; char imsi[16]; - - unsigned char lchan_type; - unsigned char lchan_mode; }; struct gsm_data_frame { @@ -179,7 +176,6 @@ struct gsm_mncc_hello { uint32_t called_offset; uint32_t signal_offset; uint32_t emergency_offset; - uint32_t lchan_type_offset; }; struct gsm_mncc_rtp { diff --git a/include/openbsc/msc_ifaces.h b/include/openbsc/msc_ifaces.h new file mode 100644 index 000000000..83aad92a4 --- /dev/null +++ b/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/include/openbsc/osmo_msc.h b/include/openbsc/osmo_msc.h index 0642c9109..5a26b6042 100644 --- a/include/openbsc/osmo_msc.h +++ b/include/openbsc/osmo_msc.h @@ -51,6 +51,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(); |