blob: 0656ccaa21740593c1b4ae0172f9d90d3a36cfa0 [file] [log] [blame]
Neels Hofmeyrc4628a32018-12-07 14:47:34 +01001/* Lookup table for various RAN implementations */
2/*
Vadim Yanitskiy999a5932023-05-18 17:22:26 +07003 * (C) 2019 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de>
Neels Hofmeyrc4628a32018-12-07 14:47:34 +01004 * All Rights Reserved
5 *
6 * SPDX-License-Identifier: AGPL-3.0+
7 *
8 * Author: Neels Hofmeyr
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
19 *
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24#include <osmocom/core/utils.h>
25#include <osmocom/core/tdef.h>
26
27#include <osmocom/msc/debug.h>
28#include <osmocom/msc/ran_msg_a.h>
29#include <osmocom/msc/ran_msg_iu.h>
30#include <osmocom/msc/ran_peer.h>
31
32#include <osmocom/msc/ran_infra.h>
33
Neels Hofmeyr4ac80092019-03-04 02:46:37 +010034#include "config.h"
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010035
36const struct value_string an_proto_names[] = {
37 { OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_48006, "Ts3G-48006" },
38 { OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_25413, "Ts3G-25413" },
39 {}
40};
41
42#define RAN_TDEFS \
43 { .T = -1, .default_val = 5, .desc = "RAN connection Complete Layer 3, Authentication and Ciphering timeout" }, \
44 { .T = -2, .default_val = 30, .desc = "RAN connection release sanity timeout" }, \
45 { .T = -3, .default_val = 10, .desc = "Timeout to find a target BSS after Handover Required" }, \
Alexander Couzensae167fc2020-09-25 05:25:16 +020046 { .T = -4, .default_val = 10, .desc = "Paging response timeout" }, \
Vadim Yanitskiy3e66ec52024-05-08 00:17:43 +020047 { .T = -36, .default_val = 0, .unit = OSMO_TDEF_MS, \
48 .desc = "Delay connection release after LU. Useful to optimize an SMSC to dispatch " \
49 "pending messages within the initial connection." }, \
Neels Hofmeyr22d4f352024-06-21 19:08:34 +020050 { .T = -37, .default_val = 10, \
51 .desc = "Voice channel Assignment sanity timeout, when no response is received (should never happen)." }, \
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010052
53struct osmo_tdef msc_tdefs_geran[] = {
54 RAN_TDEFS
55 {}
56};
57
58struct osmo_tdef msc_tdefs_utran[] = {
59 RAN_TDEFS
60 {}
61};
62
63struct osmo_tdef msc_tdefs_sgs[] = {
Alexander Couzensae167fc2020-09-25 05:25:16 +020064 { .T = -4, .default_val = 10, .desc = "Paging response timeout" },
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010065 {}
66};
67
68static __attribute__((constructor)) void ran_infra_init()
69{
70 osmo_tdefs_reset(msc_tdefs_geran);
71 osmo_tdefs_reset(msc_tdefs_utran);
72 osmo_tdefs_reset(msc_tdefs_sgs);
73}
74
75struct ran_infra msc_ran_infra[] = {
76 [OSMO_RAT_UNKNOWN] = {
77 .type = OSMO_RAT_UNKNOWN,
78 .log_subsys = DMSC,
79 .tdefs = msc_tdefs_geran,
80 },
81 [OSMO_RAT_GERAN_A] = {
82 .type = OSMO_RAT_GERAN_A,
83 .an_proto = OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_48006,
84 .ssn = OSMO_SCCP_SSN_BSSAP,
85 .log_subsys = DBSSAP,
86 .tdefs = msc_tdefs_geran,
87 .sccp_ran_ops = {
88 .up_l2 = ran_peer_up_l2,
89 .disconnect = ran_peer_disconnect,
90 .is_reset_msg = bssmap_is_reset_msg,
91 .make_reset_msg = bssmap_make_reset_msg,
92 .make_paging_msg = bssmap_make_paging_msg,
93 .msg_name = bssmap_msg_name,
94 },
95 .ran_dec_l2 = ran_a_decode_l2,
96 .ran_encode = ran_a_encode,
97 },
98 [OSMO_RAT_UTRAN_IU] = {
99 .type = OSMO_RAT_UTRAN_IU,
100 .an_proto = OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_25413,
101 .ssn = OSMO_SCCP_SSN_RANAP,
102 .log_subsys = DIUCS,
103 .tdefs = msc_tdefs_utran,
104#if BUILD_IU
105 .sccp_ran_ops = {
106 .up_l2 = ran_peer_up_l2,
107 .disconnect = ran_peer_disconnect,
108 .is_reset_msg = ranap_is_reset_msg,
109 .make_reset_msg = ranap_make_reset_msg,
110 .make_paging_msg = ranap_make_paging_msg,
111 .msg_name = ranap_msg_name,
112 },
113 .ran_dec_l2 = ran_iu_decode_l2,
114 .ran_encode = ran_iu_encode,
115#endif
Neels Hofmeyr1dc39612023-03-03 16:43:19 +0100116 .force_mgw_codecs_to_ran = {
117 .count = 1,
118 .codec = {
119 {
120 .payload_type = 96,
121 .subtype_name = "VND.3GPP.IUFP",
122 .rate = 16000,
123 },
124 },
125 },
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100126 },
127 [OSMO_RAT_EUTRAN_SGS] = {
128 .type = OSMO_RAT_EUTRAN_SGS,
129 .log_subsys = DSGS,
130 .ran_encode = NULL,
131 .tdefs = msc_tdefs_sgs,
132 },
133};
134
135const int msc_ran_infra_len = ARRAY_SIZE(msc_ran_infra);