/*****************************************************************************

 @(#) m3ua.h,v 0.8 2002/04/02 08:22:31 brian Exp

 -----------------------------------------------------------------------------

     Copyright (C) 1997-2002 OpenSS7 Corporation.  All Rights Reserved.


                                  PUBLIC LICENSE

     This license is provided without fee, provided that the above copy-
     right notice and this public license must be retained on all copies,
     extracts, compilations and derivative works.  Use or distribution of
     this work in a manner that restricts its use except as provided here
     will render this license void.

     The author(s) hereby waive any and all other restrictions in respect
     of their copyright in this software and its associated documentation.
     The authors(s) of this software place in the public domain any novel
     methods or processes which are embodied in this software.

     The author(s) undertook to write it for the sake of the advancement
     of the Arts and Sciences, but it is provided as is, and the author(s)
     will not take any responsibility in it.

 -----------------------------------------------------------------------------

 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 success regulations) or, in
 the cases of NASA, in paragraph 18.52.227-86 of the NASA Supplement to the FAR
 (or any successor regulations).

 -----------------------------------------------------------------------------

 Last Modified 2002/04/02 08:22:31 by brian

 *****************************************************************************/

#ifndef __SS7_M3UA_H__
#define __SS7_M3UA_H__

#ident "@(#) SS7preBetaRelease(0.8) Copyright (c) 1997-2002 OpenSS7 Corporation."

typedef unsigned long	m3ua_ulong;
typedef	unsigned short	m3ua_ushort;
typedef unsigned char	m3ua_uchar;

typedef struct m3ua_phdr {
	u16 tag;
	u16 len;
} m3ua_phdr_t;

#define M_TAG_NETWORK_APPEARANCE	1
#define	M_TAG_PROTOCOL_DATA		3
#define M_TAG_INFO_STRING		4
#define M_TAG_AFFECTED_DPC		5
#define M_TAG_ROUTING_CONTEXT		6
#define M_TAG_DIAGNOSTIC_INFORMATION	7
#define M_TAG_HEARTBEAT_DATA		8
#define M_TAG_UNAVAILABILITY_CAUSE	9
#define M_TAG_REASON			10
#define	M_TAG_TRAFFIC_MODE_TYPE		11
#define M_TAG_ERROR_CODE		12
#define	M_TAG_STATUS_TYPE		13
#define M_TAG_CONGESTED_INDICATIONS	14

typedef struct m3ua_msg {
	u8  vers;
	u8  res;
	u16 type;
	u32 len;
	m3ua_phdr_t ph[0];
} m3ua_msg_t;

#define M_VERSION_REL1   1

#define M_CLASS_MGMT	0x0000
#define M_CLASS_XFER	0x0100
#define	M_CLASS_SSNM	0x0200
#define M_CLASS_ASPSM	0x0300
#define M_CLASS_ASPTM	0x0400

#define M_TYPE_ERR		(0|M_CLASS_MGMT

#define M_TYPE_NTFY		(1|M_CLASS_XFER)
#define M_TYPE_DATA		(1|M_CLASS_XFER)

#define M_TYPE_DUNA		(1|M_CLASS_SSNM)
#define M_TYPE_DAVA		(2|M_CLASS_SSNM)
#define M_TYPE_DUAD		(3|M_CLASS_SSNM)
#define M_TYPE_SCON		(4|M_CLASS_SSNM)
#define M_TYPE_DUPU		(5|M_CLASS_SSNM)

#define	M_TYPE_UP		(1|M_CLASS_ASPSM)
#define	M_TYPE_DOWN		(2|M_CLASS_ASPSM)
#define	M_TYPE_BEAT		(3|M_CLASS_ASPSM)
#define	M_TYPE_UP_ACK		(4|M_CLASS_ASPSM)
#define	M_TYPE_DOWN_ACK		(5|M_CLASS_ASPSM)
#define	M_TYPE_BEAT_ACK		(6|M_CLASS_ASPSM)

#define M_TYPE_ACTIVE		(1|M_CLASS_ASPTM)
#define M_TYPE_INACTIVE		(2|M_CLASS_ASPTM)
#define M_TYPE_ACTIVE_ACK	(3|M_CLASS_ASPTM)
#define M_TYPE_INACTIVE_ACK	(4|M_CLASS_ASPTM)

#define M_CLASS_MASK	0xff00
#define	M_TYPE_MASK	0x00ff

/*
 *  LAYER MANAGEMENT PRIMITIVES
 */

#define M_T_STATUS_REQ
#define M_T_ESTABLISH_REQ
#define M_T_RELEASE_REQ
#define M_ASP_STATUS_REQ
#define M_ASP_UP_REQ
#define M_ASP_DOWN_REQ
#define M_ASP_ACTIVE_REQ
#define M_ASP_INACTIVE_REQ
#define M_AS_STATUS_REQ

#define M_T_STATUS_ACK
#define M_T_ESTABLISH_IND
#define M_T_RELEASE_IND
#define M_T_ESTABLISH_CON
#define M_T_RELEASE_CON
#define M_NOTIFY_IND
#define M_ERROR_IND
#define M_ASP_STATUS_CON
#define M_ASP_UP_CON
#define M_ASP_DOWN_CON
#define M_ASP_ACTIVE_CON
#define M_ASP_INACTIVE_CON
#define M_ASP_UP_IND
#define M_ASP_DOWN_IND
#define M_ASP_ACTIVE_IND
#define M_ASP_INACTIVE_IND
#define M_AS_ACTIVE_IND
#define M_AS_INACTIVE_IND
#define M_AS_DOWN_IND
#define M_AS_STATUS_ACK

#endif  /* __SS7_M3UA_H__ */

