18#define BSSGP_PDUF_UL 0x0001
19#define BSSGP_PDUF_DL 0x0002
20#define BSSGP_PDUF_SIG 0x0004
21#define BSSGP_PDUF_PTP 0x0008
22#define BSSGP_PDUF_PTM 0x0010
41 uint16_t
bvci, uint16_t ns_bvci);
101 uint32_t llc_pdu_len,
void *priv);
104#define BVC_S_BLOCKED 0x0001
144#define BVC_F_BLOCKED 0x0001
186 const uint8_t *buf,
size_t buf_len);
228 uint32_t bucket_size_max, uint32_t bucket_leak_rate,
229 uint32_t max_queue_depth,
231 uint32_t llc_pdu_len,
void *priv));
237 uint32_t llc_pdu_len,
void *priv);
242 uint16_t
nsei, uint32_t max_queue_depth);
struct msgb * bssgp_msgb_copy(const struct msgb *msg, const char *name)
Definition: gprs_bssgp_util.c:505
int bssgp_rcvmsg(struct msgb *msg)
Definition: gprs_bssgp.c:1192
void bssgp_fc_flush_queue(struct bssgp_flow_control *fc)
Flush the queue of the bssgp_flow_control.
Definition: gprs_bssgp.c:1452
struct bssgp_bvc_ctx * btsctx_alloc(uint16_t bvci, uint16_t nsei)
Definition: gprs_bssgp.c:209
int bssgp_tx_simple_bvci(uint8_t pdu_type, uint16_t nsei, uint16_t bvci, uint16_t ns_bvci)
Definition: gprs_bssgp_util.c:536
bssgp_paging_mode
BSSGP Paging mode.
Definition: gprs_bssgp.h:198
@ BSSGP_PAGING_PS
Definition: gprs_bssgp.h:199
@ BSSGP_PAGING_CS
Definition: gprs_bssgp.h:200
bssgp_prim
Definition: gprs_bssgp.h:45
@ PRIM_NM_BVC_UNBLOCK
Definition: gprs_bssgp.h:58
@ PRIM_BSSGP_PTM_UD
Definition: gprs_bssgp.h:48
@ PRIM_BSSGP_GMM_SUSPEND
Definition: gprs_bssgp.h:50
@ PRIM_NM_STATUS
Definition: gprs_bssgp.h:59
@ PRIM_NM_FLUSH_LL
Definition: gprs_bssgp.h:54
@ PRIM_BSSGP_GMM_RESUME
Definition: gprs_bssgp.h:51
@ PRIM_BSSGP_GMM_PAGING
Definition: gprs_bssgp.h:52
@ PRIM_NM_BVC_BLOCK
Definition: gprs_bssgp.h:57
@ PRIM_NM_BVC_RESET
Definition: gprs_bssgp.h:56
@ PRIM_NM_LLC_DISCARDED
Definition: gprs_bssgp.h:55
@ PRIM_BSSGP_DL_UD
Definition: gprs_bssgp.h:46
@ PRIM_BSSGP_RIM_PDU_TRANSFER
Definition: gprs_bssgp.h:61
@ PRIM_BSSGP_UL_UD
Definition: gprs_bssgp.h:47
struct bssgp_bvc_ctx * btsctx_by_bvci_nsei(uint16_t bvci, uint16_t nsei)
Definition: gprs_bssgp.c:192
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
Definition: gprs_bssgp.h:27
int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
const struct osmo_tlv_prot_def osmo_pdef_bssgp
Definition: gprs_bssgp_util.c:261
int bssgp_parse_cell_id2(struct osmo_routing_area_id *raid, uint16_t *cid, const uint8_t *buf, size_t buf_len)
Parse the value of a BSSGP Cell identity (04.08 RAI + Cell Id)
Definition: gprs_bssgp.c:358
void bssgp_set_bssgp_callback(bssgp_bvc_send ns_send, void *data)
Definition: gprs_bssgp.c:203
int bssgp_create_cell_id2(uint8_t *buf, size_t buf_len, const struct osmo_routing_area_id *raid, uint16_t cid)
Encode the 04.08 RAI, Cell Id into BSSGP Cell identity.
Definition: gprs_bssgp.c:387
struct gprs_ns_inst * bssgp_nsi
Definition: gprs_bssgp_util.c:37
uint16_t bssgp_parse_cell_id(struct gprs_ra_id *raid, const uint8_t *buf)
Definition: gprs_bssgp.c:349
int bssgp_fc_ms_init(struct bssgp_flow_control *fc_ms, uint16_t bvci, uint16_t nsei, uint32_t max_queue_depth)
Definition: gprs_bssgp.c:935
int(* bssgp_bvc_send)(void *ctx, struct msgb *msg)
Definition: gprs_bssgp.h:31
int bssgp_create_cell_id(uint8_t *buf, const struct gprs_ra_id *raid, uint16_t cid)
Definition: gprs_bssgp.c:375
void bssgp_bvc_ctx_free(struct bssgp_bvc_ctx *ctx)
Definition: gprs_bssgp.c:242
int bssgp_tx_paging(uint16_t nsei, uint16_t ns_bvci, struct bssgp_paging_info *pinfo)
Definition: gprs_bssgp.c:1372
const char * bssgp_pdu_str(enum bssgp_pdu_type pdu)
Definition: gprs_bssgp_util.c:489
const char * bssgp_cause_str(enum gprs_bssgp_cause cause)
Definition: gprs_bssgp_util.c:484
struct llist_head bssgp_bvc_ctxts
bssgp_ctr
Definition: gprs_bssgp.h:146
@ BSSGP_CTR_DISCARDED
Definition: gprs_bssgp.h:152
@ BSSGP_CTR_PKTS_IN
Definition: gprs_bssgp.h:147
@ BSSGP_CTR_BYTES_OUT
Definition: gprs_bssgp.h:150
@ BSSGP_CTR_PKTS_OUT
Definition: gprs_bssgp.h:148
@ BSSGP_CTR_BLOCKED
Definition: gprs_bssgp.h:151
@ BSSGP_CTR_STATUS
Definition: gprs_bssgp.h:153
@ BSSGP_CTR_BYTES_IN
Definition: gprs_bssgp.h:149
int bssgp_vty_init(void)
Definition: gprs_bssgp_vty.c:206
bssgp_paging_scope
BSSGP Paging scope.
Definition: gprs_bssgp.h:204
@ BSSGP_PAGING_ROUTEING_AREA
all cells in RA
Definition: gprs_bssgp.h:207
@ BSSGP_PAGING_LOCATION_AREA
all cells in LA
Definition: gprs_bssgp.h:206
@ BSSGP_PAGING_BVCI
one cell
Definition: gprs_bssgp.h:208
@ BSSGP_PAGING_BSS_AREA
all cells in BSS
Definition: gprs_bssgp.h:205
void bssgp_flush_all_queues(void)
Flush the queues of all BSSGP contexts.
Definition: gprs_bssgp.c:1466
struct msgb * bssgp_msgb_alloc(void)
Definition: gprs_bssgp_util.c:494
void bssgp_set_log_ss(int ss) OSMO_DEPRECATED("Use DLBSSGP instead!\n")
Definition: gprs_bssgp.c:1441
int bssgp_tx_dl_ud(struct msgb *msg, uint16_t pdu_lifetime, struct bssgp_dl_ud_par *dup)
Definition: gprs_bssgp.c:1267
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))
Definition: gprs_bssgp.c:919
int bssgp_tx_status(uint8_t cause, uint16_t *bvci, struct msgb *orig_msg)
Definition: gprs_bssgp_util.c:555
static int bssgp_tlv_parse(struct tlv_parsed *tp, const uint8_t *buf, int len)
Definition: gprs_bssgp.h:192
int bssgp_fc_in(struct bssgp_flow_control *fc, struct msgb *msg, uint32_t llc_pdu_len, void *priv)
Definition: gprs_bssgp.c:890
struct bssgp_bvc_ctx * btsctx_by_raid_cid(const struct gprs_ra_id *raid, uint16_t cid)
Definition: gprs_bssgp.c:85
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)
Definition: gprs_bssgp.c:149
uint16_t bvci
Definition: gprs_msgb.h:8
uint16_t nsei
Identifiers of a BTS, equal to 'struct bssgp_bts_ctx'.
Definition: gprs_msgb.h:7
static size_t len(const char *str)
uint8_t pdu_type
NS PDU type.
Definition: gsm_08_16.h:0
uint8_t data[0]
variable-length payload
Definition: gsm_08_16.h:1
int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def, const uint8_t *buf, int buf_len, uint8_t lv_tag, uint8_t lv_tag2)
struct tlv_definition tvlv_att_def
static uint32_t osmo_tlv_prot_msgt_flags(const struct osmo_tlv_prot_def *pdef, uint8_t msg_type)
#define OSMO_DEPRECATED(text)
bssgp_pdu_type
BSSGP PDU types (Section 11.3.26 / Table 11.27)
Definition: gsm_08_18.h:17
gprs_bssgp_cause
Cause coding (Section 11.3.8 / Table 11.10)
Definition: gsm_08_18.h:266
Definition: gprs_bssgp.h:107
struct llist_head list
Definition: gprs_bssgp.h:108
uint16_t bvci
Definition: gprs_bssgp.h:115
struct gprs_ra_id ra_id
parsed RA ID of the remote BTS
Definition: gprs_bssgp.h:110
struct bssgp_flow_control * fc
Definition: gprs_bssgp.h:122
uint16_t cell_id
Cell ID of the remote BTS.
Definition: gprs_bssgp.h:111
uint32_t r_default_ms
default bucket leak rate of per-MS bucket in octests/s
Definition: gprs_bssgp.h:126
struct rate_ctr_group * ctrg
Definition: gprs_bssgp.h:120
uint16_t nsei
Definition: gprs_bssgp.h:116
bool is_sgsn
BSS or SGSN.
Definition: gprs_bssgp.h:129
uint32_t state
Definition: gprs_bssgp.h:118
uint32_t bmax_default_ms
default maximum size of per-MS bucket in octets
Definition: gprs_bssgp.h:124
Definition: gprs_bssgp.h:169
char * imsi
Definition: gprs_bssgp.h:171
uint32_t * tlli
Definition: gprs_bssgp.h:170
struct bssgp_flow_control * fc
Definition: gprs_bssgp.h:172
uint8_t qos_profile[3]
Definition: gprs_bssgp.h:176
struct bssgp_lv ms_ra_cap
Definition: gprs_bssgp.h:175
uint16_t drx_parms
Definition: gprs_bssgp.h:173
BSSGP flow control (SGSN side) According to Section 8.2.
Definition: gprs_bssgp.h:86
struct timeval time_last_pdu
timestamp of last PDU sent
Definition: gprs_bssgp.h:91
uint32_t bucket_counter
number of tokens in the bucket
Definition: gprs_bssgp.h:90
struct llist_head queue
linked list of msgb's
Definition: gprs_bssgp.h:96
uint32_t max_queue_depth
how many packets to queue (mgs)
Definition: gprs_bssgp.h:94
struct osmo_timer_list timer
timer-based dequeueing
Definition: gprs_bssgp.h:97
int(* out_cb)(struct bssgp_flow_control *fc, struct msgb *msg, uint32_t llc_pdu_len, void *priv)
callback to be called at output of flow control
Definition: gprs_bssgp.h:100
uint32_t bucket_size_max
maximum size of the bucket (octets)
Definition: gprs_bssgp.h:87
uint32_t queue_depth
current length of queue (msgs)
Definition: gprs_bssgp.h:95
uint32_t bucket_leak_rate
leak rate of the bucket (octets/sec)
Definition: gprs_bssgp.h:88
Definition: gprs_bssgp.h:164
uint8_t * v
Definition: gprs_bssgp.h:166
uint16_t len
Definition: gprs_bssgp.h:165
BSSGP paging information.
Definition: gprs_bssgp.h:212
char * imsi
IMSI, if any.
Definition: gprs_bssgp.h:217
enum bssgp_paging_scope scope
bssgp_paging_scope
Definition: gprs_bssgp.h:214
uint8_t qos[3]
QoS parameters.
Definition: gprs_bssgp.h:220
uint16_t drx_params
DRX parameters.
Definition: gprs_bssgp.h:219
enum bssgp_paging_mode mode
CS or PS paging.
Definition: gprs_bssgp.h:213
struct gprs_ra_id raid
RA Identifier.
Definition: gprs_bssgp.h:215
uint16_t bvci
BVCI.
Definition: gprs_bssgp.h:216
uint32_t * ptmsi
P-TMSI, if any.
Definition: gprs_bssgp.h:218
An instance of the NS protocol stack.
Definition: gprs_ns.h:79
Definition: gprs_bssgp.h:64
struct osmo_bssgp_prim::@0::@1 resume
uint8_t suspend_ref
Definition: gprs_bssgp.h:77
union osmo_bssgp_prim::@0 u
uint16_t bvci
Definition: gprs_bssgp.h:69
struct tlv_parsed * tp
Definition: gprs_bssgp.h:71
struct bssgp_ran_information_pdu rim_pdu
Definition: gprs_bssgp.h:79
struct osmo_prim_hdr oph
Definition: gprs_bssgp.h:65
uint16_t nsei
Definition: gprs_bssgp.h:68
uint32_t tlli
Definition: gprs_bssgp.h:70
struct gprs_ra_id * ra_id
Definition: gprs_bssgp.h:72