OpenSS7 SS7 for the Common Man |
© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved. |
||||||||||||||||||||||||||
Home | Overview | Status | News | Documentation | Resources | About | |||||||||||||||||||||
File /code/strss7/drivers/ua/ua_msg.h#ifndef __UA_MSG_H__ #define __UA_MSG_H__ #ident "@(#) $RCSfile: ua_msg.h,v $ $Name: $($Revision: 0.8.2.1 $) $Date: 2002/10/18 02:26:20 $" /* * ========================================================================= * * SCTP USER ADAPTATION LAYER MESSAGE DEFINITIONS:- * * ========================================================================= */ #define UA_VERSION 1 #define UA_PAD4(__len) (((__len)+3)&~0x3) #define UA_MHDR(__version, __spare, __class, __type) \ (__constant_htonl(((__version)<<24)|((__spare)<<16)|((__class)<<8)|(__type))) #define UA_MSG_VERS(__hdr) ((ntohl(__hdr)>>24)&0xff) #define UA_MSG_CLAS(__hdr) ((ntohl(__hdr)>> 8)&0xff) #define UA_MSG_TYPE(__hdr) ((ntohl(__hdr)>> 0)&0xff) /* * MESSAGE CLASES:- */ #define UA_CLASS_MGMT 0x00 /* UA Management (MGMT) Message */ #define UA_CLASS_XFER 0x01 /* M3UA Data transfer messages */ #define UA_CLASS_SNMM 0x02 /* Signalling Network Mgmt (SNM) Msgs */ #define UA_CLASS_ASPS 0x03 /* ASP State Maint. (ASPSM) Messages */ #define UA_CLASS_ASPT 0x04 /* ASP Traffic Maint. (ASPTM) Messages */ #define UA_CLASS_Q921 0x05 /* Q.931 user part messages */ #define UA_CLASS_MAUP 0x06 /* M2UA Messages */ #define UA_CLASS_CNLS 0x07 /* SUA Connectionless Messages */ #define UA_CLASS_CONS 0x08 /* SUA Connection-Oriented Messages */ #define UA_CLASS_RKMM 0x09 /* Routing Key Management (RKM) Msgs */ #define UA_CLASS_TDHM 0x0a /* TUA Dialong Handling Message */ #define UA_CLASS_TCHM 0x0b /* TUA Component Handling Message */ #define UA_CLASS_LAST 0x0b /* * MESSAGES DEFINED IN EACH CLASS:- */ #define UA_MGMT_ERR UA_MHDR(UA_VERSION, 0, UA_CLASS_MGMT, 0x00) #define UA_MGMT_NTFY UA_MHDR(UA_VERSION, 0, UA_CLASS_MGMT, 0x01) #define UA_MGMT_LAST 0x01 #define UA_SNMM_DUNA UA_MHDR(UA_VERSION, 0, UA_CLASS_SNMM, 0x01) #define UA_SNMM_DAVA UA_MHDR(UA_VERSION, 0, UA_CLASS_SNMM, 0x02) #define UA_SNMM_DAUD UA_MHDR(UA_VERSION, 0, UA_CLASS_SNMM, 0x03) #define UA_SNMM_SCON UA_MHDR(UA_VERSION, 0, UA_CLASS_SNMM, 0x04) #define UA_SNMM_DUPU UA_MHDR(UA_VERSION, 0, UA_CLASS_SNMM, 0x05) #define UA_SNMM_DRST UA_MHDR(UA_VERSION, 0, UA_CLASS_SNMM, 0x06) #define UA_SNMM_LAST 0x06 #define UA_ASPS_ASPUP_REQ UA_MHDR(UA_VERSION, 0, UA_CLASS_ASPS, 0x01) #define UA_ASPS_ASPDN_REQ UA_MHDR(UA_VERSION, 0, UA_CLASS_ASPS, 0x02) #define UA_ASPS_HBEAT_REQ UA_MHDR(UA_VERSION, 0, UA_CLASS_ASPS, 0x03) #define UA_ASPS_ASPUP_ACK UA_MHDR(UA_VERSION, 0, UA_CLASS_ASPS, 0x04) #define UA_ASPS_ASPDN_ACK UA_MHDR(UA_VERSION, 0, UA_CLASS_ASPS, 0x05) #define UA_ASPS_HBEAT_ACK UA_MHDR(UA_VERSION, 0, UA_CLASS_ASPS, 0x06) #define UA_ASPS_LAST 0x06 #define UA_ASPT_ASPAC_REQ UA_MHDR(UA_VERSION, 0, UA_CLASS_ASPT, 0x01) #define UA_ASPT_ASPIA_REQ UA_MHDR(UA_VERSION, 0, UA_CLASS_ASPT, 0x02) #define UA_ASPT_ASPAC_ACK UA_MHDR(UA_VERSION, 0, UA_CLASS_ASPT, 0x03) #define UA_ASPT_ASPIA_ACK UA_MHDR(UA_VERSION, 0, UA_CLASS_ASPT, 0x04) #define UA_ASPT_LAST 0x04 #define UA_RKMM_REG_REQ UA_MHDR(UA_VERSION, 0, UA_CLASS_RKMM, 0x01) #define UA_RKMM_REG_RSP UA_MHDR(UA_VERSION, 0, UA_CLASS_RKMM, 0x02) #define UA_RKMM_DEREG_REQ UA_MHDR(UA_VERSION, 0, UA_CLASS_RKMM, 0x03) #define UA_RKMM_DEREG_RSP UA_MHDR(UA_VERSION, 0, UA_CLASS_RKMM, 0x04) #define UA_RKMM_LAST 0x04 #define UA_MHDR_SIZE (sizeof(uint32_t)*2) #define UA_PHDR_SIZE (sizeof(uint32_t)) #define UA_MAUP_SIZE (UA_MHDR_SIZE + UA_PHDR_SIZE + sizeof(uint32_t)) #define UA_TAG_MASK (__constant_htonl(0xffff0000)) #define UA_LENGTH(__phdr) (htonl(__phdr)&0xffff) #define UA_SIZE(__phdr) (__constant_htonl(__phdr)&0xffff) #define UA_PHDR(__phdr, __length) \ (((__phdr)&UA_TAG_MASK)|htonl((__length)+sizeof(uint32_t))) /* * COMMON PARAMETERS:- * * Common parameters per draft-ietf-sigtran-m2ua-10.txt * Common parameters per draft-ietf-sigtran-m3ua-08.txt * Common parameters per draft-ietf-sigtran-sua-07.txt * Common parameters per rfc3057.txt * ------------------------------------------------------------------- */ #define UA_PARM_RESERVED UA_PHDR(0x0000,0) #define UA_PARM_IID UA_PHDR(0x0001,sizeof(uint32_t)) #define UA_PARM_IID_RANGE UA_PHDR(0x0002,0) /* m2ua-10 */ #define UA_PARM_DATA UA_PHDR(0x0003,0) /* sua-07 */ #define UA_PARM_IID_TEXT UA_PHDR(0x0003,0) #define UA_PARM_INFO UA_PHDR(0x0004,0) #define UA_PARM_APC UA_PHDR(0x0005,sizeof(uint32_t)) /* sua-07 */ #define UA_PARM_DLCI UA_PHDR(0x0005,sizeof(uint32_t)) /* rfc3057 */ #define UA_PARM_RC UA_PHDR(0x0006,sizeof(uint32_t)) #define UA_PARM_DIAG UA_PHDR(0x0007,0) #define UA_PARM_IID_RANGE1 UA_PHDR(0x0008,0) /* rfc3057 */ #define UA_PARM_HBDATA UA_PHDR(0x0009,0) #define UA_PARM_REASON UA_PHDR(0x000a,sizeof(uint32_t)) #define UA_PARM_TMODE UA_PHDR(0x000b,sizeof(uint32_t)) #define UA_PARM_ECODE UA_PHDR(0x000c,sizeof(uint32_t)) #define UA_PARM_STATUS UA_PHDR(0x000d,sizeof(uint32_t)) #define UA_PARM_ASPID UA_PHDR(0x000e,sizeof(uint32_t)) #define UA_PARM_PROT_DATA UA_PHDR(0x000e,sizeof(uint32_t)) /* rfc3057 */ #define UA_PARM_CONG_LEVEL UA_PHDR(0x000f,sizeof(uint32_t)) /* sua-07 */ #define UA_PARM_REL_REASON UA_PHDR(0x000f,sizeof(uint32_t)) /* rfc3057 */ #define UA_PARM_TEI_STATUS UA_PHDR(0x0010,sizeof(uint32_t)) /* rfc3057 */ /* * Somewhat common field values: */ #define UA_ECODE_INVALID_VERSION (0x01) #define UA_ECODE_INVALID_IID_OR_NTWK_APP (0x02) #define UA_ECODE_UNSUPPORTED_MESSAGE_CLASS (0x03) #define UA_ECODE_UNSUPPORTED_MESSAGE_TYPE (0x04) #define UA_ECODE_UNSUPPORTED_TRAFFIC_MODE (0x05) #define UA_ECODE_UNEXPECTED_MESSAGE (0x06) #define UA_ECODE_PROTOCOL_ERROR (0x07) #define UA_ECODE_UNSUPPORTED_IID_TYPE (0x08) #define UA_ECODE_INVALID_ROUTING_CONTEXT (0x08) #define UA_ECODE_INVALID_STREAM_IDENTIFIER (0x09) #define UA_ECODE_INVALID_PARAMETER_VALUE (0x0a) #define SUA_ECODE_UNEXPECTED_PARAMETER (0x0b) #define IUA_ECODE_UNRECOGNIZED_SAPI (0x0b) #define M2UA_ECODE_REFUSED_MANAGEMENT_BLOCKING (0x0b) #define M3UA_ECODE_REFUSED_MANAGEMENT_BLOCKING (0x0b) #define IUA_ECODE_INVALID_TEI_SAPI_COMBINATION (0x0c) #define SUA_ECODE_DUPLICATED_PARAMETER (0x0c) #define M3UA_ECODE_UNKNOWN_ROUTING_CONTEXT (0x0c) #define SUA_ECODE_ERROR_ASPID_REQUIRED (0x0d) #define M3UA_ECODE_INVALID_ASPID (0x0d) #define SUA_ECODE_ERROR_INVALID_ASPID (0x0d) #define SUA_ECODE_REFUSED_ASPID_REQUIRED (0x0d) #define UA_STATUS_AS_DOWN (0x00010001) #define UA_STATUS_AS_INACTIVE (0x00010002) #define UA_STATUS_AS_ACTIVE (0x00010003) #define UA_STATUS_AS_PENDING (0x00010004) #define UA_STATUS_AS_INSUFFICIENT_ASPS (0x00020001) #define UA_STATUS_ALTERNAT_ASP_ACTIVE (0x00020002) #define UA_STATUS_ASP_FAILURE (0x00020003) #define UA_STATUS_AS_MINIMUM_ASPS (0x00020004) #define UA_TMODE_OVERRIDE (0x1) #define UA_TMODE_LOADSHARE (0x2) #define UA_TMODE_BROADCAST (0x3) #define UA_TMODE_SB_OVERRIDE (0x4) #define UA_TMODE_SB_LOADSHARE (0x5) #define UA_TMODE_SB_BROADCAST (0x6) #define UA_RESULT_SUCCESS (0x00) #define UA_RESULT_FAILURE (0x01) /* * Stuff for generic parm decoding. */ typedef struct ua_parm { union { caddr_t cptr; /* address pointer for strings */ uint32_t *wptr; /* word pointer for fields */ } u; size_t len; /* length in message in bytes */ uint32_t val; /* value of first uint32_t */ } parm_t; #define UA_PARM_BASE 0x0001 typedef struct ua_parms { parm_t iid; parm_t iid_range; parm_t sua_data_iid_text; parm_t info; parm_t apc; parm_t rc; parm_t diag; parm_t iid_range1; parm_t hbdata; parm_t reason; parm_t tmode; parm_t ecode; parm_t status; parm_t aspid; parm_t cong_level; #define UA_PARM_MAX 14 } ua_parms_t; struct msg_class { int (**farr) (queue_t *, mblk_t *); uint last; }; #endif /* __UA_MSG_H__ */
|
|||||||||||||||||||||||||||
OpenSS7 SS7 for the Common Man |
Home | Overview | Status | News | Documentation | Resources | About | ||||||||||||||||||||
© Copyright 1997-2004,OpenSS7 Corporation, All Rights Reserved. |