libosmogsm 1.13.1.1-afb4 Osmocom GSM library

gsm48_rest_octets.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdbool.h>
4#include <osmocom/gsm/sysinfo.h>
5#include <osmocom/gsm/protocol/gsm_44_060.h>
6
7/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1:
8 4-bit index is used (2#1111 = 10#15) */
9#define SI2Q_MAX_NUM 16
10/* length in bits (for single SI2quater message) */
11#define SI2Q_MAX_LEN 160
12#define SI2Q_MIN_LEN 18
13
14/* generate SI1 rest octets */
15 int osmo_gsm48_rest_octets_si1_encode(uint8_t *data, uint8_t *nch_pos, int is1800_net);
16 int osmo_gsm48_si1ro_nch_pos_decode(uint8_t value, uint8_t *num_blocks, uint8_t *first_block);
17 int osmo_gsm48_si1ro_nch_pos_encode(uint8_t num_blocks, uint8_t first_block);
18
19 int osmo_gsm48_rest_octets_si2quater_encode(uint8_t *data, uint8_t si2q_index, uint8_t si2q_count,
20 const uint16_t *uarfcn_list, size_t *u_offset,
21 size_t uarfcn_length, uint16_t *scramble_list,
22 struct osmo_earfcn_si2q *si2quater_neigh_list,
23 size_t *e_offset);
24
25 struct osmo_gsm48_si_pch_nch_info {
26 bool present;
27 bool paging_channel_restructuring;
28 uint8_t nln_sacch;
29 bool call_priority_present;
30 uint8_t call_priority;
31 bool nln_status_sacch;
32};
33
34 struct osmo_gsm48_si_vbs_vgcs_options {
35 bool present;
36 bool inband_notifications;
37 bool inband_pagings;
38};
39
40 struct osmo_gsm48_si_dtm_support {
41 bool present;
42 uint8_t rac;
43 uint8_t max_lapdm;
44};
45
46 struct osmo_gsm48_si_gprs_ms_txpwr_max_ccch {
47 bool present;
48 uint8_t max_txpwr;
49};
50
51 struct osmo_gsm48_si6_ro_info {
52 struct osmo_gsm48_si_pch_nch_info pch_nch_info;
53 struct osmo_gsm48_si_vbs_vgcs_options vbs_vgcs_options;
54 struct osmo_gsm48_si_dtm_support dtm_support;
55 bool band_indicator_1900;
56 struct osmo_gsm48_si_gprs_ms_txpwr_max_ccch gprs_ms_txpwr_max_ccch;
57 /* MBMS: not supported in Osmocom */
58 /* AMR config (group channel): not supported in Osmocom */
59};
60
61 int osmo_gsm48_rest_octets_si6_encode(uint8_t *data, const struct osmo_gsm48_si6_ro_info *in);
62
63/* 3GPP TS 44.018 Table 10.5.2.34.1 (Optional) "Selection Parameters" */
64 struct osmo_gsm48_si_selection_params {
65 uint16_t penalty_time:5, /* PENALTY_TIME */
66 temp_offs:3, /* TEMPORARY_OFFSET */
67 cell_resel_off:6, /* CELL_RESELECT_OFFSET */
68 cbq:1, /* CELL_BAR_QUALIFY (CBQ) */
69 present:1;
70};
71
72/* 3GPP TS 44.018 Table 10.5.2.34.1 "Optional Power offset" */
73 struct osmo_gsm48_si_power_offset {
74 uint8_t power_offset:2, /* POWER OFFSET */
75 present:1;
76};
77
78/* 3GPP TS 44.018 Table 10.5.2.34.1 "GPRS Indicator" */
79 struct osmo_gsm48_si3_gprs_ind {
80 uint8_t si13_position:1, /* SI13 POSITION */
81 ra_colour:3, /* RA COLOUR */
82 present:1;
83};
84
85/* 3GPP TS 44.018 Table 10.5.2.35.1 "LSA Parameters" */
86 struct osmo_gsm48_lsa_params {
87 uint32_t prio_thr:3, /* PRIO_THR */
88 lsa_offset:3, /* LSA_OFFSET */
89 mcc:12, /* MCC */
90 mnc:12; /* MNC */
91 unsigned int present;
92};
93
94 struct osmo_gsm48_si_ro_info {
95 struct osmo_gsm48_si_selection_params selection_params;
96 struct osmo_gsm48_si_power_offset power_offset;
97 bool si2ter_indicator;
98 bool early_cm_ctrl;
99 struct {
100 uint8_t where:3,
101 present:1;
102 } scheduling;
103 struct osmo_gsm48_si3_gprs_ind gprs_ind;
104 /* SI 3 specific */
105 bool early_cm_restrict_3g;
106 bool si2quater_indicator;
107 /* SI 4 specific */
108 struct osmo_gsm48_lsa_params lsa_params;
109 uint16_t cell_id;
110 uint8_t break_ind; /* do we have SI7 + SI8 ? */
111};
112
113/* Generate SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72) */
114 int osmo_gsm48_rest_octets_si3_encode(uint8_t *data, const struct osmo_gsm48_si_ro_info *si3);
115
116/* Generate SI4 Rest Octets (Chapter 10.5.2.35) */
117 int osmo_gsm48_rest_octets_si4_encode(uint8_t *data, const struct osmo_gsm48_si_ro_info *si4, int len);
118
119 struct osmo_gsm48_si13_info {
120 struct osmo_gprs_cell_options cell_opts;
121 struct osmo_gprs_power_ctrl_pars pwr_ctrl_pars;
122 uint8_t bcch_change_mark;
123 uint8_t si_change_field;
124 uint8_t rac;
125 uint8_t spgc_ccch_sup;
126 uint8_t net_ctrl_ord;
127 uint8_t prio_acc_thr;
128};
129
130/* Parse/Generate SI13 Rest Octests (Chapter 10.5.2.37b) */
131 int osmo_gsm48_rest_octets_si13_decode(struct osmo_gsm48_si13_info *si13, const uint8_t *data);
132 int osmo_gsm48_rest_octets_si13_encode(uint8_t *data, const struct osmo_gsm48_si13_info *si13);
133
134/* Parse SI3 Rest Octets */
135 void osmo_gsm48_rest_octets_si3_decode(struct osmo_gsm48_si_ro_info *si3, const uint8_t *data);
136
137/* Parse SI4 Rest Octets */
138 void osmo_gsm48_rest_octets_si4_decode(struct osmo_gsm48_si_ro_info *si4, const uint8_t *data, int len);
data
uint8_t data[0]
osmo_gsm48_rest_octets_si4_encode
int osmo_gsm48_rest_octets_si4_encode(uint8_t *data, const struct osmo_gsm48_si_ro_info *si4, int len)
Definition: gsm48_rest_octets.c:711
osmo_gsm48_rest_octets_si1_encode
int osmo_gsm48_rest_octets_si1_encode(uint8_t *data, uint8_t *nch_pos, int is1800_net)
Definition: gsm48_rest_octets.c:38
osmo_gsm48_rest_octets_si13_encode
int osmo_gsm48_rest_octets_si13_encode(uint8_t *data, const struct osmo_gsm48_si13_info *si13)
Definition: gsm48_rest_octets.c:1145
osmo_gsm48_rest_octets_si4_decode
void osmo_gsm48_rest_octets_si4_decode(struct osmo_gsm48_si_ro_info *si4, const uint8_t *data, int len)
Definition: gsm48_rest_octets.c:1270
osmo_gsm48_si1ro_nch_pos_encode
int osmo_gsm48_si1ro_nch_pos_encode(uint8_t num_blocks, uint8_t first_block)
Encode the 5-bit 'NCH position' field within SI1 Rest Octets.
Definition: gsm48_rest_octets.c:125
osmo_gsm48_rest_octets_si6_encode
int osmo_gsm48_rest_octets_si6_encode(uint8_t *data, const struct osmo_gsm48_si6_ro_info *in)
Definition: gsm48_rest_octets.c:778
osmo_gsm48_si1ro_nch_pos_decode
int osmo_gsm48_si1ro_nch_pos_decode(uint8_t value, uint8_t *num_blocks, uint8_t *first_block)
Decode the 5-bit 'NCH position' field within SI1 Rest Octets.
Definition: gsm48_rest_octets.c:110
osmo_gsm48_rest_octets_si13_decode
int osmo_gsm48_rest_octets_si13_decode(struct osmo_gsm48_si13_info *si13, const uint8_t *data)
Decode SI13 Rest Octests (04.08 Chapter 10.5.2.37b).
Definition: gsm48_rest_octets.c:905
osmo_gsm48_rest_octets_si3_decode
void osmo_gsm48_rest_octets_si3_decode(struct osmo_gsm48_si_ro_info *si3, const uint8_t *data)
Decode SI3 Rest Octests (Chapter 10.5.2.34 / Table 10.4.72).
Definition: gsm48_rest_octets.c:1195
osmo_gsm48_rest_octets_si3_encode
int osmo_gsm48_rest_octets_si3_encode(uint8_t *data, const struct osmo_gsm48_si_ro_info *si3)
Definition: gsm48_rest_octets.c:650
osmo_gsm48_rest_octets_si2quater_encode
int osmo_gsm48_rest_octets_si2quater_encode(uint8_t *data, uint8_t si2q_index, uint8_t si2q_count, const uint16_t *uarfcn_list, size_t *u_offset, size_t uarfcn_length, uint16_t *scramble_list, struct osmo_earfcn_si2q *si2quater_neigh_list, size_t *e_offset)
Definition: gsm48_rest_octets.c:540
len
uint8_t len
Definition: gsm_04_11.h:0
gsm_44_060.h
General Packet Radio Service (GPRS).
nch_pos
Definition: gsm48_rest_octets.c:62
osmo_earfcn_si2q
Definition: sysinfo.h:48
osmo_gprs_cell_options
Definition: gsm_44_060.h:172
osmo_gprs_power_ctrl_pars
Definition: gsm_44_060.h:196
osmo_gsm48_lsa_params
Definition: gsm48_rest_octets.h:86
osmo_gsm48_lsa_params::present
unsigned int present
Definition: gsm48_rest_octets.h:91
osmo_gsm48_lsa_params::mcc
uint32_t mcc
Definition: gsm48_rest_octets.h:89
osmo_gsm48_lsa_params::lsa_offset
uint32_t lsa_offset
Definition: gsm48_rest_octets.h:88
osmo_gsm48_lsa_params::mnc
uint32_t mnc
Definition: gsm48_rest_octets.h:90
osmo_gsm48_lsa_params::prio_thr
uint32_t prio_thr
Definition: gsm48_rest_octets.h:87
osmo_gsm48_si13_info
Definition: gsm48_rest_octets.h:119
osmo_gsm48_si13_info::bcch_change_mark
uint8_t bcch_change_mark
Definition: gsm48_rest_octets.h:122
osmo_gsm48_si13_info::rac
uint8_t rac
Definition: gsm48_rest_octets.h:124
osmo_gsm48_si13_info::cell_opts
struct osmo_gprs_cell_options cell_opts
Definition: gsm48_rest_octets.h:120
osmo_gsm48_si13_info::spgc_ccch_sup
uint8_t spgc_ccch_sup
Definition: gsm48_rest_octets.h:125
osmo_gsm48_si13_info::net_ctrl_ord
uint8_t net_ctrl_ord
Definition: gsm48_rest_octets.h:126
osmo_gsm48_si13_info::pwr_ctrl_pars
struct osmo_gprs_power_ctrl_pars pwr_ctrl_pars
Definition: gsm48_rest_octets.h:121
osmo_gsm48_si13_info::si_change_field
uint8_t si_change_field
Definition: gsm48_rest_octets.h:123
osmo_gsm48_si13_info::prio_acc_thr
uint8_t prio_acc_thr
Definition: gsm48_rest_octets.h:127
osmo_gsm48_si3_gprs_ind
Definition: gsm48_rest_octets.h:79
osmo_gsm48_si3_gprs_ind::present
uint8_t present
Definition: gsm48_rest_octets.h:82
osmo_gsm48_si3_gprs_ind::ra_colour
uint8_t ra_colour
Definition: gsm48_rest_octets.h:81
osmo_gsm48_si3_gprs_ind::si13_position
uint8_t si13_position
Definition: gsm48_rest_octets.h:80
osmo_gsm48_si6_ro_info
Definition: gsm48_rest_octets.h:51
osmo_gsm48_si6_ro_info::band_indicator_1900
bool band_indicator_1900
Definition: gsm48_rest_octets.h:55
osmo_gsm48_si6_ro_info::vbs_vgcs_options
struct osmo_gsm48_si_vbs_vgcs_options vbs_vgcs_options
Definition: gsm48_rest_octets.h:53
osmo_gsm48_si6_ro_info::dtm_support
struct osmo_gsm48_si_dtm_support dtm_support
Definition: gsm48_rest_octets.h:54
osmo_gsm48_si6_ro_info::pch_nch_info
struct osmo_gsm48_si_pch_nch_info pch_nch_info
Definition: gsm48_rest_octets.h:52
osmo_gsm48_si6_ro_info::gprs_ms_txpwr_max_ccch
struct osmo_gsm48_si_gprs_ms_txpwr_max_ccch gprs_ms_txpwr_max_ccch
Definition: gsm48_rest_octets.h:56
osmo_gsm48_si_dtm_support
Definition: gsm48_rest_octets.h:40
osmo_gsm48_si_dtm_support::rac
uint8_t rac
Definition: gsm48_rest_octets.h:42
osmo_gsm48_si_dtm_support::present
bool present
Definition: gsm48_rest_octets.h:41
osmo_gsm48_si_dtm_support::max_lapdm
uint8_t max_lapdm
Definition: gsm48_rest_octets.h:43
osmo_gsm48_si_gprs_ms_txpwr_max_ccch
Definition: gsm48_rest_octets.h:46
osmo_gsm48_si_gprs_ms_txpwr_max_ccch::max_txpwr
uint8_t max_txpwr
Definition: gsm48_rest_octets.h:48
osmo_gsm48_si_gprs_ms_txpwr_max_ccch::present
bool present
Definition: gsm48_rest_octets.h:47
osmo_gsm48_si_pch_nch_info
Definition: gsm48_rest_octets.h:25
osmo_gsm48_si_pch_nch_info::nln_status_sacch
bool nln_status_sacch
Definition: gsm48_rest_octets.h:31
osmo_gsm48_si_pch_nch_info::nln_sacch
uint8_t nln_sacch
Definition: gsm48_rest_octets.h:28
osmo_gsm48_si_pch_nch_info::paging_channel_restructuring
bool paging_channel_restructuring
Definition: gsm48_rest_octets.h:27
osmo_gsm48_si_pch_nch_info::present
bool present
Definition: gsm48_rest_octets.h:26
osmo_gsm48_si_pch_nch_info::call_priority_present
bool call_priority_present
Definition: gsm48_rest_octets.h:29
osmo_gsm48_si_pch_nch_info::call_priority
uint8_t call_priority
Definition: gsm48_rest_octets.h:30
osmo_gsm48_si_power_offset
Definition: gsm48_rest_octets.h:73
osmo_gsm48_si_power_offset::power_offset
uint8_t power_offset
Definition: gsm48_rest_octets.h:74
osmo_gsm48_si_power_offset::present
uint8_t present
Definition: gsm48_rest_octets.h:75
osmo_gsm48_si_ro_info
Definition: gsm48_rest_octets.h:94
osmo_gsm48_si_ro_info::si2ter_indicator
bool si2ter_indicator
Definition: gsm48_rest_octets.h:97
osmo_gsm48_si_ro_info::break_ind
uint8_t break_ind
Definition: gsm48_rest_octets.h:110
osmo_gsm48_si_ro_info::power_offset
struct osmo_gsm48_si_power_offset power_offset
Definition: gsm48_rest_octets.h:96
osmo_gsm48_si_ro_info::si2quater_indicator
bool si2quater_indicator
Definition: gsm48_rest_octets.h:106
osmo_gsm48_si_ro_info::present
uint8_t present
Definition: gsm48_rest_octets.h:101
osmo_gsm48_si_ro_info::early_cm_restrict_3g
bool early_cm_restrict_3g
Definition: gsm48_rest_octets.h:105
osmo_gsm48_si_ro_info::lsa_params
struct osmo_gsm48_lsa_params lsa_params
Definition: gsm48_rest_octets.h:108
osmo_gsm48_si_ro_info::where
uint8_t where
Definition: gsm48_rest_octets.h:100
osmo_gsm48_si_ro_info::early_cm_ctrl
bool early_cm_ctrl
Definition: gsm48_rest_octets.h:98
osmo_gsm48_si_ro_info::selection_params
struct osmo_gsm48_si_selection_params selection_params
Definition: gsm48_rest_octets.h:95
osmo_gsm48_si_ro_info::scheduling
struct osmo_gsm48_si_ro_info::@8 scheduling
osmo_gsm48_si_ro_info::cell_id
uint16_t cell_id
Definition: gsm48_rest_octets.h:109
osmo_gsm48_si_ro_info::gprs_ind
struct osmo_gsm48_si3_gprs_ind gprs_ind
Definition: gsm48_rest_octets.h:103
osmo_gsm48_si_selection_params
Definition: gsm48_rest_octets.h:64
osmo_gsm48_si_selection_params::cell_resel_off
uint16_t cell_resel_off
Definition: gsm48_rest_octets.h:67
osmo_gsm48_si_selection_params::penalty_time
uint16_t penalty_time
Definition: gsm48_rest_octets.h:65
osmo_gsm48_si_selection_params::present
uint16_t present
Definition: gsm48_rest_octets.h:69
osmo_gsm48_si_selection_params::temp_offs
uint16_t temp_offs
Definition: gsm48_rest_octets.h:66
osmo_gsm48_si_selection_params::cbq
uint16_t cbq
Definition: gsm48_rest_octets.h:68
osmo_gsm48_si_vbs_vgcs_options
Definition: gsm48_rest_octets.h:34
osmo_gsm48_si_vbs_vgcs_options::inband_notifications
bool inband_notifications
Definition: gsm48_rest_octets.h:36
osmo_gsm48_si_vbs_vgcs_options::present
bool present
Definition: gsm48_rest_octets.h:35
osmo_gsm48_si_vbs_vgcs_options::inband_pagings
bool inband_pagings
Definition: gsm48_rest_octets.h:37
sysinfo.h