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 | |
Neels Hofmeyr | 0e5a7c4 | 2017-05-08 15:12:20 +0200 | [diff] [blame] | 31 | int msc_tx_dtap(struct gsm_subscriber_connection *conn, |
| 32 | struct msgb *msg); |
| 33 | |
| 34 | int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn); |
| 35 | int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn, |
| 36 | enum gsm48_reject_value value); |
| 37 | |
Neels Hofmeyr | a1756f3 | 2016-05-20 21:59:55 +0200 | [diff] [blame] | 38 | int msc_tx_common_id(struct gsm_subscriber_connection *conn); |
| 39 | int msc_call_assignment(struct gsm_trans *trans); |
| 40 | int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2); |
Philipp Maier | 4b60d07 | 2017-04-09 12:32:51 +0200 | [diff] [blame^] | 41 | void msc_call_release(struct gsm_trans *trans); |
| 42 | int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip); |