2009-07-23 19:25:08 +00:00
|
|
|
#ifndef _TRANSACT_H
|
|
|
|
#define _TRANSACT_H
|
|
|
|
|
|
|
|
#include <openbsc/gsm_data.h>
|
|
|
|
#include <openbsc/gsm_subscriber.h>
|
2011-03-22 15:47:59 +00:00
|
|
|
#include <osmocom/core/linuxlist.h>
|
2009-07-26 12:24:11 +00:00
|
|
|
#include <openbsc/gsm_04_11.h>
|
2011-05-24 11:25:38 +00:00
|
|
|
#include <openbsc/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
|
|
|
|
|
|
|
/* 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
|
|
|
|
2009-07-26 12:24:11 +00:00
|
|
|
/* To whom we belong, unique identifier of remote MM entity */
|
|
|
|
struct gsm_subscriber *subscr;
|
|
|
|
|
2010-03-23 06:00:22 +00:00
|
|
|
/* The associated connection we are using to transmit messages */
|
|
|
|
struct gsm_subscriber_connection *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
|
|
|
|
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;
|
2009-07-26 12:24:11 +00:00
|
|
|
struct gsm_mncc msg; /* stores setup/disconnect/release message */
|
|
|
|
} 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
|
|
|
|
2009-08-08 14:03:15 +00:00
|
|
|
struct gsm_sms *sms;
|
2009-07-26 12:24:11 +00:00
|
|
|
} sms;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-07-23 19:25:08 +00:00
|
|
|
|
2014-12-02 13:22:53 +00:00
|
|
|
struct gsm_trans *trans_find_by_id(struct gsm_subscriber_connection *conn,
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t proto, uint8_t trans_id);
|
2009-07-23 19:25:08 +00:00
|
|
|
struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
|
2011-04-18 15:04:00 +00:00
|
|
|
uint32_t callref);
|
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,
|
|
|
|
struct gsm_subscriber *subscr,
|
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);
|
|
|
|
|
2014-12-02 13:22:53 +00:00
|
|
|
int trans_assign_trans_id(struct gsm_network *net, struct gsm_subscriber *subscr,
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t protocol, uint8_t ti_flag);
|
2012-11-23 20:33:15 +00:00
|
|
|
int trans_has_conn(const struct gsm_subscriber_connection *conn);
|
2009-12-17 16:13:28 +00:00
|
|
|
|
2009-07-23 19:25:08 +00:00
|
|
|
#endif
|