blob: ca25e9ddfd6e22618dfecc61276edb0b481fb1ef [file] [log] [blame]
Neels Hofmeyre2f24d52017-05-08 15:12:20 +02001#pragma once
2
3#include <osmocom/core/msgb.h>
Neels Hofmeyr90843962017-09-04 15:04:35 +02004#include <osmocom/msc/gsm_data.h>
Max43b01b02017-09-15 11:22:30 +02005#include <osmocom/msc/transaction.h>
Neels Hofmeyre2f24d52017-05-08 15:12:20 +02006
7/* These are the interfaces of the MSC layer towards (from?) the BSC and RNC,
8 * i.e. in the direction towards the mobile device (MS aka UE).
9 *
10 * 2G will use the A-interface,
11 * 3G aka UMTS will use the Iu-interface (for the MSC, it's IuCS).
12 *
13 * To allow linking parts of the MSC code without having to include entire
14 * infrastructures of external libraries, the core transmitting and receiving
15 * functions are left unimplemented. For example, a unit test does not need to
16 * link against external ASN1 libraries if it is never going to encode actual
17 * outgoing messages. It is up to each building scope to implement real world
18 * functions or to plug mere dummy implementations.
19 *
20 * For example, msc_tx_dtap(conn, msg), depending on conn->via_iface, will call
21 * either iu_tx() or a_tx() [note: at time of writing, the A-interface is not
22 * yet implemented]. When you try to link against libmsc, you will find that
23 * the compiler complains about an undefined reference to iu_tx(). If you,
24 * however, link against libiu as well as the osmo-iuh libs (etc.), iu_tx() is
25 * available. A unit test may instead simply implement a dummy iu_tx() function
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020026 * and not link against osmo-iuh, see tests/libiudummy/.
Neels Hofmeyre2f24d52017-05-08 15:12:20 +020027 */
28
29/* Each main linkage must implement this function (see comment above). */
30extern int iu_tx(struct msgb *msg, uint8_t sapi);
31
Neels Hofmeyre2f24d52017-05-08 15:12:20 +020032int msc_tx_dtap(struct gsm_subscriber_connection *conn,
33 struct msgb *msg);
34
35int msc_gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn);
36int msc_gsm48_tx_mm_serv_rej(struct gsm_subscriber_connection *conn,
37 enum gsm48_reject_value value);
38
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020039int msc_tx_common_id(struct gsm_subscriber_connection *conn);