blob: 19f9c5da75109d3b79f42b40f9c333ae18b3df71 [file] [log] [blame]
Neels Hofmeyr17518fe2017-06-20 04:35:06 +02001/*! \file gsm0411_smr.h */
2
Sylvain Munaut12ba7782014-06-16 10:13:40 +02003#pragma once
Andreas Eversbergc1a91a82011-10-28 11:05:37 +02004
5#include <osmocom/gsm/protocol/gsm_04_11.h>
6
7#define GSM411_SM_RL_DATA_REQ 0x401
8#define GSM411_SM_RL_DATA_IND 0x402
9#define GSM411_SM_RL_MEM_AVAIL_REQ 0x403
10#define GSM411_SM_RL_MEM_AVAIL_IND 0x404
11#define GSM411_SM_RL_REPORT_REQ 0x405
12#define GSM411_SM_RL_REPORT_IND 0x406
13
14struct gsm411_smr_inst {
Holger Hans Peter Freytherbcf125c2012-11-14 06:07:47 +010015 uint64_t id; /* a unique id for the SMS */
Andreas Eversbergc1a91a82011-10-28 11:05:37 +020016 int network; /* is this a MO (0) or MT (1) transfer */
17 int (*rl_recv) (struct gsm411_smr_inst *inst, int msg_type,
18 struct msgb *msg);
19 int (*mn_send) (struct gsm411_smr_inst *inst, int msg_type,
20 struct msgb *msg);
21
22 enum gsm411_rp_state rp_state;
23 struct osmo_timer_list rp_timer;
24};
25
26extern const struct value_string gsm411_rp_cause_strs[];
27
28/* init a new instance */
Holger Hans Peter Freytherbcf125c2012-11-14 06:07:47 +010029void gsm411_smr_init(struct gsm411_smr_inst *inst, uint64_t id, int network,
Andreas Eversbergc1a91a82011-10-28 11:05:37 +020030 int (*rl_recv) (struct gsm411_smr_inst *inst, int msg_type,
31 struct msgb *msg),
32 int (*mn_send) (struct gsm411_smr_inst *inst, int msg_type,
33 struct msgb *msg));
34
35/* clear instance */
36void gsm411_smr_clear(struct gsm411_smr_inst *inst);
37
38/* message from upper layer */
39int gsm411_smr_send(struct gsm411_smr_inst *inst, int msg_type,
40 struct msgb *msg);
41
42/* message from lower layer */
43int gsm411_smr_recv(struct gsm411_smr_inst *inst, int msg_type,
44 struct msgb *msg);