libosmogsm  0.6.3
Osmocom GSM library
gsm0411_smc.h
1 #ifndef _GSM0411_SMC_H
2 #define _GSM0411_SMC_H
3 
4 #include <osmocom/core/timer.h>
5 #include <osmocom/gsm/protocol/gsm_04_11.h>
6 
7 #define GSM411_MMSMS_EST_REQ 0x310
8 #define GSM411_MMSMS_EST_IND 0x312
9 #define GSM411_MMSMS_EST_CNF 0x311
10 #define GSM411_MMSMS_REL_REQ 0x320
11 #define GSM411_MMSMS_REL_IND 0x322
12 #define GSM411_MMSMS_DATA_REQ 0x330
13 #define GSM411_MMSMS_DATA_IND 0x332
14 #define GSM411_MMSMS_UNIT_DATA_REQ 0x340
15 #define GSM411_MMSMS_UNIT_DATA_IND 0x342
16 #define GSM411_MMSMS_ERR_IND 0x372
17 
18 #define GSM411_MNSMS_ABORT_REQ 0x101
19 #define GSM411_MNSMS_DATA_REQ 0x102
20 #define GSM411_MNSMS_DATA_IND 0x103
21 #define GSM411_MNSMS_EST_REQ 0x104
22 #define GSM411_MNSMS_EST_IND 0x105
23 #define GSM411_MNSMS_ERROR_IND 0x106
24 #define GSM411_MNSMS_REL_REQ 0x107
25 
27  uint64_t id; /* a unique id for the SMS */
28  int network; /* is this a MO (0) or MT (1) transfer */
29  int (*mn_recv) (struct gsm411_smc_inst *inst, int msg_type,
30  struct msgb *msg);
31  int (*mm_send) (struct gsm411_smc_inst *inst, int msg_type,
32  struct msgb *msg, int cp_msg_type);
33 
34  enum gsm411_cp_state cp_state;
35  struct osmo_timer_list cp_timer;
36  struct msgb *cp_msg; /* store pending message */
37  int cp_rel; /* store pending release */
38  int cp_retx; /* retry counter */
39  int cp_max_retr; /* maximum retry */
40  int cp_tc1; /* timer value TC1* */
41 
42 };
43 
44 extern const struct value_string gsm411_cp_cause_strs[];
45 
46 /* init a new instance */
47 void gsm411_smc_init(struct gsm411_smc_inst *inst, uint64_t id, int network,
48  int (*mn_recv) (struct gsm411_smc_inst *inst, int msg_type,
49  struct msgb *msg),
50  int (*mm_send) (struct gsm411_smc_inst *inst, int msg_type,
51  struct msgb *msg, int cp_msg_type));
52 
53 /* clear instance */
54 void gsm411_smc_clear(struct gsm411_smc_inst *inst);
55 
56 /* message from upper layer */
57 int gsm411_smc_send(struct gsm411_smc_inst *inst, int msg_type,
58  struct msgb *msg);
59 
60 /* message from lower layer */
61 int gsm411_smc_recv(struct gsm411_smc_inst *inst, int msg_type,
62  struct msgb *msg, int cp_msg_type);
63 
64 #endif /* _GSM0411_SMC_H */