libosmogsm 1.13.1.1-afb4 Osmocom GSM library

Data Structures | Enumerations | Functions | Variables
cbsp.h File Reference
`#include <stdint.h>`
`#include <osmocom/core/linuxlist.h>`
`#include <osmocom/gsm/protocol/gsm_48_049.h>`
`#include <osmocom/gsm/gsm0808_utils.h>`

Go to the source code of this file.

## Data Structures
struct | osmo_cbsp_content
struct | osmo_cbsp_cell_ent
struct | osmo_cbsp_cell_list
struct | osmo_cbsp_num_compl_ent
struct | osmo_cbsp_num_compl_list
struct | osmo_cbsp_loading_ent
struct | osmo_cbsp_loading_list
struct | osmo_cbsp_fail_ent
struct | osmo_cbsp_write_replace
struct | osmo_cbsp_write_replace_complete
struct | osmo_cbsp_write_replace_failure
struct | osmo_cbsp_kill
struct | osmo_cbsp_kill_complete
struct | osmo_cbsp_kill_failure
struct | osmo_cbsp_load_query
struct | osmo_cbsp_load_query_complete
struct | osmo_cbsp_load_query_failure
struct | osmo_cbsp_msg_status_query
struct | osmo_cbsp_msg_status_query_complete
struct | osmo_cbsp_msg_status_query_failure
struct | osmo_cbsp_reset
struct | osmo_cbsp_reset_complete
struct | osmo_cbsp_reset_failure
struct | osmo_cbsp_keep_alive
struct | osmo_cbsp_keep_alive_complete
struct | osmo_cbsp_restart
struct | osmo_cbsp_failure
struct | osmo_cbsp_error_ind
struct | osmo_cbsp_decoded

## Enumerations
enum | osmo_cbsp_cause { OSMO_CBSP_CAUSE_PARAM_NOT_RECOGNISED = 0 , OSMO_CBSP_CAUSE_PARAM_VALUE_INVALID , OSMO_CBSP_CAUSE_MSG_REF_NOT_IDENTIFIED , OSMO_CBSP_CAUSE_CELL_ID_NOT_VALID , OSMO_CBSP_CAUSE_UNRECOGNISED_MESSAGE , OSMO_CBSP_CAUSE_MISSING_MANDATORY_ELEMENT , OSMO_CBSP_CAUSE_BSC_CAPACITY_EXCEEDED , OSMO_CBSP_CAUSE_CELL_MEMORY_EXCEEDED , OSMO_CBSP_CAUSE_BSC_MEMORY_EXCEEDED , OSMO_CBSP_CAUSE_CELL_BROADCAST_NOT_SUPPORTED , OSMO_CBSP_CAUSE_CELL_BROADCAST_NOT_OPERATIONAL , OSMO_CBSP_CAUSE_INCOMPATIBLE_DRX_PARAM , OSMO_CBSP_CAUSE_EXT_CHAN_NOT_SUPPORTED , OSMO_CBSP_CAUSE_MSG_REF_ALREADY_USED , OSMO_CBSP_CAUSE_UNSPECIFIED_ERROR , OSMO_CBSP_CAUSE_LAI_OR_LAC_NOT_VALID }

## Functions
static const char * | osmo_cbsp_cause_name (enum osmo_cbsp_cause cause)
struct msgb * | osmo_cbsp_msgb_alloc (void *ctx, const char *name)
struct msgb * | osmo_cbsp_encode (void *ctx, const struct osmo_cbsp_decoded *in)
| Encode a CBSP message from the decoded/parsed structure representation to binary PDU. More...
struct osmo_cbsp_decoded * | osmo_cbsp_decode (void *ctx, struct msgb *in)
| Decode a CBSP message from wire formwat to pased structure. More...
void | osmo_cbsp_init_struct (struct osmo_cbsp_decoded *cbsp, enum cbsp_msg_type msg_type)
struct osmo_cbsp_decoded * | osmo_cbsp_decoded_alloc (void *ctx, enum cbsp_msg_type msg_type)
| Dynamically allocate and initialize decoded CBSP structure. More...
int | osmo_cbsp_recv_buffered (void *ctx, int fd, struct msgb **rmsg, struct msgb **tmp_msg)
int | osmo_cbsp_segmentation_cb (struct msgb *msg)

## Variables
const struct value_string | osmo_cbsp_cause_names []
__thread const char * | osmo_cbsp_errstr

## Enumeration Type Documentation

## ◆ osmo_cbsp_cause

enum osmo_cbsp_cause

Enumerator
OSMO_CBSP_CAUSE_PARAM_NOT_RECOGNISED |
OSMO_CBSP_CAUSE_PARAM_VALUE_INVALID |
OSMO_CBSP_CAUSE_MSG_REF_NOT_IDENTIFIED |
OSMO_CBSP_CAUSE_CELL_ID_NOT_VALID |
OSMO_CBSP_CAUSE_UNRECOGNISED_MESSAGE |
OSMO_CBSP_CAUSE_MISSING_MANDATORY_ELEMENT |
OSMO_CBSP_CAUSE_BSC_CAPACITY_EXCEEDED |
OSMO_CBSP_CAUSE_CELL_MEMORY_EXCEEDED |
OSMO_CBSP_CAUSE_BSC_MEMORY_EXCEEDED |
OSMO_CBSP_CAUSE_CELL_BROADCAST_NOT_SUPPORTED |
OSMO_CBSP_CAUSE_CELL_BROADCAST_NOT_OPERATIONAL |
OSMO_CBSP_CAUSE_INCOMPATIBLE_DRX_PARAM |
OSMO_CBSP_CAUSE_EXT_CHAN_NOT_SUPPORTED |
OSMO_CBSP_CAUSE_MSG_REF_ALREADY_USED |
OSMO_CBSP_CAUSE_UNSPECIFIED_ERROR |
OSMO_CBSP_CAUSE_LAI_OR_LAC_NOT_VALID |

## Function Documentation

## ◆ osmo_cbsp_cause_name()

static const char * osmo_cbsp_cause_name | ( | enum osmo_cbsp_cause | cause | ) |
| inline static

References cause, get_value_string(), and osmo_cbsp_cause_names.

## ◆ osmo_cbsp_decode()

struct osmo_cbsp_decoded * osmo_cbsp_decode | ( | void * | ctx,
|  | struct msgb * | in
| ) |  |

Decode a CBSP message from wire formwat to pased structure.

Parameters

  [in] | ctx | talloc context from which to allocate decoded output.
  [in] | in | message buffer contiaining binary CBSP message.

Returns
  callee-allocated decoded representation of CBSP message; NULL on error

References ARRAY_SIZE, cbsp_att_tlvdef, cbsp_dec_error_ind(), cbsp_dec_failure(), cbsp_dec_keep_alive(), cbsp_dec_keep_alive_compl(), cbsp_dec_kill(), cbsp_dec_kill_compl(), cbsp_dec_kill_fail(), cbsp_dec_load_query(), cbsp_dec_load_query_compl(), cbsp_dec_load_query_fail(), cbsp_dec_msg_status_query(), cbsp_dec_msg_status_query_compl(), cbsp_dec_msg_status_query_fail(), cbsp_dec_reset(), cbsp_dec_reset_compl(), cbsp_dec_reset_fail(), cbsp_dec_restart(), cbsp_dec_write_repl(), cbsp_dec_write_repl_compl(), cbsp_dec_write_repl_fail(), CBSP_MSGT_ERROR_IND, CBSP_MSGT_FAILURE, CBSP_MSGT_KEEP_ALIVE, CBSP_MSGT_KEEP_ALIVE_COMPL, CBSP_MSGT_KILL, CBSP_MSGT_KILL_COMPL, CBSP_MSGT_KILL_FAIL, CBSP_MSGT_LOAD_QUERY, CBSP_MSGT_LOAD_QUERY_COMPL, CBSP_MSGT_LOAD_QUERY_FAIL, CBSP_MSGT_MSG_STATUS_QUERY, CBSP_MSGT_MSG_STATUS_QUERY_COMPL, CBSP_MSGT_MSG_STATUS_QUERY_FAIL, CBSP_MSGT_RESET, CBSP_MSGT_RESET_COMPL, CBSP_MSGT_RESET_FAIL, CBSP_MSGT_RESTART, CBSP_MSGT_SET_DRX, CBSP_MSGT_SET_DRX_COMPL, CBSP_MSGT_SET_DRX_FAIL, CBSP_MSGT_WRITE_REPLACE, CBSP_MSGT_WRITE_REPLACE_COMPL, CBSP_MSGT_WRITE_REPLACE_FAIL, msgb::data, osmo_cbsp_decoded::error_ind, osmo_cbsp_decoded::failure, h, osmo_cbsp_decoded::keep_alive, osmo_cbsp_decoded::keep_alive_compl, osmo_cbsp_decoded::kill, osmo_cbsp_decoded::kill_compl, osmo_cbsp_decoded::kill_fail, msgb::l1h, msgb::l2h, len, osmo_cbsp_decoded::load_query, osmo_cbsp_decoded::load_query_compl, osmo_cbsp_decoded::load_query_fail, osmo_cbsp_decoded::msg_status_query, osmo_cbsp_decoded::msg_status_query_compl, osmo_cbsp_decoded::msg_status_query_fail, osmo_cbsp_decoded::msg_type, msgb_l1, msgb_l1len(), msgb_l2, msgb_l2len(), msgb_trim(), OSMO_ASSERT, osmo_cbsp_errstr, osmo_cbsp_decoded::reset, osmo_cbsp_decoded::reset_compl, osmo_cbsp_decoded::reset_fail, osmo_cbsp_decoded::restart, tlv_parse2(), osmo_cbsp_decoded::u, osmo_cbsp_decoded::write_replace, osmo_cbsp_decoded::write_replace_compl, and osmo_cbsp_decoded::write_replace_fail.

## ◆ osmo_cbsp_decoded_alloc()

struct osmo_cbsp_decoded * osmo_cbsp_decoded_alloc | ( | void * | ctx,
|  | enum cbsp_msg_type | msg_type
| ) |  |

Dynamically allocate and initialize decoded CBSP structure.

Parameters

  [in] | ctx | talloc context from which to allocate
  [in] | msg_type | CBSP message type for which to initialize result

Returns
  allocated + initialized decoded CBSP structure; NULL on talloc failure

References msg_type, and osmo_cbsp_init_struct().

## ◆ osmo_cbsp_encode()

struct msgb * osmo_cbsp_encode | ( | void * | ctx,
|  | const struct osmo_cbsp_decoded * | in
| ) |  |

Encode a CBSP message from the decoded/parsed structure representation to binary PDU.

Parameters

  [in] | ctx | talloc context from which to allocate returned msgb.
  [in] | in | decoded CBSP message which is to be encoded. Ownership not transferred.

Returns
  callee-allocated message buffer containing binary CBSP PDU; NULL on error

References cbsp_enc_error_ind(), cbsp_enc_failure(), cbsp_enc_keep_alive(), cbsp_enc_keep_alive_compl(), cbsp_enc_kill(), cbsp_enc_kill_compl(), cbsp_enc_kill_fail(), cbsp_enc_load_query(), cbsp_enc_load_query_compl(), cbsp_enc_load_query_fail(), cbsp_enc_msg_status_query(), cbsp_enc_msg_status_query_compl(), cbsp_enc_msg_status_query_fail(), cbsp_enc_reset(), cbsp_enc_reset_compl(), cbsp_enc_reset_fail(), cbsp_enc_restart(), cbsp_enc_write_repl(), cbsp_enc_write_repl_compl(), cbsp_enc_write_repl_fail(), CBSP_MSGT_ERROR_IND, CBSP_MSGT_FAILURE, CBSP_MSGT_KEEP_ALIVE, CBSP_MSGT_KEEP_ALIVE_COMPL, CBSP_MSGT_KILL, CBSP_MSGT_KILL_COMPL, CBSP_MSGT_KILL_FAIL, CBSP_MSGT_LOAD_QUERY, CBSP_MSGT_LOAD_QUERY_COMPL, CBSP_MSGT_LOAD_QUERY_FAIL, CBSP_MSGT_MSG_STATUS_QUERY, CBSP_MSGT_MSG_STATUS_QUERY_COMPL, CBSP_MSGT_MSG_STATUS_QUERY_FAIL, CBSP_MSGT_RESET, CBSP_MSGT_RESET_COMPL, CBSP_MSGT_RESET_FAIL, CBSP_MSGT_RESTART, CBSP_MSGT_SET_DRX, CBSP_MSGT_SET_DRX_COMPL, CBSP_MSGT_SET_DRX_FAIL, CBSP_MSGT_WRITE_REPLACE, CBSP_MSGT_WRITE_REPLACE_COMPL, CBSP_MSGT_WRITE_REPLACE_FAIL, osmo_cbsp_decoded::error_ind, osmo_cbsp_decoded::failure, osmo_cbsp_decoded::keep_alive, osmo_cbsp_decoded::keep_alive_compl, osmo_cbsp_decoded::kill, osmo_cbsp_decoded::kill_compl, osmo_cbsp_decoded::kill_fail, len, osmo_cbsp_decoded::load_query, osmo_cbsp_decoded::load_query_compl, osmo_cbsp_decoded::load_query_fail, msg, osmo_cbsp_decoded::msg_status_query, osmo_cbsp_decoded::msg_status_query_compl, osmo_cbsp_decoded::msg_status_query_fail, osmo_cbsp_decoded::msg_type, msgb_free(), msgb_length(), msgb_push_u8(), osmo_cbsp_errstr, osmo_cbsp_msgb_alloc(), osmo_cbsp_decoded::reset, osmo_cbsp_decoded::reset_compl, osmo_cbsp_decoded::reset_fail, osmo_cbsp_decoded::restart, osmo_cbsp_decoded::u, osmo_cbsp_decoded::write_replace, osmo_cbsp_decoded::write_replace_compl, and osmo_cbsp_decoded::write_replace_fail.

## ◆ osmo_cbsp_init_struct()

void osmo_cbsp_init_struct | ( | struct osmo_cbsp_decoded * | cbsp,
|  | enum cbsp_msg_type | msg_type
| ) |  |

References CBSP_MSGT_FAILURE, CBSP_MSGT_KILL, CBSP_MSGT_KILL_COMPL, CBSP_MSGT_KILL_FAIL, CBSP_MSGT_LOAD_QUERY, CBSP_MSGT_LOAD_QUERY_COMPL, CBSP_MSGT_LOAD_QUERY_FAIL, CBSP_MSGT_MSG_STATUS_QUERY, CBSP_MSGT_MSG_STATUS_QUERY_COMPL, CBSP_MSGT_MSG_STATUS_QUERY_FAIL, CBSP_MSGT_RESET, CBSP_MSGT_RESET_COMPL, CBSP_MSGT_RESET_FAIL, CBSP_MSGT_RESTART, CBSP_MSGT_WRITE_REPLACE, CBSP_MSGT_WRITE_REPLACE_COMPL, CBSP_MSGT_WRITE_REPLACE_FAIL, osmo_cbsp_write_replace::cell_list, osmo_cbsp_write_replace_complete::cell_list, osmo_cbsp_write_replace_failure::cell_list, osmo_cbsp_kill::cell_list, osmo_cbsp_kill_complete::cell_list, osmo_cbsp_kill_failure::cell_list, osmo_cbsp_load_query::cell_list, osmo_cbsp_msg_status_query::cell_list, osmo_cbsp_reset::cell_list, osmo_cbsp_reset_complete::cell_list, osmo_cbsp_reset_failure::cell_list, osmo_cbsp_restart::cell_list, osmo_cbsp_write_replace_failure::fail_list, osmo_cbsp_kill_failure::fail_list, osmo_cbsp_load_query_failure::fail_list, osmo_cbsp_msg_status_query_failure::fail_list, osmo_cbsp_reset_failure::fail_list, osmo_cbsp_failure::fail_list, osmo_cbsp_decoded::failure, INIT_LLIST_HEAD, osmo_cbsp_decoded::kill, osmo_cbsp_decoded::kill_compl, osmo_cbsp_decoded::kill_fail, osmo_cbsp_cell_list::list, osmo_cbsp_num_compl_list::list, osmo_cbsp_loading_list::list, osmo_cbsp_decoded::load_query, osmo_cbsp_decoded::load_query_compl, osmo_cbsp_decoded::load_query_fail, osmo_cbsp_load_query_complete::loading_list, osmo_cbsp_decoded::msg_status_query, osmo_cbsp_decoded::msg_status_query_compl, osmo_cbsp_decoded::msg_status_query_fail, osmo_cbsp_decoded::msg_type, msg_type, osmo_cbsp_write_replace_complete::num_compl_list, osmo_cbsp_write_replace_failure::num_compl_list, osmo_cbsp_kill_complete::num_compl_list, osmo_cbsp_kill_failure::num_compl_list, osmo_cbsp_msg_status_query_complete::num_compl_list, osmo_cbsp_msg_status_query_failure::num_compl_list, osmo_cbsp_decoded::reset, osmo_cbsp_decoded::reset_compl, osmo_cbsp_decoded::reset_fail, osmo_cbsp_decoded::restart, osmo_cbsp_decoded::u, osmo_cbsp_decoded::write_replace, osmo_cbsp_decoded::write_replace_compl, and osmo_cbsp_decoded::write_replace_fail.

Referenced by osmo_cbsp_decoded_alloc().

## ◆ osmo_cbsp_msgb_alloc()

struct msgb * osmo_cbsp_msgb_alloc | ( | void * | ctx,
|  | const char * | name
| ) |  |

References msgb_alloc_headroom_c(), and name.

Referenced by osmo_cbsp_encode().

## ◆ osmo_cbsp_recv_buffered()

int osmo_cbsp_recv_buffered | ( | void * | ctx,
|  | int | fd,
|  | struct msgb ** | rmsg,
|  | struct msgb ** | tmp_msg
| ) |  |

## ◆ osmo_cbsp_segmentation_cb()

int osmo_cbsp_segmentation_cb | ( | struct msgb * | msg | ) |

## Variable Documentation

## ◆ osmo_cbsp_cause_names

const struct value_string osmo_cbsp_cause_names[]
| extern

Referenced by osmo_cbsp_cause_name().

## ◆ osmo_cbsp_errstr

__thread const char* osmo_cbsp_errstr
| extern

Referenced by cbsp_dec_error_ind(), cbsp_dec_failure(), cbsp_dec_keep_alive(), cbsp_dec_kill(), cbsp_dec_kill_compl(), cbsp_dec_kill_fail(), cbsp_dec_load_query(), cbsp_dec_load_query_compl(), cbsp_dec_load_query_fail(), cbsp_dec_msg_status_query(), cbsp_dec_msg_status_query_compl(), cbsp_dec_msg_status_query_fail(), cbsp_dec_reset(), cbsp_dec_reset_compl(), cbsp_dec_reset_fail(), cbsp_dec_restart(), cbsp_dec_write_repl(), cbsp_dec_write_repl_compl(), cbsp_dec_write_repl_fail(), cbsp_decode_cell_list(), cbsp_decode_fail_list(), cbsp_decode_loading_list(), cbsp_decode_num_compl_list(), cbsp_enc_write_repl(), encode_wperiod(), osmo_cbsp_decode(), and osmo_cbsp_encode().