blob: 79de7d250b52759ec5c9d1dca571038adb35472a [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 Hofmeyrc4628a32018-12-07 14:47:34 +010050
51struct osmo_tdef msc_tdefs_geran[] = {
52 RAN_TDEFS
53 {}
54};
55
56struct osmo_tdef msc_tdefs_utran[] = {
57 RAN_TDEFS
58 {}
59};
60
61struct osmo_tdef msc_tdefs_sgs[] = {
Alexander Couzensae167fc2020-09-25 05:25:16 +020062 { .T = -4, .default_val = 10, .desc = "Paging response timeout" },
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010063 {}
64};
65
66static __attribute__((constructor)) void ran_infra_init()
67{
68 osmo_tdefs_reset(msc_tdefs_geran);
69 osmo_tdefs_reset(msc_tdefs_utran);
70 osmo_tdefs_reset(msc_tdefs_sgs);
71}
72
73struct ran_infra msc_ran_infra[] = {
74 [OSMO_RAT_UNKNOWN] = {
75 .type = OSMO_RAT_UNKNOWN,
76 .log_subsys = DMSC,
77 .tdefs = msc_tdefs_geran,
78 },
79 [OSMO_RAT_GERAN_A] = {
80 .type = OSMO_RAT_GERAN_A,
81 .an_proto = OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_48006,
82 .ssn = OSMO_SCCP_SSN_BSSAP,
83 .log_subsys = DBSSAP,
84 .tdefs = msc_tdefs_geran,
85 .sccp_ran_ops = {
86 .up_l2 = ran_peer_up_l2,
87 .disconnect = ran_peer_disconnect,
88 .is_reset_msg = bssmap_is_reset_msg,
89 .make_reset_msg = bssmap_make_reset_msg,
90 .make_paging_msg = bssmap_make_paging_msg,
91 .msg_name = bssmap_msg_name,
92 },
93 .ran_dec_l2 = ran_a_decode_l2,
94 .ran_encode = ran_a_encode,
95 },
96 [OSMO_RAT_UTRAN_IU] = {
97 .type = OSMO_RAT_UTRAN_IU,
98 .an_proto = OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_25413,
99 .ssn = OSMO_SCCP_SSN_RANAP,
100 .log_subsys = DIUCS,
101 .tdefs = msc_tdefs_utran,
102#if BUILD_IU
103 .sccp_ran_ops = {
104 .up_l2 = ran_peer_up_l2,
105 .disconnect = ran_peer_disconnect,
106 .is_reset_msg = ranap_is_reset_msg,
107 .make_reset_msg = ranap_make_reset_msg,
108 .make_paging_msg = ranap_make_paging_msg,
109 .msg_name = ranap_msg_name,
110 },
111 .ran_dec_l2 = ran_iu_decode_l2,
112 .ran_encode = ran_iu_encode,
113#endif
Neels Hofmeyr1dc39612023-03-03 16:43:19 +0100114 .force_mgw_codecs_to_ran = {
115 .count = 1,
116 .codec = {
117 {
118 .payload_type = 96,
119 .subtype_name = "VND.3GPP.IUFP",
120 .rate = 16000,
121 },
122 },
123 },
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100124 },
125 [OSMO_RAT_EUTRAN_SGS] = {
126 .type = OSMO_RAT_EUTRAN_SGS,
127 .log_subsys = DSGS,
128 .ran_encode = NULL,
129 .tdefs = msc_tdefs_sgs,
130 },
131};
132
133const int msc_ran_infra_len = ARRAY_SIZE(msc_ran_infra);