Loading...
Searching...
No Matches
gsm0411_smc.h
Go to the documentation of this file.
#pragma once
#include <osmocom/core/timer.h>
#include <osmocom/gsm/protocol/gsm_04_11.h>
#define GSM411_MMSMS_EST_REQ 0x310
#define GSM411_MMSMS_EST_IND 0x312
#define GSM411_MMSMS_EST_CNF 0x311
#define GSM411_MMSMS_REL_REQ 0x320
#define GSM411_MMSMS_REL_IND 0x322
#define GSM411_MMSMS_DATA_REQ 0x330
#define GSM411_MMSMS_DATA_IND 0x332
#define GSM411_MMSMS_UNIT_DATA_REQ 0x340
#define GSM411_MMSMS_UNIT_DATA_IND 0x342
#define GSM411_MMSMS_ERR_IND 0x372
#define GSM411_MNSMS_ABORT_REQ 0x101
#define GSM411_MNSMS_DATA_REQ 0x102
#define GSM411_MNSMS_DATA_IND 0x103
#define GSM411_MNSMS_EST_REQ 0x104
#define GSM411_MNSMS_EST_IND 0x105
#define GSM411_MNSMS_ERROR_IND 0x106
#define GSM411_MNSMS_REL_REQ 0x107
struct gsm411_smc_inst {
uint64_t id; /* a unique id for the SMS */
int network; /* is this a MO (0) or MT (1) transfer */
int (*mn_recv) (struct gsm411_smc_inst *inst, int msg_type,
struct msgb *msg);
int (*mm_send) (struct gsm411_smc_inst *inst, int msg_type,
struct msgb *msg, int cp_msg_type);
enum gsm411_cp_state cp_state;
struct osmo_timer_list cp_timer;
struct msgb *cp_msg; /* store pending message */
int cp_rel; /* store pending release */
int cp_retx; /* retry counter */
int cp_max_retr; /* maximum retry */
int cp_tc1; /* timer value TC1* */
};
extern const struct value_string gsm411_cp_cause_strs[];
/* init a new instance */
void gsm411_smc_init(struct gsm411_smc_inst *inst, uint64_t id, int network,
int (*mn_recv) (struct gsm411_smc_inst *inst, int msg_type,
struct msgb *msg),
int (*mm_send) (struct gsm411_smc_inst *inst, int msg_type,
struct msgb *msg, int cp_msg_type));
/* clear instance */
void gsm411_smc_clear(struct gsm411_smc_inst *inst);
/* message from upper layer */
int gsm411_smc_send(struct gsm411_smc_inst *inst, int msg_type,
struct msgb *msg);
/* message from lower layer */
int gsm411_smc_recv(struct gsm411_smc_inst *inst, int msg_type,
struct msgb *msg, int cp_msg_type);
extern const struct value_string gsm411_cp_state_names[];
static inline const char *gsm411_cp_state_name(enum gsm411_cp_state cp_state) {
return get_value_string(gsm411_cp_state_names, cp_state);
}
msg_type
uint8_t msg_type
Definition gsm_04_08.h:1
network
write Write running configuration to network
gsm411_smc_init
void gsm411_smc_init(struct gsm411_smc_inst *inst, uint64_t id, int network, int(*mn_recv)(struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg), int(*mm_send)(struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg, int cp_msg_type))
Definition gsm0411_smc.c:79
gsm411_smc_recv
int gsm411_smc_recv(struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg, int cp_msg_type)
Definition gsm0411_smc.c:528
gsm411_cp_cause_strs
const struct value_string gsm411_cp_cause_strs[]
Definition gsm0411_smc.c:123
gsm411_cp_state_names
const struct value_string gsm411_cp_state_names[]
Definition gsm0411_smc.c:582
gsm411_smc_clear
void gsm411_smc_clear(struct gsm411_smc_inst *inst)
Definition gsm0411_smc.c:100
gsm411_cp_state_name
static const char * gsm411_cp_state_name(enum gsm411_cp_state cp_state)
Definition gsm0411_smc.h:69
gsm411_smc_send
int gsm411_smc_send(struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg)
Definition gsm0411_smc.c:454
get_value_string
const char * get_value_string(const struct value_string *vs, uint32_t val)
gsm_04_11.h
gsm411_cp_state
gsm411_cp_state
Definition gsm_04_11.h:10
msg
uint8_t msg[0]
Definition gsm_08_08.h:8
gsm411_smc_inst
Definition gsm0411_smc.h:29
gsm411_smc_inst::cp_msg
struct msgb * cp_msg
Definition gsm0411_smc.h:39
gsm411_smc_inst::cp_timer
struct osmo_timer_list cp_timer
Definition gsm0411_smc.h:38
gsm411_smc_inst::cp_max_retr
int cp_max_retr
Definition gsm0411_smc.h:42
gsm411_smc_inst::id
uint64_t id
Definition gsm0411_smc.h:30
gsm411_smc_inst::mn_recv
int(* mn_recv)(struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg)
Definition gsm0411_smc.h:32
gsm411_smc_inst::mm_send
int(* mm_send)(struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg, int cp_msg_type)
Definition gsm0411_smc.h:34
gsm411_smc_inst::cp_tc1
int cp_tc1
Definition gsm0411_smc.h:43
gsm411_smc_inst::cp_state
enum gsm411_cp_state cp_state
Definition gsm0411_smc.h:37
gsm411_smc_inst::network
int network
Definition gsm0411_smc.h:31
gsm411_smc_inst::cp_rel
int cp_rel
Definition gsm0411_smc.h:40
gsm411_smc_inst::cp_retx
int cp_retx
Definition gsm0411_smc.h:41
msgb
osmo_timer_list
value_string
timer.h