summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2011-10-28 11:05:37 +0200
committerHarald Welte <laforge@gnumonks.org>2011-11-12 23:23:37 +0100
commitc1a91a896faf5ac510daabfe389cfa3129201c9f (patch)
tree88cb4d6e7fbc075dbbe7a7460acfb1b7d4f58d9c /include
parentbbf9034eaab39ad637ef9a3a1fd935d624dcdba8 (diff)
gsm/sms: Rewrite of SMR process, extracted from OpenBSC
The SMR process is used to transfer SMS TPDUs. It is now extracted from OpenBSC. It includes a real state machine now for easier debugging. Also it implements the TR1M and TR2M timers. The memory notification procedure is missing, but not required for network side. Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/gsm/Makefile.am2
-rw-r--r--include/osmocom/gsm/gsm0411_smr.h45
2 files changed, 46 insertions, 1 deletions
diff --git a/include/osmocom/gsm/Makefile.am b/include/osmocom/gsm/Makefile.am
index 49a2ec48..fc1abfe8 100644
--- a/include/osmocom/gsm/Makefile.am
+++ b/include/osmocom/gsm/Makefile.am
@@ -1,7 +1,7 @@
osmogsm_HEADERS = a5.h comp128.h gsm0808.h gsm48_ie.h mncc.h rxlev_stat.h \
gsm0480.h gsm48.h gsm_utils.h rsl.h tlv.h abis_nm.h \
sysinfo.h prim.h gsm0502.h lapd_core.h lapdm.h \
- gsm0411_utils.h gsm0411_smc.h
+ gsm0411_utils.h gsm0411_smc.h gsm0411_smr.h
SUBDIRS = protocol
diff --git a/include/osmocom/gsm/gsm0411_smr.h b/include/osmocom/gsm/gsm0411_smr.h
new file mode 100644
index 00000000..5ea8584d
--- /dev/null
+++ b/include/osmocom/gsm/gsm0411_smr.h
@@ -0,0 +1,45 @@
+#ifndef _GSM0411_SMR_H
+#define _GSM0411_SMR_H
+
+#include <osmocom/gsm/protocol/gsm_04_11.h>
+
+#define GSM411_SM_RL_DATA_REQ 0x401
+#define GSM411_SM_RL_DATA_IND 0x402
+#define GSM411_SM_RL_MEM_AVAIL_REQ 0x403
+#define GSM411_SM_RL_MEM_AVAIL_IND 0x404
+#define GSM411_SM_RL_REPORT_REQ 0x405
+#define GSM411_SM_RL_REPORT_IND 0x406
+
+struct gsm411_smr_inst {
+ int network; /* is this a MO (0) or MT (1) transfer */
+ int (*rl_recv) (struct gsm411_smr_inst *inst, int msg_type,
+ struct msgb *msg);
+ int (*mn_send) (struct gsm411_smr_inst *inst, int msg_type,
+ struct msgb *msg);
+
+ enum gsm411_rp_state rp_state;
+ struct osmo_timer_list rp_timer;
+};
+
+extern const struct value_string gsm411_rp_cause_strs[];
+
+/* init a new instance */
+void gsm411_smr_init(struct gsm411_smr_inst *inst, int network,
+ int (*rl_recv) (struct gsm411_smr_inst *inst, int msg_type,
+ struct msgb *msg),
+ int (*mn_send) (struct gsm411_smr_inst *inst, int msg_type,
+ struct msgb *msg));
+
+/* clear instance */
+void gsm411_smr_clear(struct gsm411_smr_inst *inst);
+
+/* message from upper layer */
+int gsm411_smr_send(struct gsm411_smr_inst *inst, int msg_type,
+ struct msgb *msg);
+
+/* message from lower layer */
+int gsm411_smr_recv(struct gsm411_smr_inst *inst, int msg_type,
+ struct msgb *msg);
+
+#endif /* _GSM0411_SMR_H */
+