Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 1 | /* Lookup table for various RAN implementations */ |
| 2 | /* |
| 3 | * (C) 2019 by sysmocom - s.m.f.c. GmbH <info@sysmocom.de> |
| 4 | * 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 Hofmeyr | 4ac8009 | 2019-03-04 02:46:37 +0100 | [diff] [blame] | 34 | #include "config.h" |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 35 | |
| 36 | const 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 Couzens | ae167fc | 2020-09-25 05:25:16 +0200 | [diff] [blame] | 46 | { .T = -4, .default_val = 10, .desc = "Paging response timeout" }, \ |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 47 | |
| 48 | struct osmo_tdef msc_tdefs_geran[] = { |
| 49 | RAN_TDEFS |
| 50 | {} |
| 51 | }; |
| 52 | |
| 53 | struct osmo_tdef msc_tdefs_utran[] = { |
| 54 | RAN_TDEFS |
| 55 | {} |
| 56 | }; |
| 57 | |
| 58 | struct osmo_tdef msc_tdefs_sgs[] = { |
Alexander Couzens | ae167fc | 2020-09-25 05:25:16 +0200 | [diff] [blame] | 59 | { .T = -4, .default_val = 10, .desc = "Paging response timeout" }, |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 60 | {} |
| 61 | }; |
| 62 | |
| 63 | static __attribute__((constructor)) void ran_infra_init() |
| 64 | { |
| 65 | osmo_tdefs_reset(msc_tdefs_geran); |
| 66 | osmo_tdefs_reset(msc_tdefs_utran); |
| 67 | osmo_tdefs_reset(msc_tdefs_sgs); |
| 68 | } |
| 69 | |
| 70 | struct ran_infra msc_ran_infra[] = { |
| 71 | [OSMO_RAT_UNKNOWN] = { |
| 72 | .type = OSMO_RAT_UNKNOWN, |
| 73 | .log_subsys = DMSC, |
| 74 | .tdefs = msc_tdefs_geran, |
| 75 | }, |
| 76 | [OSMO_RAT_GERAN_A] = { |
| 77 | .type = OSMO_RAT_GERAN_A, |
| 78 | .an_proto = OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_48006, |
| 79 | .ssn = OSMO_SCCP_SSN_BSSAP, |
| 80 | .log_subsys = DBSSAP, |
| 81 | .tdefs = msc_tdefs_geran, |
| 82 | .sccp_ran_ops = { |
| 83 | .up_l2 = ran_peer_up_l2, |
| 84 | .disconnect = ran_peer_disconnect, |
| 85 | .is_reset_msg = bssmap_is_reset_msg, |
| 86 | .make_reset_msg = bssmap_make_reset_msg, |
| 87 | .make_paging_msg = bssmap_make_paging_msg, |
| 88 | .msg_name = bssmap_msg_name, |
| 89 | }, |
| 90 | .ran_dec_l2 = ran_a_decode_l2, |
| 91 | .ran_encode = ran_a_encode, |
| 92 | }, |
| 93 | [OSMO_RAT_UTRAN_IU] = { |
| 94 | .type = OSMO_RAT_UTRAN_IU, |
| 95 | .an_proto = OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_25413, |
| 96 | .ssn = OSMO_SCCP_SSN_RANAP, |
| 97 | .log_subsys = DIUCS, |
| 98 | .tdefs = msc_tdefs_utran, |
| 99 | #if BUILD_IU |
| 100 | .sccp_ran_ops = { |
| 101 | .up_l2 = ran_peer_up_l2, |
| 102 | .disconnect = ran_peer_disconnect, |
| 103 | .is_reset_msg = ranap_is_reset_msg, |
| 104 | .make_reset_msg = ranap_make_reset_msg, |
| 105 | .make_paging_msg = ranap_make_paging_msg, |
| 106 | .msg_name = ranap_msg_name, |
| 107 | }, |
| 108 | .ran_dec_l2 = ran_iu_decode_l2, |
| 109 | .ran_encode = ran_iu_encode, |
| 110 | #endif |
Neels Hofmeyr | 1dc3961 | 2023-03-03 16:43:19 +0100 | [diff] [blame] | 111 | .force_mgw_codecs_to_ran = { |
| 112 | .count = 1, |
| 113 | .codec = { |
| 114 | { |
| 115 | .payload_type = 96, |
| 116 | .subtype_name = "VND.3GPP.IUFP", |
| 117 | .rate = 16000, |
| 118 | }, |
| 119 | }, |
| 120 | }, |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 121 | }, |
| 122 | [OSMO_RAT_EUTRAN_SGS] = { |
| 123 | .type = OSMO_RAT_EUTRAN_SGS, |
| 124 | .log_subsys = DSGS, |
| 125 | .ran_encode = NULL, |
| 126 | .tdefs = msc_tdefs_sgs, |
| 127 | }, |
| 128 | }; |
| 129 | |
| 130 | const int msc_ran_infra_len = ARRAY_SIZE(msc_ran_infra); |