libosmogsm 1.13.1.1-afb4 Osmocom GSM library

gsm_48_049.h
Go to the documentation of this file.
1#pragma once
2#include <stdint.h>
3#include <osmocom/core/utils.h>
4
5/* CBSP is an ETSI/3GPP standard protocol used between CBC (Cell
6 * Brodadcast Centre) and BSC (Base Station Controller) in 2G/GSM/GERAN
7 * networks. It is specified in 3GPP TS 48.049.
8 *
9 * (C) 2019 by Harald Welte <laforge@gnumonks.org>
10 * All rights reserved.
11 *
12 * SPDX-License-Identifier: GPL-2.0+
13 *
14 * Released under the terms of the GNU General Public License, Version 2 or
15 * (at your option) any later version.
16 */
17
18/* 5.2 TCP/IP */
19#define CBSP_TCP_PORT 48049
20
21/* 8.2.1 Information Element Identifiers */
22 enum cbsp_iei {
23 CBSP_IEI_MSG_CONTENT = 0x01,
24 CBSP_IEI_OLD_SERIAL_NR = 0x02,
25 CBSP_IEI_NEW_SERIAL_NR = 0x03,
26 CBSP_IEI_CELL_LIST = 0x04,
27 CBSP_IEI_CATEGORY = 0x05,
28 CBSP_IEI_REP_PERIOD = 0x06,
29 CBSP_IEI_NUM_BCAST_REQ = 0x07,
30 CBSP_IEI_NUM_BCAST_COMPL_LIST = 0x08,
31 CBSP_IEI_FAILURE_LIST = 0x09,
32 CBSP_IEI_RR_LOADING_LIST = 0x0a,
33 CBSP_IEI_CAUSE = 0x0b,
34 CBSP_IEI_DCS = 0x0c,
35 CBSP_IEI_RECOVERY_IND = 0x0d,
36 CBSP_IEI_MSG_ID = 0x0e,
37 CBSP_IEI_EMERG_IND = 0x0f,
38 CBSP_IEI_WARN_TYPE = 0x10,
39 CBSP_IEI_WARN_SEC_INFO = 0x11,
40 CBSP_IEI_CHANNEL_IND = 0x12,
41 CBSP_IEI_NUM_OF_PAGES = 0x13,
42 CBSP_IEI_SCHEDULE_PERIOD = 0x14,
43 CBSP_IEI_NUM_OF_RES_SLOTS = 0x15,
44 CBSP_IEI_BCAST_MSG_TYPE = 0x16,
45 CBSP_IEI_WARNING_PERIOD = 0x17,
46 CBSP_IEI_KEEP_ALIVE_REP_PERIOD = 0x18,
47};
48
49/* 8.2.2 Message Type */
50 enum cbsp_msg_type {
51 CBSP_MSGT_WRITE_REPLACE = 0x01,
52 CBSP_MSGT_WRITE_REPLACE_COMPL = 0x02,
53 CBSP_MSGT_WRITE_REPLACE_FAIL = 0x03,
54 CBSP_MSGT_KILL = 0x04,
55 CBSP_MSGT_KILL_COMPL = 0x05,
56 CBSP_MSGT_KILL_FAIL = 0x06,
57 CBSP_MSGT_LOAD_QUERY = 0x07,
58 CBSP_MSGT_LOAD_QUERY_COMPL = 0x08,
59 CBSP_MSGT_LOAD_QUERY_FAIL = 0x09,
60 CBSP_MSGT_MSG_STATUS_QUERY = 0x0a,
61 CBSP_MSGT_MSG_STATUS_QUERY_COMPL= 0x0b,
62 CBSP_MSGT_MSG_STATUS_QUERY_FAIL = 0x0c,
63 CBSP_MSGT_SET_DRX = 0x0d,
64 CBSP_MSGT_SET_DRX_COMPL = 0x0e,
65 CBSP_MSGT_SET_DRX_FAIL = 0x0f,
66 CBSP_MSGT_RESET = 0x10,
67 CBSP_MSGT_RESET_COMPL = 0x11,
68 CBSP_MSGT_RESET_FAIL = 0x12,
69 CBSP_MSGT_RESTART = 0x13,
70 CBSP_MSGT_FAILURE = 0x14,
71 CBSP_MSGT_ERROR_IND = 0x15,
72 CBSP_MSGT_KEEP_ALIVE = 0x16,
73 CBSP_MSGT_KEEP_ALIVE_COMPL = 0x17,
74};
75
76/* 8.2.7 Category */
77 enum cbsp_category {
78 CBSP_CATEG_HIGH_PRIO = 0x00,
79 CBSP_CATEG_BACKGROUND = 0x01,
80 CBSP_CATEG_NORMAL = 0x02,
81};
82
83/* Cell ID Discriminator (8.2.11, ...) */
84 enum cbsp_cell_id_disc {
85 CBSP_CIDD_WHOLE_CGI = 0x0,
86 CBSP_CIDD_LAC_CI = 0x1,
87 CBSP_CIDD_CI = 0x2,
88 CBSP_CIDD_LAI = 0x4,
89 CBSP_CIDD_LAC = 0x5,
90 CBSP_CIDD_ALL_IN_BSC = 0x6,
91};
92
93/* 8.2.13 Cause */
94 enum cbsp_cell_id_cause {
95 CBSP_CAUSE_PARAM_NOT_RECOGNISED = 0x00,
96 CBSP_CAUSE_PARAM_VAL_INVALID = 0x01,
97 CBSP_CAUSE_MSG_REF_NOT_IDENTIFIED = 0x02,
98 CBSP_CAUSE_CELL_ID_NOT_VALID = 0x03,
99 CBSP_CAUSE_UNRECOGNISED_MSG = 0x04,
100 CBSP_CAUSE_MISSING_MAND_IE = 0x05,
101 CBSP_CAUSE_BSC_CAPACITY_EXCEEDED = 0x06,
102 CBSP_CAUSE_CELL_MEMORY_EXCEEDED = 0x07,
103 CBSP_CAUSE_BSC_MEMORY_EXCEEDED = 0x08,
104 CBSP_CAUSE_CB_NOT_SUPPORTED = 0x09,
105 CBSP_CAUSE_CB_NOT_OPERATIONAL = 0x0a,
106 CBSP_CAUSE_INCOMPATIBLE_DRX_PARAM = 0x0b,
107 CBSP_CAUSE_EXT_CHAN_NOT_SUPPORTED = 0x0c,
108 CBSP_CAUSE_MSG_REF_ALREADY_USED = 0x0d,
109 CBSP_CAUSE_UNSPECIFIED_ERROR = 0x0e,
110 CBSP_CAUSE_LAI_OR_LAC_NPT_VALID = 0x0f,
111};
112
113/* 8.2.20 Chanel Indicator */
114 enum cbsp_channel_ind {
115 CBSP_CHAN_IND_BASIC = 0,
116 CBSP_CHAN_IND_EXTENDED = 1,
117};
118
119/* not explicitly specified, but every message starts with those mandatory elements */
120 struct cbsp_header {
121 uint8_t msg_type;
122 uint8_t len[3]; /* excluding the header */
123} __attribute__((packed));
124
125 extern const struct value_string cbsp_msg_type_names[];
126 extern const struct value_string cbsp_iei_names[];
127 extern const struct value_string cbsp_category_names[];
128 extern const struct tlv_definition cbsp_att_tlvdef;
__attribute__
struct cbsp_header __attribute__((packed))
cbsp_iei_names
const struct value_string cbsp_iei_names[]
Definition: gsm48049.c:49
cbsp_category_names
const struct value_string cbsp_category_names[]
Definition: gsm48049.c:77
cbsp_cell_id_cause
cbsp_cell_id_cause
Definition: gsm_48_049.h:94
CBSP_CAUSE_EXT_CHAN_NOT_SUPPORTED
@ CBSP_CAUSE_EXT_CHAN_NOT_SUPPORTED
Definition: gsm_48_049.h:107
CBSP_CAUSE_UNSPECIFIED_ERROR
@ CBSP_CAUSE_UNSPECIFIED_ERROR
Definition: gsm_48_049.h:109
CBSP_CAUSE_LAI_OR_LAC_NPT_VALID
@ CBSP_CAUSE_LAI_OR_LAC_NPT_VALID
Definition: gsm_48_049.h:110
CBSP_CAUSE_PARAM_NOT_RECOGNISED
@ CBSP_CAUSE_PARAM_NOT_RECOGNISED
Definition: gsm_48_049.h:95
CBSP_CAUSE_MISSING_MAND_IE
@ CBSP_CAUSE_MISSING_MAND_IE
Definition: gsm_48_049.h:100
CBSP_CAUSE_CELL_MEMORY_EXCEEDED
@ CBSP_CAUSE_CELL_MEMORY_EXCEEDED
Definition: gsm_48_049.h:102
CBSP_CAUSE_INCOMPATIBLE_DRX_PARAM
@ CBSP_CAUSE_INCOMPATIBLE_DRX_PARAM
Definition: gsm_48_049.h:106
CBSP_CAUSE_UNRECOGNISED_MSG
@ CBSP_CAUSE_UNRECOGNISED_MSG
Definition: gsm_48_049.h:99
CBSP_CAUSE_CB_NOT_OPERATIONAL
@ CBSP_CAUSE_CB_NOT_OPERATIONAL
Definition: gsm_48_049.h:105
CBSP_CAUSE_MSG_REF_ALREADY_USED
@ CBSP_CAUSE_MSG_REF_ALREADY_USED
Definition: gsm_48_049.h:108
CBSP_CAUSE_CELL_ID_NOT_VALID
@ CBSP_CAUSE_CELL_ID_NOT_VALID
Definition: gsm_48_049.h:98
CBSP_CAUSE_PARAM_VAL_INVALID
@ CBSP_CAUSE_PARAM_VAL_INVALID
Definition: gsm_48_049.h:96
CBSP_CAUSE_BSC_CAPACITY_EXCEEDED
@ CBSP_CAUSE_BSC_CAPACITY_EXCEEDED
Definition: gsm_48_049.h:101
CBSP_CAUSE_MSG_REF_NOT_IDENTIFIED
@ CBSP_CAUSE_MSG_REF_NOT_IDENTIFIED
Definition: gsm_48_049.h:97
CBSP_CAUSE_CB_NOT_SUPPORTED
@ CBSP_CAUSE_CB_NOT_SUPPORTED
Definition: gsm_48_049.h:104
CBSP_CAUSE_BSC_MEMORY_EXCEEDED
@ CBSP_CAUSE_BSC_MEMORY_EXCEEDED
Definition: gsm_48_049.h:103
cbsp_category
cbsp_category
Definition: gsm_48_049.h:77
CBSP_CATEG_NORMAL
@ CBSP_CATEG_NORMAL
Definition: gsm_48_049.h:80
CBSP_CATEG_HIGH_PRIO
@ CBSP_CATEG_HIGH_PRIO
Definition: gsm_48_049.h:78
CBSP_CATEG_BACKGROUND
@ CBSP_CATEG_BACKGROUND
Definition: gsm_48_049.h:79
cbsp_cell_id_disc
cbsp_cell_id_disc
Definition: gsm_48_049.h:84
CBSP_CIDD_LAC
@ CBSP_CIDD_LAC
Definition: gsm_48_049.h:89
CBSP_CIDD_LAI
@ CBSP_CIDD_LAI
Definition: gsm_48_049.h:88
CBSP_CIDD_WHOLE_CGI
@ CBSP_CIDD_WHOLE_CGI
Definition: gsm_48_049.h:85
CBSP_CIDD_CI
@ CBSP_CIDD_CI
Definition: gsm_48_049.h:87
CBSP_CIDD_LAC_CI
@ CBSP_CIDD_LAC_CI
Definition: gsm_48_049.h:86
CBSP_CIDD_ALL_IN_BSC
@ CBSP_CIDD_ALL_IN_BSC
Definition: gsm_48_049.h:90
cbsp_msg_type
cbsp_msg_type
Definition: gsm_48_049.h:50
CBSP_MSGT_WRITE_REPLACE
@ CBSP_MSGT_WRITE_REPLACE
Definition: gsm_48_049.h:51
CBSP_MSGT_RESET_COMPL
@ CBSP_MSGT_RESET_COMPL
Definition: gsm_48_049.h:67
CBSP_MSGT_SET_DRX_COMPL
@ CBSP_MSGT_SET_DRX_COMPL
Definition: gsm_48_049.h:64
CBSP_MSGT_KILL_FAIL
@ CBSP_MSGT_KILL_FAIL
Definition: gsm_48_049.h:56
CBSP_MSGT_FAILURE
@ CBSP_MSGT_FAILURE
Definition: gsm_48_049.h:70
CBSP_MSGT_LOAD_QUERY_FAIL
@ CBSP_MSGT_LOAD_QUERY_FAIL
Definition: gsm_48_049.h:59
CBSP_MSGT_LOAD_QUERY
@ CBSP_MSGT_LOAD_QUERY
Definition: gsm_48_049.h:57
CBSP_MSGT_RESET_FAIL
@ CBSP_MSGT_RESET_FAIL
Definition: gsm_48_049.h:68
CBSP_MSGT_RESTART
@ CBSP_MSGT_RESTART
Definition: gsm_48_049.h:69
CBSP_MSGT_KILL
@ CBSP_MSGT_KILL
Definition: gsm_48_049.h:54
CBSP_MSGT_SET_DRX
@ CBSP_MSGT_SET_DRX
Definition: gsm_48_049.h:63
CBSP_MSGT_KEEP_ALIVE
@ CBSP_MSGT_KEEP_ALIVE
Definition: gsm_48_049.h:72
CBSP_MSGT_MSG_STATUS_QUERY_COMPL
@ CBSP_MSGT_MSG_STATUS_QUERY_COMPL
Definition: gsm_48_049.h:61
CBSP_MSGT_MSG_STATUS_QUERY_FAIL
@ CBSP_MSGT_MSG_STATUS_QUERY_FAIL
Definition: gsm_48_049.h:62
CBSP_MSGT_LOAD_QUERY_COMPL
@ CBSP_MSGT_LOAD_QUERY_COMPL
Definition: gsm_48_049.h:58
CBSP_MSGT_ERROR_IND
@ CBSP_MSGT_ERROR_IND
Definition: gsm_48_049.h:71
CBSP_MSGT_SET_DRX_FAIL
@ CBSP_MSGT_SET_DRX_FAIL
Definition: gsm_48_049.h:65
CBSP_MSGT_WRITE_REPLACE_COMPL
@ CBSP_MSGT_WRITE_REPLACE_COMPL
Definition: gsm_48_049.h:52
CBSP_MSGT_WRITE_REPLACE_FAIL
@ CBSP_MSGT_WRITE_REPLACE_FAIL
Definition: gsm_48_049.h:53
CBSP_MSGT_KILL_COMPL
@ CBSP_MSGT_KILL_COMPL
Definition: gsm_48_049.h:55
CBSP_MSGT_MSG_STATUS_QUERY
@ CBSP_MSGT_MSG_STATUS_QUERY
Definition: gsm_48_049.h:60
CBSP_MSGT_RESET
@ CBSP_MSGT_RESET
Definition: gsm_48_049.h:66
CBSP_MSGT_KEEP_ALIVE_COMPL
@ CBSP_MSGT_KEEP_ALIVE_COMPL
Definition: gsm_48_049.h:73
cbsp_msg_type_names
const struct value_string cbsp_msg_type_names[]
Definition: gsm48049.c:22
cbsp_att_tlvdef
const struct tlv_definition cbsp_att_tlvdef
Definition: gsm48049.c:84
cbsp_channel_ind
cbsp_channel_ind
Definition: gsm_48_049.h:114
CBSP_CHAN_IND_BASIC
@ CBSP_CHAN_IND_BASIC
Definition: gsm_48_049.h:115
CBSP_CHAN_IND_EXTENDED
@ CBSP_CHAN_IND_EXTENDED
Definition: gsm_48_049.h:116
cbsp_iei
cbsp_iei
Definition: gsm_48_049.h:22
CBSP_IEI_MSG_CONTENT
@ CBSP_IEI_MSG_CONTENT
Definition: gsm_48_049.h:23
CBSP_IEI_EMERG_IND
@ CBSP_IEI_EMERG_IND
Definition: gsm_48_049.h:37
CBSP_IEI_CATEGORY
@ CBSP_IEI_CATEGORY
Definition: gsm_48_049.h:27
CBSP_IEI_OLD_SERIAL_NR
@ CBSP_IEI_OLD_SERIAL_NR
Definition: gsm_48_049.h:24
CBSP_IEI_SCHEDULE_PERIOD
@ CBSP_IEI_SCHEDULE_PERIOD
Definition: gsm_48_049.h:42
CBSP_IEI_NUM_OF_RES_SLOTS
@ CBSP_IEI_NUM_OF_RES_SLOTS
Definition: gsm_48_049.h:43
CBSP_IEI_WARNING_PERIOD
@ CBSP_IEI_WARNING_PERIOD
Definition: gsm_48_049.h:45
CBSP_IEI_WARN_SEC_INFO
@ CBSP_IEI_WARN_SEC_INFO
Definition: gsm_48_049.h:39
CBSP_IEI_MSG_ID
@ CBSP_IEI_MSG_ID
Definition: gsm_48_049.h:36
CBSP_IEI_DCS
@ CBSP_IEI_DCS
Definition: gsm_48_049.h:34
CBSP_IEI_CELL_LIST
@ CBSP_IEI_CELL_LIST
Definition: gsm_48_049.h:26
CBSP_IEI_NUM_BCAST_COMPL_LIST
@ CBSP_IEI_NUM_BCAST_COMPL_LIST
Definition: gsm_48_049.h:30
CBSP_IEI_NUM_OF_PAGES
@ CBSP_IEI_NUM_OF_PAGES
Definition: gsm_48_049.h:41
CBSP_IEI_NEW_SERIAL_NR
@ CBSP_IEI_NEW_SERIAL_NR
Definition: gsm_48_049.h:25
CBSP_IEI_CAUSE
@ CBSP_IEI_CAUSE
Definition: gsm_48_049.h:33
CBSP_IEI_BCAST_MSG_TYPE
@ CBSP_IEI_BCAST_MSG_TYPE
Definition: gsm_48_049.h:44
CBSP_IEI_NUM_BCAST_REQ
@ CBSP_IEI_NUM_BCAST_REQ
Definition: gsm_48_049.h:29
CBSP_IEI_RECOVERY_IND
@ CBSP_IEI_RECOVERY_IND
Definition: gsm_48_049.h:35
CBSP_IEI_KEEP_ALIVE_REP_PERIOD
@ CBSP_IEI_KEEP_ALIVE_REP_PERIOD
Definition: gsm_48_049.h:46
CBSP_IEI_FAILURE_LIST
@ CBSP_IEI_FAILURE_LIST
Definition: gsm_48_049.h:31
CBSP_IEI_WARN_TYPE
@ CBSP_IEI_WARN_TYPE
Definition: gsm_48_049.h:38
CBSP_IEI_RR_LOADING_LIST
@ CBSP_IEI_RR_LOADING_LIST
Definition: gsm_48_049.h:32
CBSP_IEI_REP_PERIOD
@ CBSP_IEI_REP_PERIOD
Definition: gsm_48_049.h:28
CBSP_IEI_CHANNEL_IND
@ CBSP_IEI_CHANNEL_IND
Definition: gsm_48_049.h:40
cbsp_header
Definition: gsm_48_049.h:120
cbsp_header::len
uint8_t len[3]
Definition: gsm_48_049.h:122
cbsp_header::msg_type
uint8_t msg_type
Definition: gsm_48_049.h:121
tlv_definition
Definition of All 256 IE / TLV.
Definition: tlv.h:527
value_string
utils.h