aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am1
-rw-r--r--include/osmocom/gsm/gsm0808_utils.h2
-rw-r--r--include/osmocom/gsm/gsm29205.h41
3 files changed, 43 insertions, 1 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index 366fd70b..ccf9e108 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -86,6 +86,7 @@ nobase_include_HEADERS = \
osmocom/coding/gsm0503_interleaving.h \
osmocom/coding/gsm0503_coding.h \
osmocom/gsm/gsm0808.h \
+ osmocom/gsm/gsm29205.h \
osmocom/gsm/gsm0808_utils.h \
osmocom/gsm/gsm23003.h \
osmocom/gsm/gsm29118.h \
diff --git a/include/osmocom/gsm/gsm0808_utils.h b/include/osmocom/gsm/gsm0808_utils.h
index 90ff6771..5d5803be 100644
--- a/include/osmocom/gsm/gsm0808_utils.h
+++ b/include/osmocom/gsm/gsm0808_utils.h
@@ -62,7 +62,7 @@ struct gsm0808_cell_id_list2 {
struct osmo_lcls {
enum gsm0808_lcls_config config; /**< §3.2.2.116 Configuration */
enum gsm0808_lcls_control control; /**< §3.2.2.117 Connection Status Control */
- struct gsm29205_gcr *gcr; /**< §3.2.2.115 Global Call Reference */
+ struct osmo_gcr_parsed *gcr; /**< §3.2.2.115 Global Call Reference */
bool corr_needed; /**< §3.2.2.118 Correlation-Not-Needed */
};
diff --git a/include/osmocom/gsm/gsm29205.h b/include/osmocom/gsm/gsm29205.h
new file mode 100644
index 00000000..0c3c153e
--- /dev/null
+++ b/include/osmocom/gsm/gsm29205.h
@@ -0,0 +1,41 @@
+/*! \defgroup gsm29205 3GPP TS 29.205
+ * @{
+ * \file gsm29205.h */
+/*
+ * (C) 2018 by sysmocom - s.f.m.c. GmbH
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#pragma once
+
+#include <osmocom/core/msgb.h>
+
+#include <stdint.h>
+
+#define OSMO_GCR_MIN_LEN 13
+
+/*! Parsed representation of Global Call Reference, 3GPP TS 29.205 Table B 2.1.9.1. */
+struct osmo_gcr_parsed {
+ uint8_t net[5]; /** Network ID, ITU-T Q.1902.3 */
+ uint8_t net_len; /** length (3-5 octets) of gsm29205_gcr#net */
+ uint16_t node; /** Node ID */
+ uint8_t cr[5]; /** Call Reference ID */
+};
+
+uint8_t osmo_enc_gcr(struct msgb *msg, const struct osmo_gcr_parsed *g);
+int osmo_dec_gcr(struct osmo_gcr_parsed *gcr, const uint8_t *elem, uint8_t len);