2009-07-23 19:25:08 +00:00
|
|
|
#ifndef _TRANSACT_H
|
|
|
|
#define _TRANSACT_H
|
|
|
|
|
|
|
|
#include <openbsc/gsm_data.h>
|
|
|
|
#include <openbsc/gsm_subscriber.h>
|
split 'libosmocore' from openbsc codebase
This library is intended to collect all generic/common funcitionality
of all Osmocom.org projects, including OpenBSC but also OsmocomBB
The library currently includes the following modules:
bitvec, comp128, gsm_utils, msgb, select, signal, statistics, talloc, timer,
tlv_parse, linuxlist
msgb allocation error debugging had to be temporarily disabled as it depends on
'debug.c' functionality which at the moment remains in OpenBSC
2010-02-20 15:24:02 +00:00
|
|
|
#include <osmocore/linuxlist.h>
|
2009-07-26 12:24:11 +00:00
|
|
|
#include <openbsc/gsm_04_11.h>
|
|
|
|
|
|
|
|
/* One transaction */
|
|
|
|
struct gsm_trans {
|
|
|
|
/* Entry in list of all transactions */
|
|
|
|
struct llist_head entry;
|
|
|
|
|
|
|
|
/* The protocol within which we live */
|
|
|
|
u_int8_t protocol;
|
|
|
|
|
|
|
|
/* The current transaction ID */
|
|
|
|
u_int8_t transaction_id;
|
|
|
|
|
|
|
|
/* To whom we belong, unique identifier of remote MM entity */
|
|
|
|
struct gsm_subscriber *subscr;
|
|
|
|
|
|
|
|
/* The LCHAN that we're currently using to transmit messages */
|
|
|
|
struct gsm_lchan *lchan;
|
|
|
|
|
|
|
|
/* reference from MNCC or other application */
|
|
|
|
u_int32_t callref;
|
|
|
|
|
2009-12-19 21:23:05 +00:00
|
|
|
/* if traffic channel receive was requested */
|
|
|
|
int tch_recv;
|
|
|
|
|
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 */
|
|
|
|
struct timer_list timer;
|
|
|
|
struct gsm_mncc msg; /* stores setup/disconnect/release message */
|
|
|
|
} cc;
|
|
|
|
struct {
|
2009-08-14 09:41:12 +00:00
|
|
|
u_int8_t link_id; /* RSL Link ID to be used for this trans */
|
2009-07-27 18:11:35 +00:00
|
|
|
int is_mt; /* is this a MO (0) or MT (1) transfer */
|
2009-07-26 12:24:11 +00:00
|
|
|
enum gsm411_cp_state cp_state;
|
2009-08-09 22:24:32 +00:00
|
|
|
struct timer_list cp_timer;
|
|
|
|
|
2009-07-26 12:24:11 +00:00
|
|
|
enum gsm411_rp_state rp_state;
|
|
|
|
|
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
|
|
|
|
2009-07-23 19:58:40 +00:00
|
|
|
struct gsm_trans *trans_find_by_id(struct gsm_subscriber *subscr,
|
|
|
|
u_int8_t proto, u_int8_t trans_id);
|
2009-07-23 19:25:08 +00:00
|
|
|
struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
|
|
|
|
u_int32_t callref);
|
|
|
|
|
|
|
|
struct gsm_trans *trans_alloc(struct gsm_subscriber *subscr,
|
|
|
|
u_int8_t protocol, u_int8_t trans_id,
|
|
|
|
u_int32_t callref);
|
|
|
|
void trans_free(struct gsm_trans *trans);
|
|
|
|
|
2009-07-23 19:36:44 +00:00
|
|
|
int trans_assign_trans_id(struct gsm_subscriber *subscr,
|
|
|
|
u_int8_t protocol, u_int8_t ti_flag);
|
2009-12-17 16:13:28 +00:00
|
|
|
|
|
|
|
/* update all transactions to use a different LCHAN, e.g.
|
|
|
|
* after handover has succeeded */
|
|
|
|
int trans_lchan_change(struct gsm_lchan *lchan_old,
|
|
|
|
struct gsm_lchan *lchan_new);
|
2009-07-23 19:25:08 +00:00
|
|
|
#endif
|