2009-07-23 19:25:08 +00:00
|
|
|
#ifndef _TRANSACT_H
|
|
|
|
#define _TRANSACT_H
|
|
|
|
|
2017-09-04 13:04:35 +00:00
|
|
|
#include <osmocom/msc/gsm_data.h>
|
|
|
|
#include <osmocom/msc/gsm_subscriber.h>
|
2011-03-22 15:47:59 +00:00
|
|
|
#include <osmocom/core/linuxlist.h>
|
2017-09-04 13:04:35 +00:00
|
|
|
#include <osmocom/msc/gsm_04_11.h>
|
|
|
|
#include <osmocom/msc/mncc.h>
|
2011-10-28 02:07:07 +00:00
|
|
|
#include <osmocom/gsm/gsm0411_smc.h>
|
2011-10-28 09:11:13 +00:00
|
|
|
#include <osmocom/gsm/gsm0411_smr.h>
|
2009-07-26 12:24:11 +00:00
|
|
|
|
2016-05-20 19:59:55 +00:00
|
|
|
enum bridge_state {
|
|
|
|
BRIDGE_STATE_NONE,
|
|
|
|
BRIDGE_STATE_LOOPBACK_PENDING,
|
|
|
|
BRIDGE_STATE_LOOPBACK_ESTABLISHED,
|
|
|
|
BRIDGE_STATE_BRIDGE_PENDING,
|
|
|
|
BRIDGE_STATE_BRIDGE_ESTABLISHED,
|
|
|
|
};
|
|
|
|
|
2009-07-26 12:24:11 +00:00
|
|
|
/* One transaction */
|
|
|
|
struct gsm_trans {
|
|
|
|
/* Entry in list of all transactions */
|
|
|
|
struct llist_head entry;
|
|
|
|
|
2016-08-29 15:52:39 +00:00
|
|
|
/* Back pointer to the network struct */
|
2014-12-02 10:58:00 +00:00
|
|
|
struct gsm_network *net;
|
|
|
|
|
2009-07-26 12:24:11 +00:00
|
|
|
/* The protocol within which we live */
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t protocol;
|
2009-07-26 12:24:11 +00:00
|
|
|
|
|
|
|
/* The current transaction ID */
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t transaction_id;
|
2016-08-29 15:52:39 +00:00
|
|
|
|
2018-04-09 14:35:01 +00:00
|
|
|
/* The DLCI (DCCH/ACCH + SAPI) of this transaction */
|
|
|
|
uint8_t dlci;
|
|
|
|
|
2009-07-26 12:24:11 +00:00
|
|
|
/* To whom we belong, unique identifier of remote MM entity */
|
2016-06-19 16:06:02 +00:00
|
|
|
struct vlr_subscr *vsub;
|
2009-07-26 12:24:11 +00:00
|
|
|
|
2010-03-23 06:00:22 +00:00
|
|
|
/* The associated connection we are using to transmit messages */
|
rename gsm_subscriber_connection to ran_conn
In preparation for inter-BSC and inter-MSC handover, we need to separate the
subscriber management logic from the actual RAN connections. What better time
to finally rename gsm_subscriber_connection.
* Name choice:
In 2G, this is a connection to the BSS, but even though 3GPP TS commonly talk
of "BSS-A" and "BSS-B" when explaining handover, it's not good to call it
"bss_conn": in 3G a BSS is called RNS, IIUC.
The overall term for 2G (GERAN) and 3G (UTRAN) is RAN: Radio Access Network.
* Rationale:
A subscriber in the MSC so far has only one RAN connection, but e.g. for
inter-BSC handover, a second one needs to be created to handover to. Most of
the items in the former gsm_subscriber_connection are actually related to the
RAN, with only a few MM and RTP related items. So, as a first step, just rename
it to ran_conn, to cosmetically prepare for moving the not strictly RAN related
items away later.
Also:
- Rename some functions from msc_subscr_conn_* to ran_conn_*
- Rename "Subscr_Conn" FSM instance name to "RAN_conn"
- Rename SUBSCR_CONN_* to RAN_CONN_*
Change-Id: Ic595f7a558d3553c067f77dc67543ab59659707a
2018-11-29 21:37:51 +00:00
|
|
|
struct ran_conn *conn;
|
2009-07-26 12:24:11 +00:00
|
|
|
|
|
|
|
/* reference from MNCC or other application */
|
2011-04-18 15:04:00 +00:00
|
|
|
uint32_t callref;
|
2009-07-26 12:24:11 +00:00
|
|
|
|
2009-12-19 21:23:05 +00:00
|
|
|
/* if traffic channel receive was requested */
|
|
|
|
int tch_recv;
|
|
|
|
|
2010-12-29 16:09:07 +00:00
|
|
|
/* is thats one paging? */
|
2015-04-06 10:03:45 +00:00
|
|
|
struct subscr_request *paging_request;
|
2010-12-29 16:09:07 +00:00
|
|
|
|
2017-04-09 10:32:51 +00:00
|
|
|
/* bearer capabilities (rate and codec) */
|
|
|
|
struct gsm_mncc_bearer_cap bearer_cap;
|
|
|
|
|
|
|
|
/* if true, TCH_RTP_CREATE is sent after the
|
|
|
|
* assignment is done */
|
|
|
|
bool tch_rtp_create;
|
|
|
|
|
2009-07-26 12:24:11 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
|
|
|
|
/* current call state */
|
|
|
|
int state;
|
|
|
|
|
|
|
|
/* current timer and message queue */
|
|
|
|
int Tcurrent; /* current CC timer */
|
|
|
|
int T308_second; /* used to send release again */
|
2011-05-06 10:11:06 +00:00
|
|
|
struct osmo_timer_list timer;
|
2018-10-10 15:00:49 +00:00
|
|
|
struct osmo_timer_list timer_guard;
|
2009-07-26 12:24:11 +00:00
|
|
|
struct gsm_mncc msg; /* stores setup/disconnect/release message */
|
2018-12-20 02:03:44 +00:00
|
|
|
bool assignment_started;
|
2009-07-26 12:24:11 +00:00
|
|
|
} cc;
|
|
|
|
struct {
|
2011-10-28 02:07:07 +00:00
|
|
|
struct gsm411_smc_inst smc_inst;
|
2011-10-28 09:11:13 +00:00
|
|
|
struct gsm411_smr_inst smr_inst;
|
2011-10-28 02:07:07 +00:00
|
|
|
|
2015-12-21 09:05:56 +00:00
|
|
|
/* SM-RP-MR, Message Reference (see GSM TS 04.11, section 8.2.3) */
|
|
|
|
uint8_t sm_rp_mr;
|
|
|
|
|
2009-08-08 14:03:15 +00:00
|
|
|
struct gsm_sms *sms;
|
2009-07-26 12:24:11 +00:00
|
|
|
} sms;
|
2018-06-17 14:09:28 +00:00
|
|
|
struct {
|
|
|
|
/**
|
|
|
|
* Stores a GSM 04.80 message to be sent to
|
|
|
|
* a subscriber after successful Paging Response
|
|
|
|
*/
|
|
|
|
struct msgb *msg;
|
|
|
|
} ss;
|
2009-07-26 12:24:11 +00:00
|
|
|
};
|
2016-05-20 19:59:55 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
struct gsm_trans *peer;
|
|
|
|
enum bridge_state state;
|
|
|
|
} bridge;
|
2009-07-26 12:24:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-07-23 19:25:08 +00:00
|
|
|
|
2019-01-02 10:48:14 +00:00
|
|
|
struct gsm_trans *trans_find_by_id(const struct ran_conn *conn,
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t proto, uint8_t trans_id);
|
2019-01-02 10:48:14 +00:00
|
|
|
struct gsm_trans *trans_find_by_callref(const struct gsm_network *net,
|
2011-04-18 15:04:00 +00:00
|
|
|
uint32_t callref);
|
2019-01-23 14:22:27 +00:00
|
|
|
struct gsm_trans *trans_find_by_sm_rp_mr(const struct gsm_network *net,
|
|
|
|
const struct vlr_subscr *vsub,
|
2015-12-21 09:05:56 +00:00
|
|
|
uint8_t sm_rp_mr);
|
2009-07-23 19:25:08 +00:00
|
|
|
|
2014-12-02 13:22:53 +00:00
|
|
|
struct gsm_trans *trans_alloc(struct gsm_network *net,
|
2016-06-19 16:06:02 +00:00
|
|
|
struct vlr_subscr *vsub,
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t protocol, uint8_t trans_id,
|
|
|
|
uint32_t callref);
|
2009-07-23 19:25:08 +00:00
|
|
|
void trans_free(struct gsm_trans *trans);
|
|
|
|
|
2019-01-02 10:48:14 +00:00
|
|
|
int trans_assign_trans_id(const struct gsm_network *net, const struct vlr_subscr *vsub,
|
2019-01-10 16:25:33 +00:00
|
|
|
uint8_t protocol);
|
rename gsm_subscriber_connection to ran_conn
In preparation for inter-BSC and inter-MSC handover, we need to separate the
subscriber management logic from the actual RAN connections. What better time
to finally rename gsm_subscriber_connection.
* Name choice:
In 2G, this is a connection to the BSS, but even though 3GPP TS commonly talk
of "BSS-A" and "BSS-B" when explaining handover, it's not good to call it
"bss_conn": in 3G a BSS is called RNS, IIUC.
The overall term for 2G (GERAN) and 3G (UTRAN) is RAN: Radio Access Network.
* Rationale:
A subscriber in the MSC so far has only one RAN connection, but e.g. for
inter-BSC handover, a second one needs to be created to handover to. Most of
the items in the former gsm_subscriber_connection are actually related to the
RAN, with only a few MM and RTP related items. So, as a first step, just rename
it to ran_conn, to cosmetically prepare for moving the not strictly RAN related
items away later.
Also:
- Rename some functions from msc_subscr_conn_* to ran_conn_*
- Rename "Subscr_Conn" FSM instance name to "RAN_conn"
- Rename SUBSCR_CONN_* to RAN_CONN_*
Change-Id: Ic595f7a558d3553c067f77dc67543ab59659707a
2018-11-29 21:37:51 +00:00
|
|
|
struct gsm_trans *trans_has_conn(const struct ran_conn *conn);
|
2019-01-02 10:48:14 +00:00
|
|
|
void trans_conn_closed(const struct ran_conn *conn);
|
2009-12-17 16:13:28 +00:00
|
|
|
|
2009-07-23 19:25:08 +00:00
|
|
|
#endif
|