blob: af4054149b954576ec0fd322ecbb872bcfb3223f [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" }, \
46
47struct osmo_tdef msc_tdefs_geran[] = {
48 RAN_TDEFS
49 {}
50};
51
52struct osmo_tdef msc_tdefs_utran[] = {
53 RAN_TDEFS
54 {}
55};
56
57struct osmo_tdef msc_tdefs_sgs[] = {
58 {}
59};
60
61static __attribute__((constructor)) void ran_infra_init()
62{
63 osmo_tdefs_reset(msc_tdefs_geran);
64 osmo_tdefs_reset(msc_tdefs_utran);
65 osmo_tdefs_reset(msc_tdefs_sgs);
66}
67
68struct ran_infra msc_ran_infra[] = {
69 [OSMO_RAT_UNKNOWN] = {
70 .type = OSMO_RAT_UNKNOWN,
71 .log_subsys = DMSC,
72 .tdefs = msc_tdefs_geran,
73 },
74 [OSMO_RAT_GERAN_A] = {
75 .type = OSMO_RAT_GERAN_A,
76 .an_proto = OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_48006,
77 .ssn = OSMO_SCCP_SSN_BSSAP,
78 .log_subsys = DBSSAP,
79 .tdefs = msc_tdefs_geran,
80 .sccp_ran_ops = {
81 .up_l2 = ran_peer_up_l2,
82 .disconnect = ran_peer_disconnect,
83 .is_reset_msg = bssmap_is_reset_msg,
84 .make_reset_msg = bssmap_make_reset_msg,
85 .make_paging_msg = bssmap_make_paging_msg,
86 .msg_name = bssmap_msg_name,
87 },
88 .ran_dec_l2 = ran_a_decode_l2,
89 .ran_encode = ran_a_encode,
90 },
91 [OSMO_RAT_UTRAN_IU] = {
92 .type = OSMO_RAT_UTRAN_IU,
93 .an_proto = OSMO_GSUP_ACCESS_NETWORK_PROTOCOL_TS3G_25413,
94 .ssn = OSMO_SCCP_SSN_RANAP,
95 .log_subsys = DIUCS,
96 .tdefs = msc_tdefs_utran,
97#if BUILD_IU
98 .sccp_ran_ops = {
99 .up_l2 = ran_peer_up_l2,
100 .disconnect = ran_peer_disconnect,
101 .is_reset_msg = ranap_is_reset_msg,
102 .make_reset_msg = ranap_make_reset_msg,
103 .make_paging_msg = ranap_make_paging_msg,
104 .msg_name = ranap_msg_name,
105 },
106 .ran_dec_l2 = ran_iu_decode_l2,
107 .ran_encode = ran_iu_encode,
108#endif
109 },
110 [OSMO_RAT_EUTRAN_SGS] = {
111 .type = OSMO_RAT_EUTRAN_SGS,
112 .log_subsys = DSGS,
113 .ran_encode = NULL,
114 .tdefs = msc_tdefs_sgs,
115 },
116};
117
118const int msc_ran_infra_len = ARRAY_SIZE(msc_ran_infra);