libosmogb
1.4.0.160-7619
Osmocom Gb library
|
NS virtual circuit FSM implementation 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) as well as its successor 3GPP TS 48.016. More...
#include <errno.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <osmocom/core/fsm.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/socket.h>
#include <osmocom/core/stat_item.h>
#include <osmocom/gsm/prim.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gprs/gprs_msgb.h>
#include <osmocom/gprs/protocol/gsm_08_16.h>
#include "gprs_ns2_internal.h"
Data Structures | |
struct | gprs_ns2_vc_priv |
Macros | |
#define | S(x) (1 << (x)) |
#define | DNS 10 |
Functions | |
static struct gprs_ns2_inst * | ns_inst_from_fi (struct osmo_fsm_inst *fi) |
static void | start_test_procedure (struct gprs_ns2_vc_priv *priv) |
static void | stop_test_procedure (struct gprs_ns2_vc_priv *priv) |
static int | alive_timer_elapsed_ms (struct gprs_ns2_vc_priv *priv) |
static void | recv_test_procedure (struct osmo_fsm_inst *fi) |
static void | alive_timeout_handler (void *data) |
static void | gprs_ns2_st_unconfigured (struct osmo_fsm_inst *fi, uint32_t event, void *data) |
static void | gprs_ns2_st_reset_onenter (struct osmo_fsm_inst *fi, uint32_t old_state) |
static void | gprs_ns2_st_reset (struct osmo_fsm_inst *fi, uint32_t event, void *data) |
static void | gprs_ns2_st_blocked_onenter (struct osmo_fsm_inst *fi, uint32_t old_state) |
static void | gprs_ns2_st_blocked (struct osmo_fsm_inst *fi, uint32_t event, void *data) |
static void | gprs_ns2_st_unblocked_on_enter (struct osmo_fsm_inst *fi, uint32_t old_state) |
static void | gprs_ns2_st_unblocked (struct osmo_fsm_inst *fi, uint32_t event, void *data) |
static void | gprs_ns2_st_alive (struct osmo_fsm_inst *fi, uint32_t event, void *data) |
static void | gprs_ns2_st_alive_onenter (struct osmo_fsm_inst *fi, uint32_t old_state) |
static void | gprs_ns2_st_alive_onleave (struct osmo_fsm_inst *fi, uint32_t next_state) |
static int | gprs_ns2_vc_fsm_timer_cb (struct osmo_fsm_inst *fi) |
static void | gprs_ns2_recv_unitdata (struct osmo_fsm_inst *fi, struct msgb *msg) |
static void | gprs_ns2_vc_fsm_allstate_action (struct osmo_fsm_inst *fi, uint32_t event, void *data) |
struct osmo_fsm_inst * | gprs_ns2_vc_fsm_alloc (struct gprs_ns2_vc *nsvc, const char *id, bool initiater) |
gprs_ns2_vc_fsm_alloc More... | |
int | gprs_ns2_vc_fsm_start (struct gprs_ns2_vc *nsvc) |
Start a NS-VC FSM. More... | |
int | gprs_ns2_vc_rx (struct gprs_ns2_vc *nsvc, struct msgb *msg, struct tlv_parsed *tp) |
entry point for messages from the driver/VL More... | |
int | gprs_ns2_vc_is_unblocked (struct gprs_ns2_vc *nsvc) |
is the given NS-VC unblocked? More... | |
static | __attribute__ ((constructor)) |
Variables | |
static const struct value_string | gprs_ns2_vc_event_names [] |
static const struct osmo_fsm_state | gprs_ns2_vc_states [] |
static struct osmo_fsm | gprs_ns2_vc_fsm |
NS virtual circuit FSM implementation 3GPP TS 08.16 version 8.0.1 Release 1999 / ETSI TS 101 299 V8.0.1 (2002-05) as well as its successor 3GPP TS 48.016.
#define DNS 10 |
#define S | ( | x | ) | (1 << (x)) |
enum gprs_ns2_vc_event |
enum gprs_ns2_vc_state |
|
static |
References gprs_ns2_vc_fsm, OSMO_ASSERT, and osmo_fsm_register().
|
static |
References data, GPRS_NS2_ST_ALIVE, GPRS_NS2_ST_RESET, ns2_tx_alive(), NS2_VC_MODE_BLOCKRESET, ns_inst_from_fi(), NS_TOUT_TNS_ALIVE, NS_TOUT_TNS_ALIVE_RETRIES, NS_TOUT_TNS_RESET, NS_TOUT_TNS_TEST, osmo_fsm_inst_state_chg, osmo_timer_schedule(), osmo_fsm_inst::priv, priv, and gprs_ns2_inst::timeout.
Referenced by gprs_ns2_vc_fsm_alloc().
|
static |
References osmo_gettimeofday(), priv, and timersub.
Referenced by recv_test_procedure().
|
static |
References msg, ns_inst_from_fi(), osmo_fsm_inst::priv, and priv.
|
static |
References GPRS_NS2_EV_ALIVE_ACK, GPRS_NS2_ST_UNBLOCKED, and osmo_fsm_inst_state_chg.
|
static |
|
static |
References osmo_fsm_inst::priv, and start_test_procedure().
|
static |
|
static |
References GPRS_NS2_ST_BLOCKED, ns2_tx_unblock(), osmo_fsm_inst::priv, priv, and start_test_procedure().
|
static |
|
static |
|
static |
References GPRS_NS2_EV_BLOCK, GPRS_NS2_ST_BLOCKED, ns2_tx_block_ack(), osmo_fsm_inst_state_chg, osmo_fsm_inst::priv, and priv.
|
static |
References ns2_nse_notify_unblocked(), osmo_fsm_inst::priv, and priv.
|
static |
struct osmo_fsm_inst* gprs_ns2_vc_fsm_alloc | ( | struct gprs_ns2_vc * | nsvc, |
const char * | id, | ||
bool | initiater | ||
) |
gprs_ns2_vc_fsm_alloc
ctx | |
vc | |
id | a char representation of the virtual curcuit |
initiater | initiater is the site which starts the connection. Usually the BSS. |
References alive_timeout_handler(), gprs_ns2_vc::fi, gprs_ns2_vc_fsm, gprs_ns2_vc_priv::initiater, LOGL_DEBUG, gprs_ns2_vc_priv::nsvc, osmo_fsm_inst_alloc(), osmo_timer_setup(), osmo_fsm_inst::priv, and priv.
Referenced by ns2_vc_alloc().
|
static |
int gprs_ns2_vc_fsm_start | ( | struct gprs_ns2_vc * | nsvc | ) |
Start a NS-VC FSM.
nsvc | the virtual circuit |
References gprs_ns2_vc::fi, GPRS_NS2_EV_START, GPRS_NS2_ST_UNCONFIGURED, gprs_ns2_vc_priv::nsvc, osmo_fsm_inst_dispatch, and osmo_fsm_inst::state.
Referenced by gprs_ns2_ip_connect(), gprs_ns2_start_alive_all_nsvcs(), handle_nsfrgre_read(), and handle_nsip_read().
|
static |
References GPRS_NS2_ST_ALIVE, GPRS_NS2_ST_BLOCKED, GPRS_NS2_ST_RESET, ns_inst_from_fi(), NS_TOUT_TNS_ALIVE_RETRIES, NS_TOUT_TNS_BLOCK, NS_TOUT_TNS_BLOCK_RETRIES, NS_TOUT_TNS_RESET, NS_TOUT_TNS_RESET_RETRIES, osmo_fsm_inst_state_chg, osmo_fsm_inst::priv, priv, osmo_fsm_inst::state, and gprs_ns2_inst::timeout.
int gprs_ns2_vc_is_unblocked | ( | struct gprs_ns2_vc * | nsvc | ) |
is the given NS-VC unblocked?
References gprs_ns2_vc::fi, GPRS_NS2_ST_UNBLOCKED, and osmo_fsm_inst::state.
Referenced by gprs_ns2_recv_prim(), ns2_nse_notify_unblocked(), and ns2_sns_free_nsvc().
int gprs_ns2_vc_rx | ( | struct gprs_ns2_vc * | nsvc, |
struct msgb * | msg, | ||
struct tlv_parsed * | tp | ||
) |
entry point for messages from the driver/VL
nsvc | virtual circuit on which the message was received |
msg | message that was received |
tp | parsed TLVs of the received message |
References cause, DLNS, gprs_ns2_vc::fi, get_value_string(), GPRS_NS2_EV_ALIVE, GPRS_NS2_EV_ALIVE_ACK, GPRS_NS2_EV_BLOCK, GPRS_NS2_EV_BLOCK_ACK, GPRS_NS2_EV_RESET, GPRS_NS2_EV_RESET_ACK, GPRS_NS2_EV_UNBLOCK, GPRS_NS2_EV_UNBLOCK_ACK, GPRS_NS2_EV_UNITDATA, gprs_ns2_validate(), gprs_ns_pdu_strings, if(), LOGL_ERROR, LOGP, msg, ns2_tx_status(), NS_PDUT_ALIVE, NS_PDUT_ALIVE_ACK, NS_PDUT_BLOCK, NS_PDUT_BLOCK_ACK, NS_PDUT_RESET, NS_PDUT_RESET_ACK, NS_PDUT_STATUS, NS_PDUT_UNBLOCK, NS_PDUT_UNBLOCK_ACK, NS_PDUT_UNITDATA, gprs_ns2_vc::nse, gprs_ns2_nse::nsei, osmo_fsm_inst_dispatch, and gprs_ns_hdr::pdu_type.
Referenced by ns2_recv_vc().
|
inlinestatic |
References osmo_fsm_inst::priv, and priv.
Referenced by alive_timeout_handler(), gprs_ns2_recv_unitdata(), gprs_ns2_st_alive_onenter(), gprs_ns2_st_reset(), gprs_ns2_vc_fsm_timer_cb(), and recv_test_procedure().
|
static |
|
static |
References ns2_tx_alive(), NS_TOUT_TNS_ALIVE, osmo_gettimeofday(), osmo_timer_pending(), osmo_timer_schedule(), priv, and gprs_ns2_inst::timeout.
Referenced by gprs_ns2_st_alive_onleave(), and gprs_ns2_st_blocked_onenter().
|
static |
References osmo_timer_del(), and priv.
Referenced by gprs_ns2_st_reset_onenter().
|
static |
|
static |
Referenced by __attribute__(), and gprs_ns2_vc_fsm_alloc().
|
static |