aboutsummaryrefslogtreecommitdiffstats
path: root/libosmocore/include/osmocore/gsm_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'libosmocore/include/osmocore/gsm_utils.h')
-rw-r--r--libosmocore/include/osmocore/gsm_utils.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/libosmocore/include/osmocore/gsm_utils.h b/libosmocore/include/osmocore/gsm_utils.h
index c87e967bd..51e9f2e6a 100644
--- a/libosmocore/include/osmocore/gsm_utils.h
+++ b/libosmocore/include/osmocore/gsm_utils.h
@@ -27,6 +27,13 @@
#include <stdint.h>
+#define ADD_MODULO(sum, delta, modulo) do { \
+ if ((sum += delta) >= modulo) \
+ sum -= modulo; \
+ } while (0)
+
+#define GSM_MAX_FN (26*51*2048)
+
struct gsm_time {
uint32_t fn; /* FN count */
uint16_t t1; /* FN div (26*51) */
@@ -80,5 +87,17 @@ void gsm_fn2gsmtime(struct gsm_time *time, uint32_t fn);
/* Convert from GSM time to frame number */
uint32_t gsm_gsmtime2fn(struct gsm_time *time);
+/* GSM TS 03.03 Chapter 2.6 */
+enum gprs_tlli_tyoe {
+ TLLI_LOCAL,
+ TLLI_FOREIGN,
+ TLLI_RANDOM,
+ TLLI_AUXILIARY,
+ TLLI_RESERVED,
+};
+
+/* TS 03.03 Chapter 2.6 */
+int gprs_tlli_type(uint32_t tlli);
+
void generate_backtrace();
#endif