2010-04-25 16:28:24 +00:00
|
|
|
#ifndef _TRANSACT_H
|
|
|
|
#define _TRANSACT_H
|
|
|
|
|
2011-04-26 00:55:30 +00:00
|
|
|
#include <osmocom/core/linuxlist.h>
|
2011-10-31 17:14:03 +00:00
|
|
|
#include <osmocom/gsm/gsm0411_smc.h>
|
|
|
|
#include <osmocom/gsm/gsm0411_smr.h>
|
2010-04-25 16:28:24 +00:00
|
|
|
|
|
|
|
/* One transaction */
|
|
|
|
struct gsm_trans {
|
|
|
|
/* Entry in list of all transactions */
|
|
|
|
struct llist_head entry;
|
|
|
|
|
|
|
|
/* The protocol within which we live */
|
|
|
|
uint8_t protocol;
|
|
|
|
|
|
|
|
/* The current transaction ID */
|
|
|
|
uint8_t transaction_id;
|
|
|
|
|
|
|
|
/* To whom we belong */
|
|
|
|
struct osmocom_ms *ms;
|
|
|
|
|
|
|
|
/* reference from MNCC or other application */
|
|
|
|
uint32_t callref;
|
|
|
|
|
|
|
|
/* if traffic channel receive was requested */
|
|
|
|
int tch_recv;
|
|
|
|
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
|
|
|
|
/* current call state */
|
|
|
|
int state;
|
|
|
|
|
|
|
|
/* most recent progress indicator */
|
|
|
|
uint8_t prog_ind;
|
|
|
|
|
|
|
|
/* current timer and message queue */
|
|
|
|
int Tcurrent; /* current CC timer */
|
|
|
|
int T308_second; /* used to send release again */
|
2011-05-15 12:23:02 +00:00
|
|
|
struct osmo_timer_list timer;
|
2010-04-25 16:28:24 +00:00
|
|
|
struct gsm_mncc msg; /* stores setup/disconnect/release message */
|
|
|
|
} cc;
|
2011-11-03 10:33:19 +00:00
|
|
|
struct {
|
|
|
|
/* current supp.serv. state */
|
|
|
|
int state;
|
|
|
|
|
|
|
|
uint8_t invoke_id;
|
|
|
|
struct msgb *msg;
|
|
|
|
} ss;
|
2010-04-25 16:28:24 +00:00
|
|
|
struct {
|
2011-10-31 17:14:03 +00:00
|
|
|
uint8_t sapi; /* SAPI to be used for this trans */
|
2010-04-25 16:28:24 +00:00
|
|
|
|
2011-10-31 17:14:03 +00:00
|
|
|
struct gsm411_smc_inst smc_inst;
|
|
|
|
struct gsm411_smr_inst smr_inst;
|
2010-04-25 16:28:24 +00:00
|
|
|
|
|
|
|
struct gsm_sms *sms;
|
|
|
|
} sms;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct gsm_trans *trans_find_by_id(struct osmocom_ms *ms,
|
|
|
|
uint8_t proto, uint8_t trans_id);
|
|
|
|
struct gsm_trans *trans_find_by_callref(struct osmocom_ms *ms,
|
|
|
|
uint32_t callref);
|
|
|
|
|
|
|
|
struct gsm_trans *trans_alloc(struct osmocom_ms *ms,
|
|
|
|
uint8_t protocol, uint8_t trans_id,
|
|
|
|
uint32_t callref);
|
|
|
|
void trans_free(struct gsm_trans *trans);
|
|
|
|
|
|
|
|
int trans_assign_trans_id(struct osmocom_ms *ms,
|
|
|
|
uint8_t protocol, uint8_t ti_flag);
|
|
|
|
|
|
|
|
#endif
|