From d84f47abb3d5571f57bbc751b5e3f429958ee63e Mon Sep 17 00:00:00 2001 From: "Andreas.Eversberg" Date: Sun, 6 Nov 2011 20:22:12 +0100 Subject: gsm/sms: Moved utility functions of SMS processing to new gsm0411_utils.c Written-by: Andreas Eversberg Signed-off-by: Sylvain Munaut --- include/osmocom/gsm/Makefile.am | 3 ++- include/osmocom/gsm/gsm0411_utils.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 include/osmocom/gsm/gsm0411_utils.h (limited to 'include/osmocom') diff --git a/include/osmocom/gsm/Makefile.am b/include/osmocom/gsm/Makefile.am index 5971d0c5..3dbbad5f 100644 --- a/include/osmocom/gsm/Makefile.am +++ b/include/osmocom/gsm/Makefile.am @@ -1,6 +1,7 @@ osmogsm_HEADERS = a5.h comp128.h gsm0808.h gsm48_ie.h mncc.h rxlev_stat.h \ gsm0480.h gsm48.h gsm_utils.h rsl.h tlv.h abis_nm.h \ - sysinfo.h prim.h gsm0502.h lapd_core.h lapdm.h + sysinfo.h prim.h gsm0502.h lapd_core.h lapdm.h \ + gsm0411_utils.h SUBDIRS = protocol diff --git a/include/osmocom/gsm/gsm0411_utils.h b/include/osmocom/gsm/gsm0411_utils.h new file mode 100644 index 00000000..a030f581 --- /dev/null +++ b/include/osmocom/gsm/gsm0411_utils.h @@ -0,0 +1,30 @@ +#ifndef _GSM0411_UTILS_H +#define _GSM0411_UTILS_H + +struct msgb *gsm411_msgb_alloc(void); + +/* Generate 03.40 TP-SCTS */ +void gsm340_gen_scts(uint8_t *scts, time_t time); + +/* Decode 03.40 TP-SCTS (into utc/gmt timestamp) */ +time_t gsm340_scts(uint8_t *scts); + +/* decode validity period. return minutes */ +unsigned long gsm340_validity_period(uint8_t sms_vpf, uint8_t *sms_vp); + +/* determine coding alphabet dependent on GSM 03.38 Section 4 DCS */ +enum sms_alphabet gsm338_get_sms_alphabet(uint8_t dcs); + +/* generate a TPDU address field compliant with 03.40 sec. 9.1.2.5 */ +int gsm340_gen_oa(uint8_t *oa, unsigned int oa_len, uint8_t type, + uint8_t plan, const char *number); + +/* Prefix msg with a RP header */ +int gsm411_push_rp_header(struct msgb *msg, uint8_t rp_msg_type, + uint8_t rp_msg_ref); + +/* Prefix msg with a 04.08/04.11 CP header */ +int gsm411_push_cp_header(struct msgb *msg, uint8_t proto, uint8_t trans, + uint8_t msg_type); + +#endif /* _GSM0411_UTILS_H */ -- cgit v1.2.3