From 7740d26d7e6a3ee963cafadae8fc6d0ef7e7d21b Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 16 Jan 2019 16:53:26 +0100 Subject: 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 --- include/osmocom/gsm/protocol/gsm_04_08.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/osmocom') 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 { -- cgit v1.2.3