diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2018-11-30 13:36:12 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-12-08 19:29:34 +0000 |
commit | 4f4905fac590be8feea0b22010444ed40d7b11b5 (patch) | |
tree | 26870a2f21aca35188d3c34bd5027be45603e562 /include/osmocom/gsm/gsm0808_utils.h | |
parent | e190e032d97d6a67524efc4f6169a30789c86048 (diff) |
gsm0808: add encoder for cause codes and use it
At the moment the all gsm0808 cause codes are encoded directly using the
tlv API directly to put a one byte TLV field. This works ok for most
situations where the cause code consists of a single byte. However,
gsm0808 specifies a two byte cause code model where cause codes may be
extended up to two bytes. Instead of implementing the encoding over and
over and again, let's rather have an encoder function we can call.
- Add an encoder function that can generate single byte and extended
cause codeds and makes the length decision automatically.
- Use only this function to append cause codes
Change-Id: I71d58fad89502a43532f60717ca022c15c73f8bb
Diffstat (limited to 'include/osmocom/gsm/gsm0808_utils.h')
-rw-r--r-- | include/osmocom/gsm/gsm0808_utils.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h index 097bd76b..90ff6771 100644 --- a/include/osmocom/gsm/gsm0808_utils.h +++ b/include/osmocom/gsm/gsm0808_utils.h @@ -77,6 +77,7 @@ int gsm0808_cell_id_list_name_buf(char *buf, size_t buflen, const struct gsm0808 int gsm0808_cell_id_u_name(char *buf, size_t buflen, enum CELL_IDENT id_discr, const union gsm0808_cell_id_u *u); +uint8_t gsm0808_enc_cause(struct msgb *msg, uint16_t cause); uint8_t gsm0808_enc_aoip_trasp_addr(struct msgb *msg, const struct sockaddr_storage *ss); int gsm0808_dec_aoip_trasp_addr(struct sockaddr_storage *ss, |