libosmogb  1.9.0.12-9519.202310132026
Osmocom Gb library
bssgp_bvc_fsm.h
Go to the documentation of this file.
1 #pragma once
2 #include <stdint.h>
3 
4 struct gprs_ns2_inst;
5 struct osmo_fsm_inst;
6 struct gprs_ra_id;
7 struct bssgp2_flow_ctrl;
8 
14 };
15 
17  /* Rx of BSSGP PDUs from the remote side; 'data' is 'struct tlv_parsed', and
18  * the assumption is that the caller has already validated all mandatory IEs
19  * are present and of sufficient length */
28  /* Requests of the local user */
29  BSSGP_BVCFSM_E_REQ_BLOCK, /* data: uint8_t *cause */
31  BSSGP_BVCFSM_E_REQ_RESET, /* data: uint8_t *cause */
32  BSSGP_BVCFSM_E_REQ_FC_BVC, /* data: struct bssgp2_flow_ctrl */
33 };
34 
36  /* call-back notifying the user of a state change */
37  void (*state_chg_notification)(uint16_t nsei, uint16_t bvci, int old_state, int new_state,
38  void *priv);
39  /* call-back notifying the user of a BVC-RESET event */
40  void (*reset_notification)(uint16_t nsei, uint16_t bvci, const struct gprs_ra_id *ra_id,
41  uint16_t cell_id, uint8_t cause, void *priv);
42  void (*rx_fc_bvc)(uint16_t nsei, uint16_t bvci, const struct bssgp2_flow_ctrl *fc, void *priv);
43  void (*reset_ack_notification)(uint16_t nsei, uint16_t bvci, const struct gprs_ra_id *ra_id,
44  uint16_t cell_id, uint8_t cause, void *priv);
45 };
46 
47 struct osmo_fsm_inst *
48 bssgp_bvc_fsm_alloc_sig_bss(void *ctx, struct gprs_ns2_inst *nsi, uint16_t nsei, uint32_t features);
49 
50 struct osmo_fsm_inst *
51 bssgp_bvc_fsm_alloc_ptp_bss(void *ctx, struct gprs_ns2_inst *nsi, uint16_t nsei, uint16_t bvci,
52  const struct gprs_ra_id *ra_id, uint16_t cell_id);
53 
54 struct osmo_fsm_inst *
55 bssgp_bvc_fsm_alloc_sig_sgsn(void *ctx, struct gprs_ns2_inst *nsi, uint16_t nsei, uint32_t features);
56 
57 struct osmo_fsm_inst *
58 bssgp_bvc_fsm_alloc_ptp_sgsn(void *ctx, struct gprs_ns2_inst *nsi, uint16_t nsei, uint16_t bvci);
59 
60 void bssgp_bvc_fsm_set_ops(struct osmo_fsm_inst *fi, const struct bssgp_bvc_fsm_ops *ops, void *ops_priv);
61 
63 
65 
69 
70 void bssgp_bvc_fsm_set_max_pdu_len(struct osmo_fsm_inst *fi, uint16_t max_pdu_len);
71 uint16_t bssgp_bvc_fsm_get_max_pdu_len(const struct osmo_fsm_inst *fi);
Definition: bssgp_bvc_fsm.h:31
void(* rx_fc_bvc)(uint16_t nsei, uint16_t bvci, const struct bssgp2_flow_ctrl *fc, void *priv)
Definition: bssgp_bvc_fsm.h:42
Definition: bssgp_bvc_fsm.h:25
uint32_t bssgp_bvc_fsm_get_features_negotiated(struct osmo_fsm_inst *fi)
Return the negotiated features / extended features.
Definition: bssgp_bvc_fsm.c:826
Definition: bssgp_bvc_fsm.h:32
Definition: bssgp_bvc_fsm.h:20
Definition: bssgp_bvc_fsm.h:22
An instance of the NS protocol stack.
Definition: gprs_ns2_internal.h:151
void bssgp_bvc_fsm_set_ops(struct osmo_fsm_inst *fi, const struct bssgp_bvc_fsm_ops *ops, void *ops_priv)
Set the &#39;operations&#39; callbacks + private data.
Definition: bssgp_bvc_fsm.c:782
Definition: bssgp_bvc_fsm.h:35
uint8_t ra_id[6]
void(* state_chg_notification)(uint16_t nsei, uint16_t bvci, int old_state, int new_state, void *priv)
Definition: bssgp_bvc_fsm.h:37
uint8_t cause
Definition: bssgp_bvc_fsm.h:29
bool bssgp_bvc_fsm_is_unblocked(struct osmo_fsm_inst *fi)
Return if the given BVC FSM is in UNBLOCKED state.
Definition: bssgp_bvc_fsm.c:793
struct osmo_fsm_inst * bssgp_bvc_fsm_alloc_sig_sgsn(void *ctx, struct gprs_ns2_inst *nsi, uint16_t nsei, uint32_t features)
Allocate a SIGNALING-BVC FSM for the SGSN role (facing a remote BSS).
Definition: bssgp_bvc_fsm.c:744
Definition: bssgp_bvc_fsm.h:13
uint8_t bssgp_bvc_fsm_get_block_cause(struct osmo_fsm_inst *fi)
Determine the cause value why given BVC FSM is blocked.
Definition: bssgp_bvc_fsm.c:799
uint16_t nsei
Identifiers of a BTS, equal to &#39;struct bssgp_bts_ctx&#39;.
Definition: gprs_msgb.h:260
Definition: bssgp_bvc_fsm.h:30
Definition: bssgp_bvc_fsm.h:21
uint16_t bvci
Definition: gprs_msgb.h:261
Definition: bssgp_bvc_fsm.h:12
void(* reset_notification)(uint16_t nsei, uint16_t bvci, const struct gprs_ra_id *ra_id, uint16_t cell_id, uint8_t cause, void *priv)
Definition: bssgp_bvc_fsm.h:40
Definition: bssgp_bvc_fsm.h:11
Definition: bssgp_bvc_fsm.h:10
uint32_t bssgp_bvc_fsm_get_features_advertised(struct osmo_fsm_inst *fi)
Return the advertised features / extended features.
Definition: bssgp_bvc_fsm.c:808
bssgp_ptp_bvc_fsm_event
Definition: bssgp_bvc_fsm.h:16
Definition: gprs_bssgp2.h:12
struct osmo_fsm_inst * bssgp_bvc_fsm_alloc_ptp_bss(void *ctx, struct gprs_ns2_inst *nsi, uint16_t nsei, uint16_t bvci, const struct gprs_ra_id *ra_id, uint16_t cell_id)
Allocate a PTP-BVC FSM for the BSS role (facing a remote SGSN).
Definition: bssgp_bvc_fsm.c:717
Definition: bssgp_bvc_fsm.h:27
uint16_t bssgp_bvc_fsm_get_max_pdu_len(const struct osmo_fsm_inst *fi)
Return the maximum size of a BSSGP PDU ! On the NS layer this corresponds to the size of an NS SDU in...
Definition: bssgp_bvc_fsm.c:845
bssp_ptp_bvc_fsm_state
Definition: bssgp_bvc_fsm.h:9
Definition: bssgp_bvc_fsm.h:24
void(* reset_ack_notification)(uint16_t nsei, uint16_t bvci, const struct gprs_ra_id *ra_id, uint16_t cell_id, uint8_t cause, void *priv)
Definition: bssgp_bvc_fsm.h:43
uint32_t bssgp_bvc_fsm_get_features_received(struct osmo_fsm_inst *fi)
Return the received features / extended features.
Definition: bssgp_bvc_fsm.c:817
struct osmo_fsm_inst * bssgp_bvc_fsm_alloc_sig_bss(void *ctx, struct gprs_ns2_inst *nsi, uint16_t nsei, uint32_t features)
Allocate a SIGNALING-BVC FSM for the BSS role (facing a remote SGSN).
Definition: bssgp_bvc_fsm.c:694
struct osmo_fsm_inst * bssgp_bvc_fsm_alloc_ptp_sgsn(void *ctx, struct gprs_ns2_inst *nsi, uint16_t nsei, uint16_t bvci)
Allocate a PTP-BVC FSM for the SGSN role (facing a remote BSS).
Definition: bssgp_bvc_fsm.c:765
Definition: bssgp_bvc_fsm.h:26
Definition: bssgp_bvc_fsm.h:23
void bssgp_bvc_fsm_set_max_pdu_len(struct osmo_fsm_inst *fi, uint16_t max_pdu_len)
Set the maximum size of a BSSGP PDU.
Definition: bssgp_bvc_fsm.c:836