libosmogb 1.9.0.196-9975
Osmocom Gb library
gprs_bssgp.h File Reference

GPRS BSSGP RIM protocol implementation as per 3GPP TS 48.018. More...

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 More...
 
void bssgp_set_bssgp_callback (bssgp_bvc_send ns_send, void *data)
 
struct msgbbssgp_msgb_alloc (void)
 
struct msgbbssgp_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) More...
 
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_ctxbtsctx_alloc (uint16_t bvci, uint16_t nsei)
 
struct bssgp_bvc_ctxbtsctx_by_raid_cid (const struct gprs_ra_id *raid, uint16_t cid)
 
struct bssgp_bvc_ctxbtsctx_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. More...
 
void bssgp_fc_flush_queue (struct bssgp_flow_control *fc)
 Flush the queue of the bssgp_flow_control. More...
 
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_instbssgp_nsi
 
struct llist_head bssgp_bvc_ctxts
 

Detailed Description

GPRS BSSGP RIM protocol implementation as per 3GPP TS 48.018.

Macro Definition Documentation

◆ BSSGP_PDUF_DL

#define BSSGP_PDUF_DL   0x0002 /* PDU may occur in downlink */

◆ BSSGP_PDUF_PTM

#define BSSGP_PDUF_PTM   0x0010 /* PDU may occur on PTM BVC */

◆ BSSGP_PDUF_PTP

#define BSSGP_PDUF_PTP   0x0008 /* PDU may occur on PTP BVC */

◆ BSSGP_PDUF_SIG

#define BSSGP_PDUF_SIG   0x0004 /* PDU may occur on Signaling BVC */

◆ BSSGP_PDUF_UL

#define BSSGP_PDUF_UL   0x0001 /* PDU may occur in uplink */

◆ BVC_F_BLOCKED

#define BVC_F_BLOCKED   0x0001

◆ BVC_S_BLOCKED

#define BVC_S_BLOCKED   0x0001

Typedef Documentation

◆ bssgp_bvc_send

typedef int(* bssgp_bvc_send) (void *ctx, struct msgb *msg)

Enumeration Type Documentation

◆ bssgp_ctr

enum bssgp_ctr
Enumerator
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 

◆ bssgp_paging_mode

BSSGP Paging mode.

Enumerator
BSSGP_PAGING_PS 
BSSGP_PAGING_CS 

◆ bssgp_paging_scope

BSSGP Paging scope.

Enumerator
BSSGP_PAGING_BSS_AREA 

all cells in BSS

BSSGP_PAGING_LOCATION_AREA 

all cells in LA

BSSGP_PAGING_ROUTEING_AREA 

all cells in RA

BSSGP_PAGING_BVCI 

one cell

◆ bssgp_prim

enum bssgp_prim
Enumerator
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 

Function Documentation

◆ bssgp_bvc_ctx_free()

◆ bssgp_cause_str()

◆ bssgp_create_cell_id()

◆ bssgp_fc_flush_queue()

void bssgp_fc_flush_queue ( struct bssgp_flow_control fc)

Flush the queue of the bssgp_flow_control.

Parameters
[in]Theflow control object which holds the queue.

References list, bssgp_fc_queue_element::list, llist_del(), llist_for_each_entry_safe, bssgp_fc_queue_element::msg, msgb_free(), and bssgp_flow_control::queue.

Referenced by bssgp_flush_all_queues().

◆ bssgp_fc_in()

◆ bssgp_fc_init()

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(*)(struct bssgp_flow_control *fc, struct msgb *msg, uint32_t llc_pdu_len, void *priv)  out_cb 
)

◆ bssgp_fc_ms_init()

int bssgp_fc_ms_init ( struct bssgp_flow_control fc_ms,
uint16_t  bvci,
uint16_t  nsei,
uint32_t  max_queue_depth 
)

◆ bssgp_flush_all_queues()

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, list, and llist_for_each_entry.

◆ bssgp_msgb_alloc()

◆ bssgp_msgb_copy()

◆ bssgp_parse_cell_id()

uint16_t bssgp_parse_cell_id ( struct gprs_ra_id raid,
const uint8_t *  buf 
)

◆ bssgp_pdu_str()

◆ bssgp_pdu_type_flags()

static uint32_t bssgp_pdu_type_flags ( uint8_t  pdu_type)
inlinestatic

return the PDU type flags (UL/DL/SIG/PTP/PTM) of specified PDU type

References osmo_pdef_bssgp, osmo_tlv_prot_msgt_flags(), and pdu_type.

◆ bssgp_prim_cb()

◆ bssgp_rcvmsg()

◆ bssgp_set_bssgp_callback()

void bssgp_set_bssgp_callback ( bssgp_bvc_send  ns_send,
void *  data 
)

◆ bssgp_set_log_ss()

void bssgp_set_log_ss ( int  ss)

◆ bssgp_tlv_parse()

static int bssgp_tlv_parse ( struct tlv_parsed tp,
const uint8_t *  buf,
int  len 
)
inlinestatic

References len(), tlv_parse(), and tvlv_att_def.

Referenced by bssgp_rcvmsg(), and bssgp_rx_paging().

◆ bssgp_tx_bvc_reset_nsei_bvci()

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)

Parameters
[in]nseiThe NSEI to transmit over
[in]bvciBVCI of the BVC to reset
[in]causeThe cause of the reset
[in]ra_idPointer to the ra_id to include. If NULL no cell information will be included
[in]cell_idThe cell_id to include (if ra_id is not NULL) returns >= 0 on success, on error < 0.

References BSSGP_PDUT_BVC_RESET, bvci, cause, nsei, ra_id, and tx_bvc_reset_nsei_bvci().

Referenced by bssgp_tx_bvc_reset2().

◆ bssgp_tx_dl_ud()

◆ bssgp_tx_paging()

◆ bssgp_tx_simple_bvci()

int bssgp_tx_simple_bvci ( uint8_t  pdu_type,
uint16_t  nsei,
uint16_t  bvci,
uint16_t  ns_bvci 
)

◆ bssgp_tx_status()

◆ bssgp_vty_init()

◆ btsctx_alloc()

◆ btsctx_by_bvci_nsei()

◆ btsctx_by_raid_cid()

struct bssgp_bvc_ctx * btsctx_by_raid_cid ( const struct gprs_ra_id raid,
uint16_t  cid 
)

Variable Documentation

◆ bssgp_bvc_ctxts

◆ bssgp_nsi

struct gprs_ns_inst* bssgp_nsi
extern

Referenced by _gprs_ns_sendmsg().

◆ osmo_pdef_bssgp

const struct osmo_tlv_prot_def osmo_pdef_bssgp
extern