src: use new libosmogsm and include/osmocom/[gsm|core] path to headers
[osmocom-bb.git] / src / host / layer23 / include / osmocom / bb / mobile / transaction.h
1 #ifndef _TRANSACT_H
2 #define _TRANSACT_H
3
4 #include <osmocom/core/linuxlist.h>
5
6 /* One transaction */
7 struct gsm_trans {
8         /* Entry in list of all transactions */
9         struct llist_head entry;
10
11         /* The protocol within which we live */
12         uint8_t protocol;
13
14         /* The current transaction ID */
15         uint8_t transaction_id;
16         
17         /* To whom we belong */
18         struct osmocom_ms *ms;
19
20         /* reference from MNCC or other application */
21         uint32_t callref;
22
23         /* if traffic channel receive was requested */
24         int tch_recv;
25
26         union {
27                 struct {
28
29                         /* current call state */
30                         int state;
31
32                         /* most recent progress indicator */
33                         uint8_t prog_ind;
34
35                         /* current timer and message queue */
36                         int Tcurrent;           /* current CC timer */
37                         int T308_second;        /* used to send release again */
38                         struct timer_list timer;
39                         struct gsm_mncc msg;    /* stores setup/disconnect/release message */
40                 } cc;
41 #if 0
42                 struct {
43                         uint8_t link_id;        /* RSL Link ID to be used for this trans */
44                         int is_mt;      /* is this a MO (0) or MT (1) transfer */
45                         enum gsm411_cp_state cp_state;
46                         struct timer_list cp_timer;
47
48                         enum gsm411_rp_state rp_state;
49
50                         struct gsm_sms *sms;
51                 } sms;
52 #endif
53         };
54 };
55
56
57
58 struct gsm_trans *trans_find_by_id(struct osmocom_ms *ms,
59                                    uint8_t proto, uint8_t trans_id);
60 struct gsm_trans *trans_find_by_callref(struct osmocom_ms *ms,
61                                         uint32_t callref);
62
63 struct gsm_trans *trans_alloc(struct osmocom_ms *ms,
64                               uint8_t protocol, uint8_t trans_id,
65                               uint32_t callref);
66 void trans_free(struct gsm_trans *trans);
67
68 int trans_assign_trans_id(struct osmocom_ms *ms,
69                           uint8_t protocol, uint8_t ti_flag);
70
71 #endif