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