| #ifndef __IMS_DBG_H__ |
| #define __IMS_DBG_H__ |
| |
| #include "ims_interface_ap.h" |
| #include "volte_def.h" |
| #include "sip/inet_msg_def.h" |
| #include "sip/sip_status_code.h" |
| #include "sip/sip_msg_defs.h" |
| |
| #include "sdp/sdp_msg_api.h" |
| |
| #include "ims_dbg_enum.h" |
| #include "ims_dbg_struct.h" |
| |
| /****************************************************************************** |
| * |
| * Constants |
| * |
| *****************************************************************************/ |
| #define __IMS_EM_CCCI__ 0 |
| |
| |
| #define IMS_DBG_MAX_SIP_INFO_SIZE 8192 |
| #define IMS_DBG_TLV_TL_SIZE (IMS_DBG_TLV_TAG_SIZE+IMS_DBG_TLV_LEN_SIZE) |
| #define IMS_DBG_ROOT_TL_SIZE (IMS_DBG_TLV_TAG_SIZE+IMS_DBG_TLV_LEN_SIZE) |
| #define IMS_DBG_SEGMENT_SIZE (IMS_DBG_TLV_TAG_SIZE+IMS_DBG_TLV_LEN_SIZE) // segment: tag (2) + length=0 (2) |
| #define IMS_DBG_SEGMENT_VALUE_LEN 0 |
| |
| /* will be assign to response code if SIP message is request */ |
| #define IMS_DBG_INVALID_RSP_CODE 0 |
| /* will be assign to method type if SIP message is response */ |
| #define IMS_DBG_INVALID_METHOD_TYPE INET_METHOD_MAX |
| |
| #define IMS_DGB_VAR_LEN 0xFE |
| #define IMS_DBG_MAX_ROOT 6 |
| #define IMS_DBG_MAX_TLV 20 |
| |
| #define IMS_DBG_TLV_SET_T(tlv, t)\ |
| ((ims_dbg_tlv *)tlv)->tag = (UINT16)t; |
| |
| #define IMS_DBG_TLV_SET_L(tlv, l)\ |
| ((ims_dbg_tlv *)tlv)->len = (UINT16)l; |
| |
| #define IMS_DBG_TLV_SET_V(tlv, v)\ |
| ((ims_dbg_tlv *)tlv)->value_ptr = (UINT8 *)v; |
| |
| #define IMS_DBG_TLV_SET_TLV(tlv, t, l, v)\ |
| IMS_DBG_TLV_SET_T(tlv, t)\ |
| IMS_DBG_TLV_SET_L(tlv, l)\ |
| IMS_DBG_TLV_SET_V(tlv, v) |
| |
| #define IMS_DBG_NULL_CHECK_RETURN(_c_) if ((_c_ == NULL)) { ErrMsg(IMSUA_TRACE_ERROR_01216, #_c_); return; } |
| |
| /* EM defined struct value variable quick setup macro */ |
| #define IMS_DBG_EM_DEF_VALUE_SET(_ptr_, _elm_, _val_) \ |
| _ptr_->is_##_elm_##_valid = KAL_TRUE; \ |
| _ptr_->_elm_ = _val_; |
| |
| #define IMS_DBG_EM_DEF_VALUE_CLEAR(_ptr_, _elm_) \ |
| _ptr_->is_##_elm_##_valid = KAL_FALSE; \ |
| _ptr_->_elm_ = 0; |
| |
| /* EM defined struct string variable quick setup macro */ |
| #define IMS_DBG_EM_DEF_STR_SET(_dst_, _elm_, _src_, _len_) \ |
| _dst_->is_##_elm_##_valid = KAL_TRUE; \ |
| voip_snprintf((char*)_dst_->_elm_, _len_, "%s", _src_); |
| |
| #define IMS_DBG_EM_DEF_STR_CLEAR(_dst_, _elm_, _len_) \ |
| _dst_->is_##_elm_##_valid = KAL_FALSE; \ |
| memset(_dst_->_elm_, 0, _len_); |
| |
| /* EM defined struct array variable quick setup macro */ |
| #define IMS_DBG_EM_DEF_ARRAY_SET(_dst_, _elm_, _src_, _len_) \ |
| _dst_->is_##_elm_##_valid = KAL_TRUE; \ |
| memcpy(_dst_->_elm_, _src_, _len_); |
| |
| #define IMS_DBG_EM_DEF_ARRAY_CLEAR(_dst_, _elm_, _len_) \ |
| _dst_->is_##_elm_##_valid = KAL_FALSE; \ |
| memset(_dst_->_elm_, 0, _len_); |
| |
| /****************************************************************************** |
| * |
| * Definitions |
| * |
| *****************************************************************************/ |
| typedef struct { |
| UINT16 tag; |
| UINT16 len; |
| UINT8 *value_ptr; |
| } ims_dbg_tlv; |
| |
| |
| typedef struct { |
| UINT8 root_cnt; |
| UINT8 obj_cnt; |
| UINT16 root_tag[IMS_DBG_MAX_ROOT]; |
| ims_dbg_tlv object[IMS_DBG_MAX_TLV]; |
| } ims_dbg_tlv_tbl; |
| |
| /* |
| * ROOT tag enum |
| */ |
| typedef enum { |
| IMS_DBG_ROOT_SIP_TAG, |
| IMS_DBG_ROOT_EM_TAG, |
| IMS_DBG_ROOT_SETTING_TAG, |
| IMS_DBG_ROOT_TAG_NUM |
| } ims_dbg_root_tag_enum; |
| |
| /* |
| * indication message ID enum (IMCB <- UAs) |
| */ |
| |
| /* |
| * request message ID enum (IMCB -> UAs -> VoLTE Stack) |
| */ |
| typedef enum { |
| IMS_DBG_REQ_START_CODE = 1000000, |
| //MSG_ID_IMS_DBG_SETTING_REQ, |
| IMS_DBG_REQ_MSG_NUM |
| } ims_dbg_req_msg_enum; |
| |
| |
| typedef enum { |
| IMS_DBG_SIP_TIME_TAG, |
| IMS_DBG_SIP_SRC_IP_TAG, |
| IMS_DBG_SIP_DST_IP_TAG, |
| IMS_DBG_SIP_DIR_TAG, |
| IMS_DBG_SIP_BEARER_TYPE_TAG, |
| IMS_DBG_SIP_TP_TAG, |
| IMS_DBG_SIP_TAG, |
| IMS_DBG_SIP_MSG_TYPE_TAG, |
| IMS_DBG_SIP_METHOD_TAG, |
| IMS_DBG_SIP_RESP_CODE_TAG, |
| IMS_DBG_SIP_SEGMENT_TAG, |
| IMS_DBG_SIP_TS_TAG, |
| IMS_DBG_SIP_CSEQ_TAG, |
| |
| /* add here */ |
| |
| IMS_DBG_SIP_INFO_TAG_NUM |
| } ims_dbg_sip_info_tag_enum; |
| |
| |
| /* ------------------------------------------------ */ |
| /* Define transport protocol sending SIP message */ |
| /* ------------------------------------------------ */ |
| typedef inet_method_enum ims_dbg_method_enum; |
| |
| /* ------------------------------------------------ */ |
| /* Define transport protocol sending SIP message */ |
| /* ------------------------------------------------ */ |
| typedef sip_transport_enum ims_dbg_transport_enum; |
| |
| /* ------------------------------------------------ */ |
| /* Define SIP message direction */ |
| /* ------------------------------------------------ */ |
| typedef enum { |
| IMS_DBG_DIR_MO = 0x00, |
| IMS_DBG_DIR_MT = 0x01, |
| IMS_DBG_DIR_MAX, |
| } ims_dbg_direction_enum; |
| |
| /* ------------------------------------------------ */ |
| /* Define SIP message type */ |
| /* ------------------------------------------------ */ |
| typedef enum { |
| IMS_DBG_MSG_TYPE_REQUEST = 0x00, |
| IMS_DBG_MSG_TYPE_RESPONSE = 0x01, |
| IMS_DBG_MSG_TYPE_MAX, |
| } ims_dbg_msg_type_enum; |
| |
| #if 0 /* move to sync ims_dbg_def.h */ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| /* under construction !*/ |
| #else |
| typedef ims_dbg_sip_info_ind_struct imcb_ua_dbg_sip_info_struct; |
| #endif |
| |
| |
| /* ------------------------------------------------ * |
| * ATT Diagnostic Metric |
| * ------------------------------------------------ */ |
| /* |
| * ATT DM Type Enum |
| */ |
| typedef enum { |
| IMS_DBG_ATT_DM_TYPE_MM_START = 0x000, |
| IMS_DBG_ATT_DM_TYPE_MM01, |
| IMS_DBG_ATT_DM_TYPE_MM02, |
| IMS_DBG_ATT_DM_TYPE_MM03, |
| IMS_DBG_ATT_DM_TYPE_MM04, |
| |
| IMS_DBG_ATT_DM_TYPE_SP_START = 0x100, |
| IMS_DBG_ATT_DM_TYPE_SPRX, |
| IMS_DBG_ATT_DM_TYPE_SPTX, |
| |
| IMS_DBG_ATT_DM_TYPE_INVALID = 0xFFFFFFFF, |
| } ims_dbg_att_dm_type_enum; |
| |
| /* |
| * ATT Reg Type Enum |
| */ |
| typedef enum { |
| IMS_DBG_ATT_REG_TYPE_UNKNOWN = 0, |
| IMS_DBG_ATT_REG_TYPE_INITIAL, |
| IMS_DBG_ATT_REG_TYPE_REREG, |
| IMS_DBG_ATT_REG_TYPE_DEREG, |
| IMS_DBG_ATT_REG_TYPE_REAUTH, |
| IMS_DBG_ATT_REG_TYPE_INVALID = 0xFFFFFFFF, |
| } ims_dbg_att_reg_type_enum; |
| |
| /* |
| * ATT Reg Direction Enum |
| */ |
| typedef enum { |
| IMS_DBG_ATT_REG_DIR_UNKNOWN = 0, |
| IMS_DBG_ATT_REG_DIR_UEAT, |
| IMS_DBG_ATT_REG_DIR_NETWORK, |
| IMS_DBG_ATT_REG_DIR_INVALID = 0xFFFFFFFF, |
| } ims_dbg_att_reg_dir_enum; |
| |
| /* |
| * ATT Reg State Enum |
| */ |
| typedef enum { |
| IMS_DBG_ATT_REG_STATE_UNKNOWN = 0, |
| IMS_DBG_ATT_REG_STATE_NOT_REGISTERED, |
| IMS_DBG_ATT_REG_STATE_REGISTERING, |
| IMS_DBG_ATT_REG_STATE_AUTH_CHALLENGE, |
| IMS_DBG_ATT_REG_STATE_AUTH_REGISTER, |
| IMS_DBG_ATT_REG_STATE_REGISTERED, |
| IMS_DBG_ATT_REG_STATE_NOTIFIED, |
| IMS_DBG_ATT_REG_STATE_TIMEOUT, |
| IMS_DBG_ATT_REG_STATE_INVALID = 0xFFFFFFFF, |
| } ims_dbg_att_reg_state_enum; |
| |
| /* |
| * ATT SIP Result Enum |
| */ |
| typedef enum { |
| IMS_DBG_ATT_SIP_RESULT_UNKNOWN = 0, |
| IMS_DBG_ATT_SIP_RESULT_TIMEOUT, |
| IMS_DBG_ATT_SIP_RESULT_LOST_RAN, |
| /* remaining part is assigned by number, e.g. 200 OK = 200 */ |
| IMS_DBG_ATT_SIP_RESULT_INVALID = 0xFFFFFFFF, |
| } ims_dbg_att_sip_result_enum; |
| |
| typedef enum { |
| IMS_DBG_ACCESS_RAT_CELLULAR, |
| IMS_DBG_ACCESS_RAT_WIFI, |
| IMS_DBG_ACCESS_RAT_NUM |
| } ims_dbg_access_rat_enum; |
| |
| |
| /* ------------------------------------------------ * |
| * CMCC IMS EVENT INFO Metric (for collecting KPI statistics) |
| * ------------------------------------------------ * |
| */ |
| typedef enum |
| { |
| EVENT_INFO_NONE = 0, |
| |
| /* MO Call */ |
| EVENT_INFO_MO_CALL_STARTED = 1, /* Send the initial INVITE */ |
| EVENT_INFO_MO_CALL_ALERTED, /* Receive 183 (with early media), otherwise receive 180, otherwise receive 200 OK for INVITE*/ |
| EVENT_INFO_MO_CALL_ESTABLISHED, /* Receive 200 OK for INVITE */ |
| EVENT_INFO_MO_CALL_END, /* Normal End (local/remote user triggered) for MO Call */ |
| EVENT_INFO_MO_CALL_DROPPED, /* Unexpected End for MO Call */ |
| EVENT_INFO_MO_CALL_FAILED, /* Unexpected failure during MO call establishment */ |
| EVENT_INFO_MO_CALL_EARLY_RELEASE, /* Send CANCEL before having received 180 */ |
| |
| /* MT Call */ |
| EVENT_INFO_MT_CALL_STARTED = 51, /* Receive the initial INVITE*/ |
| EVENT_INFO_MT_CALL_ALERTED, /* Send 180 Ringing */ |
| EVENT_INFO_MT_CALL_ESTABLISHED, /* Send 200 OK for INVITE */ |
| EVENT_INFO_MT_CALL_END, /* Normal End (local/remote user triggered) for MT Call */ |
| EVENT_INFO_MT_CALL_DROPPED, /* Unexpected End for MT Call */ |
| EVENT_INFO_MT_CALL_FAILED, /* Unexpected failure during MT call establishment */ |
| EVENT_INFO_MT_CALL_EARLY_RELEASE, /* Receive CANCEL before having sent 180 */ |
| |
| /* SMS */ |
| EVENT_INFO_MT_SMS_FAILED = 201, /* MT IMS SMS directly rejected by SMS UA */ |
| |
| /* Registration */ |
| EVENT_INFO_INIT_REG_REQ = 501, |
| EVENT_INFO_INIT_REG_401_RECEIVED, |
| EVENT_INFO_INIT_REG_REQ_WITH_IPSEC, |
| EVENT_INFO_INIT_REG_COMPLETE, |
| EVENT_INFO_INIT_REG_FAILED, |
| EVENT_INFO_REREG_REG_REQ, |
| EVENT_INFO_REREG_REG_401_RECEIVED, |
| EVENT_INFO_REREG_REG_REQ_WITH_NEW_IPSEC, |
| EVENT_INFO_REREG_REG_COMPLETE, |
| EVENT_INFO_REREG_REG_FAILED, |
| }ims_dbg_ims_event_info_enum; |
| |
| typedef enum { |
| EVENT_FAILURE_CAUSE_NONE = 0, |
| |
| /* Call */ |
| EVENT_FAILURE_CAUSE_NOT_USER_TRIGGERD = 1, |
| EVENT_FAILURE_CAUSE_RTP_RTCP_Timeout = 2, |
| EVENT_FAILURE_CAUSE_BEARER_LOST = 3, |
| EVENT_FAILURE_CAUSE_NOT_ALERTED = 4, |
| |
| /* SMS */ |
| EVENT_FAILURE_CAUSE_IMS_OVER_SMS_DISABLED = 51, |
| EVENT_FAILURE_CAUSE_SMS_OBJ_CREATED_FAILED = 52, |
| EVENT_FAILURE_CAUSE_SMS_MEDIA_TYPE_NOT_SUPPORTED = 53, |
| |
| /* MISC */ |
| EVENT_FAILURE_CAUSE_IMS_UNREGISTERED = 101, |
| }ims_dbg_ims_event_info_failure_cause_enum; |
| |
| #endif /* __IMS_DBG_H__ */ |