[MERGED] libosmo-sccp[master]: Add mtp_sap.h file with definitions for MTP-USER SAP

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Apr 10 09:27:28 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: Add mtp_sap.h file with definitions for MTP-USER SAP
......................................................................


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
---
M include/osmocom/sigtran/Makefile.am
A include/osmocom/sigtran/mtp_sap.h
2 files changed, 69 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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 at 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);

-- 
To view, visit https://gerrit.osmocom.org/2203
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id1f8892e5dee877e2ffbeb3925753ab3da5a9420
Gerrit-PatchSet: 4
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list