libosmogb UNKNOWN
Osmocom Gb library
Loading...
Searching...
No Matches
gprs_bssgp2.h File Reference
#include <stdint.h>
#include <osmocom/gprs/protocol/gsm_08_18.h>
#include <osmocom/gprs/gprs_ns2.h>

Go to the source code of this file.

Data Structures

struct  bssgp2_flow_ctrl

Functions

int bssgp2_nsi_tx_ptp (struct gprs_ns2_inst *nsi, uint16_t nsei, uint16_t bvci, struct msgb *msg, uint32_t lsp)
 transmit BSSGP PDU over NS (PTP BVC)
int bssgp2_nsi_tx_sig (struct gprs_ns2_inst *nsi, uint16_t nsei, struct msgb *msg, uint32_t lsp)
 transmit BSSGP PDU over NS (SIGNALING BVC)
struct msgbbssgp2_enc_bvc_block (uint16_t bvci, enum gprs_bssgp_cause cause)
 Encode BSSGP BVC-BLOCK PDU as per TS 48.018 Section 10.4.8.
struct msgbbssgp2_enc_bvc_block_ack (uint16_t bvci)
 Encode BSSGP BVC-BLOCK-ACK PDU as per TS 48.018 Section 10.4.9.
struct msgbbssgp2_enc_bvc_unblock (uint16_t bvci)
 Encode BSSGP BVC-UNBLOCK PDU as per TS 48.018 Section 10.4.10.
struct msgbbssgp2_enc_bvc_unblock_ack (uint16_t bvci)
 Encode BSSGP BVC-UNBLOCK-ACK PDU as per TS 48.018 Section 10.4.11.
struct msgbbssgp2_enc_bvc_reset (uint16_t bvci, enum gprs_bssgp_cause cause, const struct gprs_ra_id *ra_id, uint16_t cell_id, const uint8_t *feat_bm, const uint8_t *ext_feat_bm)
 Encode BSSGP BVC-RESET PDU as per TS 48.018 Section 10.4.12.
struct msgbbssgp2_enc_bvc_reset_ack (uint16_t bvci, const struct gprs_ra_id *ra_id, uint16_t cell_id, const uint8_t *feat_bm, const uint8_t *ext_feat_bm)
 Encode BSSGP BVC-RESET-ACK PDU as per TS 48.018 Section 10.4.13.
struct msgbbssgp2_enc_flush_ll (uint32_t tlli, uint16_t old_bvci, const uint16_t *new_bvci, const uint16_t *nsei)
 Encode BSSGP FLUSH-LL PDU as per TS 48.018 Section 10.4.1.
struct msgbbssgp2_enc_status (uint8_t cause, const uint16_t *bvci, const struct msgb *orig_msg, uint16_t max_pdu_len)
 Encode BSSGP STATUS PDU as per TS 48.018 Section 10.4.14.
int bssgp2_dec_fc_bvc (struct bssgp2_flow_ctrl *fc, const struct tlv_parsed *tp)
 Decode a FLOW-CONTROL-BVC PDU as per TS 48.018 Section 10.4.4.
struct msgbbssgp2_enc_fc_bvc (const struct bssgp2_flow_ctrl *fc, enum bssgp_fc_granularity *gran)
 Encode a FLOW-CONTROL-BVC PDU as per TS 48.018 Section 10.4.4.
struct msgbbssgp2_enc_fc_bvc_ack (uint8_t tag)
 Encode a FLOW-CONTROL-BVC-ACK PDU as per TS 48.018 Section 10.4.4.
int bssgp2_dec_fc_ms (struct bssgp2_flow_ctrl *fc, struct tlv_parsed *tp)
 Decode a FLOW-CONTROL-MS PDU as per TS 48.018 Section 10.4.6.
struct msgbbssgp2_enc_fc_ms (const struct bssgp2_flow_ctrl *fc, enum bssgp_fc_granularity *gran)
 Encode a FLOW-CONTROL-MS PDU as per TS 48.018 Section 10.4.6.
struct msgbbssgp2_enc_fc_ms_ack (uint32_t tlli, uint8_t tag)
 Encode a FLOW-CONTROL-BVC-ACK PDU as per TS 48.018 Section 10.4.7.

Function Documentation

◆ bssgp2_dec_fc_bvc()

◆ bssgp2_dec_fc_ms()

int bssgp2_dec_fc_ms ( struct bssgp2_flow_ctrl * fc,
struct tlv_parsed * tp )

Decode a FLOW-CONTROL-MS PDU as per TS 48.018 Section 10.4.6.

Parameters
[out]fccaller-allocated memory for parsed output
[in]tppre-parsed TLVs; caller must ensure mandatory IE presence/length
Returns
0 on success; negative in case of error

References bssgp_fc_gran_tbl, BSSGP_IE_BUCKET_FULL_RATIO, BSSGP_IE_BUCKET_LEAK_RATE, BSSGP_IE_FLOW_CTRL_GRANULARITY, BSSGP_IE_MS_BUCKET_SIZE, BSSGP_IE_TAG, BSSGP_IE_TLLI, bssgp2_flow_ctrl::bucket_full_ratio, bssgp2_flow_ctrl::bucket_full_ratio_present, bssgp2_flow_ctrl::bucket_leak_rate, bssgp2_flow_ctrl::bucket_size_max, bssgp2_flow_ctrl::ms, bssgp2_flow_ctrl::tag, bssgp2_flow_ctrl::tlli, and bssgp2_flow_ctrl::u.

◆ bssgp2_enc_bvc_block()

struct msgb * bssgp2_enc_bvc_block ( uint16_t bvci,
enum gprs_bssgp_cause cause )

◆ bssgp2_enc_bvc_block_ack()

struct msgb * bssgp2_enc_bvc_block_ack ( uint16_t bvci)

Encode BSSGP BVC-BLOCK-ACK PDU as per TS 48.018 Section 10.4.9.

References BSSGP_IE_BVCI, bssgp_msgb_alloc(), BSSGP_PDUT_BVC_BLOCK_ACK, bvci, and bssgp_normal_hdr::pdu_type.

Referenced by bssgp_bvc_fsm_blocked(), and bssgp_bvc_fsm_unblocked().

◆ bssgp2_enc_bvc_reset()

struct msgb * bssgp2_enc_bvc_reset ( uint16_t bvci,
enum gprs_bssgp_cause cause,
const struct gprs_ra_id * ra_id,
uint16_t cell_id,
const uint8_t * feat_bm,
const uint8_t * ext_feat_bm )

Encode BSSGP BVC-RESET PDU as per TS 48.018 Section 10.4.12.

Parameters
[in]bvciPTP BVCI to encode into the BVCI IE
[in]causeBSSGP Cause value (reason for reset)
[in]ra_idRouting Area ID to be encoded to CELL_ID IE (optional)
[in]cell_idCell ID to be encoded to CELL_ID IE (only if ra_id is non-NULL)
[in]feat_bmFeature Bitmap (optional)
[in]ext_feat_bmExtended Feature Bitmap (optional)

References bssgp_create_cell_id(), BSSGP_IE_BVCI, BSSGP_IE_CAUSE, BSSGP_IE_CELL_ID, BSSGP_IE_EXT_FEATURE_BITMAP, BSSGP_IE_FEATURE_BITMAP, bssgp_msgb_alloc(), BSSGP_PDUT_BVC_RESET, bvci, and bssgp_normal_hdr::pdu_type.

Referenced by _tx_bvc_reset().

◆ bssgp2_enc_bvc_reset_ack()

struct msgb * bssgp2_enc_bvc_reset_ack ( uint16_t bvci,
const struct gprs_ra_id * ra_id,
uint16_t cell_id,
const uint8_t * feat_bm,
const uint8_t * ext_feat_bm )

Encode BSSGP BVC-RESET-ACK PDU as per TS 48.018 Section 10.4.13.

Parameters
[in]bvciPTP BVCI to encode into the BVCI IE
[in]ra_idRouting Area ID to be encoded to CELL_ID IE (optional)
[in]cell_idCell ID to be encoded to CELL_ID IE (only if ra_id is non-NULL)
[in]feat_bmFeature Bitmap (optional)
[in]ext_feat_bmExtended Feature Bitmap (optional)

References bssgp_create_cell_id(), BSSGP_IE_BVCI, BSSGP_IE_CELL_ID, BSSGP_IE_EXT_FEATURE_BITMAP, BSSGP_IE_FEATURE_BITMAP, bssgp_msgb_alloc(), BSSGP_PDUT_BVC_RESET_ACK, bvci, and bssgp_normal_hdr::pdu_type.

Referenced by _tx_bvc_reset_ack().

◆ bssgp2_enc_bvc_unblock()

struct msgb * bssgp2_enc_bvc_unblock ( uint16_t bvci)

Encode BSSGP BVC-UNBLOCK PDU as per TS 48.018 Section 10.4.10.

References BSSGP_IE_BVCI, bssgp_msgb_alloc(), BSSGP_PDUT_BVC_UNBLOCK, bvci, and bssgp_normal_hdr::pdu_type.

Referenced by bssgp_bvc_fsm_blocked(), and bssgp_bvc_fsm_timer_cb().

◆ bssgp2_enc_bvc_unblock_ack()

struct msgb * bssgp2_enc_bvc_unblock_ack ( uint16_t bvci)

Encode BSSGP BVC-UNBLOCK-ACK PDU as per TS 48.018 Section 10.4.11.

References BSSGP_IE_BVCI, bssgp_msgb_alloc(), BSSGP_PDUT_BVC_UNBLOCK_ACK, bvci, and bssgp_normal_hdr::pdu_type.

Referenced by bssgp_bvc_fsm_blocked().

◆ bssgp2_enc_fc_bvc()

◆ bssgp2_enc_fc_bvc_ack()

struct msgb * bssgp2_enc_fc_bvc_ack ( uint8_t tag)

Encode a FLOW-CONTROL-BVC-ACK PDU as per TS 48.018 Section 10.4.4.

Parameters
[in]tagthe tag IE value to encode
Returns
encoded PDU or NULL in case of error

References BSSGP_IE_TAG, bssgp_msgb_alloc(), BSSGP_PDUT_FLOW_CONTROL_BVC_ACK, and bssgp_normal_hdr::pdu_type.

Referenced by bssgp_bvc_fsm_unblocked().

◆ bssgp2_enc_fc_ms()

struct msgb * bssgp2_enc_fc_ms ( const struct bssgp2_flow_ctrl * fc,
enum bssgp_fc_granularity * gran )

◆ bssgp2_enc_fc_ms_ack()

struct msgb * bssgp2_enc_fc_ms_ack ( uint32_t tlli,
uint8_t tag )

Encode a FLOW-CONTROL-BVC-ACK PDU as per TS 48.018 Section 10.4.7.

Parameters
[in]tllithe TLLI IE value to encode
[in]tagthe tag IE value to encode
Returns
encoded PDU or NULL in case of error

References BSSGP_IE_TAG, BSSGP_IE_TLLI, bssgp_msgb_alloc(), BSSGP_PDUT_FLOW_CONTROL_MS_ACK, and bssgp_normal_hdr::pdu_type.

◆ bssgp2_enc_flush_ll()

struct msgb * bssgp2_enc_flush_ll ( uint32_t tlli,
uint16_t old_bvci,
const uint16_t * new_bvci,
const uint16_t * nsei )

Encode BSSGP FLUSH-LL PDU as per TS 48.018 Section 10.4.1.

Parameters
[in]tlli- the TLLI of the MS
[in]old_bvciBVCI
[in]new_bvci2optional BVCI - only encoded if non-NULL
[in]nseioptional - only encoded if non-NULL
Returns
encoded PDU or NULL in case of error

References BSSGP_IE_BVCI, BSSGP_IE_TLLI, bssgp_msgb_alloc(), BSSGP_PDUT_FLUSH_LL, nsei, and bssgp_normal_hdr::pdu_type.

◆ bssgp2_enc_status()

struct msgb * bssgp2_enc_status ( uint8_t cause,
const uint16_t * bvci,
const struct msgb * orig_msg,
uint16_t max_pdu_len )

Encode BSSGP STATUS PDU as per TS 48.018 Section 10.4.14.

Parameters
[in]causeBSSGP Cause value
[in]bvcioptional BVCI - only encoded if non-NULL
[in]msgoptional message buffer containing PDU in error - only encoded if non-NULL
[in]max_pdu_lenMaximum BSSGP PDU size the NS layer accepts

References BSSGP_IE_BVCI, BSSGP_IE_CAUSE, BSSGP_IE_PDU_IN_ERROR, bssgp_msgb_alloc(), BSSGP_PDUT_STATUS, bvci, msgb_bssgp_len, msgb_bssgph, and bssgp_normal_hdr::pdu_type.

Referenced by _tx_status().

◆ bssgp2_nsi_tx_ptp()

int bssgp2_nsi_tx_ptp ( struct gprs_ns2_inst * nsi,
uint16_t nsei,
uint16_t bvci,
struct msgb * msg,
uint32_t lsp )

transmit BSSGP PDU over NS (PTP BVC)

Parameters
[in]nsiNS Instance through which to transmit
[in]nseiNSEI of NSE through which to transmit
[in]bvciBVCI through which to transmit
[in]msgBSSGP PDU to transmit
Returns
0 on success; negative on error

References bvci, osmo_gprs_ns2_prim::bvci, GPRS_NS2_PRIM_UNIT_DATA, gprs_ns2_recv_prim(), osmo_gprs_ns2_prim::link_selector, nsei, osmo_gprs_ns2_prim::nsei, osmo_gprs_ns2_prim::oph, osmo_gprs_ns2_prim::u, and osmo_gprs_ns2_prim::unitdata.

Referenced by bssgp2_nsi_tx_sig(), and fi_tx_ptp().

◆ bssgp2_nsi_tx_sig()

int bssgp2_nsi_tx_sig ( struct gprs_ns2_inst * nsi,
uint16_t nsei,
struct msgb * msg,
uint32_t lsp )

transmit BSSGP PDU over NS (SIGNALING BVC)

Parameters
[in]nsiNS Instance through which to transmit
[in]nseiNSEI of NSE through which to transmit
[in]msgBSSGP PDU to transmit
Returns
0 on success; negative on error

References bssgp2_nsi_tx_ptp(), and nsei.

Referenced by fi_tx_sig().