📄 mtpi.h
字号:
/***************************************************************************** @(#) mtpi.h,v 0.9.2.5 2007/02/13 14:05:28 brian Exp ----------------------------------------------------------------------------- Copyright (c) 2001-2007 OpenSS7 Corporation <http://www.openss7.com/> Copyright (c) 1997-2001 Brian F. G. Bidulock <bidulock@openss7.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; version 2 of the License. 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., 675 Mass Ave, Cambridge, MA 02139, USA. ----------------------------------------------------------------------------- U.S. GOVERNMENT RESTRICTED RIGHTS. If you are licensing this Software on behalf of the U.S. Government ("Government"), the following provisions apply to you. If the Software is supplied by the Department of Defense ("DoD"), it is classified as "Commercial Computer Software" under paragraph 252.227-7014 of the DoD Supplement to the Federal Acquisition Regulations ("DFARS") (or any successor regulations) and the Government is acquiring only the license rights granted herein (the license rights customarily provided to non-Government users). If the Software is supplied to any unit or agency of the Government other than DoD, it is classified as "Restricted Computer Software" and the Government's rights in the Software are defined in paragraph 52.227-19 of the Federal Acquisition Regulations ("FAR") (or any successor regulations) or, in the cases of NASA, in paragraph 18.52.227-86 of the NASA Supplement to the FAR (or any successor regulations). ----------------------------------------------------------------------------- Commercial licensing and support of this software is available from OpenSS7 Corporation at a fee. See http://www.openss7.com/ ----------------------------------------------------------------------------- Last Modified 2007/02/13 14:05:28 by brian ----------------------------------------------------------------------------- mtpi.h,v Revision 0.9.2.5 2007/02/13 14:05:28 brian - corrected ulong and long for 32-bit compat *****************************************************************************/#ifndef __SS7_MTPI_H__#define __SS7_MTPI_H__#ident "@(#) mtpi.h,v openss7-0_9_2_E(0.9.2.5) Copyright (c) 2001-2007 OpenSS7 Corporation."/* This file can be processed by doxygen(1). */#define MTP_VERSION_1 0x10#define MTP_CURRENT_VERSION MTP_VERSION_1typedef int32_t mtp_long;typedef u_int32_t mtp_ulong;typedef u_int16_t mtp_ushort;typedef u_int8_t mtp_uchar;#define MTP_BIND_REQ 1+120 /* Bind to an MTP-SAP */#define MTP_UNBIND_REQ 2+120 /* Unbind from an MTP-SAP */#define MTP_CONN_REQ 3+120 /* Connect to a remote MTP-SAP */#define MTP_DISCON_REQ 4+120 /* Disconnect from a remote MTP-SAP */#define MTP_ADDR_REQ 5+120 /* Address service */#define MTP_INFO_REQ 6+120 /* Information service */#define MTP_OPTMGMT_REQ 7+120 /* Options management service */#define MTP_TRANSFER_REQ 8+120 /* MTP data transfer request */#define MTP_OK_ACK 9+120 /* Positive acknowledgement */#define MTP_ERROR_ACK 10+120 /* Negative acknowledgement */#define MTP_BIND_ACK 11+120 /* Bind acknowledgement */#define MTP_ADDR_ACK 12+120 /* Address acknowledgement */#define MTP_INFO_ACK 13+120 /* Information acknowledgement */#define MTP_OPTMGMT_ACK 14+120 /* Options management acknowledgement */#define MTP_TRANSFER_IND 15+120 /* MTP data transfer indication */#define MTP_PAUSE_IND 16+120 /* MTP pause (stop) indication */#define MTP_RESUME_IND 17+120 /* MTP resume (start) indication */#define MTP_STATUS_IND 18+120 /* MTP status indication */#define MTP_RESTART_BEGINS_IND 19+120 /* MTP restart begins (impl. dep.) */#define MTP_RESTART_COMPLETE_IND 20+120 /* MTP restart complete (impl. dep.) *//* * Interface States */#define MTPS_UNBND 0UL#define MTPS_WACK_BREQ 1UL#define MTPS_IDLE 2UL#define MTPS_WACK_CREQ 3UL#define MTPS_WCON_CREQ 4UL#define MTPS_CONNECTED 5UL#define MTPS_WACK_UREQ 6UL#define MTPS_WACK_DREQ6 7UL#define MTPS_WACK_DREQ9 8UL#define MTPS_WACK_OPTREQ 9UL#define MTPS_WREQ_ORDREL 10UL#define MTPS_WIND_ORDREL 11UL#define MTPS_WRES_CIND 12UL#define MTPS_UNUSABLE 0xffffffffUL#ifndef __HAVE_MTP_ADDR#ifndef AF_MTP#define AF_MTP 0#endiftypedef struct mtp_addr { unsigned int family __attribute__ ((packed)); unsigned short int ni __attribute__ ((packed)); /* network identifier */ unsigned short int si __attribute__ ((packed)); /* service indicator */ unsigned int pc __attribute__ ((packed)); /* point code */} mtp_addr_t;#define __HAVE_MTP_ADDR#endif/* * MTP_INFO_REQ, M_PROTO */typedef struct MTP_info_req { mtp_ulong mtp_primitive; /* always MTP_INFO_REQ */} MTP_info_req_t;/* * MTP_INFO_ACK, M_PCPROTO */typedef struct MTP_info_ack { mtp_ulong mtp_primitive; /* always MTP_INFO_ACK */ mtp_ulong mtp_msu_size; /* maximum MSU size for guaranteed delivery */ mtp_ulong mtp_addr_size; /* maximum address size */ mtp_ulong mtp_addr_length; /* address length */ mtp_ulong mtp_addr_offset; /* address offset */ mtp_ulong mtp_current_state; /* current interface state */ mtp_ulong mtp_serv_type; /* service type */ mtp_ulong mtp_version; /* version of interface */} MTP_info_ack_t;#define M_COMS 1 /* Connection-mode MTP service supported */#define M_CLMS 2 /* Connection-less MTP service supported *//* * MTP_ADDR_REQ, M_PCPROTO */typedef struct MTP_addr_req { mtp_ulong mtp_primitive; /* always MTP_ADDR_REQ */} MTP_addr_req_t;/* * MTP_ADDR_ACK, M_PCPROTO */typedef struct MTP_addr_ack { mtp_ulong mtp_primitive; /* always MTP_ADDR_ACK */ mtp_ulong mtp_loc_length; /* length of local MTP address */ mtp_ulong mtp_loc_offset; /* offset of local MTP address */ mtp_ulong mtp_rem_length; /* length of remote MTP address */ mtp_ulong mtp_rem_offset; /* offset of remote MTP address */} MTP_addr_ack_t;/* * MTP_BIND_REQ, M_PROTO */typedef struct MTP_bind_req { mtp_ulong mtp_primitive; /* always MTP_BIND_REQ */ mtp_ulong mtp_addr_length; /* length of MTP address */ mtp_ulong mtp_addr_offset; /* offset of MTP address */ mtp_ulong mtp_bind_flags; /* bind flags */} MTP_bind_req_t;/* * MTP_BIND_ACK, M_PCPROTO */typedef struct MTP_bind_ack { mtp_ulong mtp_primitive; /* always MTP_BIND_ACK */ mtp_ulong mtp_addr_length; /* length of bound MTP address */ mtp_ulong mtp_addr_offset; /* offset of bound MTP address */} MTP_bind_ack_t;/* * MTP_UNBIND_REQ, M_PROTO */typedef struct MTP_unbind_req { mtp_ulong mtp_primitive; /* always MTP_UNBIND_REQ */} MTP_unbind_req_t;/* * MTP_CONN_REQ, M_PROTO */typedef struct MTP_conn_req { mtp_ulong mtp_primitive; /* always MTP_CONN_REQ */ mtp_ulong mtp_addr_length; /* length of MTP address to connect */ mtp_ulong mtp_addr_offset; /* offset of MTP address to connect */ mtp_ulong mtp_conn_flags; /* connect flags */} MTP_conn_req_t;/* * MTP_DISCON_REQ, M_PROTO, M_PCPROTO */typedef struct MTP_discon_req { mtp_ulong mtp_primitive; /* always MTP_DISCON_REQ */} MTP_discon_req_t;/* * MTP_OPTMGMT_REQ, M_PROTO or M_PCPROTO */typedef struct MTP_optmgmt_req { mtp_ulong mtp_primitive; /* always MTP_OPTMGMT_REQ */ mtp_ulong mtp_opt_length; /* length of options */ mtp_ulong mtp_opt_offset; /* offset of options */ mtp_ulong mtp_mgmt_flags; /* management flags */} MTP_optmgmt_req_t;#define MTP_DEFAULT 0UL#define MTP_CHECK 1UL#define MTP_NEGOTIATE 2UL#define MTP_CURRENT 3UL/* * MTP_OPTMGMT_ACK, M_PCPROTO */typedef struct MTP_optmgmt_ack { mtp_ulong mtp_primitive; /* always MTP_OPTMGMT_ACK */ mtp_ulong mtp_opt_length; /* length of options */ mtp_ulong mtp_opt_offset; /* offset of options */ mtp_ulong mtp_mgmt_flags; /* management flags */} MTP_optmgmt_ack_t;/* * MTP_OK, MTP_ERROR, M_PCPROTO */typedef struct MTP_ok_ack { mtp_ulong mtp_primitive; /* always MTP_OK_ACK */ mtp_ulong mtp_correct_prim; /* correct primitive */} MTP_ok_ack_t;typedef struct MTP_error_ack { mtp_ulong mtp_primitive; /* always MTP_ERROR_ACK */ mtp_ulong mtp_error_primitive; /* primitive in error */ mtp_ulong mtp_mtpi_error; /* MTP interface error */ mtp_ulong mtp_unix_error; /* UNIX error */} MTP_error_ack_t;#define MSYSERR 0UL#define MACCESS 1UL#define MBADADDR 2UL#define MNOADDR 3UL#define MBADPRIM 4UL#define MOUTSTATE 5UL#define MNOTSUPP 6UL#define MBADFLAG 7UL#define MBADOPT 8UL/* * MTP_TRANSFER_REQ, M_PROTO */typedef struct MTP_transfer_req { mtp_ulong mtp_primitive; /* always MTP_TRANSFER_REQ */ mtp_ulong mtp_dest_length; /* length of destination address */ mtp_ulong mtp_dest_offset; /* offset of destination address */ mtp_ulong mtp_mp; /* message priority */ mtp_ulong mtp_sls; /* signalling link selection */} MTP_transfer_req_t;/* * MTP_TRANSFER_IND, M_PROTO */typedef struct MTP_transfer_ind { mtp_ulong mtp_primitive; /* always MTP_TRANSFER_IND */ mtp_ulong mtp_srce_length; /* length of source address */ mtp_ulong mtp_srce_offset; /* offset of source address */ mtp_ulong mtp_mp; /* message priority */ mtp_ulong mtp_sls; /* signalling link selection */} MTP_transfer_ind_t;/* * MTP_PAUSE_IND, M_PCPROTO */typedef struct MTP_pause_ind { mtp_ulong mtp_primitive; /* always MTP_PAUSE_IND */ mtp_ulong mtp_addr_length; /* length of affected MTP address */ mtp_ulong mtp_addr_offset; /* offset of affected MTP address */} MTP_pause_ind_t;/* * MTP_RESUME_IND, M_PCPROTO */typedef struct MTP_resume_ind { mtp_ulong mtp_primitive; /* always MTP_RESUME_IND */ mtp_ulong mtp_addr_length; /* length of affected MTP address */ mtp_ulong mtp_addr_offset; /* offset of affected MTP address */} MTP_resume_ind_t;/* * MTP_STATUS_IND, M_PCPROTO */typedef struct MTP_status_ind { mtp_ulong mtp_primitive; /* always MTP_STATUS_IND */ mtp_ulong mtp_addr_length; /* length of affected MTP address */ mtp_ulong mtp_addr_offset; /* offset of affected MTP address */ mtp_ulong mtp_type; /* type */ mtp_ulong mtp_status; /* status */} MTP_status_ind_t;/* Type for MTP_STATUS_IND */#define MTP_STATUS_TYPE_CONG 0x00 /* MTP-STATUS refers to congestion */#define MTP_STATUS_TYPE_UPU 0x01 /* MTP-STATUS refers to user part unavailability */#define MTP_STATUS_TYPE_RSTR 0x02 /* MTP-STATUS refers to restriction *//* Status for MTP_STATUS_IND, with MTP_STATUS_TYPE_UPU */#define MTP_STATUS_UPU_UNKNOWN 0x01 /* User part unavailable: unknown */#define MTP_STATUS_UPU_UNEQUIPPED 0x02 /* User part unavailable: unequipped remote user. */#define MTP_STATUS_UPU_INACCESSIBLE 0x03 /* User part unavailable: inaccessible remote user. *//* Status for MTP_STATUS_IND, with MTP_STATUS_TYPE_CONG */#define MTP_STATUS_CONGESTION_LEVEL0 0x00 /* Signalling network congestion level 0 */#define MTP_STATUS_CONGESTION_LEVEL1 0x01 /* Signalling network congestion level 1 */#define MTP_STATUS_CONGESTION_LEVEL2 0x02 /* Signalling network congestion level 2 */#define MTP_STATUS_CONGESTION_LEVEL3 0x03 /* Signalling network congestion level 3 */#define MTP_STATUS_CONGESTION 0x04 /* Signalling network congestion *//* * MTP_RESTART_BEGINS_IND, M_PCPROTO */typedef struct MTP_restart_begins_ind { mtp_ulong mtp_primitive; /* always MTP_RESTART_BEGINS_IND */} MTP_restart_begins_ind_t;/* * MTP_RESTART_COMPLETE_IND, M_PCPROTO */typedef struct MTP_restart_complete_ind { mtp_ulong mtp_primitive; /* always MTP_RESTART_COMPLETE_IND */} MTP_restart_complete_ind_t;union MTP_primitives { mtp_ulong mtp_primitive; MTP_info_req_t info_req; MTP_info_ack_t info_ack; MTP_addr_req_t addr_req; MTP_addr_ack_t addr_ack; MTP_bind_req_t bind_req; MTP_bind_ack_t bind_ack; MTP_unbind_req_t unbind_req; MTP_conn_req_t conn_req; MTP_discon_req_t discon_req; MTP_optmgmt_req_t optmgmt_req; MTP_optmgmt_ack_t optmgmt_ack; MTP_ok_ack_t ok_ack; MTP_error_ack_t error_ack; MTP_transfer_req_t transfer_req; MTP_transfer_ind_t transfer_ind; MTP_pause_ind_t pause_ind; MTP_resume_ind_t resume_ind; MTP_status_ind_t status_ind; MTP_restart_complete_ind_t restart_complete_ind;};typedef struct { mtp_ulong mtp_affected_dpc;} mtp_pause_ind_t;typedef struct { mtp_ulong mtp_affected_dpc;} mtp_resume_ind_t;/*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -