mtp_sap.h
Go to the documentation of this file.
#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 & 0x3) << 6) | (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);
osmo_mtp_prim_type
osmo_mtp_prim_type
Definition: mtp_sap.h:27
OSMO_MTP_PRIM_RESUME
@ OSMO_MTP_PRIM_RESUME
Definition: mtp_sap.h:30
OSMO_MTP_PRIM_TRANSFER
@ OSMO_MTP_PRIM_TRANSFER
Definition: mtp_sap.h:28
OSMO_MTP_PRIM_PAUSE
@ OSMO_MTP_PRIM_PAUSE
Definition: mtp_sap.h:29
OSMO_MTP_PRIM_STATUS
@ OSMO_MTP_PRIM_STATUS
Definition: mtp_sap.h:31
osmo_mtp_prim_name
char * osmo_mtp_prim_name(struct osmo_prim_hdr *oph)
sigtran_sap.h
osmo_mtp_pause_param
Definition: mtp_sap.h:43
osmo_mtp_pause_param::affected_dpc
uint32_t affected_dpc
Definition: mtp_sap.h:44
osmo_mtp_prim
Definition: mtp_sap.h:56
osmo_mtp_prim::status
struct osmo_mtp_status_param status
Definition: mtp_sap.h:62
osmo_mtp_prim::resume
struct osmo_mtp_resume_param resume
Definition: mtp_sap.h:61
osmo_mtp_prim::u
union osmo_mtp_prim::@18 u
osmo_mtp_prim::transfer
struct osmo_mtp_transfer_param transfer
Definition: mtp_sap.h:59
osmo_mtp_prim::pause
struct osmo_mtp_pause_param pause
Definition: mtp_sap.h:60
osmo_mtp_prim::oph
struct osmo_prim_hdr oph
Definition: mtp_sap.h:57
osmo_mtp_resume_param
Definition: mtp_sap.h:47
osmo_mtp_resume_param::affected_dpc
uint32_t affected_dpc
Definition: mtp_sap.h:48
osmo_mtp_status_param
Definition: mtp_sap.h:51
osmo_mtp_status_param::cause
uint32_t cause
Definition: mtp_sap.h:53
osmo_mtp_status_param::affected_dpc
uint32_t affected_dpc
Definition: mtp_sap.h:52
osmo_mtp_transfer_param
Definition: mtp_sap.h:36
osmo_mtp_transfer_param::dpc
uint32_t dpc
Definition: mtp_sap.h:38
osmo_mtp_transfer_param::opc
uint32_t opc
Definition: mtp_sap.h:37
osmo_mtp_transfer_param::sls
uint8_t sls
Definition: mtp_sap.h:39
osmo_mtp_transfer_param::sio
uint8_t sio
Definition: mtp_sap.h:40