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