diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/osmocom/gprs/gprs_bssgp2.h | 39 | ||||
-rw-r--r-- | include/osmocom/gprs/protocol/gsm_08_18.h | 8 |
2 files changed, 47 insertions, 0 deletions
diff --git a/include/osmocom/gprs/gprs_bssgp2.h b/include/osmocom/gprs/gprs_bssgp2.h index 0ab36191..bf814cb7 100644 --- a/include/osmocom/gprs/gprs_bssgp2.h +++ b/include/osmocom/gprs/gprs_bssgp2.h @@ -4,10 +4,41 @@ #include <osmocom/gprs/protocol/gsm_08_18.h> #include <osmocom/gprs/gprs_ns2.h> +struct bssgp2_flow_ctrl; struct gprs_ns2_inst; struct gprs_ra_id; struct msgb; +struct bssgp2_flow_ctrl { + uint8_t tag; + /* maximum bucket size (Bmax) in bytes */ + uint64_t bucket_size_max; + /*! bucket leak rate in _bytes_ per second */ + uint64_t bucket_leak_rate; + /* percentage how full the given bucket is */ + uint8_t bucket_full_ratio; + bool bucket_full_ratio_present; + union { + /*! FC-BVC specifi members */ + struct { + /*! default maximum bucket size per MS in bytes */ + uint64_t bmax_default_ms; + /*! default bucket leak rate (R) for MS flow control bucket */ + uint64_t r_default_ms; + + /*! average milliseconds of queueing delay for a BVC */ + uint32_t measurement; + bool measurement_present; + } bvc; + /*! FC-MS specifi members */ + struct { + /*! TLLI of the MS */ + uint32_t tlli; + } ms; + } u; +}; + + int bssgp2_nsi_tx_ptp(struct gprs_ns2_inst *nsi, uint16_t nsei, uint16_t bvci, struct msgb *msg, uint32_t lsp); @@ -29,3 +60,11 @@ struct msgb *bssgp2_enc_bvc_reset_ack(uint16_t bvci, const struct gprs_ra_id *ra const uint8_t *feat_bm, const uint8_t *ext_feat_bm); struct msgb *bssgp2_enc_status(uint8_t cause, const uint16_t *bvci, const struct msgb *orig_msg); + + +int bssgp2_dec_fc_bvc(struct bssgp2_flow_ctrl *fc, const struct tlv_parsed *tp); +struct msgb *bssgp2_enc_fc_bvc(const struct bssgp2_flow_ctrl *fc, enum bssgp_fc_granularity *gran); +struct msgb *bssgp2_enc_fc_bvc_ack(uint8_t tag); +int bssgp2_dec_fc_ms(struct bssgp2_flow_ctrl *fc, struct tlv_parsed *tp); +struct msgb *bssgp2_enc_fc_ms(const struct bssgp2_flow_ctrl *fc, enum bssgp_fc_granularity *gran); +struct msgb *bssgp2_enc_fc_ms_ack(uint32_t tlli, uint8_t tag); diff --git a/include/osmocom/gprs/protocol/gsm_08_18.h b/include/osmocom/gprs/protocol/gsm_08_18.h index 0ce28f55..466b0c51 100644 --- a/include/osmocom/gprs/protocol/gsm_08_18.h +++ b/include/osmocom/gprs/protocol/gsm_08_18.h @@ -341,3 +341,11 @@ enum gprs_bssgp_cause { #define BSSGP_XFEAT_DCN 0x20 /* Dedicated CN */ #define BSSGP_XFEAT_eDRX 0x40 /* eDRX */ #define BSSGP_XFEAT_MSAD 0x80 /* MS-assisted Dedicated CN selection */ + +/* Flow Control Granularity (Section 11.3.102) */ +enum bssgp_fc_granularity { + BSSGP_FC_GRAN_100 = 0, + BSSGP_FC_GRAN_1000 = 1, + BSSGP_FC_GRAN_10000 = 2, + BSSGP_FC_GRAN_100000 = 3, +}; |