From 21c8a1bcc8f853f3da05d71c4b4fbea6faf53b24 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 11 Feb 2017 23:37:47 +0100 Subject: mtp_sap.h: Add definitions for upcoming MTP SAP Change-Id: I714c44720821e1deaffef75d36ab49ac5a3186f0 --- include/osmocom/sigtran/mtp_sap.h | 66 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 include/osmocom/sigtran/mtp_sap.h diff --git a/include/osmocom/sigtran/mtp_sap.h b/include/osmocom/sigtran/mtp_sap.h new file mode 100644 index 0000000..3e64fc7 --- /dev/null +++ b/include/osmocom/sigtran/mtp_sap.h @@ -0,0 +1,66 @@ +#pragma once + +/* MTP User SAP description in accordance with ITU Q.701 */ + +/* (C) 2017 by Harald Welte + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +enum osmo_mtp_prim_type { + OSMO_MTP_PRIM_TRANSFER, + OSMO_MTP_PRIM_PAUSE, + OSMO_MTP_PRIM_RESUME, + OSMO_MTP_PRIM_STATUS, +}; + +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); -- cgit v1.2.3