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