Loading...
Searching...
No Matches
gprs_bssgp2.h
Go to the documentation of this file.
#pragma once
#include <stdint.h>
#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;
uint64_t bucket_leak_rate;
/* percentage how full the given bucket is */
uint8_t bucket_full_ratio;
bool bucket_full_ratio_present;
union {
struct {
uint64_t bmax_default_ms;
uint64_t r_default_ms;
uint32_t measurement;
bool measurement_present;
} bvc;
struct {
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);
int bssgp2_nsi_tx_sig(struct gprs_ns2_inst *nsi, uint16_t nsei, struct msgb *msg, uint32_t lsp);
struct msgb *bssgp2_enc_bvc_block(uint16_t bvci, enum gprs_bssgp_cause cause);
struct msgb *bssgp2_enc_bvc_block_ack(uint16_t bvci);
struct msgb *bssgp2_enc_bvc_unblock(uint16_t bvci);
struct msgb *bssgp2_enc_bvc_unblock_ack(uint16_t bvci);
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);
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);
struct msgb *bssgp2_enc_flush_ll(uint32_t tlli, uint16_t old_bvci,
const uint16_t *new_bvci, const uint16_t *nsei);
struct msgb *bssgp2_enc_status(uint8_t cause, const uint16_t *bvci, const struct msgb *orig_msg, uint16_t max_pdu_len);
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);
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
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
cause
uint8_t cause
tlli
uint32_t tlli
ra_id
uint8_t ra_id[6]
msg
uint8_t msg[0]
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::u
union bssgp2_flow_ctrl::@030161277153000252222102377242302144366034034345 u
bssgp2_flow_ctrl::bucket_full_ratio_present
bool bucket_full_ratio_present
Definition gprs_bssgp2.h:20
bssgp2_flow_ctrl::bvc
struct bssgp2_flow_ctrl::@030161277153000252222102377242302144366034034345::@156200125021063011336353304255127031207054251177 bvc
FC-BVC specifi members.
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::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::ms
struct bssgp2_flow_ctrl::@030161277153000252222102377242302144366034034345::@006163252120106011066213156230123117222124121142 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