aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-04-03 16:53:23 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-03 18:03:47 +0200
commitf8827eaab47455ffd185ed522a03209a9b201a9a (patch)
tree61af40044faa17d43941506d9d415bff4c9ed1be
parent5994c78f163125a6cb4cf4252de0be3256f5da1b (diff)
Add mtp_sap.h file with definitions for MTP-USER SAP
The ITU-T Q.70x series describe a MTP-USER SAP, which we define here for use with osmocom primitives. Change-Id: Id1f8892e5dee877e2ffbeb3925753ab3da5a9420
-rw-r--r--include/osmocom/sigtran/Makefile.am2
-rw-r--r--include/osmocom/sigtran/mtp_sap.h68
2 files changed, 69 insertions, 1 deletions
diff --git a/include/osmocom/sigtran/Makefile.am b/include/osmocom/sigtran/Makefile.am
index ca7de0f..2f2912f 100644
--- a/include/osmocom/sigtran/Makefile.am
+++ b/include/osmocom/sigtran/Makefile.am
@@ -1,5 +1,5 @@
sigtran_HEADERS = xua_types.h xua_msg.h m2ua_types.h sccp_sap.h \
- sua.h sigtran_sap.h sccp_helpers.h
+ sua.h sigtran_sap.h sccp_helpers.h mtp_sap.h
sigtrandir = $(includedir)/osmocom/sigtran
diff --git a/include/osmocom/sigtran/mtp_sap.h b/include/osmocom/sigtran/mtp_sap.h
new file mode 100644
index 0000000..120ae91
--- /dev/null
+++ b/include/osmocom/sigtran/mtp_sap.h
@@ -0,0 +1,68 @@
+#pragma once
+
+/* MTP User SAP description in accordance with ITU Q.701 */
+
+/* (C) 2017 by Harald Welte <laforge@gnumonks.org>
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <stdint.h>
+#include <osmocom/core/prim.h>
+#include <osmocom/sigtran/sigtran_sap.h>
+
+enum osmo_mtp_prim_type {
+ OSMO_MTP_PRIM_TRANSFER,
+ OSMO_MTP_PRIM_PAUSE,
+ OSMO_MTP_PRIM_RESUME,
+ OSMO_MTP_PRIM_STATUS,
+};
+
+#define MTP_SIO(service, net_ind) (((net_ind & 0xF) << 4) | (service & 0xF))
+
+struct osmo_mtp_transfer_param {
+ uint32_t opc;
+ uint32_t dpc;
+ uint8_t sls;
+ uint8_t sio;
+};
+
+struct osmo_mtp_pause_param {
+ uint32_t affected_dpc;
+};
+
+struct osmo_mtp_resume_param {
+ uint32_t affected_dpc;
+};
+
+struct osmo_mtp_status_param {
+ uint32_t affected_dpc;
+ uint32_t cause;
+};
+
+struct osmo_mtp_prim {
+ struct osmo_prim_hdr oph;
+ union {
+ struct osmo_mtp_transfer_param transfer;
+ struct osmo_mtp_pause_param pause;
+ struct osmo_mtp_resume_param resume;
+ struct osmo_mtp_status_param status;
+ } u;
+};
+
+#define msgb_mtp_prim(msg) ((struct osmo_mtp_prim *)(msg)->l1h)
+
+char *osmo_mtp_prim_name(struct osmo_prim_hdr *oph);