Loading...
Searching...
No Matches
gprs_bssgp_rim.h File Reference
`#include <osmocom/gsm/gsm48.h>`
`#include <osmocom/gprs/protocol/gsm_08_18.h>`
`#include <osmocom/gprs/protocol/gsm_24_301.h>`

Go to the source code of this file.

## Data Structures

struct | bssgp_rim_routing_info
| BSSGP RIM Routing information, see also 3GPP TS 48.018, section 11.3.70. More...
struct | bssgp_ran_inf_req_app_cont_nacc
struct | bssgp_ran_inf_app_cont_nacc
struct | bssgp_app_err_cont_nacc
struct | bssgp_ran_inf_req_rim_cont
struct | bssgp_ran_inf_rim_cont
struct | bssgp_ran_inf_ack_rim_cont
struct | bssgp_ran_inf_err_rim_cont
struct | bssgp_ran_inf_app_err_rim_cont
struct | bssgp_ran_information_pdu

## Macros

#define | BSSGP_RIM_ROUTING_INFO_MAXLEN 14
#define | BSSGP_RIM_SI_LEN 21
#define | BSSGP_RIM_PSI_LEN 22

## Enumerations

enum | bssgp_rim_routing_info_discr { BSSGP_RIM_ROUTING_INFO_GERAN , BSSGP_RIM_ROUTING_INFO_UTRAN , BSSGP_RIM_ROUTING_INFO_EUTRAN }
enum | bssgp_nacc_cause { BSSGP_NACC_CAUSE_UNSPEC , BSSGP_NACC_CAUSE_SYNTAX_ERR , BSSGP_NACC_CAUSE_RPRT_CELL_MISSMTCH , BSSGP_NACC_CAUSE_SIPSI_TYPE_ERR , BSSGP_NACC_CAUSE_SIPSI_LEN_ERR , BSSGP_NACC_CAUSE_SIPSI_SET_ERR }
enum | bssgp_ran_inf_app_id { BSSGP_RAN_INF_APP_ID_NACC = 1 , BSSGP_RAN_INF_APP_ID_SI3 = 2 , BSSGP_RAN_INF_APP_ID_MBMS = 3 , BSSGP_RAN_INF_APP_ID_SON = 4 , BSSGP_RAN_INF_APP_ID_UTRA_SI = 5 }

## Functions

static const char * | bssgp_rim_routing_info_discr_str (enum bssgp_rim_routing_info_discr val)
| Obtain a human-readable string for NACC Cause code.
char * | bssgp_rim_ri_name_buf (char *buf, size_t buf_len, const struct bssgp_rim_routing_info *ri)
| Encode a RIM Routing information into a human readable string.
const char * | bssgp_rim_ri_name (const struct bssgp_rim_routing_info *ri)
| Encode a RIM Routing information into a human readable string.
int | bssgp_parse_rim_ri (struct bssgp_rim_routing_info *ri, const uint8_t *buf, unsigned int len)
| Parse a RIM Routing information IE (3GPP TS 48.018, chapter 11.3.70).
int | bssgp_parse_rim_ra (struct bssgp_rim_routing_info *ri, const uint8_t *buf, unsigned int len, uint8_t discr)
| Parse a RIM Routing address IE (3GPP TS 29.060, chapter 7.7.57 and 7.7.77).
int | bssgp_create_rim_ri (uint8_t *buf, const struct bssgp_rim_routing_info *ri)
| Encode a RIM Routing information IE (3GPP TS 48.018, chapter 11.3.70).
int | bssgp_dec_ran_inf_req_app_cont_nacc (struct bssgp_ran_inf_req_app_cont_nacc *cont, const uint8_t *buf, size_t len)
| Decode a RAN Information Request Application Container for NACC (3GPP TS 48.018, section 11.3.63.1.1).
int | bssgp_enc_ran_inf_req_app_cont_nacc (uint8_t *buf, size_t len, const struct bssgp_ran_inf_req_app_cont_nacc *cont)
| Encode a RAN Information Request Application Container for NACC (3GPP TS 48.018, section 11.3.63.1.1).
int | bssgp_dec_ran_inf_app_cont_nacc (struct bssgp_ran_inf_app_cont_nacc *cont, const uint8_t *buf, size_t len)
| Decode a RAN Information Application Container (3GPP TS 48.018, section 11.3.63.2.1).
int | bssgp_enc_ran_inf_app_cont_nacc (uint8_t *buf, size_t len, const struct bssgp_ran_inf_app_cont_nacc *cont)
| Encode a RAN Information Application Container (3GPP TS 48.018, section 11.3.63.2.1).
static const char * | bssgp_nacc_cause_str (enum bssgp_nacc_cause val)
| Obtain a human-readable string for NACC Cause code.
int | bssgp_dec_app_err_cont_nacc (struct bssgp_app_err_cont_nacc *cont, const uint8_t *buf, size_t len)
| Decode a Application Error Container for NACC (3GPP TS 48.018, section 11.3.64.1).
int | bssgp_enc_app_err_cont_nacc (uint8_t *buf, size_t len, const struct bssgp_app_err_cont_nacc *cont)
| Encode Application Error Container for NACC (3GPP TS 48.018, section 11.3.64.1).
static const char * | bssgp_ran_inf_app_id_str (enum bssgp_ran_inf_app_id val)
| Obtain a human-readable string for RIM Application Identity code.
int | bssgp_dec_ran_inf_req_rim_cont (struct bssgp_ran_inf_req_rim_cont *cont, const uint8_t *buf, size_t len)
| Decode a RAN Information Request RIM Container (3GPP TS 48.018, table 11.3.62a.1.b).
int | bssgp_enc_ran_inf_req_rim_cont (uint8_t *buf, size_t len, const struct bssgp_ran_inf_req_rim_cont *cont)
| Encode a RAN Information Request RIM Container (3GPP TS 48.018, table 11.3.62a.1.b).
int | bssgp_dec_ran_inf_rim_cont (struct bssgp_ran_inf_rim_cont *cont, const uint8_t *buf, size_t len)
| Decode a RAN Information RIM Container (3GPP TS 48.018, table 11.3.62a.2.b).
int | bssgp_enc_ran_inf_rim_cont (uint8_t *buf, size_t len, const struct bssgp_ran_inf_rim_cont *cont)
| Encode a RAN Information RIM Container (3GPP TS 48.018, table 11.3.62a.2.b).
int | bssgp_dec_ran_inf_ack_rim_cont (struct bssgp_ran_inf_ack_rim_cont *cont, const uint8_t *buf, size_t len)
| Decode a RAN Information ACK RIM Container (3GPP TS 48.018, table 11.3.62a.3.b).
int | bssgp_enc_ran_inf_ack_rim_cont (uint8_t *buf, size_t len, const struct bssgp_ran_inf_ack_rim_cont *cont)
| Encode a RAN Information ACK RIM Container (3GPP TS 48.018, table 11.3.62a.3.b).
int | bssgp_dec_ran_inf_err_rim_cont (struct bssgp_ran_inf_err_rim_cont *cont, const uint8_t *buf, size_t len)
| Decode a RAN Information Error RIM Container (3GPP TS 48.018, table 11.3.62a.4.b).
int | bssgp_enc_ran_inf_err_rim_cont (uint8_t *buf, size_t len, const struct bssgp_ran_inf_err_rim_cont *cont)
| Encode a RAN Information Error RIM Container (3GPP TS 48.018, table 11.3.62a.4.b).
int | bssgp_dec_ran_inf_app_err_rim_cont (struct bssgp_ran_inf_app_err_rim_cont *cont, const uint8_t *buf, size_t len)
| Decode a RAN Information Application Error RIM Container (3GPP TS 48.018, table 11.3.62a.5.b).
int | bssgp_enc_ran_inf_app_err_rim_cont (uint8_t *buf, size_t len, const struct bssgp_ran_inf_app_err_rim_cont *cont)
| Encode a RAN Information Application Error RIM Container (3GPP TS 48.018, table 11.3.62a.5.b).
int | bssgp_parse_rim_pdu (struct bssgp_ran_information_pdu *pdu, const struct msgb *msg)
| Parse a given message buffer into a rim-pdu struct.
struct msgb * | bssgp_encode_rim_pdu (const struct bssgp_ran_information_pdu *pdu)
| Encode a given rim-pdu struct into a message buffer.
int | bssgp_tx_rim (const struct bssgp_ran_information_pdu *pdu, uint16_t nsei)
| Send RIM RAN INFORMATION REQUEST via BSSGP (3GPP TS 48.018, section 10.6.1).
int | bssgp_tx_rim_encoded (struct msgb *msg, uint16_t nsei)
| Send encoded RAN TRANSPARENT CONTAINER via BSSGP (3GPP TS 29.060, section 7.7.43).

## Variables

const struct value_string | bssgp_rim_routing_info_discr_strs []
const struct value_string | bssgp_nacc_cause_strs []
const struct value_string | bssgp_ran_inf_app_id_strs []

## Macro Definition Documentation

## BSSGP_RIM_PSI_LEN

#define BSSGP_RIM_PSI_LEN 22

## BSSGP_RIM_ROUTING_INFO_MAXLEN

#define BSSGP_RIM_ROUTING_INFO_MAXLEN 14

## BSSGP_RIM_SI_LEN

#define BSSGP_RIM_SI_LEN 21

## Enumeration Type Documentation

## bssgp_nacc_cause

enum bssgp_nacc_cause

Enumerator
BSSGP_NACC_CAUSE_UNSPEC |
BSSGP_NACC_CAUSE_SYNTAX_ERR |
BSSGP_NACC_CAUSE_RPRT_CELL_MISSMTCH |
BSSGP_NACC_CAUSE_SIPSI_TYPE_ERR |
BSSGP_NACC_CAUSE_SIPSI_LEN_ERR |
BSSGP_NACC_CAUSE_SIPSI_SET_ERR |

## bssgp_ran_inf_app_id

enum bssgp_ran_inf_app_id

Enumerator
BSSGP_RAN_INF_APP_ID_NACC |
BSSGP_RAN_INF_APP_ID_SI3 |
BSSGP_RAN_INF_APP_ID_MBMS |
BSSGP_RAN_INF_APP_ID_SON |
BSSGP_RAN_INF_APP_ID_UTRA_SI |

## bssgp_rim_routing_info_discr

enum bssgp_rim_routing_info_discr

Enumerator
BSSGP_RIM_ROUTING_INFO_GERAN |
BSSGP_RIM_ROUTING_INFO_UTRAN |
BSSGP_RIM_ROUTING_INFO_EUTRAN |

## Function Documentation

## bssgp_create_rim_ri()

int bssgp_create_rim_ri | ( | uint8_t * | buf,
|  | const struct bssgp_rim_routing_info * | ri
| ) |  |

Encode a RIM Routing information IE (3GPP TS 48.018, chapter 11.3.70).

Parameters

  [out] | buf | user provided memory (at least 14 byte) for the generated value part of the IE.
  [in] | ri | user provided input data struct.

Returns
  length of encoded octets, -EINVAL on error.

References bssgp_create_cell_id(), BSSGP_RIM_ROUTING_INFO_EUTRAN, BSSGP_RIM_ROUTING_INFO_GERAN, BSSGP_RIM_ROUTING_INFO_MAXLEN, BSSGP_RIM_ROUTING_INFO_UTRAN, bssgp_rim_routing_info::cid, bssgp_rim_routing_info::discr, bssgp_rim_routing_info::eutran, bssgp_rim_routing_info::geran, bssgp_rim_routing_info::global_enb_id, bssgp_rim_routing_info::global_enb_id_len, gsm48_encode_ra(), len, gprs_ra_id::mcc, osmo_eutran_tai::mcc, osmo_eutran_tai::mnc, osmo_eutran_tai::mnc_3_digits, OSMO_ASSERT, bssgp_rim_routing_info::raid, bssgp_rim_routing_info::rncid, osmo_eutran_tai::tac, bssgp_rim_routing_info::tai, and bssgp_rim_routing_info::utran.

Referenced by bssgp_encode_rim_pdu().

## bssgp_dec_app_err_cont_nacc()

int bssgp_dec_app_err_cont_nacc | ( | struct bssgp_app_err_cont_nacc * | cont,
|  | const uint8_t * | buf,
|  | size_t | len
| ) |  |

Decode a Application Error Container for NACC (3GPP TS 48.018, section 11.3.64.1).

Parameters

  [out] | user | provided memory for decoded data struct.
  [in] | buf | user provided memory with the encoded value data of the IE.

Returns
  0 on success, -EINVAL on error.

References bssgp_app_err_cont_nacc::err_app_cont, bssgp_app_err_cont_nacc::err_app_cont_len, len, and bssgp_app_err_cont_nacc::nacc_cause.

Referenced by bssgp_dec_ran_inf_app_err_rim_cont(), and bssgp_dec_ran_inf_rim_cont().

## bssgp_dec_ran_inf_ack_rim_cont()

int bssgp_dec_ran_inf_ack_rim_cont | ( | struct bssgp_ran_inf_ack_rim_cont * | cont,
|  | const uint8_t * | buf,
|  | size_t | len
| ) |  |

Decode a RAN Information ACK RIM Container (3GPP TS 48.018, table 11.3.62a.3.b).

Parameters

  [out] | user | provided memory for decoded data struct.
  [in] | buf | user provided memory with the encoded value data of the IE.

Returns
  0 on success, -EINVAL on error.

References bssgp_ran_inf_ack_rim_cont::app_id, BSSGP_IE_RIM_APP_IDENTITY, BSSGP_IE_RIM_PROTOCOL_VERSION, BSSGP_IE_RIM_SEQ_NR, BSSGP_IE_SON_TRANSFER_APP_ID, len, bssgp_ran_inf_ack_rim_cont::prot_ver, bssgp_ran_inf_ack_rim_cont::seq_num, bssgp_ran_inf_ack_rim_cont::son_trans_app_id, bssgp_ran_inf_ack_rim_cont::son_trans_app_id_len, tlv_parse(), TLVP_LEN, TLVP_PRES_LEN, TLVP_VAL, and tvlv_att_def.

Referenced by bssgp_parse_rim_pdu().

## bssgp_dec_ran_inf_app_cont_nacc()

int bssgp_dec_ran_inf_app_cont_nacc | ( | struct bssgp_ran_inf_app_cont_nacc * | cont,
|  | const uint8_t * | buf,
|  | size_t | len
| ) |  |

Decode a RAN Information Application Container (3GPP TS 48.018, section 11.3.63.2.1).

Parameters

  [out] | user | provided memory for decoded data struct.
  [in] | buf | user provided memory with the encoded value data of the IE.

Returns
  0 on success, -EINVAL on error.

References BSSGP_RIM_PSI_LEN, BSSGP_RIM_SI_LEN, CELL_IDENT_WHOLE_GLOBAL_PS, gsm0808_decode_cell_id_u(), len, bssgp_ran_inf_app_cont_nacc::num_si, REP_CELL_ID_LEN, bssgp_ran_inf_app_cont_nacc::reprt_cell, bssgp_ran_inf_app_cont_nacc::si, and bssgp_ran_inf_app_cont_nacc::type_psi.

Referenced by bssgp_dec_ran_inf_rim_cont().

## bssgp_dec_ran_inf_app_err_rim_cont()

int bssgp_dec_ran_inf_app_err_rim_cont | ( | struct bssgp_ran_inf_app_err_rim_cont * | cont,
|  | const uint8_t * | buf,
|  | size_t | len
| ) |  |

Decode a RAN Information Application Error RIM Container (3GPP TS 48.018, table 11.3.62a.5.b).

Parameters

  [out] | user | provided memory for decoded data struct.
  [in] | buf | user provided memory with the encoded value data of the IE.

Returns
  0 on success, -EINVAL on error.

References bssgp_ran_inf_app_err_rim_cont::app_err_cont_nacc, bssgp_ran_inf_app_err_rim_cont::app_id, bssgp_dec_app_err_cont_nacc(), BSSGP_IE_APP_ERROR_CONTAINER, BSSGP_RAN_INF_APP_ID_MBMS, BSSGP_RAN_INF_APP_ID_NACC, BSSGP_RAN_INF_APP_ID_SI3, BSSGP_RAN_INF_APP_ID_SON, BSSGP_RAN_INF_APP_ID_UTRA_SI, dec_rim_cont_common(), len, tlv_parse(), TLVP_LEN, TLVP_VAL, tvlv_att_def, and bssgp_ran_inf_app_err_rim_cont::u.

Referenced by bssgp_parse_rim_pdu().

## bssgp_dec_ran_inf_err_rim_cont()

int bssgp_dec_ran_inf_err_rim_cont | ( | struct bssgp_ran_inf_err_rim_cont * | cont,
|  | const uint8_t * | buf,
|  | size_t | len
| ) |  |

Decode a RAN Information Error RIM Container (3GPP TS 48.018, table 11.3.62a.4.b).

Parameters

  [out] | user | provided memory for decoded data struct.
  [in] | buf | user provided memory with the encoded value data of the IE.

Returns
  0 on success, -EINVAL on error.

References bssgp_ran_inf_err_rim_cont::app_id, BSSGP_IE_CAUSE, BSSGP_IE_PDU_IN_ERROR, BSSGP_IE_RIM_APP_IDENTITY, BSSGP_IE_RIM_PROTOCOL_VERSION, BSSGP_IE_SON_TRANSFER_APP_ID, bssgp_ran_inf_err_rim_cont::cause, bssgp_ran_inf_err_rim_cont::err_pdu, bssgp_ran_inf_err_rim_cont::err_pdu_len, len, bssgp_ran_inf_err_rim_cont::prot_ver, bssgp_ran_inf_err_rim_cont::son_trans_app_id, bssgp_ran_inf_err_rim_cont::son_trans_app_id_len, tlv_parse(), TLVP_LEN, TLVP_PRES_LEN, TLVP_PRESENT, TLVP_VAL, and tvlv_att_def.

Referenced by bssgp_parse_rim_pdu().

## bssgp_dec_ran_inf_req_app_cont_nacc()

int bssgp_dec_ran_inf_req_app_cont_nacc | ( | struct bssgp_ran_inf_req_app_cont_nacc * | cont,
|  | const uint8_t * | buf,
|  | size_t | len
| ) |  |

Decode a RAN Information Request Application Container for NACC (3GPP TS 48.018, section 11.3.63.1.1).

Parameters

  [out] | user | provided memory for decoded data struct.
  [in] | buf | user provided memory with the encoded value data of the IE.

Returns
  0 on success, -EINVAL on error.

References CELL_IDENT_WHOLE_GLOBAL_PS, gsm0808_decode_cell_id_u(), len, REP_CELL_ID_LEN, and bssgp_ran_inf_req_app_cont_nacc::reprt_cell.

Referenced by bssgp_dec_ran_inf_req_rim_cont().

## bssgp_dec_ran_inf_req_rim_cont()

int bssgp_dec_ran_inf_req_rim_cont | ( | struct bssgp_ran_inf_req_rim_cont * | cont,
|  | const uint8_t * | buf,
|  | size_t | len
| ) |  |

Decode a RAN Information Request RIM Container (3GPP TS 48.018, table 11.3.62a.1.b).

Parameters

  [out] | user | provided memory for decoded data struct.
  [in] | buf | user provided memory with the encoded value data of the IE.

Returns
  0 on success, -EINVAL on error.

References bssgp_ran_inf_req_rim_cont::app_cont_nacc, bssgp_ran_inf_req_rim_cont::app_id, bssgp_dec_ran_inf_req_app_cont_nacc(), BSSGP_IE_RIM_REQ_APP_CONTAINER, BSSGP_IE_SON_TRANSFER_APP_ID, BSSGP_RAN_INF_APP_ID_MBMS, BSSGP_RAN_INF_APP_ID_NACC, BSSGP_RAN_INF_APP_ID_SI3, BSSGP_RAN_INF_APP_ID_SON, BSSGP_RAN_INF_APP_ID_UTRA_SI, dec_rim_cont_common(), len, bssgp_ran_inf_req_rim_cont::son_trans_app_id, bssgp_ran_inf_req_rim_cont::son_trans_app_id_len, tlv_parse(), TLVP_LEN, TLVP_PRES_LEN, TLVP_PRESENT, TLVP_VAL, tvlv_att_def, and bssgp_ran_inf_req_rim_cont::u.

Referenced by bssgp_parse_rim_pdu().

## bssgp_dec_ran_inf_rim_cont()

int bssgp_dec_ran_inf_rim_cont | ( | struct bssgp_ran_inf_rim_cont * | cont,
|  | const uint8_t * | buf,
|  | size_t | len
| ) |  |

Decode a RAN Information RIM Container (3GPP TS 48.018, table 11.3.62a.2.b).

Parameters

  [out] | user | provided memory for decoded data struct.
  [in] | buf | user provided memory with the encoded value data of the IE.

Returns
  0 on success, -EINVAL on error.

References bssgp_ran_inf_rim_cont::app_cont_nacc, bssgp_ran_inf_rim_cont::app_err, bssgp_ran_inf_rim_cont::app_err_cont_nacc, bssgp_ran_inf_rim_cont::app_id, bssgp_dec_app_err_cont_nacc(), bssgp_dec_ran_inf_app_cont_nacc(), BSSGP_IE_APP_ERROR_CONTAINER, BSSGP_IE_RAN_INFO_APP_CONTAINER, BSSGP_IE_SON_TRANSFER_APP_ID, BSSGP_RAN_INF_APP_ID_MBMS, BSSGP_RAN_INF_APP_ID_NACC, BSSGP_RAN_INF_APP_ID_SI3, BSSGP_RAN_INF_APP_ID_SON, BSSGP_RAN_INF_APP_ID_UTRA_SI, dec_rim_cont_common(), len, bssgp_ran_inf_rim_cont::son_trans_app_id, bssgp_ran_inf_rim_cont::son_trans_app_id_len, tlv_parse(), TLVP_LEN, TLVP_PRES_LEN, TLVP_PRESENT, TLVP_VAL, tvlv_att_def, and bssgp_ran_inf_rim_cont::u.

Referenced by bssgp_parse_rim_pdu().

## bssgp_enc_app_err_cont_nacc()

int bssgp_enc_app_err_cont_nacc | ( | uint8_t * | buf,
|  | size_t | len,
|  | const struct bssgp_app_err_cont_nacc * | cont
| ) |  |

Encode Application Error Container for NACC (3GPP TS 48.018, section 11.3.64.1).

Parameters

  [out] | buf | user provided memory for the generated value part of the IE.
  [in] | cont | user provided input data struct.

Returns
  length of encoded octets, -EINVAL on error.

References bssgp_app_err_cont_nacc::err_app_cont, bssgp_app_err_cont_nacc::err_app_cont_len, and bssgp_app_err_cont_nacc::nacc_cause.

Referenced by bssgp_enc_ran_inf_app_err_rim_cont(), and bssgp_enc_ran_inf_rim_cont().

## bssgp_enc_ran_inf_ack_rim_cont()

int bssgp_enc_ran_inf_ack_rim_cont | ( | uint8_t * | buf,
|  | size_t | len,
|  | const struct bssgp_ran_inf_ack_rim_cont * | cont
| ) |  |

Encode a RAN Information ACK RIM Container (3GPP TS 48.018, table 11.3.62a.3.b).

Parameters

  [out] | buf | user provided memory for the generated value part of the IE.
  [in] | cont | user provided input data struct.

Returns
  length of encoded octets, -EINVAL on error.

References bssgp_ran_inf_ack_rim_cont::app_id, BSSGP_IE_RIM_APP_IDENTITY, BSSGP_IE_RIM_PROTOCOL_VERSION, BSSGP_IE_RIM_SEQ_NR, BSSGP_IE_SON_TRANSFER_APP_ID, len, osmo_htonl, bssgp_ran_inf_ack_rim_cont::prot_ver, bssgp_ran_inf_ack_rim_cont::seq_num, bssgp_ran_inf_ack_rim_cont::son_trans_app_id, bssgp_ran_inf_ack_rim_cont::son_trans_app_id_len, and TVLV_HDR_MAXLEN.

Referenced by bssgp_encode_rim_pdu().

## bssgp_enc_ran_inf_app_cont_nacc()

int bssgp_enc_ran_inf_app_cont_nacc | ( | uint8_t * | buf,
|  | size_t | len,
|  | const struct bssgp_ran_inf_app_cont_nacc * | cont
| ) |  |

Encode a RAN Information Application Container (3GPP TS 48.018, section 11.3.63.2.1).

Parameters

  [out] | buf | user provided memory for the generated value part of the IE.
  [in] | cont | user provided input data struct.

Returns
  length of encoded octets, -EINVAL on error.

References bssgp_create_cell_id(), BSSGP_RIM_PSI_LEN, BSSGP_RIM_SI_LEN, osmo_cell_global_id_ps::cell_identity, bssgp_ran_inf_app_cont_nacc::num_si, osmo_cell_global_id_ps::rai, bssgp_ran_inf_app_cont_nacc::reprt_cell, bssgp_ran_inf_app_cont_nacc::si, and bssgp_ran_inf_app_cont_nacc::type_psi.

Referenced by bssgp_enc_ran_inf_rim_cont().

## bssgp_enc_ran_inf_app_err_rim_cont()

int bssgp_enc_ran_inf_app_err_rim_cont | ( | uint8_t * | buf,
|  | size_t | len,
|  | const struct bssgp_ran_inf_app_err_rim_cont * | cont
| ) |  |

Encode a RAN Information Application Error RIM Container (3GPP TS 48.018, table 11.3.62a.5.b).

Parameters

  [out] | buf | user provided memory for the generated value part of the IE.
  [in] | cont | user provided input data struct.

Returns
  length of encoded octets, -EINVAL on error.

References bssgp_ran_inf_app_err_rim_cont::app_err_cont_nacc, bssgp_ran_inf_app_err_rim_cont::app_id, bssgp_enc_app_err_cont_nacc(), BSSGP_IE_APP_ERROR_CONTAINER, BSSGP_RAN_INF_APP_ID_MBMS, BSSGP_RAN_INF_APP_ID_NACC, BSSGP_RAN_INF_APP_ID_SI3, BSSGP_RAN_INF_APP_ID_SON, BSSGP_RAN_INF_APP_ID_UTRA_SI, dub_tlvp_header(), enc_rim_cont_common(), len, TVLV_HDR_LEN, TVLV_HDR_MAXLEN, and bssgp_ran_inf_app_err_rim_cont::u.

Referenced by bssgp_encode_rim_pdu().

## bssgp_enc_ran_inf_err_rim_cont()

int bssgp_enc_ran_inf_err_rim_cont | ( | uint8_t * | buf,
|  | size_t | len,
|  | const struct bssgp_ran_inf_err_rim_cont * | cont
| ) |  |

Encode a RAN Information Error RIM Container (3GPP TS 48.018, table 11.3.62a.4.b).

Parameters

  [out] | buf | user provided memory for the generated value part of the IE.
  [in] | cont | user provided input data struct.

Returns
  length of encoded octets, -EINVAL on error.

References bssgp_ran_inf_err_rim_cont::app_id, BSSGP_IE_CAUSE, BSSGP_IE_PDU_IN_ERROR, BSSGP_IE_RIM_APP_IDENTITY, BSSGP_IE_RIM_PROTOCOL_VERSION, BSSGP_IE_SON_TRANSFER_APP_ID, bssgp_ran_inf_err_rim_cont::cause, bssgp_ran_inf_err_rim_cont::err_pdu, bssgp_ran_inf_err_rim_cont::err_pdu_len, len, bssgp_ran_inf_err_rim_cont::prot_ver, bssgp_ran_inf_err_rim_cont::son_trans_app_id, bssgp_ran_inf_err_rim_cont::son_trans_app_id_len, and TVLV_HDR_MAXLEN.

Referenced by bssgp_encode_rim_pdu().

## bssgp_enc_ran_inf_req_app_cont_nacc()

int bssgp_enc_ran_inf_req_app_cont_nacc | ( | uint8_t * | buf,
|  | size_t | len,
|  | const struct bssgp_ran_inf_req_app_cont_nacc * | cont
| ) |  |

Encode a RAN Information Request Application Container for NACC (3GPP TS 48.018, section 11.3.63.1.1).

Parameters

  [out] | buf | user provided memory for the generated value part of the IE.
  [in] | cont | user provided input data struct.

Returns
  length of encoded octets, -EINVAL on error.

References bssgp_create_cell_id(), osmo_cell_global_id_ps::cell_identity, len, osmo_cell_global_id_ps::rai, REP_CELL_ID_LEN, and bssgp_ran_inf_req_app_cont_nacc::reprt_cell.

Referenced by bssgp_enc_ran_inf_req_rim_cont().

## bssgp_enc_ran_inf_req_rim_cont()

int bssgp_enc_ran_inf_req_rim_cont | ( | uint8_t * | buf,
|  | size_t | len,
|  | const struct bssgp_ran_inf_req_rim_cont * | cont
| ) |  |

Encode a RAN Information Request RIM Container (3GPP TS 48.018, table 11.3.62a.1.b).

Parameters

  [out] | buf | user provided memory for the generated value part of the IE.
  [in] | cont | user provided input data struct.

Returns
  length of encoded octets, -EINVAL on error.

References bssgp_ran_inf_req_rim_cont::app_cont_nacc, bssgp_ran_inf_req_rim_cont::app_id, bssgp_enc_ran_inf_req_app_cont_nacc(), BSSGP_IE_RIM_REQ_APP_CONTAINER, BSSGP_IE_SON_TRANSFER_APP_ID, BSSGP_RAN_INF_APP_ID_MBMS, BSSGP_RAN_INF_APP_ID_NACC, BSSGP_RAN_INF_APP_ID_SI3, BSSGP_RAN_INF_APP_ID_SON, BSSGP_RAN_INF_APP_ID_UTRA_SI, dub_tlvp_header(), enc_rim_cont_common(), len, bssgp_ran_inf_req_rim_cont::son_trans_app_id, bssgp_ran_inf_req_rim_cont::son_trans_app_id_len, TVLV_HDR_LEN, TVLV_HDR_MAXLEN, and bssgp_ran_inf_req_rim_cont::u.

Referenced by bssgp_encode_rim_pdu().

## bssgp_enc_ran_inf_rim_cont()

int bssgp_enc_ran_inf_rim_cont | ( | uint8_t * | buf,
|  | size_t | len,
|  | const struct bssgp_ran_inf_rim_cont * | cont
| ) |  |

Encode a RAN Information RIM Container (3GPP TS 48.018, table 11.3.62a.2.b).

Parameters

  [out] | buf | user provided memory for the generated value part of the IE.
  [in] | cont | user provided input data struct.

Returns
  length of encoded octets, -EINVAL on error.

References bssgp_ran_inf_rim_cont::app_cont_nacc, bssgp_ran_inf_rim_cont::app_err, bssgp_ran_inf_rim_cont::app_err_cont_nacc, bssgp_ran_inf_rim_cont::app_id, bssgp_enc_app_err_cont_nacc(), bssgp_enc_ran_inf_app_cont_nacc(), BSSGP_IE_APP_ERROR_CONTAINER, BSSGP_IE_RAN_INFO_APP_CONTAINER, BSSGP_IE_SON_TRANSFER_APP_ID, BSSGP_RAN_INF_APP_ID_MBMS, BSSGP_RAN_INF_APP_ID_NACC, BSSGP_RAN_INF_APP_ID_SI3, BSSGP_RAN_INF_APP_ID_SON, BSSGP_RAN_INF_APP_ID_UTRA_SI, dub_tlvp_header(), enc_rim_cont_common(), len, bssgp_ran_inf_rim_cont::son_trans_app_id, bssgp_ran_inf_rim_cont::son_trans_app_id_len, TVLV_HDR_LEN, TVLV_HDR_MAXLEN, and bssgp_ran_inf_rim_cont::u.

Referenced by bssgp_encode_rim_pdu().

## bssgp_encode_rim_pdu()

struct msgb * bssgp_encode_rim_pdu | ( | const struct bssgp_ran_information_pdu * | pdu | ) |

Encode a given rim-pdu struct into a message buffer.

Parameters

  [out] | pdu | user provided memory that contains the RAN INFORMATION PDU to encode.

Returns
  BSSGP message buffer on sccess, NULL on error.

References bssgp_ran_information_pdu::ack_rim_cont, bssgp_ran_information_pdu::app_err_rim_cont, bssgp_create_rim_ri(), bssgp_enc_ran_inf_ack_rim_cont(), bssgp_enc_ran_inf_app_err_rim_cont(), bssgp_enc_ran_inf_err_rim_cont(), bssgp_enc_ran_inf_req_rim_cont(), bssgp_enc_ran_inf_rim_cont(), BSSGP_IE_RI_ACK_RIM_CONTAINER, BSSGP_IE_RI_APP_ERROR_RIM_CONT, BSSGP_IE_RI_ERROR_RIM_COINTAINER, BSSGP_IE_RI_REQ_RIM_CONTAINER, BSSGP_IE_RI_RIM_CONTAINER, BSSGP_IE_RIM_ROUTING_INFO, bssgp_msgb_alloc(), BSSGP_PDUT_RAN_INFO, BSSGP_PDUT_RAN_INFO_ACK, BSSGP_PDUT_RAN_INFO_APP_ERROR, BSSGP_PDUT_RAN_INFO_ERROR, BSSGP_PDUT_RAN_INFO_REQ, BSSGP_RIM_ROUTING_INFO_MAXLEN, bssgp_ran_information_pdu::decoded, bssgp_ran_information_pdu::decoded_present, bssgp_ran_information_pdu::err_rim_cont, msg, msgb_free(), OSMO_ASSERT, bssgp_normal_hdr::pdu_type, bssgp_ran_information_pdu::req_rim_cont, bssgp_ran_information_pdu::rim_cont, bssgp_ran_information_pdu::rim_cont_iei, bssgp_ran_information_pdu::rim_cont_len, bssgp_ran_information_pdu::routing_info_dest, and bssgp_ran_information_pdu::routing_info_src.

Referenced by bssgp_tx_rim().

## bssgp_nacc_cause_str()

static const char * bssgp_nacc_cause_str | ( | enum bssgp_nacc_cause | val | ) |

inline static

Obtain a human-readable string for NACC Cause code.

References bssgp_nacc_cause_strs, and get_value_string().

## bssgp_parse_rim_pdu()

int bssgp_parse_rim_pdu | ( | struct bssgp_ran_information_pdu * | pdu,
|  | const struct msgb * | msg
| ) |  |

Parse a given message buffer into a rim-pdu struct.

Parameters

  [out] | pdu | user provided memory for the resulting RAN INFORMATION PDU.
  [in] | msg | BSSGP message buffer that contains the encoded RAN INFORMATION PDU.

Returns
  0 on sccess, -EINVAL on error.

References bssgp_ran_information_pdu::ack_rim_cont, bssgp_ran_information_pdu::app_err_rim_cont, ARRAY_SIZE, bssgp_dec_ran_inf_ack_rim_cont(), bssgp_dec_ran_inf_app_err_rim_cont(), bssgp_dec_ran_inf_err_rim_cont(), bssgp_dec_ran_inf_req_rim_cont(), bssgp_dec_ran_inf_rim_cont(), BSSGP_IE_RI_ACK_RIM_CONTAINER, BSSGP_IE_RI_APP_ERROR_RIM_CONT, BSSGP_IE_RI_ERROR_RIM_COINTAINER, BSSGP_IE_RI_REQ_RIM_CONTAINER, BSSGP_IE_RI_RIM_CONTAINER, BSSGP_IE_RIM_ROUTING_INFO, bssgp_parse_rim_ri(), bssgp_normal_hdr::data, bssgp_ran_information_pdu::decoded, bssgp_ran_information_pdu::decoded_present, DLBSSGP, bssgp_ran_information_pdu::err_rim_cont, LOGL_DEBUG, LOGL_ERROR, LOGP, msg, msgb_bssgp_len, msgb_bssgph, msgb_nsei, nsei, osmo_pdef_bssgp, osmo_tlv_prot_parse(), bssgp_normal_hdr::pdu_type, bssgp_ran_information_pdu::req_rim_cont, bssgp_ran_information_pdu::rim_cont, bssgp_ran_information_pdu::rim_cont_iei, bssgp_ran_information_pdu::rim_cont_len, bssgp_ran_information_pdu::routing_info_dest, bssgp_ran_information_pdu::routing_info_src, TLVP_LEN, TLVP_PRESENT, and TLVP_VAL.

Referenced by bssgp_rx_rim().

## bssgp_parse_rim_ra()

int bssgp_parse_rim_ra | ( | struct bssgp_rim_routing_info * | ri,
|  | const uint8_t * | buf,
|  | unsigned int | len,
|  | uint8_t | discr
| ) |  |

Parse a RIM Routing address IE (3GPP TS 29.060, chapter 7.7.57 and 7.7.77).

Parameters

  [out] | ri | user provided memory to store the parsed results.
  [in] | buf | input buffer of the value part of the RIM Routing address IE. \discr[in] discr value part (one byte) of the RIM Routing Address Discriminator IE.

Returns
  length of parsed octets, -EINVAL on error.

References bssgp_parse_cell_id(), BSSGP_RIM_ROUTING_INFO_EUTRAN, BSSGP_RIM_ROUTING_INFO_GERAN, BSSGP_RIM_ROUTING_INFO_UTRAN, bssgp_rim_routing_info::cid, bssgp_rim_routing_info::discr, bssgp_rim_routing_info::eutran, bssgp_rim_routing_info::geran, bssgp_rim_routing_info::global_enb_id, bssgp_rim_routing_info::global_enb_id_len, gsm48_parse_ra(), len, gprs_ra_id::mcc, osmo_eutran_tai::mcc, gprs_ra_id::mnc, osmo_eutran_tai::mnc, gprs_ra_id::mnc_3_digits, osmo_eutran_tai::mnc_3_digits, bssgp_rim_routing_info::raid, bssgp_rim_routing_info::rncid, osmo_eutran_tai::tac, bssgp_rim_routing_info::tai, and bssgp_rim_routing_info::utran.

Referenced by bssgp_parse_rim_ri().

## bssgp_parse_rim_ri()

int bssgp_parse_rim_ri | ( | struct bssgp_rim_routing_info * | ri,
|  | const uint8_t * | buf,
|  | unsigned int | len
| ) |  |

Parse a RIM Routing information IE (3GPP TS 48.018, chapter 11.3.70).

Parameters

  [out] | ri | user provided memory to store the parsed results.
  [in] | buf | input buffer of the value part of the IE.

Returns
  length of parsed octets, -EINVAL on error.

References bssgp_parse_rim_ra(), and len.

Referenced by bssgp_parse_rim_pdu().

## bssgp_ran_inf_app_id_str()

static const char * bssgp_ran_inf_app_id_str | ( | enum bssgp_ran_inf_app_id | val | ) |

inline static

Obtain a human-readable string for RIM Application Identity code.

References bssgp_ran_inf_app_id_strs, and get_value_string().

## bssgp_rim_ri_name()

const char * bssgp_rim_ri_name | ( | const struct bssgp_rim_routing_info * | ri | ) |

Encode a RIM Routing information into a human readable string.

Parameters

  [in] | ri | user provided input data struct.

Returns
  pointer to the resulting string.

References bssgp_rim_ri_name_buf().

## bssgp_rim_ri_name_buf()

char * bssgp_rim_ri_name_buf | ( | char * | buf,
|  | size_t | buf_len,
|  | const struct bssgp_rim_routing_info * | ri
| ) |  |

Encode a RIM Routing information into a human readable string.

Parameters

  | [buf] | user provided string buffer to store the resulting string.
  | [buf_len] | maximum length of string buffer.
  [in] | ri | user provided input data struct.

Returns
  pointer to the beginning of the resulting string stored in string buffer.

References bssgp_rim_routing_info_discr_str(), BSSGP_RIM_ROUTING_INFO_EUTRAN, BSSGP_RIM_ROUTING_INFO_GERAN, BSSGP_RIM_ROUTING_INFO_UTRAN, osmo_cell_global_id_ps::cell_identity, bssgp_rim_routing_info::cid, bssgp_rim_routing_info::discr, bssgp_rim_routing_info::eutran, bssgp_rim_routing_info::geran, bssgp_rim_routing_info::global_enb_id, bssgp_rim_routing_info::global_enb_id_len, gprs_ra_id::lac, osmo_location_area_id::lac, osmo_routing_area_id::lac, gprs_ra_id::mcc, osmo_plmn_id::mcc, osmo_eutran_tai::mcc, gprs_ra_id::mnc, osmo_plmn_id::mnc, osmo_eutran_tai::mnc, gprs_ra_id::mnc_3_digits, osmo_plmn_id::mnc_3_digits, osmo_eutran_tai::mnc_3_digits, osmo_cgi_ps_name_buf(), osmo_hexdump_buf(), osmo_plmn_name_buf(), osmo_location_area_id::plmn, gprs_ra_id::rac, osmo_routing_area_id::rac, osmo_cell_global_id_ps::rai, bssgp_rim_routing_info::raid, bssgp_rim_routing_info::rncid, osmo_eutran_tai::tac, bssgp_rim_routing_info::tai, and bssgp_rim_routing_info::utran.

Referenced by bssgp_rim_ri_name(), bssgp_rx_rim(), and bssgp_tx_rim().

## bssgp_rim_routing_info_discr_str()

static const char * bssgp_rim_routing_info_discr_str | ( | enum bssgp_rim_routing_info_discr | val | ) |

inline static

Obtain a human-readable string for NACC Cause code.

References bssgp_rim_routing_info_discr_strs, and get_value_string().

Referenced by bssgp_rim_ri_name_buf().

## bssgp_tx_rim()

int bssgp_tx_rim | ( | const struct bssgp_ran_information_pdu * | pdu,
|  | uint16_t | nsei
| ) |  |

Send RIM RAN INFORMATION REQUEST via BSSGP (3GPP TS 48.018, section 10.6.1).

Parameters

  [in] | pdu | user provided memory for the RAN INFORMATION PDU to be sent.
  [in] | nsei | BSSGP network service entity identifier (NSEI).

Returns
  0 on sccess, -EINVAL on error.

References bssgp_encode_rim_pdu(), bssgp_ns_send, bssgp_ns_send_data, bssgp_pdu_str(), bssgp_rim_ri_name_buf(), DEBUGP, DLBSSGP, LOGL_ERROR, LOGP, msg, msgb_bssgph, msgb_bvci, msgb_nsei, nsei, bssgp_normal_hdr::pdu_type, bssgp_ran_information_pdu::routing_info_dest, and bssgp_ran_information_pdu::routing_info_src.

## bssgp_tx_rim_encoded()

int bssgp_tx_rim_encoded | ( | struct msgb * | msg,
|  | uint16_t | nsei
| ) |  |

Send encoded RAN TRANSPARENT CONTAINER via BSSGP (3GPP TS 29.060, section 7.7.43).

Parameters

  [in] | msg | user provided memory for the encoded RAN TRANSPARENT CONTAINER to be sent. (this function will take ownership of msg).
  [in] | nsei | BSSGP network service entity identifier (NSEI).

Returns
  0 on sccess, -EINVAL on error.

References bssgp_ns_send, bssgp_ns_send_data, bssgp_pdu_str(), DEBUGP, DLBSSGP, msg, msgb_bssgph, msgb_bvci, msgb_nsei, nsei, and bssgp_normal_hdr::pdu_type.

## Variable Documentation

## bssgp_nacc_cause_strs

const struct value_string bssgp_nacc_cause_strs[]

extern

Referenced by bssgp_nacc_cause_str().

## bssgp_ran_inf_app_id_strs

const struct value_string bssgp_ran_inf_app_id_strs[]

extern

Referenced by bssgp_ran_inf_app_id_str().

## bssgp_rim_routing_info_discr_strs

const struct value_string bssgp_rim_routing_info_discr_strs[]

extern

Referenced by bssgp_rim_routing_info_discr_str().