blob: c0eaa1ac2695a2f2df309e3558f43e8bbd3cd6a5 [file] [log] [blame]
Neels Hofmeyrc4628a32018-12-07 14:47:34 +01001/* 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 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" }, \
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010047
48struct osmo_tdef msc_tdefs_geran[] = {
49 RAN_TDEFS
50 {}
51};
52
53struct osmo_tdef msc_tdefs_utran[] = {
54 RAN_TDEFS
55 {}
56};
57
58struct osmo_tdef msc_tdefs_sgs[] = {
Alexander Couzensae167fc2020-09-25 05:25:16 +020059 { .T = -4, .default_val = 10, .desc = "Paging response timeout" },
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010060 {}
61};
62
63static __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
70struct 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
111 },
112 [OSMO_RAT_EUTRAN_SGS] = {
113 .type = OSMO_RAT_EUTRAN_SGS,
114 .log_subsys = DSGS,
115 .ran_encode = NULL,
116 .tdefs = msc_tdefs_sgs,
117 },
118};
119
120const int msc_ran_infra_len = ARRAY_SIZE(msc_ran_infra);