libosmogsm
0.9.6.270-38c0
Osmocom GSM library
|
Point-to-Point (PP) Short Message Service (SMS) as per TS 04.11. More...
Data Structures | |
struct | smcdownstate |
struct | smcdatastate |
struct | smrdownstate |
struct | smrdatastate |
Macros | |
#define | MAX_SMS_RETRY 2 |
#define | SMC_LOG_STR "SMC(%" PRIu64 ") " |
#define | SMCDOWNSLLEN (sizeof(smcdownstatelist) / sizeof(struct smcdownstate)) |
#define | SMCDATASLLEN (sizeof(smcdatastatelist) / sizeof(struct smcdatastate)) |
#define | SMRDOWNSLLEN (sizeof(smrdownstatelist) / sizeof(struct smrdownstate)) |
#define | SMRDATASLLEN (sizeof(smrdatastatelist) / sizeof(struct smrdatastate)) |
#define | GSM411_ALLOC_SIZE 1024 |
#define | GSM411_ALLOC_HEADROOM 128 |
Functions | |
struct gsm341_ms_message * | gsm0341_build_msg (void *ctx, uint8_t geo_scope, uint8_t msg_code, uint8_t update, uint16_t msg_id, uint8_t dcs, uint8_t page_total, uint8_t page_cur, uint8_t *data, uint8_t len) |
Encode a 3GPP TS 03.41 SMS-CB message. More... | |
static void | cp_timer_expired (void *data) |
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)) |
void | gsm411_smc_clear (struct gsm411_smc_inst *inst) |
static void | new_cp_state (struct gsm411_smc_inst *inst, enum gsm411_cp_state state) |
static int | gsm411_tx_cp_error (struct gsm411_smc_inst *inst, uint8_t cause) |
static int | gsm411_mnsms_est_req (struct gsm411_smc_inst *inst, struct msgb *msg) |
static int | gsm411_mmsms_send_msg (struct gsm411_smc_inst *inst) |
static int | gsm411_mmsms_est_cnf (struct gsm411_smc_inst *inst, struct msgb *msg) |
static int | gsm411_mmsms_cp_ack (struct gsm411_smc_inst *inst, struct msgb *msg) |
static int | gsm411_mmsms_cp_data (struct gsm411_smc_inst *inst, struct msgb *msg) |
static int | gsm411_mnsms_data_req (struct gsm411_smc_inst *inst, struct msgb *msg) |
static int | gsm411_mnsms_rel_req (struct gsm411_smc_inst *inst, struct msgb *msg) |
static int | gsm411_mmsms_cp_error (struct gsm411_smc_inst *inst, struct msgb *msg) |
static int | gsm411_mmsms_rel_ind (struct gsm411_smc_inst *inst, struct msgb *msg) |
static int | gsm411_mnsms_abort_req (struct gsm411_smc_inst *inst, struct msgb *msg) |
int | gsm411_smc_send (struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg) |
int | gsm411_smc_recv (struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg, int cp_msg_type) |
static void | rp_timer_expired (void *data) |
void | gsm411_smr_init (struct gsm411_smr_inst *inst, uint64_t id, int network, int(*rl_recv)(struct gsm411_smr_inst *inst, int msg_type, struct msgb *msg), int(*mn_send)(struct gsm411_smr_inst *inst, int msg_type, struct msgb *msg)) |
void | gsm411_smr_clear (struct gsm411_smr_inst *inst) |
static void | new_rp_state (struct gsm411_smr_inst *inst, enum gsm411_rp_state state) |
static int | gsm411_rp_sendmsg (struct gsm411_smr_inst *inst, struct msgb *msg, uint8_t rp_msg_type, uint8_t rp_msg_ref, int mnsms_msg_type) |
static int | gsm411_send_rp_error (struct gsm411_smr_inst *inst, uint8_t msg_ref, uint8_t cause) |
static int | gsm411_send_release (struct gsm411_smr_inst *inst) |
static int | gsm411_send_abort (struct gsm411_smr_inst *inst) |
static int | gsm411_send_report (struct gsm411_smr_inst *inst) |
static int | gsm411_rl_data_req (struct gsm411_smr_inst *inst, struct msgb *msg) |
static int | gsm411_rl_report_req (struct gsm411_smr_inst *inst, struct msgb *msg) |
static int | gsm411_mnsms_est_ind (struct gsm411_smr_inst *inst, struct msgb *msg) |
static int | gsm411_mnsms_data_ind_tx (struct gsm411_smr_inst *inst, struct msgb *msg) |
static int | gsm411_mnsms_error_ind_tx (struct gsm411_smr_inst *inst, struct msgb *msg) |
static int | gsm411_mnsms_error_ind_rx (struct gsm411_smr_inst *inst, struct msgb *msg) |
int | gsm411_smr_send (struct gsm411_smr_inst *inst, int msg_type, struct msgb *msg) |
int | gsm411_smr_recv (struct gsm411_smr_inst *inst, int msg_type, struct msgb *msg) |
struct msgb * | gsm411_msgb_alloc (void) |
Allocate a message buffer for use as TS 04.11 message. More... | |
uint8_t | gsm411_bcdify (uint8_t value) |
Turn int into semi-octet representation: 98 => 0x89. More... | |
uint8_t | gsm411_unbcdify (uint8_t value) |
Turn semi-octet representation into int: 0x89 => 98. More... | |
void | gsm340_gen_scts (uint8_t *scts, time_t time) |
Generate 03.40 TP-SCTS. More... | |
time_t | gsm340_scts (uint8_t *scts) |
Decode 03.40 TP-SCTS (into utc/gmt timestamp) More... | |
static unsigned long | gsm340_vp_default (void) |
static unsigned long | gsm340_vp_relative (uint8_t *sms_vp) |
static unsigned long | gsm340_vp_absolute (uint8_t *sms_vp) |
static unsigned long | gsm340_vp_relative_integer (uint8_t *sms_vp) |
static unsigned long | gsm340_vp_relative_semioctet (uint8_t *sms_vp) |
unsigned long | gsm340_validity_period (uint8_t sms_vpf, uint8_t *sms_vp) |
decode validity period. return minutes More... | |
enum sms_alphabet | gsm338_get_sms_alphabet (uint8_t dcs) |
determine coding alphabet dependent on GSM 03.38 Section 4 DCS More... | |
int | gsm340_gen_oa (uint8_t *oa, unsigned int oa_len, uint8_t type, uint8_t plan, const char *number) |
generate a TPDU address field compliant with 03.40 sec. 9.1.2.5 More... | |
int | gsm411_push_rp_header (struct msgb *msg, uint8_t rp_msg_type, uint8_t rp_msg_ref) |
Prefix msgb with a RP header. More... | |
int | gsm411_push_cp_header (struct msgb *msg, uint8_t proto, uint8_t trans, uint8_t msg_type) |
Prefix msgb with a 04.08/04.11 CP header. More... | |
Variables | |
const char * | smc_state_names [] |
const struct value_string | gsm411_cp_cause_strs [] |
static const struct smcdownstate | smcdownstatelist [] |
static const struct smcdatastate | smcdatastatelist [] |
static const char * | smr_state_names [] |
const struct value_string | gsm411_rp_cause_strs [] |
static const struct smrdownstate | smrdownstatelist [] |
static const struct smrdatastate | smrdatastatelist [] |
Point-to-Point (PP) Short Message Service (SMS) as per TS 04.11.
struct gsm341_ms_message* gsm0341_build_msg | ( | void * | ctx, |
uint8_t | geo_scope, | ||
uint8_t | msg_code, | ||
uint8_t | update, | ||
uint16_t | msg_id, | ||
uint8_t | dcs, | ||
uint8_t | page_total, | ||
uint8_t | page_cur, | ||
uint8_t * | data, | ||
uint8_t | len | ||
) |
Encode a 3GPP TS 03.41 SMS-CB message.
[in] | ctx | talloc allocation context |
[in] | geo_scope | Geographic Scope |
[in] | msg_code | Message Code |
[in] | update | Is this an update? |
[in] | msg_id | Message ID |
[in] | dcs | Data Coding Scheme |
[in] | page_total | Total number of pages |
[in] | page_cur | Current Page (up to page_total) |
[in] | data | Message data (copied 1:1) |
[in] | len | Length of data in bytes (up to 88) |
enum sms_alphabet gsm338_get_sms_alphabet | ( | uint8_t | dcs | ) |
determine coding alphabet dependent on GSM 03.38 Section 4 DCS
[in] | dcs | Data Coding Scheme in 03.38 encoding |
int gsm340_gen_oa | ( | uint8_t * | oa, |
unsigned int | oa_len, | ||
uint8_t | type, | ||
uint8_t | plan, | ||
const char * | number | ||
) |
generate a TPDU address field compliant with 03.40 sec. 9.1.2.5
[out] | oa | caller-provided output buffer |
[in] | oa_len | caller-specified length of oa in bytes |
[in] | type | GSM340_TYPE_* |
[in] | plan | Numbering Plan |
[in] | number | string containing number number of bytes of oa that have been used |
References gsm48_encode_bcd_number().
void gsm340_gen_scts | ( | uint8_t * | scts, |
time_t | time | ||
) |
Generate 03.40 TP-SCTS.
[out] | scts | Caller-provided buffer to store SCTS (7 octets) |
[in] | time | to encode |
References gsm411_bcdify().
time_t gsm340_scts | ( | uint8_t * | scts | ) |
Decode 03.40 TP-SCTS (into utc/gmt timestamp)
[in] | scts | SMS Center Time Stamp |
References gsm411_unbcdify().
unsigned long gsm340_validity_period | ( | uint8_t | sms_vpf, |
uint8_t * | sms_vp | ||
) |
decode validity period. return minutes
[in] | sms_vpf | Validity Period Format in 03.40 encoding |
[in] | sms_vp | Validity Period Information Element |
uint8_t gsm411_bcdify | ( | uint8_t | value | ) |
Turn int into semi-octet representation: 98 => 0x89.
[in] | integer | value representing decimal number 0..99 |
Referenced by gsm340_gen_scts().
struct msgb* gsm411_msgb_alloc | ( | void | ) |
Allocate a message buffer for use as TS 04.11 message.
int gsm411_push_cp_header | ( | struct msgb * | msg, |
uint8_t | proto, | ||
uint8_t | trans, | ||
uint8_t | msg_type | ||
) |
Prefix msgb with a 04.08/04.11 CP header.
msg | Message Buffer containing message | |
[in] | proto | Protocol |
[in] | trans | Transaction |
[in] | msg_type | Message Type 0 |
int gsm411_push_rp_header | ( | struct msgb * | msg, |
uint8_t | rp_msg_type, | ||
uint8_t | rp_msg_ref | ||
) |
Prefix msgb with a RP header.
msg | Message Buffer containing message | |
[in] | rp_msg_type | RP Message Type |
[in] | rp_msg_ref | RP Message Reference |
uint8_t gsm411_unbcdify | ( | uint8_t | value | ) |
Turn semi-octet representation into int: 0x89 => 98.
[in] | value | byte containing two BCD nibbles in revere order |
Referenced by gsm340_scts().
const struct value_string gsm411_cp_cause_strs[] |
const struct value_string gsm411_rp_cause_strs[] |
const char* smc_state_names[] |
|
static |
|
static |
|
static |
|
static |