blob: 277ec07db0efb9cdc8d8c65295be17dd58284bab [file] [log] [blame]
Neels Hofmeyr84da6b12016-05-20 21:59:55 +02001/* Trivial switch-off of external Iu dependencies,
2 * allowing to run full unit tests even when built without Iu support. */
3
4/*
5 * (C) 2016,2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
6 *
7 * Author: Neels Hofmeyr <nhofmeyr@sysmocom.de>
8 *
9 * All Rights Reserved
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Affero General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Affero General Public License for more details.
20 *
21 * You should have received a copy of the GNU Affero General Public License
22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 *
24 */
25
26#include "../../bscconfig.h"
27#ifndef BUILD_IU
28
Neels Hofmeyr90843962017-09-04 15:04:35 +020029#include <osmocom/msc/iu_dummy.h>
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020030
31#include <osmocom/core/logging.h>
32#include <osmocom/vty/logging.h>
33#include <osmocom/core/msgb.h>
34
35struct msgb;
Neels Hofmeyr00e82d62017-07-05 15:19:52 +020036struct ranap_ue_conn_ctx;
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020037struct RANAP_Cause;
Neels Hofmeyr00e82d62017-07-05 15:19:52 +020038struct osmo_auth_vector;
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020039
Neels Hofmeyr00e82d62017-07-05 15:19:52 +020040int ranap_iu_tx(struct msgb *msg, uint8_t sapi)
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020041{
42 LOGP(DLGLOBAL, LOGL_INFO, "iu_tx() dummy called, NOT transmitting %d bytes: %s\n",
43 msg->len, osmo_hexdump(msg->data, msg->len));
44 return 0;
45}
46
Neels Hofmeyr00e82d62017-07-05 15:19:52 +020047int ranap_iu_tx_sec_mode_cmd(struct ranap_ue_conn_ctx *uectx, struct osmo_auth_vector *vec,
48 int send_ck)
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020049{
50 LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_sec_mode_cmd() dummy called, NOT transmitting Security Mode Command\n");
51 return 0;
52}
53
Neels Hofmeyr00e82d62017-07-05 15:19:52 +020054int ranap_iu_page_cs(const char *imsi, const uint32_t *tmsi, uint16_t lac)
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020055{
56 LOGP(DLGLOBAL, LOGL_INFO, "iu_page_cs() dummy called, NOT paging\n");
57 return 23;
58}
59
Neels Hofmeyr00e82d62017-07-05 15:19:52 +020060int ranap_iu_page_ps(const char *imsi, const uint32_t *ptmsi, uint16_t lac, uint8_t rac)
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020061{
62 LOGP(DLGLOBAL, LOGL_INFO, "iu_page_ps() dummy called, NOT paging\n");
63 return 0;
64}
65
66struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip,
67 uint16_t rtp_port,
68 bool use_x213_nsap)
69{
70 LOGP(DLGLOBAL, LOGL_INFO, "ranap_new_msg_rab_assign_voice() dummy called, NOT composing RAB Assignment\n");
71 return NULL;
72}
73
Neels Hofmeyr00e82d62017-07-05 15:19:52 +020074int ranap_iu_rab_act(struct ranap_ue_conn_ctx *ue_ctx, struct msgb *msg)
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020075{
76 LOGP(DLGLOBAL, LOGL_INFO, "iu_rab_act() dummy called, NOT activating RAB\n");
77 return 0;
78}
79
Neels Hofmeyr00e82d62017-07-05 15:19:52 +020080int ranap_iu_tx_common_id(struct ranap_ue_conn_ctx *uectx, const char *imsi)
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020081{
82 LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_common_id() dummy called, NOT sending CommonID\n");
83 return 0;
84}
85
Neels Hofmeyr00e82d62017-07-05 15:19:52 +020086int ranap_iu_tx_release(struct ranap_ue_conn_ctx *ctx, const struct RANAP_Cause *cause)
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020087{
88 LOGP(DLGLOBAL, LOGL_INFO, "iu_tx_release() dummy called, NOT sending Release\n");
89 return 0;
90}
91
Daniel Willmann6fbd3bf2018-02-15 10:33:21 +010092uint32_t iu_get_conn_id(const struct ranap_ue_conn_ctx *ue)
93{
Neels Hofmeyr361e5712019-01-03 02:32:14 +010094 /* There is a bogus conn_id in the bogus struct ranap_ue_conn_ctx, managed for unit testing of Iu even in the
95 * absence of libosmo-ranap (when built without Iu support). */
96 return ue->conn_id;
Daniel Willmann6fbd3bf2018-02-15 10:33:21 +010097}
98
Neels Hofmeyr84da6b12016-05-20 21:59:55 +020099#endif