Neels Hofmeyr | ce67be1 | 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 |
| 25 | * and not link against osmo-iuh. |
| 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 | |
| 38 | int msc_tx_dtap(struct gsm_subscriber_connection *conn, |
| 39 | struct msgb *msg); |
| 40 | |
| 41 | int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn); |
| 42 | int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn, |
| 43 | enum gsm48_reject_value value); |
| 44 | |
| 45 | /* TODO: specific to A interface, move this away */ |
| 46 | int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, |
| 47 | const uint8_t *key, int len, int include_imeisv); |