libosmogsm 1.13.1.1-afb4 Osmocom GSM library

gsm0411_utils.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <time.h>
8
9/* Turn int into semi-octet representation: 98 => 0x89 */
10uint8_t gsm411_bcdify(uint8_t value);
11
12/* Turn semi-octet representation into int: 0x89 => 98 */
13uint8_t gsm411_unbcdify(uint8_t value);
14
15 struct msgb *gsm411_msgb_alloc(void);
16
17/* Generate 03.40 TP-SCTS */
18 void gsm340_gen_scts(uint8_t *scts, time_t time);
19
20/* Decode 03.40 TP-SCTS (into utc/gmt timestamp) */
21time_t gsm340_scts(uint8_t *scts);
22
23/* decode validity period. return minutes */
24 unsigned long gsm340_validity_period(uint8_t sms_vpf, uint8_t *sms_vp);
25
26/* determine coding alphabet dependent on GSM 03.38 Section 4 DCS */
27 enum sms_alphabet gsm338_get_sms_alphabet(uint8_t dcs);
28
29/* generate a TPDU address field compliant with 03.40 sec. 9.1.2.5 */
30 int gsm340_gen_oa(uint8_t *oa, unsigned int oa_len, uint8_t type,
31 uint8_t plan, const char *number);
32
33/* Prefix msg with a RP header */
34 int gsm411_push_rp_header(struct msgb *msg, uint8_t rp_msg_type,
35 uint8_t rp_msg_ref);
36
37/* Prefix msg with a 04.08/04.11 CP header */
38 int gsm411_push_cp_header(struct msgb *msg, uint8_t proto, uint8_t trans,
39 uint8_t msg_type);
40
gsm340_gen_oa
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.
Definition: gsm0411_utils.c:297
gsm411_push_cp_header
int gsm411_push_cp_header(struct msgb *msg, uint8_t proto, uint8_t trans, uint8_t msg_type)
Prefix Message buffers with a 04.08/04.11 CP header.
Definition: gsm0411_utils.c:352
gsm411_msgb_alloc
struct msgb * gsm411_msgb_alloc(void)
Allocate a message buffer for use as TS 04.11 message.
Definition: gsm0411_utils.c:52
gsm340_validity_period
unsigned long gsm340_validity_period(uint8_t sms_vpf, uint8_t *sms_vp)
decode validity period.
Definition: gsm0411_utils.c:213
gsm411_unbcdify
uint8_t gsm411_unbcdify(uint8_t value)
Turn semi-octet representation into int: 0x89 => 98.
Definition: gsm0411_utils.c:74
gsm411_bcdify
uint8_t gsm411_bcdify(uint8_t value)
Turn int into semi-octet representation: 98 => 0x89.
Definition: gsm0411_utils.c:61
gsm340_gen_scts
void gsm340_gen_scts(uint8_t *scts, time_t time)
Generate 03.40 TP-SCTS.
Definition: gsm0411_utils.c:91
gsm338_get_sms_alphabet
enum sms_alphabet gsm338_get_sms_alphabet(uint8_t dcs)
determine coding alphabet dependent on GSM 03.38 Section 4 DCS
Definition: gsm0411_utils.c:253
gsm340_scts
time_t gsm340_scts(uint8_t *scts)
Decode 03.40 TP-SCTS (into utc/gmt timestamp)
Definition: gsm0411_utils.c:112
gsm411_push_rp_header
int gsm411_push_rp_header(struct msgb *msg, uint8_t rp_msg_type, uint8_t rp_msg_ref)
Prefix Message buffers with a RP header.
Definition: gsm0411_utils.c:331
dcs
struct @34 dcs
Definition: gsm_23_041.h:3
msg_type
uint8_t msg_type
Definition: gsm_04_08.h:2
type
uint8_t type
Definition: gsm_04_08_gprs.h:7
sms_alphabet
sms_alphabet
Definition: gsm_04_11.h:122
msg
uint8_t msg[0]
Definition: gsm_08_08.h:8
proto
uint8_t proto
Definition: ipaccess.h:1
time
char time[12]
Definition: ipaccess.h:7
msgb