blob: 2965c72c50ef4f6b41b0a949ab01f456ecde13dd [file] [log] [blame]
Neels Hofmeyr0e5a7c42017-05-08 15:12:20 +02001#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 Hofmeyra1756f32016-05-20 21:59:55 +020025 * and not link against osmo-iuh, see tests/libiudummy/.
Neels Hofmeyr0e5a7c42017-05-08 15:12:20 +020026 */
27
28/* Each main linkage must implement this function (see comment above). */
29extern 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 * " */
36extern int a_tx(struct msgb *msg);
37
Neels Hofmeyra1756f32016-05-20 21:59:55 +020038/* 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 * " */
43extern int a_page(const char *imsi, uint32_t tmsi, uint16_t lac);
44
Neels Hofmeyr0e5a7c42017-05-08 15:12:20 +020045int msc_tx_dtap(struct gsm_subscriber_connection *conn,
46 struct msgb *msg);
47
48int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn);
49int 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 */
53int msc_gsm0808_tx_cipher_mode(struct gsm_subscriber_connection *conn, int cipher,
54 const uint8_t *key, int len, int include_imeisv);
Neels Hofmeyra1756f32016-05-20 21:59:55 +020055
56int msc_tx_common_id(struct gsm_subscriber_connection *conn);
57int msc_call_assignment(struct gsm_trans *trans);
58int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2);