libosmogb  1.4.1
Osmocom Gb library
gprs_bssgp.h File Reference
#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/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 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
}
 
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

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_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_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, 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 ()
 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)
 
int bssgp_prim_cb (struct osmo_prim_hdr *oph, void *ctx)
 

Variables

struct gprs_ns_instbssgp_nsi
 
struct llist_head bssgp_bvc_ctxts
 

Macro Definition Documentation

#define BVC_F_BLOCKED   0x0001
#define BVC_S_BLOCKED   0x0001

Typedef Documentation

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

Enumeration Type Documentation

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.

Enumerator
BSSGP_PAGING_PS 
BSSGP_PAGING_CS 

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

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 

Function Documentation

void bssgp_bvc_ctx_free ( struct bssgp_bvc_ctx ctx)
int bssgp_create_cell_id ( uint8_t *  buf,
const struct gprs_ra_id raid,
uint16_t  cid 
)

References gsm48_encode_ra().

Referenced by bssgp_tx_bvc_reset2(), and bssgp_tx_ul_ud().

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 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().

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 
)
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 ( )
uint16_t bssgp_parse_cell_id ( struct gprs_ra_id raid,
const uint8_t *  buf 
)

References gsm48_parse_ra().

Referenced by bssgp_rx_bvc_reset().

const char* bssgp_pdu_str ( enum bssgp_pdu_type  pdu)
void bssgp_set_bssgp_callback ( bssgp_bvc_send  ns_send,
void *  data 
)
void bssgp_set_log_ss ( int  ss)

References DBSSGP.

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

References tlv_parse(), and tvlv_att_def.

Referenced by bssgp_rcvmsg(), and bssgp_rx_paging().

int bssgp_tx_simple_bvci ( uint8_t  pdu_type,
uint16_t  nsei,
uint16_t  bvci,
uint16_t  ns_bvci 
)
struct bssgp_bvc_ctx* btsctx_by_raid_cid ( const struct gprs_ra_id raid,
uint16_t  cid 
)

Variable Documentation

struct gprs_ns_inst* bssgp_nsi

Referenced by _gprs_ns_sendmsg().