libosmogb 1.10.0
Osmocom Gb library
|
GPRS BSSGP RIM protocol implementation as per 3GPP TS 48.018. More...
#include <stdint.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/gsm/gsm48.h>
#include <osmocom/gsm/prim.h>
#include <osmocom/gprs/protocol/gsm_08_18.h>
#include <osmocom/gprs/protocol/gsm_24_301.h>
#include <osmocom/gprs/gprs_bssgp_rim.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gprs/gprs_msgb.h>
Go to the source code of this file.
Data Structures | |
struct | osmo_bssgp_prim |
struct | bssgp_flow_control |
BSSGP flow control (SGSN side) According to Section 8.2. More... | |
struct | bssgp_bvc_ctx |
struct | bssgp_lv |
struct | bssgp_dl_ud_par |
struct | bssgp_paging_info |
BSSGP paging information. More... | |
Macros | |
#define | BSSGP_PDUF_UL 0x0001 /* PDU may occur in uplink */ |
#define | BSSGP_PDUF_DL 0x0002 /* PDU may occur in downlink */ |
#define | BSSGP_PDUF_SIG 0x0004 /* PDU may occur on Signaling BVC */ |
#define | BSSGP_PDUF_PTP 0x0008 /* PDU may occur on PTP BVC */ |
#define | BSSGP_PDUF_PTM 0x0010 /* PDU may occur on PTM BVC */ |
#define | BVC_S_BLOCKED 0x0001 |
#define | BVC_F_BLOCKED 0x0001 |
Typedefs | |
typedef int(* | bssgp_bvc_send) (void *ctx, struct msgb *msg) |
Enumerations | |
enum | bssgp_prim { PRIM_BSSGP_DL_UD , PRIM_BSSGP_UL_UD , PRIM_BSSGP_PTM_UD , PRIM_BSSGP_GMM_SUSPEND , PRIM_BSSGP_GMM_RESUME , PRIM_BSSGP_GMM_PAGING , PRIM_NM_FLUSH_LL , PRIM_NM_LLC_DISCARDED , PRIM_NM_BVC_RESET , PRIM_NM_BVC_BLOCK , PRIM_NM_BVC_UNBLOCK , PRIM_NM_STATUS , PRIM_BSSGP_RIM_PDU_TRANSFER } |
enum | bssgp_ctr { BSSGP_CTR_PKTS_IN , BSSGP_CTR_PKTS_OUT , BSSGP_CTR_BYTES_IN , BSSGP_CTR_BYTES_OUT , BSSGP_CTR_BLOCKED , BSSGP_CTR_DISCARDED , BSSGP_CTR_STATUS } |
enum | bssgp_paging_mode { BSSGP_PAGING_PS , BSSGP_PAGING_CS } |
BSSGP Paging mode. More... | |
enum | bssgp_paging_scope { BSSGP_PAGING_BSS_AREA , BSSGP_PAGING_LOCATION_AREA , BSSGP_PAGING_ROUTEING_AREA , BSSGP_PAGING_BVCI } |
BSSGP Paging scope. More... | |
Functions | |
static uint32_t | bssgp_pdu_type_flags (uint8_t pdu_type) |
return the PDU type flags (UL/DL/SIG/PTP/PTM) of specified PDU type | |
void | bssgp_set_bssgp_callback (bssgp_bvc_send ns_send, void *data) |
struct msgb * | bssgp_msgb_alloc (void) |
struct msgb * | bssgp_msgb_copy (const struct msgb *msg, const char *name) |
const char * | bssgp_cause_str (enum gprs_bssgp_cause cause) |
const char * | bssgp_pdu_str (enum bssgp_pdu_type pdu) |
int | bssgp_tx_bvc_reset_nsei_bvci (uint16_t nsei, uint16_t bvci, enum gprs_bssgp_cause cause, const struct gprs_ra_id *ra_id, uint16_t cell_id) |
Transmit a BVC-RESET message with a given nsei and bvci (Chapter 10.4.12) | |
int | bssgp_tx_simple_bvci (uint8_t pdu_type, uint16_t nsei, uint16_t bvci, uint16_t ns_bvci) |
int | bssgp_tx_status (uint8_t cause, uint16_t *bvci, struct msgb *orig_msg) |
struct bssgp_bvc_ctx * | btsctx_alloc (uint16_t bvci, uint16_t nsei) |
struct bssgp_bvc_ctx * | btsctx_by_raid_cid (const struct gprs_ra_id *raid, uint16_t cid) |
struct bssgp_bvc_ctx * | btsctx_by_bvci_nsei (uint16_t bvci, uint16_t nsei) |
void | bssgp_bvc_ctx_free (struct bssgp_bvc_ctx *ctx) |
int | bssgp_rcvmsg (struct msgb *msg) |
int | bssgp_tx_dl_ud (struct msgb *msg, uint16_t pdu_lifetime, struct bssgp_dl_ud_par *dup) |
uint16_t | bssgp_parse_cell_id (struct gprs_ra_id *raid, const uint8_t *buf) |
int | bssgp_create_cell_id (uint8_t *buf, const struct gprs_ra_id *raid, uint16_t cid) |
static int | bssgp_tlv_parse (struct tlv_parsed *tp, const uint8_t *buf, int len) |
int | bssgp_tx_paging (uint16_t nsei, uint16_t ns_bvci, struct bssgp_paging_info *pinfo) |
void | bssgp_fc_init (struct bssgp_flow_control *fc, uint32_t bucket_size_max, uint32_t bucket_leak_rate, uint32_t max_queue_depth, int(*out_cb)(struct bssgp_flow_control *fc, struct msgb *msg, uint32_t llc_pdu_len, void *priv)) |
int | bssgp_fc_in (struct bssgp_flow_control *fc, struct msgb *msg, uint32_t llc_pdu_len, void *priv) |
int | bssgp_fc_ms_init (struct bssgp_flow_control *fc_ms, uint16_t bvci, uint16_t nsei, uint32_t max_queue_depth) |
void | bssgp_flush_all_queues (void) |
Flush the queues of all BSSGP contexts. | |
void | bssgp_fc_flush_queue (struct bssgp_flow_control *fc) |
Flush the queue of the bssgp_flow_control. | |
int | bssgp_vty_init (void) |
void | bssgp_set_log_ss (int ss) OSMO_DEPRECATED("Use DLBSSGP instead!\n") |
int | bssgp_prim_cb (struct osmo_prim_hdr *oph, void *ctx) |
Variables | |
const struct osmo_tlv_prot_def | osmo_pdef_bssgp |
struct gprs_ns_inst * | bssgp_nsi |
struct llist_head | bssgp_bvc_ctxts |
GPRS BSSGP RIM protocol implementation as per 3GPP TS 48.018.
#define BSSGP_PDUF_DL 0x0002 /* PDU may occur in downlink */ |
#define BSSGP_PDUF_PTM 0x0010 /* PDU may occur on PTM BVC */ |
#define BSSGP_PDUF_PTP 0x0008 /* PDU may occur on PTP BVC */ |
#define BSSGP_PDUF_SIG 0x0004 /* PDU may occur on Signaling BVC */ |
#define BSSGP_PDUF_UL 0x0001 /* PDU may occur in uplink */ |
#define BVC_F_BLOCKED 0x0001 |
#define BVC_S_BLOCKED 0x0001 |
Referenced by bssgp_rx_bvc_block(), bssgp_rx_bvc_reset(), bssgp_rx_bvc_unblock(), bssgp_rx_ptp(), and dump_bvc().
enum bssgp_ctr |
enum bssgp_paging_mode |
enum bssgp_paging_scope |
enum bssgp_prim |
void bssgp_bvc_ctx_free | ( | struct bssgp_bvc_ctx * | ctx | ) |
References bssgp_bvc_ctx::ctrg, bssgp_bvc_ctx::fc, bssgp_bvc_ctx::list, and bssgp_flow_control::timer.
const char * bssgp_cause_str | ( | enum gprs_bssgp_cause | cause | ) |
int bssgp_create_cell_id | ( | uint8_t * | buf, |
const struct gprs_ra_id * | raid, | ||
uint16_t | cid ) |
void bssgp_fc_flush_queue | ( | struct bssgp_flow_control * | fc | ) |
Flush the queue of the bssgp_flow_control.
[in] | The | flow control object which holds the queue. |
References bssgp_fc_queue_element::list, bssgp_fc_queue_element::msg, and bssgp_flow_control::queue.
Referenced by bssgp_flush_all_queues().
int bssgp_fc_in | ( | struct bssgp_flow_control * | fc, |
struct msgb * | msg, | ||
uint32_t | llc_pdu_len, | ||
void * | priv ) |
References bssgp_fc_needs_queueing(), bssgp_flow_control::bucket_size_max, fc_enqueue(), bssgp_flow_control::out_cb, and bssgp_flow_control::time_last_pdu.
Referenced by bssgp_fc_ms_init(), and bssgp_tx_dl_ud().
void bssgp_fc_init | ( | struct bssgp_flow_control * | fc, |
uint32_t | bucket_size_max, | ||
uint32_t | bucket_leak_rate, | ||
uint32_t | max_queue_depth, | ||
int(* | out_cb )(struct bssgp_flow_control *fc, struct msgb *msg, uint32_t llc_pdu_len, void *priv) ) |
int bssgp_fc_ms_init | ( | struct bssgp_flow_control * | fc_ms, |
uint16_t | bvci, | ||
uint16_t | nsei, | ||
uint32_t | max_queue_depth ) |
void bssgp_flush_all_queues | ( | void | ) |
Flush the queues of all BSSGP contexts.
References bssgp_bvc_ctxts, bssgp_fc_flush_queue(), bssgp_bvc_ctx::fc, and bssgp_bvc_ctx::list.
struct msgb * bssgp_msgb_alloc | ( | void | ) |
References msgb_bssgph.
Referenced by bssgp2_enc_bvc_block(), bssgp2_enc_bvc_block_ack(), bssgp2_enc_bvc_reset(), bssgp2_enc_bvc_reset_ack(), bssgp2_enc_bvc_unblock(), bssgp2_enc_bvc_unblock_ack(), bssgp2_enc_fc_bvc(), bssgp2_enc_fc_bvc_ack(), bssgp2_enc_fc_ms(), bssgp2_enc_fc_ms_ack(), bssgp2_enc_flush_ll(), bssgp2_enc_status(), bssgp_encode_rim_pdu(), bssgp_tx_bvc_block(), bssgp_tx_bvc_unblock(), bssgp_tx_fc_bvc(), bssgp_tx_fc_bvc_ack(), bssgp_tx_fc_ms(), bssgp_tx_flush_ll_ack(), bssgp_tx_llc_discarded(), bssgp_tx_paging(), bssgp_tx_ra_capa_upd(), bssgp_tx_resume(), bssgp_tx_resume_ack(), bssgp_tx_resume_nack(), bssgp_tx_simple_bvci(), bssgp_tx_status(), bssgp_tx_suspend(), bssgp_tx_suspend_ack(), bssgp_tx_suspend_nack(), common_tx_radio_status(), and tx_bvc_reset_nsei_bvci().
uint16_t bssgp_parse_cell_id | ( | struct gprs_ra_id * | raid, |
const uint8_t * | buf ) |
Referenced by bssgp_bvc_fsm_allstate(), bssgp_bvc_fsm_wait_reset_ack(), bssgp_parse_rim_ra(), and bssgp_rx_bvc_reset().
const char * bssgp_pdu_str | ( | enum bssgp_pdu_type | pdu | ) |
References bssgp_pdu_strings.
Referenced by bssgp_rcvmsg(), bssgp_rx_ptp(), bssgp_rx_rim(), bssgp_rx_sign(), bssgp_tx_rim(), and bssgp_tx_rim_encoded().
|
inlinestatic |
return the PDU type flags (UL/DL/SIG/PTP/PTM) of specified PDU type
References osmo_pdef_bssgp, and pdu_type.
int bssgp_prim_cb | ( | struct osmo_prim_hdr * | oph, |
void * | ctx ) |
int bssgp_rcvmsg | ( | struct msgb * | msg | ) |
References BSSGP_CAUSE_INV_MAND_INF, BSSGP_CAUSE_PDU_INCOMP_FEAT, BSSGP_CAUSE_UNKNOWN_BVCI, BSSGP_CTR_BYTES_IN, BSSGP_CTR_PKTS_IN, BSSGP_IE_BVCI, bssgp_pdu_str(), BSSGP_PDUT_BVC_RESET, BSSGP_PDUT_DL_UNITDATA, BSSGP_PDUT_STATUS, BSSGP_PDUT_UL_UNITDATA, bssgp_rx_ptp(), bssgp_rx_sign(), bssgp_rx_status(), bssgp_tlv_parse(), bssgp_tx_status(), btsctx_by_bvci_nsei(), bvci, BVCI_PTM, BVCI_SIGNALLING, bssgp_bvc_ctx::ctrg, bssgp_normal_hdr::data, bssgp_ud_hdr::data, msgb_bssgp_len, msgb_bssgph, msgb_bvci, msgb_nsei, nsei, bssgp_normal_hdr::pdu_type, and pdu_type.
void bssgp_set_bssgp_callback | ( | bssgp_bvc_send | ns_send, |
void * | data ) |
References bssgp_ns_send, and bssgp_ns_send_data.
void bssgp_set_log_ss | ( | int | ss | ) |
|
inlinestatic |
Referenced by bssgp_rcvmsg(), and bssgp_rx_paging().
int bssgp_tx_bvc_reset_nsei_bvci | ( | uint16_t | nsei, |
uint16_t | bvci, | ||
enum gprs_bssgp_cause | cause, | ||
const struct gprs_ra_id * | ra_id, | ||
uint16_t | cell_id ) |
Transmit a BVC-RESET message with a given nsei and bvci (Chapter 10.4.12)
[in] | nsei | The NSEI to transmit over |
[in] | bvci | BVCI of the BVC to reset |
[in] | cause | The cause of the reset |
[in] | ra_id | Pointer to the ra_id to include. If NULL no cell information will be included |
[in] | cell_id | The cell_id to include (if ra_id is not NULL) returns >= 0 on success, on error < 0. |
References BSSGP_PDUT_BVC_RESET, bvci, nsei, and tx_bvc_reset_nsei_bvci().
Referenced by bssgp_tx_bvc_reset2().
int bssgp_tx_dl_ud | ( | struct msgb * | msg, |
uint16_t | pdu_lifetime, | ||
struct bssgp_dl_ud_par * | dup ) |
References BSSGP_CTR_BYTES_OUT, BSSGP_CTR_PKTS_OUT, bssgp_fc_in(), BSSGP_IE_DRX_PARAMS, BSSGP_IE_IMSI, BSSGP_IE_LLC_PDU, BSSGP_IE_MS_RADIO_ACCESS_CAP, BSSGP_IE_PDU_LIFETIME, BSSGP_IE_TLLI, BSSGP_PDUT_DL_UNITDATA, btsctx_by_bvci_nsei(), bvci, BVCI_PTM, bssgp_bvc_ctx::ctrg, bssgp_dl_ud_par::drx_parms, bssgp_bvc_ctx::fc, bssgp_dl_ud_par::fc, bssgp_dl_ud_par::imsi, bssgp_lv::len, bssgp_dl_ud_par::ms_ra_cap, msgb_bvci, msgb_nsei, msgb_tlli, nsei, bssgp_ud_hdr::pdu_type, bssgp_dl_ud_par::qos_profile, bssgp_ud_hdr::qos_profile, bssgp_dl_ud_par::tlli, bssgp_ud_hdr::tlli, and bssgp_lv::v.
int bssgp_tx_paging | ( | uint16_t | nsei, |
uint16_t | ns_bvci, | ||
struct bssgp_paging_info * | pinfo ) |
References BSSGP_IE_BSS_AREA_ID, BSSGP_IE_BVCI, BSSGP_IE_DRX_PARAMS, BSSGP_IE_IMSI, BSSGP_IE_LOCATION_AREA, BSSGP_IE_QOS_PROFILE, BSSGP_IE_TMSI, bssgp_msgb_alloc(), bssgp_msgb_ra_put(), bssgp_ns_send, bssgp_ns_send_data, BSSGP_PAGING_BSS_AREA, BSSGP_PAGING_BVCI, BSSGP_PAGING_LOCATION_AREA, BSSGP_PAGING_PS, BSSGP_PAGING_ROUTEING_AREA, BSSGP_PDUT_PAGING_CS, BSSGP_PDUT_PAGING_PS, bssgp_paging_info::bvci, bvci, bssgp_paging_info::drx_params, bssgp_paging_info::imsi, bssgp_paging_info::mode, msgb_bvci, msgb_nsei, nsei, bssgp_normal_hdr::pdu_type, bssgp_paging_info::ptmsi, bssgp_paging_info::qos, bssgp_paging_info::raid, and bssgp_paging_info::scope.
int bssgp_tx_simple_bvci | ( | uint8_t | pdu_type, |
uint16_t | nsei, | ||
uint16_t | bvci, | ||
uint16_t | ns_bvci ) |
References BSSGP_IE_BVCI, bssgp_msgb_alloc(), bssgp_ns_send, bssgp_ns_send_data, bvci, msgb_bvci, msgb_nsei, nsei, bssgp_normal_hdr::pdu_type, and pdu_type.
Referenced by bssgp_bvc_fsm_unblocked(), bssgp_rx_bvc_block(), bssgp_rx_bvc_reset(), and bssgp_rx_bvc_unblock().
int bssgp_tx_status | ( | uint8_t | cause, |
uint16_t * | bvci, | ||
struct msgb * | orig_msg ) |
References BSSGP_CAUSE_BVCI_BLOCKED, bssgp_cause_str(), BSSGP_CAUSE_UNKNOWN_BVCI, BSSGP_IE_BVCI, BSSGP_IE_CAUSE, BSSGP_IE_PDU_IN_ERROR, bssgp_msgb_alloc(), bssgp_ns_send, bssgp_ns_send_data, BSSGP_PDUT_STATUS, bvci, msgb_bssgp_len, msgb_bssgph, msgb_bvci, msgb_nsei, and bssgp_normal_hdr::pdu_type.
Referenced by bssgp_rcvmsg(), bssgp_rx_bvc_block(), bssgp_rx_bvc_unblock(), bssgp_rx_fc_bvc(), bssgp_rx_llc_disc(), bssgp_rx_ptp(), bssgp_rx_resume(), bssgp_rx_rim(), bssgp_rx_sign(), bssgp_rx_suspend(), and bssgp_rx_ul_ud().
int bssgp_vty_init | ( | void | ) |
References bssgp_node, and config_write_bssgp().
struct bssgp_bvc_ctx * btsctx_alloc | ( | uint16_t | bvci, |
uint16_t | nsei ) |
References _bssgp_tx_dl_ud(), bssgp_bvc_ctxts, bssgp_ctrg_desc, bssgp_fc_init(), bssgp_tall_ctx, bssgp_bvc_ctx::bvci, bvci, bssgp_bvc_ctx::ctrg, bssgp_bvc_ctx::fc, bssgp_bvc_ctx::is_sgsn, bssgp_bvc_ctx::list, bssgp_bvc_ctx::nsei, and nsei.
Referenced by bssgp_rx_bvc_reset().
struct bssgp_bvc_ctx * btsctx_by_bvci_nsei | ( | uint16_t | bvci, |
uint16_t | nsei ) |
References bssgp_bvc_ctxts, bssgp_bvc_ctx::bvci, bvci, bssgp_bvc_ctx::list, bssgp_bvc_ctx::nsei, and nsei.
Referenced by bssgp_fc_ms_init(), bssgp_rcvmsg(), bssgp_rx_bvc_block(), bssgp_rx_bvc_reset(), bssgp_rx_bvc_unblock(), bssgp_tx_dl_ud(), DEFUN(), and DEFUN().
struct bssgp_bvc_ctx * btsctx_by_raid_cid | ( | const struct gprs_ra_id * | raid, |
uint16_t | cid ) |
References bssgp_bvc_ctxts, bssgp_bvc_ctx::cell_id, bssgp_bvc_ctx::list, and bssgp_bvc_ctx::ra_id.
|
extern |
|
extern |
Referenced by _gprs_ns_sendmsg().
|
extern |
Referenced by bssgp_parse_rim_pdu(), bssgp_pdu_type_flags(), fi_tx_ptp(), and fi_tx_sig().