blob: 5ea8584dbbf58c2796f147bd618329bee959159f [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 {
14 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 */
27void gsm411_smr_init(struct gsm411_smr_inst *inst, int network,
28 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);
43
44#endif /* _GSM0411_SMR_H */
45