Neels Hofmeyr | 0e5a7c4 | 2017-05-08 15:12:20 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <osmocom/core/msgb.h> |
| 4 | #include <openbsc/gsm_data.h> |
| 5 | |
| 6 | /* These are the interfaces of the MSC layer towards (from?) the BSC and RNC, |
| 7 | * i.e. in the direction towards the mobile device (MS aka UE). |
| 8 | * |
| 9 | * 2G will use the A-interface, |
| 10 | * 3G aka UMTS will use the Iu-interface (for the MSC, it's IuCS). |
| 11 | * |
| 12 | * To allow linking parts of the MSC code without having to include entire |
| 13 | * infrastructures of external libraries, the core transmitting and receiving |
| 14 | * functions are left unimplemented. For example, a unit test does not need to |
| 15 | * link against external ASN1 libraries if it is never going to encode actual |
| 16 | * outgoing messages. It is up to each building scope to implement real world |
| 17 | * functions or to plug mere dummy implementations. |
| 18 | * |
| 19 | * For example, msc_tx_dtap(conn, msg), depending on conn->via_iface, will call |
| 20 | * either iu_tx() or a_tx() [note: at time of writing, the A-interface is not |
| 21 | * yet implemented]. When you try to link against libmsc, you will find that |
| 22 | * the compiler complains about an undefined reference to iu_tx(). If you, |
| 23 | * however, link against libiu as well as the osmo-iuh libs (etc.), iu_tx() is |
| 24 | * available. A unit test may instead simply implement a dummy iu_tx() function |
Neels Hofmeyr | a1756f3 | 2016-05-20 21:59:55 +0200 | [diff] [blame] | 25 | * and not link against osmo-iuh, see tests/libiudummy/. |
Neels Hofmeyr | 0e5a7c4 | 2017-05-08 15:12:20 +0200 | [diff] [blame] | 26 | */ |
| 27 | |
| 28 | /* Each main linkage must implement this function (see comment above). */ |
| 29 | extern int iu_tx(struct msgb *msg, uint8_t sapi); |
| 30 | |
| 31 | /* So far this is a dummy implemented in libmsc/a_iface.c. When A-interface |
| 32 | * gets implemented, it should be in a separate lib (like libiu), this function |
| 33 | * should move there, and the following comment should remain here: " |
| 34 | * Each main linkage must implement this function (see comment above). |
| 35 | * " */ |
| 36 | extern int a_tx(struct msgb *msg); |
| 37 | |
Neels Hofmeyr | a1756f3 | 2016-05-20 21:59:55 +0200 | [diff] [blame] | 38 | /* So far this is a dummy implemented in libmsc/a_iface.c. When A-interface |
| 39 | * gets implemented, it should be in a separate lib (like libiu), this function |
| 40 | * should move there, and the following comment should remain here: " |
| 41 | * Each main linkage must implement this function (see comment above). |
| 42 | * " */ |
| 43 | extern int a_page(const char *imsi, uint32_t tmsi, uint16_t lac); |
| 44 | |
Neels Hofmeyr | 0e5a7c4 | 2017-05-08 15:12:20 +0200 | [diff] [blame] | 45 | int msc_tx_dtap(struct gsm_subscriber_connection *conn, |
| 46 | struct msgb *msg); |
| 47 | |
| 48 | int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn); |
| 49 | int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn, |
| 50 | enum gsm48_reject_value value); |
| 51 | |
| 52 | /* TODO: specific to A interface, move this away */ |
| 53 | int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, |
| 54 | const uint8_t *key, int len, int include_imeisv); |
Neels Hofmeyr | a1756f3 | 2016-05-20 21:59:55 +0200 | [diff] [blame] | 55 | |
| 56 | int msc_tx_common_id(struct gsm_subscriber_connection *conn); |
| 57 | int msc_call_assignment(struct gsm_trans *trans); |
| 58 | int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2); |