blob: 2556b128d0238d7ac7e0c87c1b9fafad58f57245 [file] [log] [blame]
Andreas Eversberg19b0bb72023-04-20 10:56:55 +02001/* Group Call Control (GCC) is an ETSI/3GPP standard protocol used between
2 * MS (Mobile Station) and MSC (Mobile Switchting Center) in 2G/GSM-R network.
3 * It is specified in 3GPP TS 44.068.
4 *
5 * (C) 2023 by Sysmocom s.f.m.c. GmbH
6 * All Rights Reserved
7 *
8 * Author: Andreas Eversberg
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 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 General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 *
23 * SPDX-License-Identifier: GPL-2.0+
24 */
25
26#include <stddef.h>
27#include <osmocom/gsm/tlv.h>
28#include <osmocom/gsm/protocol/gsm_44_068.h>
29
30/***********************************************************************
31 * Protocol Definitions
32 ***********************************************************************/
33
34const struct value_string osmo_gsm44068_msg_type_names[] = {
35 { OSMO_GSM44068_MSGT_IMMEDIATE_SETUP, "IMMEDIATE SETUP" },
36 { OSMO_GSM44068_MSGT_SETUP, "SETUP" },
37 { OSMO_GSM44068_MSGT_CONNECT, "CONNECT" },
38 { OSMO_GSM44068_MSGT_TERMINATION, "TERMINATION" },
39 { OSMO_GSM44068_MSGT_TERMINATION_REQUEST, "TERMINATION REQUEST" },
40 { OSMO_GSM44068_MSGT_TERMINATION_REJECT, "TERMINATION REJECT" },
41 { OSMO_GSM44068_MSGT_STATUS, "STATUS" },
42 { OSMO_GSM44068_MSGT_GET_STATUS, "GET STATUS" },
43 { OSMO_GSM44068_MSGT_SET_PARAMETER, "SET PARAMETER" },
44 { OSMO_GSM44068_MSGT_IMMEDIATE_SETUP_2, "IMMEDIATE SETUP 2" },
45 { 0, NULL }
46};
47
48const struct value_string osmo_gsm44068_priority_level_names[] = {
49 { OSMO_GSM44068_PRIO_LEVEL_4, "priority level 4" },
50 { OSMO_GSM44068_PRIO_LEVEL_3, "priority level 3" },
51 { OSMO_GSM44068_PRIO_LEVEL_2, "priority level 2" },
52 { OSMO_GSM44068_PRIO_LEVEL_1, "priority level 1" },
53 { OSMO_GSM44068_PRIO_LEVEL_0, "priority level 0" },
54 { OSMO_GSM44068_PRIO_LEVEL_B, "priority level B" },
55 { OSMO_GSM44068_PRIO_LEVEL_A, "priority level A" },
56 { 0, NULL }
57};
58
59const struct value_string osmo_gsm44068_cause_names[] = {
60 { OSMO_GSM44068_CAUSE_ILLEGAL_MS, "Illegal MS" },
61 { OSMO_GSM44068_CAUSE_IMEI_NOT_ACCEPTED, "IMEI not accepted" },
62 { OSMO_GSM44068_CAUSE_ILLEGAL_ME, "Illegal ME" },
63 { OSMO_GSM44068_CAUSE_SERVICE_NOT_AUTHORIZED, "Service not authorized" },
64 { OSMO_GSM44068_CAUSE_APP_NOT_SUPPORTED_ON_PROTO, "Application not supported on the protocol" },
65 { OSMO_GSM44068_CAUSE_RR_CONNECTION_ABORTED, "RR connection aborted" },
66 { OSMO_GSM44068_CAUSE_NORMAL_CALL_CLEARING, "Normal call clearing" },
67 { OSMO_GSM44068_CAUSE_NETWORK_FAILURE, "Network failure" },
68 { OSMO_GSM44068_CAUSE_BUSY, "Busy" },
69 { OSMO_GSM44068_CAUSE_CONGESTION, "Congestion" },
70 { OSMO_GSM44068_CAUSE_USER_NOT_ORIGINATOR, "User not originator of call" },
71 { OSMO_GSM44068_CAUSE_NET_WANTS_TO_MAINTAIN_CALL, "Network wants to maintain call" },
72 { OSMO_GSM44068_CAUSE_RESPONSE_TO_GET_STATUS, "Response to GET STATUS" },
73 { OSMO_GSM44068_CAUSE_SERVICE_OPTION_NOT_SUBSCR, "Service option not supported" },
74 { OSMO_GSM44068_CAUSE_REQUESTED_SERVICE_NOT_SUB, "Requested service option not subscribed" },
75 { OSMO_GSM44068_CAUSE_SERVICE_OPTION_OOO, "Service option temporarily out of order" },
76 { OSMO_GSM44068_CAUSE_CALL_CANNOT_BE_IDENTIFIED, "Call cannot be identified" },
77 { OSMO_GSM44068_CAUSE_RETRY_UPON_ENTRY_NEW_CALL, "retry upon entry into a new cell" },
78 { OSMO_GSM44068_CAUSE_INVALID_TRANSACTION_ID, "Invalid transaction identifier value" },
79 { OSMO_GSM44068_CAUSE_SEMANTICALLY_INCORRECT_MSG, "Semantically incorrect message" },
80 { OSMO_GSM44068_CAUSE_INVALID_MANDATORY_INFO, "Invalid mandatory information" },
81 { OSMO_GSM44068_CAUSE_MESSAGE_TYPE_NON_EXISTENT, "Message type non-existent or not implemented" },
82 { OSMO_GSM44068_CAUSE_MESSAGE_TYPE_NOT_COMPAT, "Message type not compatible with the protocol state" },
83 { OSMO_GSM44068_CAUSE_IE_NON_EXISTENT, "Information element non-existent or not implemented" },
84 { OSMO_GSM44068_CAUSE_IE_NOT_COMPAT, "Message type not compatible with the protocol state" },
85 { OSMO_GSM44068_CAUSE_PROTOCOL_ERROR, "Protocol error, unspecified" },
86 { 0, NULL }
87};
88
89const struct value_string osmo_gsm44068_call_state_names[] = {
90 { OSMO_GSM44068_CSTATE_U0, "U0" },
91 { OSMO_GSM44068_CSTATE_U1, "U1" },
Andreas Eversberg0267b342023-08-24 10:46:09 +020092 { OSMO_GSM44068_CSTATE_U2sl_U2, "U2sl/U2" },
Andreas Eversberg19b0bb72023-04-20 10:56:55 +020093 { OSMO_GSM44068_CSTATE_U3, "U3" },
94 { OSMO_GSM44068_CSTATE_U4, "U4" },
95 { OSMO_GSM44068_CSTATE_U5, "U5" },
96 { OSMO_GSM44068_CSTATE_U0p, "U0.p" },
Andreas Eversberg0267b342023-08-24 10:46:09 +020097 { OSMO_GSM44068_CSTATE_U2wr_U6, "U2wr/U6" },
Andreas Eversberg19b0bb72023-04-20 10:56:55 +020098 { OSMO_GSM44068_CSTATE_U2r, "U2r" },
99 { OSMO_GSM44068_CSTATE_U2ws, "U2ws" },
100 { OSMO_GSM44068_CSTATE_U2sr, "U2sr" },
101 { OSMO_GSM44068_CSTATE_U2nc, "U2nc" },
102 { 0, NULL }
103};
104
105const struct value_string osmo_gsm44068_talker_priority_names[] = {
106 { OSMO_GSM44068_PRIO_NORMAL, "Normal" },
107 { OSMO_GSM44068_PRIO_PRIVILEGED, "Privileged" },
108 { OSMO_GSM44068_PRIO_EMERGENCY, "Emergency" },
109 { 0, NULL }
110};
111
112const struct tlv_definition osmo_gsm44068_att_tlvdef = {
113 .def = {
114 [OSMO_GSM44068_IEI_MOBILE_IDENTITY] = { TLV_TYPE_TLV },
115 [OSMO_GSM44068_IEI_USER_USER] = { TLV_TYPE_TLV },
116 [OSMO_GSM44068_IEI_CALL_STATE] = { TLV_TYPE_SINGLE_TV },
117 [OSMO_GSM44068_IEI_STATE_ATTRIBUTES] = { TLV_TYPE_SINGLE_TV },
118 [OSMO_GSM44068_IEI_TALKER_PRIORITY] = { TLV_TYPE_SINGLE_TV },
119 [OSMO_GSM44068_IEI_SMS_INDICATIONS] = { TLV_TYPE_SINGLE_TV },
120 },
121};