libosmogsm 1.9.0.196-9975
Osmocom GSM library
gsm48_rest_octets.c File Reference
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <stdbool.h>
#include <osmocom/core/bitvec.h>
#include <osmocom/gsm/bitvec_gsm.h>
#include <osmocom/gsm/sysinfo.h>
#include <osmocom/gsm/gsm48_arfcn_range_encode.h>
#include <osmocom/gsm/gsm48_rest_octets.h>

Data Structures

struct  nch_pos
 

Functions

int osmo_gsm48_rest_octets_si1_encode (uint8_t *data, uint8_t *nch_pos, int is1800_net)
 
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. More...
 
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. More...
 
static bool append_eutran_neib_cell (struct bitvec *bv, const struct osmo_earfcn_si2q *e, size_t *e_offset, uint8_t budget)
 
static void append_earfcn (struct bitvec *bv, const struct osmo_earfcn_si2q *e, size_t *e_offset, uint8_t budget)
 
static int range_encode (enum osmo_gsm48_range r, int *arfcns, int arfcns_used, int *w, int f0, uint8_t *chan_list)
 
static int f0_helper (int *sc, size_t length, uint8_t *chan_list)
 
static unsigned range1024_p (unsigned n)
 
static int append_utran_fdd_length (uint16_t u, const int *sc, size_t sc_len, size_t length)
 
static int append_utran_fdd (struct bitvec *bv, uint16_t u, int *sc, size_t length)
 
static int try_adding_uarfcn (struct bitvec *bv, uint16_t *scramble_list, size_t uarfcn_length, size_t *u_offset, uint16_t uarfcn, uint8_t num_sc, uint8_t start_pos, uint8_t budget)
 
static void append_uarfcns (struct bitvec *bv, const uint16_t *uarfcn_list, size_t *u_offset, size_t uarfcn_length, uint16_t *scramble_list, uint8_t budget)
 
static size_t si2q_earfcn_count (const struct osmo_earfcn_si2q *e)
 
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)
 
static void append_selection_params (struct bitvec *bv, const struct osmo_gsm48_si_selection_params *sp)
 
static void append_power_offset (struct bitvec *bv, const struct osmo_gsm48_si_power_offset *po)
 
static void append_gprs_ind (struct bitvec *bv, const struct osmo_gsm48_si3_gprs_ind *gi)
 
int osmo_gsm48_rest_octets_si3_encode (uint8_t *data, const struct osmo_gsm48_si_ro_info *si3)
 
static int append_lsa_params (struct bitvec *bv, const struct osmo_gsm48_lsa_params *lsa_params)
 
int osmo_gsm48_rest_octets_si4_encode (uint8_t *data, const struct osmo_gsm48_si_ro_info *si4, int len)
 
int osmo_gsm48_rest_octets_si6_encode (uint8_t *data, const struct osmo_gsm48_si6_ro_info *in)
 
static unsigned int decode_t3192 (unsigned int t3192)
 
static unsigned int decode_drx_timer (unsigned int drx)
 
static int decode_gprs_cell_opt (struct osmo_gprs_cell_options *gco, struct bitvec *bv)
 
static void decode_gprs_pwr_ctrl_pars (struct osmo_gprs_power_ctrl_pars *pcp, struct bitvec *bv)
 
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). More...
 
static int append_gprs_mobile_alloc (struct bitvec *bv)
 
static int encode_t3192 (unsigned int t3192)
 
static int encode_drx_timer (unsigned int drx)
 
static int append_gprs_cell_opt (struct bitvec *bv, const struct osmo_gprs_cell_options *gco)
 
static void append_gprs_pwr_ctrl_pars (struct bitvec *bv, const struct osmo_gprs_power_ctrl_pars *pcp)
 
int osmo_gsm48_rest_octets_si13_encode (uint8_t *data, const struct osmo_gsm48_si13_info *si13)
 
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). More...
 
void osmo_gsm48_rest_octets_si4_decode (struct osmo_gsm48_si_ro_info *si4, const uint8_t *data, int len)
 

Variables

static const struct nch_pos si1ro_nch_positions []
 

Function Documentation

◆ append_earfcn()

static void append_earfcn ( struct bitvec bv,
const struct osmo_earfcn_si2q e,
size_t *  e_offset,
uint8_t  budget 
)
inlinestatic

◆ append_eutran_neib_cell()

◆ append_gprs_cell_opt()

◆ append_gprs_ind()

◆ append_gprs_mobile_alloc()

static int append_gprs_mobile_alloc ( struct bitvec bv)
static

◆ append_gprs_pwr_ctrl_pars()

◆ append_lsa_params()

static int append_lsa_params ( struct bitvec bv,
const struct osmo_gsm48_lsa_params lsa_params 
)
static

◆ append_power_offset()

◆ append_selection_params()

◆ append_uarfcns()

static void append_uarfcns ( struct bitvec bv,
const uint16_t *  uarfcn_list,
size_t *  u_offset,
size_t  uarfcn_length,
uint16_t *  scramble_list,
uint8_t  budget 
)
inlinestatic

◆ append_utran_fdd()

static int append_utran_fdd ( struct bitvec bv,
uint16_t  u,
int *  sc,
size_t  length 
)
inlinestatic

◆ append_utran_fdd_length()

static int append_utran_fdd_length ( uint16_t  u,
const int *  sc,
size_t  sc_len,
size_t  length 
)
inlinestatic

References f0_helper(), length, and range1024_p().

Referenced by try_adding_uarfcn().

◆ decode_drx_timer()

static unsigned int decode_drx_timer ( unsigned int  drx)
static

References OSMO_ASSERT.

Referenced by decode_gprs_cell_opt().

◆ decode_gprs_cell_opt()

◆ decode_gprs_pwr_ctrl_pars()

◆ decode_t3192()

static unsigned int decode_t3192 ( unsigned int  t3192)
static

References OSMO_ASSERT.

Referenced by decode_gprs_cell_opt().

◆ encode_drx_timer()

static int encode_drx_timer ( unsigned int  drx)
static

Referenced by append_gprs_cell_opt().

◆ encode_t3192()

static int encode_t3192 ( unsigned int  t3192)
static

Referenced by append_gprs_cell_opt().

◆ f0_helper()

static int f0_helper ( int *  sc,
size_t  length,
uint8_t *  chan_list 
)
inlinestatic

◆ osmo_gsm48_rest_octets_si13_decode()

int osmo_gsm48_rest_octets_si13_decode ( struct osmo_gsm48_si13_info si13,
const uint8_t *  data 
)

◆ osmo_gsm48_rest_octets_si13_encode()

◆ osmo_gsm48_rest_octets_si1_encode()

int osmo_gsm48_rest_octets_si1_encode ( uint8_t *  data,
uint8_t *  nch_pos,
int  is1800_net 
)

◆ 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 
)

◆ osmo_gsm48_rest_octets_si3_decode()

◆ osmo_gsm48_rest_octets_si3_encode()

◆ osmo_gsm48_rest_octets_si4_decode()

◆ osmo_gsm48_rest_octets_si4_encode()

◆ osmo_gsm48_rest_octets_si6_encode()

◆ 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.

Parameters
[in]value5-bit value from SI1 rest octets
[out]num_blocksNumber of CCCH used for NCH
[out]first_blockFirst CCCH block used for NCH
Returns
0 on success; negative in case of error

References ARRAY_SIZE, nch_pos::first_block, nch_pos::num_blocks, and si1ro_nch_positions.

◆ 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.

Parameters
[in]num_blocksNumber of CCCH used for NCH
[in]first_blockFirst CCCH block used for NCH
Returns
5-bit value for SI1 rest octets on success; negative in case of error

References ARRAY_SIZE, nch_pos::first_block, nch_pos::num_blocks, and si1ro_nch_positions.

◆ range1024_p()

static unsigned range1024_p ( unsigned  n)
static

References n.

Referenced by append_utran_fdd(), and append_utran_fdd_length().

◆ range_encode()

◆ si2q_earfcn_count()

static size_t si2q_earfcn_count ( const struct osmo_earfcn_si2q e)
static

◆ try_adding_uarfcn()

static int try_adding_uarfcn ( struct bitvec bv,
uint16_t *  scramble_list,
size_t  uarfcn_length,
size_t *  u_offset,
uint16_t  uarfcn,
uint8_t  num_sc,
uint8_t  start_pos,
uint8_t  budget 
)
inlinestatic

Variable Documentation

◆ si1ro_nch_positions

const struct nch_pos si1ro_nch_positions[]
static