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