From ed651d2485a51b57bf6090f4f58fd356118c6835 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 7 Nov 2018 15:25:05 +0100 Subject: Support cipher mode reject with extended cause * add function to generate cipher mode reject with extended (2-byte) Cause IE * add function to get (extended) Cause value * add corresponding (extended cause) test * update existing (non-extended cause) test * use enum as a parameter for existing non-extended version to make interface more unified Change-Id: Id5509b94a18180a44f45300caaa02b843c166fa3 Related: OS#3187 --- include/osmocom/gsm/gsm0808.h | 1 + include/osmocom/gsm/gsm0808_utils.h | 2 ++ 2 files changed, 3 insertions(+) (limited to 'include') diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h index 66f7c277..9b19d691 100644 --- a/include/osmocom/gsm/gsm0808.h +++ b/include/osmocom/gsm/gsm0808.h @@ -51,6 +51,7 @@ struct msgb *gsm0808_create_cipher(const struct gsm0808_encrypt_info *ei, const uint8_t *cipher_response_mode); struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id); struct msgb *gsm0808_create_cipher_reject(enum gsm0808_cause cause); +struct msgb *gsm0808_create_cipher_reject_ext(enum gsm0808_cause_class class, uint8_t ext); struct msgb *gsm0808_create_classmark_request(); struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len, const uint8_t *cm3, uint8_t cm3_len); diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index b56e2635..c22d0a9b 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -120,6 +120,8 @@ static inline bool gsm0808_cause_ext(enum gsm0808_cause cause) return (cause & 0x80) && !(cause & 0x0F); } +int gsm0808_get_cipher_reject_cause(const struct tlv_parsed *tp); + /*! \returns 3GPP TS 48.008 3.2.2.49 Current Channel Type 1 from enum gsm_chan_t. */ static inline uint8_t gsm0808_current_channel_type_1(enum gsm_chan_t type) { -- cgit v1.2.3