libosmogb 1.13.1.1-afb4 Osmocom Gb library

gprs_bssgp2.h
Go to the documentation of this file.
1#pragma once
2#include <stdint.h>
3
4#include <osmocom/gprs/protocol/gsm_08_18.h>
5#include <osmocom/gprs/gprs_ns2.h>
6
7 struct bssgp2_flow_ctrl;
8 struct gprs_ns2_inst;
9 struct gprs_ra_id;
10 struct msgb;
11
12 struct bssgp2_flow_ctrl {
13 uint8_t tag;
14 /* maximum bucket size (Bmax) in bytes */
15 uint64_t bucket_size_max;
17 uint64_t bucket_leak_rate;
18 /* percentage how full the given bucket is */
19 uint8_t bucket_full_ratio;
20 bool bucket_full_ratio_present;
21 union {
23 struct {
25 uint64_t bmax_default_ms;
27 uint64_t r_default_ms;
28
30 uint32_t measurement;
31 bool measurement_present;
32 } bvc;
34 struct {
36 uint32_t tlli;
37 } ms;
38 } u;
39};
40
41
42 int bssgp2_nsi_tx_ptp(struct gprs_ns2_inst *nsi, uint16_t nsei, uint16_t bvci,
43 struct msgb *msg, uint32_t lsp);
44
45 int bssgp2_nsi_tx_sig(struct gprs_ns2_inst *nsi, uint16_t nsei, struct msgb *msg, uint32_t lsp);
46
47 struct msgb *bssgp2_enc_bvc_block(uint16_t bvci, enum gprs_bssgp_cause cause);
48
49 struct msgb *bssgp2_enc_bvc_block_ack(uint16_t bvci);
50
51 struct msgb *bssgp2_enc_bvc_unblock(uint16_t bvci);
52
53 struct msgb *bssgp2_enc_bvc_unblock_ack(uint16_t bvci);
54
55 struct msgb *bssgp2_enc_bvc_reset(uint16_t bvci, enum gprs_bssgp_cause cause,
56 const struct gprs_ra_id *ra_id, uint16_t cell_id,
57 const uint8_t *feat_bm, const uint8_t *ext_feat_bm);
58
59 struct msgb *bssgp2_enc_bvc_reset_ack(uint16_t bvci, const struct gprs_ra_id *ra_id, uint16_t cell_id,
60 const uint8_t *feat_bm, const uint8_t *ext_feat_bm);
61
62 struct msgb *bssgp2_enc_flush_ll(uint32_t tlli, uint16_t old_bvci,
63 const uint16_t *new_bvci, const uint16_t *nsei);
64 struct msgb *bssgp2_enc_status(uint8_t cause, const uint16_t *bvci, const struct msgb *orig_msg, uint16_t max_pdu_len);
65
66
67 int bssgp2_dec_fc_bvc(struct bssgp2_flow_ctrl *fc, const struct tlv_parsed *tp);
68 struct msgb *bssgp2_enc_fc_bvc(const struct bssgp2_flow_ctrl *fc, enum bssgp_fc_granularity *gran);
69 struct msgb *bssgp2_enc_fc_bvc_ack(uint8_t tag);
70 int bssgp2_dec_fc_ms(struct bssgp2_flow_ctrl *fc, struct tlv_parsed *tp);
71 struct msgb *bssgp2_enc_fc_ms(const struct bssgp2_flow_ctrl *fc, enum bssgp_fc_granularity *gran);
72 struct msgb *bssgp2_enc_fc_ms_ack(uint32_t tlli, uint8_t tag);
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.
Definition: gprs_bssgp2.c:109
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.
Definition: gprs_bssgp2.c:222
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.
Definition: gprs_bssgp2.c:471
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.
Definition: gprs_bssgp2.c:358
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.
Definition: gprs_bssgp2.c:404
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.
Definition: gprs_bssgp2.c:151
bssgp2_enc_fc_ms
struct msgb * bssgp2_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.
Definition: gprs_bssgp2.c:436
bssgp2_enc_fc_bvc
struct msgb * bssgp2_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.
Definition: gprs_bssgp2.c:310
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)
Definition: gprs_bssgp2.c:42
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)
Definition: gprs_bssgp2.c:66
bssgp2_dec_fc_bvc
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.
Definition: gprs_bssgp2.c:264
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.
Definition: gprs_bssgp2.c:188
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.
Definition: gprs_bssgp2.c:384
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.
Definition: gprs_bssgp2.c:91
bssgp2_enc_bvc_block
struct msgb * bssgp2_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.
Definition: gprs_bssgp2.c:72
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.
Definition: gprs_bssgp2.c:127
tlli
uint32_t tlli
Identifier of a MS (inside BTS), equal to 'struct sgsn_mm_ctx'.
Definition: gprs_msgb.h:11
bvci
uint16_t bvci
Definition: gprs_msgb.h:8
nsei
uint16_t nsei
Identifiers of a BTS, equal to 'struct bssgp_bts_ctx'.
Definition: gprs_msgb.h:7
gprs_ns2.h
gsm_08_18.h
gprs_bssgp_cause
gprs_bssgp_cause
Cause coding (Section 11.3.8 / Table 11.10)
Definition: gsm_08_18.h:266
bssgp_fc_granularity
bssgp_fc_granularity
Definition: gsm_08_18.h:347
bssgp2_flow_ctrl
Definition: gprs_bssgp2.h:12
bssgp2_flow_ctrl::measurement_present
bool measurement_present
Definition: gprs_bssgp2.h:31
bssgp2_flow_ctrl::bucket_size_max
uint64_t bucket_size_max
Definition: gprs_bssgp2.h:15
bssgp2_flow_ctrl::bucket_full_ratio_present
bool bucket_full_ratio_present
Definition: gprs_bssgp2.h:20
bssgp2_flow_ctrl::measurement
uint32_t measurement
average milliseconds of queueing delay for a BVC
Definition: gprs_bssgp2.h:30
bssgp2_flow_ctrl::bmax_default_ms
uint64_t bmax_default_ms
default maximum bucket size per MS in bytes
Definition: gprs_bssgp2.h:25
bssgp2_flow_ctrl::tag
uint8_t tag
Definition: gprs_bssgp2.h:13
bssgp2_flow_ctrl::bvc
struct bssgp2_flow_ctrl::@2::@3 bvc
FC-BVC specifi members.
bssgp2_flow_ctrl::bucket_leak_rate
uint64_t bucket_leak_rate
bucket leak rate in bytes per second
Definition: gprs_bssgp2.h:17
bssgp2_flow_ctrl::bucket_full_ratio
uint8_t bucket_full_ratio
Definition: gprs_bssgp2.h:19
bssgp2_flow_ctrl::u
union bssgp2_flow_ctrl::@2 u
bssgp2_flow_ctrl::ms
struct bssgp2_flow_ctrl::@2::@4 ms
FC-MS specifi members.
bssgp2_flow_ctrl::r_default_ms
uint64_t r_default_ms
default bucket leak rate (R) for MS flow control bucket
Definition: gprs_bssgp2.h:27
bssgp2_flow_ctrl::tlli
uint32_t tlli
TLLI of the MS.
Definition: gprs_bssgp2.h:36
gprs_ns2_inst
An instance of the NS protocol stack.
Definition: gprs_ns2_internal.h:166
gprs_ra_id
msgb
tlv_parsed