libosmogsm
0.11.0-dirty
Osmocom GSM library
|
00001 00005 #pragma once 00006 00007 #include <osmocom/gsm/protocol/gsm_04_11.h> 00008 00009 #define GSM411_SM_RL_DATA_REQ 0x401 00010 #define GSM411_SM_RL_DATA_IND 0x402 00011 #define GSM411_SM_RL_MEM_AVAIL_REQ 0x403 00012 #define GSM411_SM_RL_MEM_AVAIL_IND 0x404 00013 #define GSM411_SM_RL_REPORT_REQ 0x405 00014 #define GSM411_SM_RL_REPORT_IND 0x406 00015 00016 struct gsm411_smr_inst { 00017 uint64_t id; /* a unique id for the SMS */ 00018 int network; /* is this a MO (0) or MT (1) transfer */ 00019 int (*rl_recv) (struct gsm411_smr_inst *inst, int msg_type, 00020 struct msgb *msg); 00021 int (*mn_send) (struct gsm411_smr_inst *inst, int msg_type, 00022 struct msgb *msg); 00023 00024 enum gsm411_rp_state rp_state; 00025 struct osmo_timer_list rp_timer; 00026 }; 00027 00028 extern const struct value_string gsm411_rp_cause_strs[]; 00029 00030 /* init a new instance */ 00031 void gsm411_smr_init(struct gsm411_smr_inst *inst, uint64_t id, int network, 00032 int (*rl_recv) (struct gsm411_smr_inst *inst, int msg_type, 00033 struct msgb *msg), 00034 int (*mn_send) (struct gsm411_smr_inst *inst, int msg_type, 00035 struct msgb *msg)); 00036 00037 /* clear instance */ 00038 void gsm411_smr_clear(struct gsm411_smr_inst *inst); 00039 00040 /* message from upper layer */ 00041 int gsm411_smr_send(struct gsm411_smr_inst *inst, int msg_type, 00042 struct msgb *msg); 00043 00044 /* message from lower layer */ 00045 int gsm411_smr_recv(struct gsm411_smr_inst *inst, int msg_type, 00046 struct msgb *msg); 00047 00048 extern const struct value_string gsm411_rp_state_names[]; 00049 00050 static inline const char *gsm411_rp_state_name(enum gsm411_rp_state rp_state) { 00051 return get_value_string(gsm411_rp_state_names, rp_state); 00052 } 00053