blob: a1071ae9b5bd8ad882c0fcf74f34c9075a569c3c [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
Neels Hofmeyr0e5a7c42017-05-08 15:12:20 +020031int msc_tx_dtap(struct gsm_subscriber_connection *conn,
32 struct msgb *msg);
33
34int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn);
35int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn,
36 enum gsm48_reject_value value);
37
Neels Hofmeyra1756f32016-05-20 21:59:55 +020038int msc_tx_common_id(struct gsm_subscriber_connection *conn);
39int msc_call_assignment(struct gsm_trans *trans);
40int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2);
Philipp Maier4b60d072017-04-09 12:32:51 +020041void msc_call_release(struct gsm_trans *trans);
42int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip);