Sylvain Munaut | 12ba778 | 2014-06-16 10:13:40 +0200 | [diff] [blame] | 1 | #pragma once |
Andreas Eversberg | c1a91a8 | 2011-10-28 11:05:37 +0200 | [diff] [blame] | 2 | |
| 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 | |
| 12 | struct gsm411_smr_inst { |
Holger Hans Peter Freyther | bcf125c | 2012-11-14 06:07:47 +0100 | [diff] [blame] | 13 | uint64_t id; /* a unique id for the SMS */ |
Andreas Eversberg | c1a91a8 | 2011-10-28 11:05:37 +0200 | [diff] [blame] | 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 | |
| 24 | extern const struct value_string gsm411_rp_cause_strs[]; |
| 25 | |
| 26 | /* init a new instance */ |
Holger Hans Peter Freyther | bcf125c | 2012-11-14 06:07:47 +0100 | [diff] [blame] | 27 | void gsm411_smr_init(struct gsm411_smr_inst *inst, uint64_t id, int network, |
Andreas Eversberg | c1a91a8 | 2011-10-28 11:05:37 +0200 | [diff] [blame] | 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 */ |
| 34 | void gsm411_smr_clear(struct gsm411_smr_inst *inst); |
| 35 | |
| 36 | /* message from upper layer */ |
| 37 | int gsm411_smr_send(struct gsm411_smr_inst *inst, int msg_type, |
| 38 | struct msgb *msg); |
| 39 | |
| 40 | /* message from lower layer */ |
| 41 | int gsm411_smr_recv(struct gsm411_smr_inst *inst, int msg_type, |
| 42 | struct msgb *msg); |