apierr.h
资源名称:h323.zip [点击查看]
上传用户:hnnddl
上传日期:2007-01-06
资源大小:3580k
文件大小:8k
源码类别:
IP电话/视频会议
开发平台:
WINDOWS
- /*
- * $Revision: 1.8 $
- * $Date: 1998/10/13 15:13:00 $
- */
- ////////////////////////////////////////////////////////////////
- // Copyright (c) 1996,97 Lucent Technologies //
- // All Rights Reserved //
- // //
- // THIS IS UNPUBLISHED //
- // PROPRIETARY SOURCE //
- // CODE OF Lucent Technologies //
- // //
- // The copyright notice above does not evidence any //
- // actual or intended publication of such source code//
- ////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////
- // File : apierr.h //
- // //
- // //
- // //
- // History: //
- // //
- // 2_Feb_1997 Created //
- // 30_Jun_1997 right shifts must be logical in Extrt err codes //
- // 08_Jul_1997 Merged Sun5 changes. //
- // 09_Jul_1997 Unixware compilation, changed all enums to //
- // unsigned #defines.. //
- // 15_Oct_1997 Added new PROT_CODE for software expiry. //
- // 1_July_1997 Added support for H.450. //
- // //
- /////////////////////////////////////////////////////////////////
- #if !defined(__APIERR_H__)
- #define __APIERR_H__
- // Format of return codes for all APIs
- //
- // 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
- // 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
- // +---+-----------+---------------+-------------------------------+
- // |Sev| Facility | Fac-Sub-Code | Code |
- // +---+-----------+---------------+-------------------------------+
- //
- // where
- //
- // Sev - is the severity code (2 bits)
- //
- // 00 - Success
- // 01 - Informational
- // 10 - Warning
- // 11 - Error
- //
- // R - is a reserved bit (2 bits)
- //
- // Facility - is the facility code ( 6 bits)
- //
- // Fac-Sub-Code - is the facility sub code.
- //
- // Code - is the facility's status code (16 bits)
- //
- #define PROT_MASK(BITS,SHIFT) (((1U << (BITS)) - 1) << (SHIFT))
- #define PROT_CODE_SHIFT 0U
- #define PROT_CODE_BITS 16U
- #define PROT_CODE_MASK PROT_MASK(PROT_CODE_BITS,
- PROT_CODE_SHIFT)
- #define PROT_FACILITY_SUB_CODE_SHIFT 16U
- #define PROT_FACILITY_SUB_CODE_BITS 8U
- #define PROT_FACILITY_SUB_CODE_MASK PROT_MASK(PROT_FACILITY_SUB_CODE_BITS,
- PROT_FACILITY_SUB_CODE_SHIFT)
- #define PROT_FACILITY_CODE_SHIFT 24U
- #define PROT_FACILITY_CODE_BITS 6U
- #define PROT_FACILITY_CODE_MASK PROT_MASK(PROT_FACILITY_CODE_BITS,
- PROT_FACILITY_CODE_SHIFT)
- #define PROT_SEVERITY_SHIFT 30U
- #define PROT_SEVERITY_BITS 2U
- #define PROT_SEVERITY_MASK PROT_MASK(PROT_SEVERITY_BITS,
- PROT_SEVERITY_SHIFT)
- // Severity codes
- #define PROT_SEVERITY_SUCCESS 0U
- #define PROT_SEVERITY_INFORMATIONAL 1U
- #define PROT_SEVERITY_WARNING 2U
- #define PROT_SEVERITY_ERROR 3U
- // Well known facility codes
- #define PROT_FACILITY_CODE_OS 1U
- #define PROT_FACILITY_CODE_TRANSPORT 2U
- #define PROT_FACILITY_CODE_RTP 3U
- #define PROT_FACILITY_CODE_Q931 4U
- #define PROT_FACILITY_CODE_H225 5U
- #define PROT_FACILITY_CODE_H245 6U
- #define PROT_FACILITY_CODE_GKTK 7U
- #define PROT_FACILITY_CODE_H450 8U
- // Well known facility sub codes
- // The sockets sub system like winsock etc...
- #define PROT_FACILITY_SUB_CODE_SOCKETS 1U
- // The connection manager...
- #define PROT_FACILITY_SUB_CODE_CONNMGR 2U
- // Basic H245 Signalling
- #define PROT_FACILITY_SUB_CODE_H245ENGINE 3U
- // H245 Signalling ASN independent API
- #define PROT_FACILITY_SUB_CODE_H245SIG 4U
- // RAS portion of H225
- #define PROT_FACILITY_SUB_CODE_H225RAS 5U
- // Call signalling portion of H225
- #define PROT_FACILITY_SUB_CODE_H225CS 6U
- // Generic functional protocol H.450.1
- #define PROT_FACILITY_SUB_CODE_H4501 7U
- // call transfer supp services H.450.2
- #define PROT_FACILITY_SUB_CODE_H4502 8U
- // call dervision supp services H.450.3
- #define PROT_FACILITY_SUB_CODE_H4503 9U
- // supplementary services ASN.1 level
- #define PROT_FACILITY_SUB_CODE_ASN1 10U
- // List of codes common to all modules
- #define PROT_CODE_PENDING 1U
- #define PROT_CODE_INVALID_PARAM 2U
- #define PROT_CODE_NOT_IMPLEMENTED 3U
- #define PROT_CODE_MEM_ALLOC_FAILED 4U
- #define PROT_CODE_UNKNOWN_ERROR 5U
- #define PROT_CODE_NOT_SUPPORTED 6U
- #define PROT_CODE_ITEM_NOT_PRESENT 7U
- #define PROT_CODE_BUFFER_TOO_SMALL 8U
- #define PROT_CODE_SOFTWARE_EXPIRED 9U
- #define PROT_CODE_MAX 256U
- #define PROT_STATUS(SEV,FAC,SUB,CODE)
- (((SEV) << PROT_SEVERITY_SHIFT) & PROT_SEVERITY_MASK) |
- (((FAC) << PROT_FACILITY_CODE_SHIFT) & PROT_FACILITY_CODE_MASK) |
- (((SUB) << PROT_FACILITY_SUB_CODE_SHIFT) & PROT_FACILITY_SUB_CODE_MASK) |
- (((CODE) << PROT_CODE_SHIFT) & PROT_CODE_MASK)
- #define PROT_SUCC(FAC,SUB,CODE) PROT_STATUS(PROT_SEVERITY_SUCCESS,
- FAC,SUB,CODE)
- #define PROT_WARN(FAC,SUB,CODE) PROT_STATUS(PROT_SEVERITY_WARNING,
- FAC,SUB,CODE)
- #define PROT_INFO(FAC,SUB,CODE) PROT_STATUS(PROT_SEVERITY_INFORMATIONAL,
- FAC,SUB,CODE)
- #define PROT_ERR(FAC,SUB,CODE) PROT_STATUS(PROT_SEVERITY_ERROR,
- FAC,SUB,CODE)
- #define PROT_GET_CODE(STATUS)
- ((unsigned int)((STATUS) & PROT_CODE_MASK) >> PROT_CODE_SHIFT)
- #define PROT_EXTRACT_CODES(STATUS,LSEV,LFAC,LSUB,LCODE)
- {
- (LSEV) = ((unsigned int)((STATUS) & PROT_SEVERITY_MASK) >>
- PROT_SEVERITY_SHIFT);
- (LFAC) = ((unsigned int)((STATUS) & PROT_FACILITY_CODE_MASK) >>
- PROT_FACILITY_CODE_SHIFT);
- (LSUB) = ((unsigned int)((STATUS) & PROT_FACILITY_SUB_CODE_MASK) >>
- PROT_FACILITY_SUB_CODE_SHIFT);
- (LCODE) = ((unsigned int)((STATUS) & PROT_CODE_MASK) >> PROT_CODE_SHIFT);
- }
- #define PROT_IS_SUCCESS(STATUS)
- ((((STATUS) & PROT_SEVERITY_MASK) >> PROT_SEVERITY_SHIFT)
- == PROT_SEVERITY_SUCCESS)
- #define PROT_IS_PENDING(STATUS)
- ((((STATUS) & PROT_CODE_MASK) >> PROT_CODE_SHIFT) == PROT_CODE_PENDING)
- #define PROT_IS_ERROR(STATUS)
- ((((STATUS) & PROT_SEVERITY_MASK) >> PROT_SEVERITY_SHIFT)
- == PROT_SEVERITY_ERROR)
- typedef unsigned int ProtReturnCode;
- // Various additional logging levels we use...
- #define LOG_FLAG_DUMP_PACKET (1U << 31U)
- // Flag to control dumping of objects like Q931Message, Q931IE etc.
- #define LOG_FLAG_DUMP_OBJECT (1U << 30U)
- // Names under which various api classes log debugging information.
- #define LOG_NAME_H225RASASN1 "H225RASASN1"
- #define LOG_NAME_H225CSASN1 "H225CSASN1"
- #define LOG_NAME_H245ASN1 "H245ASN1"
- #define LOG_NAME_H225RAS "H225RAS"
- #define LOG_NAME_H225Q931CLIENT "H225Q931CLIENT"
- #define LOG_NAME_Q931ENGINE "Q931ENGINE"
- #define LOG_NAME_Q931IE "Q931IE"
- #define LOG_NAME_Q931MESSAGE "Q931MESSAGE"
- #define LOG_NAME_H225CSPROTOCOL "H225CSPROTOCOL"
- #define LOG_NAME_H245CLIENT "H245CLIENT"
- #define LOG_NAME_H245ENGINE "H245ENGINE"
- #define LOG_NAME_H245CODEC "H245CODEC"
- #define LOG_NAME_H245PROTOCOL "H245PROTOCOL"
- #define LOG_NAME_RTPSESSION "RTPSESSION"
- #define LOG_NAME_RTPPACKET "RTPPACKET"
- #define LOG_NAME_RTCPPACKET "RTCPPACKET"
- #define LOG_NAME_RTPENDPOINTINFO "RTPENDPOINTINFO"
- #define LOG_NAME_SOCKTRANS "SOCKTRANS"
- #define LOG_NAME_SOCKTHREAD "SOCKTHREAD"
- #define LOG_NAME_CONNMGR "CONNECTIONMANAGER"
- #define LOG_NAME_H450ASN1 "H450ASN1"
- #define LOG_NAME_H450CALLTR "H450CALLTRANSFER"
- #define LOG_NAME_H450CALLDR "H450CALLDIVERSION"
- #endif //__APIERR_H__