blob: 70050105935741f54930a354fd12b3705a13e413 [file] [log] [blame]
Sylvain Munaut12ba7782014-06-16 10:13:40 +02001#pragma once
Andreas.Eversbergd84f47a2011-11-06 20:22:12 +01002
Holger Hans Peter Freyther6145a252013-09-04 12:12:58 +02003#include <time.h>
4
Harald Weltead633b02011-12-01 21:08:19 +01005/* Turn int into semi-octet representation: 98 => 0x89 */
6uint8_t gsm411_bcdify(uint8_t value);
7
8/* Turn semi-octet representation into int: 0x89 => 98 */
9uint8_t gsm411_unbcdify(uint8_t value);
10
Andreas.Eversbergd84f47a2011-11-06 20:22:12 +010011struct msgb *gsm411_msgb_alloc(void);
12
13/* Generate 03.40 TP-SCTS */
14void gsm340_gen_scts(uint8_t *scts, time_t time);
15
16/* Decode 03.40 TP-SCTS (into utc/gmt timestamp) */
17time_t gsm340_scts(uint8_t *scts);
18
19/* decode validity period. return minutes */
20unsigned long gsm340_validity_period(uint8_t sms_vpf, uint8_t *sms_vp);
21
22/* determine coding alphabet dependent on GSM 03.38 Section 4 DCS */
23enum sms_alphabet gsm338_get_sms_alphabet(uint8_t dcs);
24
25/* generate a TPDU address field compliant with 03.40 sec. 9.1.2.5 */
26int gsm340_gen_oa(uint8_t *oa, unsigned int oa_len, uint8_t type,
27 uint8_t plan, const char *number);
28
29/* Prefix msg with a RP header */
30int gsm411_push_rp_header(struct msgb *msg, uint8_t rp_msg_type,
31 uint8_t rp_msg_ref);
32
33/* Prefix msg with a 04.08/04.11 CP header */
34int gsm411_push_cp_header(struct msgb *msg, uint8_t proto, uint8_t trans,
35 uint8_t msg_type);