summaryrefslogtreecommitdiffstats
path: root/include/osmocom/gsm
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2019-01-16 16:53:26 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2019-01-29 00:59:32 +0100
commit7740d26d7e6a3ee963cafadae8fc6d0ef7e7d21b (patch)
tree80853135e78da11fe0318a719b564e94c33d62b5 /include/osmocom/gsm
parent0423b61aa8dd75b3141e13cf9276b8fa14ceb473 (diff)
add osmo_classmark_* API
osmo-bsc and osmo-msc implement identical Classmark structures. It makes sense to define once near the gsm48 protocol definitions. Also move along some generic Classmark API from osmo-msc. Change-Id: Ifd27bab0380f7ad0c44c719aa6c8bd62cf7b034c
Diffstat (limited to 'include/osmocom/gsm')
-rw-r--r--include/osmocom/gsm/protocol/gsm_04_08.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h
index 234fa793..fbd4fe6a 100644
--- a/include/osmocom/gsm/protocol/gsm_04_08.h
+++ b/include/osmocom/gsm/protocol/gsm_04_08.h
@@ -56,6 +56,22 @@ struct gsm48_classmark2 {
#endif
} __attribute__ ((packed));
+struct osmo_gsm48_classmark {
+ bool classmark1_set;
+ struct gsm48_classmark1 classmark1;
+ uint8_t classmark2_len;
+ struct gsm48_classmark2 classmark2;
+ uint8_t classmark3_len;
+ uint8_t classmark3[14]; /* if cm3 gets extended by spec, it will be truncated */
+};
+
+bool osmo_gsm48_classmark_is_r99(const struct osmo_gsm48_classmark *cm);
+bool osmo_gsm48_classmark1_is_r99(const struct gsm48_classmark1 *cm1);
+bool osmo_gsm48_classmark2_is_r99(const struct gsm48_classmark2 *cm2, uint8_t cm2_len);
+int osmo_gsm48_classmark_supports_a5(const struct osmo_gsm48_classmark *cm, uint8_t a5);
+const char *osmo_gsm48_classmark_a5_name(const struct osmo_gsm48_classmark *cm);
+void osmo_gsm48_classmark_update(struct osmo_gsm48_classmark *dst, const struct osmo_gsm48_classmark *src);
+
/* Chapter 10.5.2.1b.3 */
#if OSMO_IS_LITTLE_ENDIAN == 1
struct gsm48_range_1024 {