libosmogb  1.7.0
Osmocom Gb library
common_vty.h
Go to the documentation of this file.
1 
3 #include <osmocom/vty/command.h>
4 #include <osmocom/core/logging.h>
5 
6 extern int DNS;
7 
BSSGP_BVCFSM_E_RX_BLOCK_ACK
@ BSSGP_BVCFSM_E_RX_BLOCK_ACK
Definition: bssgp_bvc_fsm.h:21
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:355
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
osmo_fsm_inst::priv
void * priv
osmo_fsm_state
OSMO_TDEF_S
OSMO_TDEF_S
bvc_fsm_priv::ra_id
struct gprs_ra_id ra_id
Definition: bssgp_bvc_fsm.c:147
bssgp_bvc_fsm_set_max_pdu_len
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
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_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
_onenter_tail
static void _onenter_tail(struct osmo_fsm_inst *fi, uint32_t prev_state)
Definition: bssgp_bvc_fsm.c:271
bssgp_bvc_fsm_states
static const struct osmo_fsm_state bssgp_bvc_fsm_states[]
Definition: bssgp_bvc_fsm.c:596
vty.h
gprs_ns2_inst
An instance of the NS protocol stack.
Definition: gprs_ns2_internal.h:148
BSSGP_BVCFSM_S_BLOCKED
@ BSSGP_BVCFSM_S_BLOCKED
Definition: bssgp_bvc_fsm.h:11
BSSGP_BVCFSM_S_WAIT_RESET_ACK
@ BSSGP_BVCFSM_S_WAIT_RESET_ACK
Definition: bssgp_bvc_fsm.h:12
_tx_bvc_reset
static void _tx_bvc_reset(struct osmo_fsm_inst *fi, uint8_t cause)
Definition: bssgp_bvc_fsm.c:181
gprs_msgb.h
gprs_bssgp.h
cause
uint8_t cause
osmo_fsm::name
const char * name
bvc_fsm_priv::max_pdu_len
uint16_t max_pdu_len
Definition: bssgp_bvc_fsm.c:120
bssgp_bvc_fsm_alloc_ptp_bss
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
BSSGP_BVCFSM_S_NULL
@ BSSGP_BVCFSM_S_NULL
Definition: bssgp_bvc_fsm.h:10
OSMO_ASSERT
#define OSMO_ASSERT(exp)
bssgp_parse_cell_id
uint16_t bssgp_parse_cell_id(struct gprs_ra_id *raid, const uint8_t *buf)
Definition: gprs_bssgp.c:349
bvc_fsm_priv::advertised
uint32_t advertised
Definition: bssgp_bvc_fsm.c:137
bssgp_cause_str
const char * bssgp_cause_str(enum gprs_bssgp_cause cause)
Definition: gprs_bssgp_util.c:484
utils.h
LOG_FLT_GB_BVC
LOG_FLT_GB_BVC
data
uint8_t data[0]
variable-length payload
Definition: gsm_08_16.h:3
bssgp_bvc_fsm_blocked_onenter
static void bssgp_bvc_fsm_blocked_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
Definition: bssgp_bvc_fsm.c:288
LOG_FLT_GB_NSVC
LOG_FLT_GB_NSVC
LOG_CTX_GB_NSVC
LOG_CTX_GB_NSVC
common_vty.h
TLVP_PRES_LEN
#define TLVP_PRES_LEN(tp, tag, min_len)
bssgp_bvc_fsm_ops::reset_ack_notification
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
fi_tx_ptp
static int fi_tx_ptp(struct osmo_fsm_inst *fi, struct msgb *msg)
Definition: bssgp_bvc_fsm.c:156
gsm48.h
bvc_fsm_priv::negotiated
uint32_t negotiated
Definition: bssgp_bvc_fsm.c:139
BSSGP_IE_EXT_FEATURE_BITMAP
@ BSSGP_IE_EXT_FEATURE_BITMAP
Definition: gsm_08_18.h:205
bssgp_bvc_fsm_allstate
static void bssgp_bvc_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: bssgp_bvc_fsm.c:514
bssgp2_flow_ctrl
Definition: gprs_bssgp2.h:12
gprs_bssgp2.h
osmo_fsm_inst_alloc
struct osmo_fsm_inst * osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void *priv, int log_level, const char *id)
msg
uint8_t msg[0]
BSSGP_BVCFSM_E_RX_FC_BVC_ACK
@ BSSGP_BVCFSM_E_RX_FC_BVC_ACK
Definition: bssgp_bvc_fsm.h:27
LOG_CTX_GB_NSE
LOG_CTX_GB_NSE
bvc_fsm_priv::received
uint32_t received
Definition: bssgp_bvc_fsm.c:138
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
update_negotiated_features
static void update_negotiated_features(struct osmo_fsm_inst *fi, const struct tlv_parsed *tp)
Definition: bssgp_bvc_fsm.c:250
buffer.h
gprs_ra_id
BSSGP_IE_CAUSE
@ BSSGP_IE_CAUSE
Definition: gsm_08_18.h:125
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
osmo_tdef
osmo_tlv_prot_msg_name
const char * osmo_tlv_prot_msg_name(const struct osmo_tlv_prot_def *pdef, uint8_t msg_type)
BSSGP_BVCFSM_E_RX_RESET
@ BSSGP_BVCFSM_E_RX_RESET
Definition: bssgp_bvc_fsm.h:24
log_target::filter_data
void * filter_data[LOG_MAX_FILTERS+1]
BSSGP_CAUSE_BVCI_BLOCKED
@ BSSGP_CAUSE_BVCI_BLOCKED
Definition: gsm_08_18.h:276
LOG_CTX_GB_BVC
LOG_CTX_GB_BVC
osmo_fsm_inst
bssgp_bvc_fsm_ops::reset_notification
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
bssgp2_flow_ctrl::tag
uint8_t tag
Definition: gprs_bssgp2.h:13
bssgp_bvc_fsm_alloc_sig_bss
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
osmo_pdef_bssgp
const struct osmo_tlv_prot_def osmo_pdef_bssgp
Definition: gprs_bssgp_util.c:261
osmo_fsm
LOGPFSM
#define LOGPFSM(fi, fmt, args...)
bssgp_normal_hdr::pdu_type
uint8_t pdu_type
BSSGP PDU type.
Definition: gsm_08_18.h:112
bssgp_bvc_fsm_ops::state_chg_notification
void(* state_chg_notification)(uint16_t nsei, uint16_t bvci, int old_state, int new_state, void *priv)
Definition: bssgp_bvc_fsm.h:37
bssgp_bvc_fsm.h
DLBSSGP
#define DLBSSGP
bvc_fsm_priv::nsei
uint16_t nsei
Definition: bssgp_bvc_fsm.c:118
BSSGP_CAUSE_SEM_INCORR_PDU
@ BSSGP_CAUSE_SEM_INCORR_PDU
Definition: gsm_08_18.h:280
msgb
bvc_fsm_priv::features
struct bvc_fsm_priv::@25 features
BSSGP_CAUSE_UNKNOWN_BVCI
@ BSSGP_CAUSE_UNKNOWN_BVCI
Definition: gsm_08_18.h:272
LOGL_INFO
#define LOGL_INFO
log_target
S
#define S(x)
Definition: bssgp_bvc_fsm.c:42
bssgp_bvc_fsm_get_features_advertised
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_bvc_fsm_ops
Definition: bssgp_bvc_fsm.h:35
bssgp_bvc_fsm_get_features_negotiated
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
osmo_fsm_inst_free
void osmo_fsm_inst_free(struct osmo_fsm_inst *fi)
BSSGP_BVCFSM_E_RX_FC_BVC
@ BSSGP_BVCFSM_E_RX_FC_BVC
Definition: bssgp_bvc_fsm.h:26
ptp_bvc_event_names
static const struct value_string ptp_bvc_event_names[]
Definition: bssgp_bvc_fsm.c:97
tlv.h
nsei
uint16_t nsei
Identifiers of a BTS, equal to 'struct bssgp_bts_ctx'.
Definition: gprs_msgb.h:9
bvc_fsm_priv::last_reset_cause
uint8_t last_reset_cause
Definition: bssgp_bvc_fsm.c:133
__attribute__
static __attribute__((constructor))
Definition: bssgp_bvc_fsm.c:854
gprs_bssgp_cause
gprs_bssgp_cause
Cause coding (Section 11.3.8 / Table 11.10)
Definition: gsm_08_18.h:266
bvc_fsm_priv::bvci
uint16_t bvci
Definition: bssgp_bvc_fsm.c:123
bvc_fsm_priv::ops
const struct bssgp_bvc_fsm_ops * ops
Definition: bssgp_bvc_fsm.c:151
_tx_bvc_reset_ack
static void _tx_bvc_reset_ack(struct osmo_fsm_inst *fi)
Definition: bssgp_bvc_fsm.c:206
bssgp_bvc_fsm_get_block_cause
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
bssgp_fc_granularity
bssgp_fc_granularity
Definition: gsm_08_18.h:347
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
bssgp_bvc_fsm_set_ops
void bssgp_bvc_fsm_set_ops(struct osmo_fsm_inst *fi, const struct bssgp_bvc_fsm_ops *ops, void *ops_priv)
Set the 'operations' callbacks + private data.
Definition: bssgp_bvc_fsm.c:782
BSSGP_BVCFSM_E_RX_UNBLOCK_ACK
@ BSSGP_BVCFSM_E_RX_UNBLOCK_ACK
Definition: bssgp_bvc_fsm.h:23
osmo_tdef::T
const int T
bvc_fsm_priv::cell_id
uint16_t cell_id
Definition: bssgp_bvc_fsm.c:148
bssgp_bvc_fsm_get_max_pdu_len
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
bvc_fsm_priv::block_cause
uint8_t block_cause
Definition: bssgp_bvc_fsm.c:130
bvc_fsm_priv::nsi
struct gprs_ns2_inst * nsi
Definition: bssgp_bvc_fsm.c:115
bssgp_bvc_fsm_ops::rx_fc_bvc
void(* rx_fc_bvc)(uint16_t nsei, uint16_t bvci, const struct bssgp2_flow_ctrl *fc, void *priv)
Definition: bssgp_bvc_fsm.h:42
osmo_fsm_inst::state
uint32_t state
T2_SECS
#define T2_SECS
Definition: bssgp_bvc_fsm.c:92
BSSGP_BVCFSM_E_RX_RESET_ACK
@ BSSGP_BVCFSM_E_RX_RESET_ACK
Definition: bssgp_bvc_fsm.h:25
T1_SECS
#define T1_SECS
Definition: bssgp_bvc_fsm.c:91
event
event
talloc.h
msgb_bcid
#define msgb_bcid(__x)
Definition: gprs_msgb.h:28
bssgp_bvc_fsm_tdefs
struct osmo_tdef bssgp_bvc_fsm_tdefs[]
Definition: bssgp_bvc_fsm.c:45
BSSGP_BVCFSM_E_REQ_RESET
@ BSSGP_BVCFSM_E_REQ_RESET
Definition: bssgp_bvc_fsm.h:31
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
OSMO_TDEF_MS
OSMO_TDEF_MS
BSSGP_BVCFSM_E_RX_UNBLOCK
@ BSSGP_BVCFSM_E_RX_UNBLOCK
Definition: bssgp_bvc_fsm.h:22
osmo_fsm_inst::T
int T
bvc_fsm_priv::ops_priv
void * ops_priv
Definition: bssgp_bvc_fsm.c:153
osmo_fsm_inst_state_chg
#define osmo_fsm_inst_state_chg(fi, new_state, timeout_secs, T)
tdef.h
bssgp_bvc_fsm_wait_reset_ack
static void bssgp_bvc_fsm_wait_reset_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: bssgp_bvc_fsm.c:373
bvci
uint16_t bvci
Definition: gprs_msgb.h:10
bssgp_bvc_fsm_is_unblocked
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
LOGL_NOTICE
#define LOGL_NOTICE
value_string
BSSGP_PDUT_BVC_UNBLOCK_ACK
@ BSSGP_PDUT_BVC_UNBLOCK_ACK
Definition: gsm_08_18.h:49
BSSGP_BVCFSM_E_REQ_FC_BVC
@ BSSGP_BVCFSM_E_REQ_FC_BVC
Definition: bssgp_bvc_fsm.h:32
BSSGP_BVCFSM_E_RX_BLOCK
@ BSSGP_BVCFSM_E_RX_BLOCK
Definition: bssgp_bvc_fsm.h:20
DNS
int DNS
Definition: common_vty.c:66
bssgp_bvc_fsm
static struct osmo_fsm bssgp_bvc_fsm
Definition: bssgp_bvc_fsm.c:95
T1
#define T1
Definition: bssgp_bvc_fsm.c:85
osmo_fsm_inst::fsm
struct osmo_fsm * fsm
LOG_FLT_GB_NSE
LOG_FLT_GB_NSE
ARRAY_SIZE
#define ARRAY_SIZE(x)
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
BSSGP_XFEAT_GBIT
#define BSSGP_XFEAT_GBIT
Definition: gsm_08_18.h:338
bvc_fsm_priv::locally_blocked
bool locally_blocked
Definition: bssgp_bvc_fsm.c:129
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
osmo_fsm_register
int osmo_fsm_register(struct osmo_fsm *fsm)
LOGPFSML
#define LOGPFSML(fi, level, fmt, args...)
bssgp_bvc_fsm_get_features_received
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
BSSGP_IE_CELL_ID
@ BSSGP_IE_CELL_ID
Definition: gsm_08_18.h:126
bssgp_bvc_fsm_blocked
static void bssgp_bvc_fsm_blocked(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: bssgp_bvc_fsm.c:296
bssgp_bvc_fsm_alloc_ptp_sgsn
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
bssgp_bvc_fsm_alloc_sig_sgsn
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
_bvc_fsm_alloc
static struct osmo_fsm_inst * _bvc_fsm_alloc(void *ctx, struct gprs_ns2_inst *nsi, bool role_sgsn, uint16_t nsei, uint16_t bvci)
Definition: bssgp_bvc_fsm.c:658
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
BSSGP_BVCFSM_S_UNBLOCKED
@ BSSGP_BVCFSM_S_UNBLOCKED
Definition: bssgp_bvc_fsm.h:13
msgb_bvci
#define msgb_bvci(__x)
Definition: gprs_msgb.h:24
bssgp_bvc_fsm_unblocked
static void bssgp_bvc_fsm_unblocked(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: bssgp_bvc_fsm.c:409
bvc_fsm_priv::role_sgsn
bool role_sgsn
Definition: bssgp_bvc_fsm.c:126
_tx_status
static void _tx_status(struct osmo_fsm_inst *fi, enum gprs_bssgp_cause cause, const struct msgb *rx)
Definition: bssgp_bvc_fsm.c:230
bssgp_normal_hdr
BSSGP normal header.
Definition: gsm_08_18.h:111
fsm.h
BSSGP_BVCFSM_E_REQ_BLOCK
@ BSSGP_BVCFSM_E_REQ_BLOCK
Definition: bssgp_bvc_fsm.h:29
bssgp_tx_simple_bvci
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_bvc_fsm_null
static void bssgp_bvc_fsm_null(struct osmo_fsm_inst *fi, uint32_t event, void *data)
Definition: bssgp_bvc_fsm.c:282
logging.h
osmo_fsm_state::name
const char * name
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
log_context
log_target::filter_map
int filter_map
msgb_bssgph
#define msgb_bssgph(__x)
Definition: gprs_msgb.h:26
bssgp_bvc_fsm_timer_cb
static int bssgp_bvc_fsm_timer_cb(struct osmo_fsm_inst *fi)
Definition: bssgp_bvc_fsm.c:551
bvc_fsm_priv::fc_granularity
enum bssgp_fc_granularity fc_granularity
Definition: bssgp_bvc_fsm.c:141
log_context::ctx
void * ctx[LOG_MAX_CTX+1]
command.h
fi_tx_sig
static int fi_tx_sig(struct osmo_fsm_inst *fi, struct msgb *msg)
Definition: bssgp_bvc_fsm.c:168
telnet_interface.h
BSSGP_BVCFSM_E_REQ_UNBLOCK
@ BSSGP_BVCFSM_E_REQ_UNBLOCK
Definition: bssgp_bvc_fsm.h:30
DNS
int DNS
Definition: common_vty.c:66
T2
#define T2
Definition: bssgp_bvc_fsm.c:86
LOGL_ERROR
#define LOGL_ERROR
tlv_parsed
gprs_log_filter_fn
int gprs_log_filter_fn(const struct log_context *ctx, struct log_target *tar)
Definition: common_vty.c:40
bvc_fsm_priv
Definition: bssgp_bvc_fsm.c:113
TLVP_VAL
#define TLVP_VAL(x, y)
BSSGP_IE_FEATURE_BITMAP
@ BSSGP_IE_FEATURE_BITMAP
Definition: gsm_08_18.h:161