libosmogsm  0.11.0-dirty
Osmocom GSM library
src/gsm/sysinfo.c File Reference

GSM 04.08 System Information (SI) encoding and decoding. More...

#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <osmocom/core/bitvec.h>
#include <osmocom/core/utils.h>
#include <osmocom/gsm/sysinfo.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/protocol/gsm_08_58.h>

Functions

 osmo_static_assert (sizeof(struct gsm48_system_information_type_header)==3, _si_header_size)
 osmo_static_assert (sizeof(struct gsm48_rach_control)==3, _si_rach_control)
 osmo_static_assert (sizeof(struct gsm48_system_information_type_1)==22, _si1_size)
 osmo_static_assert (sizeof(struct gsm48_system_information_type_2)==23, _si2_size)
 osmo_static_assert (sizeof(struct gsm48_system_information_type_3)==19, _si3_size)
 osmo_static_assert (sizeof(struct gsm48_system_information_type_4)==13, _si4_size)
 osmo_static_assert (sizeof(struct gsm48_system_information_type_5)==18, _si5_size)
 osmo_static_assert (sizeof(struct gsm48_system_information_type_6)==11, _si6_size)
 osmo_static_assert (sizeof(struct gsm48_system_information_type_13)==3, _si13_size)
int osmo_earfcn_add (struct osmo_earfcn_si2q *e, uint16_t arfcn, uint8_t meas_bw)
 Add pair of arfcn and measurement bandwith value to earfcn struct.
size_t osmo_earfcn_bit_size (const struct osmo_earfcn_si2q *e)
 Return number of bits necessary to represent earfcn struct as Repeated E-UTRAN Neighbour Cells IE from 3GPP TS 44.018 Table 10.5.2.33b.1.
size_t osmo_earfcn_bit_size_ext (const struct osmo_earfcn_si2q *e, size_t offset)
 Return number of bits necessary to represent earfcn struct as Repeated E-UTRAN Neighbour Cells IE from 3GPP TS 44.018 Table 10.5.2.33b.1.
int osmo_earfcn_del (struct osmo_earfcn_si2q *e, uint16_t arfcn)
 Delete arfcn (and corresponding measurement bandwith) from earfcn struct.
void osmo_earfcn_init (struct osmo_earfcn_si2q *e)
 Initialize earfcn struct.
uint8_t osmo_sitype2rsl (enum osmo_sysinfo_type si_type)
enum osmo_sysinfo_type osmo_rsl2sitype (uint8_t rsl_si)

Variables

static const uint8_t sitype2rsl [_MAX_SYSINFO_TYPE]
static const uint8_t rsl2sitype [256]
struct value_string osmo_sitype_strs [_MAX_SYSINFO_TYPE]

Detailed Description

GSM 04.08 System Information (SI) encoding and decoding.

3GPP TS 04.08 version 7.21.0 Release 1998 / ETSI TS 100 940 V7.21.0


Function Documentation

int osmo_earfcn_add ( struct osmo_earfcn_si2q e,
uint16_t  arfcn,
uint8_t  meas_bw 
)

Add pair of arfcn and measurement bandwith value to earfcn struct.

Parameters:
[in,out]eearfcn struct
[in]arfcnEARFCN value, 16 bits
[in]meas_bwmeasurement bandwith value
Returns:
0 on success, error otherwise

References osmo_earfcn_si2q::arfcn, osmo_earfcn_si2q::length, osmo_earfcn_si2q::meas_bw, and OSMO_EARFCN_INVALID.

size_t osmo_earfcn_bit_size ( const struct osmo_earfcn_si2q e)

Return number of bits necessary to represent earfcn struct as Repeated E-UTRAN Neighbour Cells IE from 3GPP TS 44.018 Table 10.5.2.33b.1.

Parameters:
[in,out]eearfcn struct
Returns:
number of bits

References osmo_earfcn_bit_size_ext().

size_t osmo_earfcn_bit_size_ext ( const struct osmo_earfcn_si2q e,
size_t  offset 
)

Return number of bits necessary to represent earfcn struct as Repeated E-UTRAN Neighbour Cells IE from 3GPP TS 44.018 Table 10.5.2.33b.1.

Parameters:
[in,out]eearfcn struct
[in]offsetinto earfcn struct: how many EARFCNs to skip while estimating size
Returns:
number of bits

References osmo_earfcn_si2q::arfcn, osmo_earfcn_si2q::length, osmo_earfcn_si2q::meas_bw, OSMO_EARFCN_INVALID, OSMO_EARFCN_MEAS_INVALID, osmo_earfcn_si2q::prio_valid, osmo_earfcn_si2q::qrxlm_valid, and osmo_earfcn_si2q::thresh_lo_valid.

Referenced by osmo_earfcn_bit_size().

int osmo_earfcn_del ( struct osmo_earfcn_si2q e,
uint16_t  arfcn 
)

Delete arfcn (and corresponding measurement bandwith) from earfcn struct.

Parameters:
[in,out]eearfcn struct
[in]arfcnEARFCN value, 16 bits
Returns:
0 on success, error otherwise

References osmo_earfcn_si2q::arfcn, osmo_earfcn_si2q::length, osmo_earfcn_si2q::meas_bw, OSMO_EARFCN_INVALID, and OSMO_EARFCN_MEAS_INVALID.

void osmo_earfcn_init ( struct osmo_earfcn_si2q e)

Initialize earfcn struct.

Parameters:
[in,out]eearfcn struct

References osmo_earfcn_si2q::arfcn, osmo_earfcn_si2q::length, osmo_earfcn_si2q::meas_bw, OSMO_EARFCN_INVALID, and OSMO_EARFCN_MEAS_INVALID.

enum osmo_sysinfo_type osmo_rsl2sitype ( uint8_t  rsl_si)
uint8_t osmo_sitype2rsl ( enum osmo_sysinfo_type  si_type)
osmo_static_assert ( sizeof(struct gsm48_system_information_type_header = =3,
_si_header_size   
)
osmo_static_assert ( sizeof(struct gsm48_rach_control = =3,
_si_rach_control   
)
osmo_static_assert ( sizeof(struct gsm48_system_information_type_1 = =22,
_si1_size   
)
osmo_static_assert ( sizeof(struct gsm48_system_information_type_2 = =23,
_si2_size   
)
osmo_static_assert ( sizeof(struct gsm48_system_information_type_3 = =19,
_si3_size   
)
osmo_static_assert ( sizeof(struct gsm48_system_information_type_4 = =13,
_si4_size   
)
osmo_static_assert ( sizeof(struct gsm48_system_information_type_5 = =18,
_si5_size   
)
osmo_static_assert ( sizeof(struct gsm48_system_information_type_6 = =11,
_si6_size   
)
osmo_static_assert ( sizeof(struct gsm48_system_information_type_13 = =3,
_si13_size   
)

Variable Documentation

Initial value:
 {
        { SYSINFO_TYPE_1,       "1" },
        { SYSINFO_TYPE_2,       "2" },
        { SYSINFO_TYPE_3,       "3" },
        { SYSINFO_TYPE_4,       "4" },
        { SYSINFO_TYPE_5,       "5" },
        { SYSINFO_TYPE_6,       "6" },
        { SYSINFO_TYPE_7,       "7" },
        { SYSINFO_TYPE_8,       "8" },
        { SYSINFO_TYPE_9,       "9" },
        { SYSINFO_TYPE_10,      "10" },
        { SYSINFO_TYPE_13,      "13" },
        { SYSINFO_TYPE_16,      "16" },
        { SYSINFO_TYPE_17,      "17" },
        { SYSINFO_TYPE_18,      "18" },
        { SYSINFO_TYPE_19,      "19" },
        { SYSINFO_TYPE_20,      "20" },
        { SYSINFO_TYPE_2bis,    "2bis" },
        { SYSINFO_TYPE_2ter,    "2ter" },
        { SYSINFO_TYPE_2quater, "2quater" },
        { SYSINFO_TYPE_5bis,    "5bis" },
        { SYSINFO_TYPE_5ter,    "5ter" },
        { SYSINFO_TYPE_EMO,     "EMO" },
        { SYSINFO_TYPE_MEAS_INFO, "MI" },
        { 0, NULL }
}
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines