yu.dong | c33b307 | 2024-08-21 23:14:49 -0700 | [diff] [blame^] | 1 | /***************************************************************************** |
| 2 | * Copyright Statement: |
| 3 | * -------------------- |
| 4 | * This software is protected by Copyright and the information contained |
| 5 | * herein is confidential. The software may not be copied and the information |
| 6 | * contained herein may not be used or disclosed except with the written |
| 7 | * permission of MediaTek Inc. (C) 2016 |
| 8 | * |
| 9 | * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| 10 | * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS (""MEDIATEK SOFTWARE"") |
| 11 | * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON |
| 12 | * AN ""AS-IS"" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| 13 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| 14 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| 15 | * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| 16 | * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| 17 | * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH |
| 18 | * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO |
| 19 | * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S |
| 20 | * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. |
| 21 | * |
| 22 | * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE |
| 23 | * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| 24 | * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| 25 | * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO |
| 26 | * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| 27 | * |
| 28 | * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE |
| 29 | * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF |
| 30 | * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND |
| 31 | * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER |
| 32 | * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC). |
| 33 | * |
| 34 | *****************************************************************************/ |
| 35 | #ifndef _VDMAPI_H_ |
| 36 | #define _VDMAPI_H_ |
| 37 | |
| 38 | /*---------------------------------------------------------------------------- |
| 39 | Include Files |
| 40 | ----------------------------------------------------------------------------*/ |
| 41 | #include "sysdefs.h" |
| 42 | #include "valapi.h" |
| 43 | |
| 44 | /*---------------------------------------------------------------------------- |
| 45 | Global Defines and Macros |
| 46 | ----------------------------------------------------------------------------*/ |
| 47 | #define VDM_STARTUP_SIGNAL EXE_SIGNAL_1 |
| 48 | #define VDM_STARTUP_SIGNAL2 EXE_SIGNAL_2 |
| 49 | |
| 50 | #define VDM_MAILBOX_CMD EXE_MAILBOX_1_ID |
| 51 | #define VDM_MAILBOX2_CMD EXE_MAILBOX_2_ID |
| 52 | |
| 53 | #define VDM_MAILBOX EXE_MESSAGE_MBOX_1 |
| 54 | #define VDM_DBM_MAILBOX EXE_MESSAGE_MBOX_2 |
| 55 | |
| 56 | #define MANUFACTURER "Fusion" |
| 57 | |
| 58 | #define MODULENAME "FW2770P" |
| 59 | #define CLIENTVERDOR "redbend" |
| 60 | #define CLIENTVERSION "1.2" |
| 61 | |
| 62 | #define SESSION_RETRY_INTERVAL 60000 /* 60 seconds*/ |
| 63 | #define MAX_NIA_RETRY_NUM 5 |
| 64 | #define MAX_HFA_RETRY_NUM 5 |
| 65 | #define MIP_PROFILE_ZERO 0 |
| 66 | #define MIP_PROFILE_ONE 1 |
| 67 | #define MAX_PROXY_ADD_LEN 100 |
| 68 | #define DEFAULT_PROXY_ADD "http://68.31.28.1:80" |
| 69 | |
| 70 | #define MAX_NIA_MSG_LEN 255 |
| 71 | |
| 72 | typedef enum |
| 73 | { |
| 74 | VDM_HFA_CEHCK_MSG, |
| 75 | VDM_WAP_PUSH_SMS_MSG, |
| 76 | VDM_CI_FUMO_MSG, |
| 77 | VDM_NIA_MSG, |
| 78 | VDM_CIDC_MSG, |
| 79 | VDM_CIPRL_MSG, |
| 80 | VDM_HFA_CIDC_MSG, |
| 81 | VDM_HFA_CIPRL_MSG, |
| 82 | VDM_HFA_CIFUMO_MSG, |
| 83 | VDM_FUMO_REPORT_MSG, |
| 84 | VDM_RTN_RESET_MSG, |
| 85 | |
| 86 | VDM_NET_MSG, |
| 87 | VDM_SOCKET_MSG, |
| 88 | VDM_DNS_MSG, |
| 89 | |
| 90 | VDM_SESSION_RETRY_TIMER_EXPIRED_MSG, |
| 91 | VDM_HFA_RETRY_TIMER_EXPIRED_MSG, |
| 92 | VDM_PRL_UPDATE_TIMER_EXPIRED_MSG, |
| 93 | VDM_DORM_TIMER_EXPIRED_MSG, |
| 94 | |
| 95 | VDM_GET_MOBILE_ID_RSP_MSG, |
| 96 | VDM_DBM_DATA_PRL_WRITE_MSG, |
| 97 | VDM_DBM_DATA_NAM_WRITE_ACK_MSG, |
| 98 | VDM_SET_ACTIVE_PROFILE_RSP_MSG, |
| 99 | VDM_GET_ACTIVE_PROFILE_RSP_MSG, |
| 100 | VDM_SET_PROFILE_DATA_RSP_MSG, |
| 101 | VDM_GET_PROFILE_DATA_RSP_MSG, |
| 102 | VDM_SET_SECURE_DATA_RSP_MSG, |
| 103 | VDM_GET_SECURE_DATA_RSP_MSG, |
| 104 | VDM_SET_MN_HA_AUTH_ALGO_RSP_MSG, |
| 105 | VDM_GET_MN_HA_AUTH_ALGO_RSP_MSG, |
| 106 | VDM_SET_MN_AAA_AUTH_ALGO_RSP_MSG, |
| 107 | VDM_GET_MN_AAA_AUTH_ALGO_RSP_MSG, |
| 108 | |
| 109 | VDM_SET_HYBRID_PREF_MODE_RSP_MSG, |
| 110 | VDM_SET_PRI_SEC_CH_RSP_MSG, |
| 111 | VDM_SET_RRP_TIMEOUT_RSP_MSG, |
| 112 | VDM_SET_NUM_REG_RETRIES_RSP_MSG, |
| 113 | VDM_SET_REG_BACKOFF_RSP_MSG, |
| 114 | VDM_SET_NUM_PROFILE_RSP_MSG, |
| 115 | VDM_SET_MIP_MODE_RSP_MSG, |
| 116 | VDM_SET_MN_HA_AUTH_RSP_MSG, |
| 117 | VDM_SET_MIP_STRING_PASkal_int16_RSP_MSG, |
| 118 | |
| 119 | VDM_NUM_MSG_IDS |
| 120 | }VdmMsgIdT; |
| 121 | |
| 122 | typedef enum |
| 123 | { |
| 124 | VDM_NO_SESSION, |
| 125 | VDM_CI_FUMO, |
| 126 | VDM_NIA, |
| 127 | VDM_CIDC, |
| 128 | VDM_CIPRL, |
| 129 | VDM_HFA_CIDC, |
| 130 | VDM_HFA_CIPRL, |
| 131 | VDM_HFA_CIFUMO |
| 132 | }VdmTriggerType; |
| 133 | |
| 134 | typedef PACKED_PREFIX struct |
| 135 | { |
| 136 | kal_uint32 ParamA; |
| 137 | kal_int32 ParamB; |
| 138 | } PACKED_POSTFIX DmMsgT; |
| 139 | |
| 140 | typedef PACKED_PREFIX struct |
| 141 | { |
| 142 | kal_uint8 NumFields; /* Length of data in octets */ |
| 143 | kal_uint8 Char[ VAL_SMS_MAX_USERDATA_LENGTH ]; /* User Data field of message */ |
| 144 | } PACKED_POSTFIX VdmWapPushDataT; |
| 145 | |
| 146 | typedef struct |
| 147 | { |
| 148 | kal_uint8* Data; |
| 149 | kal_uint16 DataLen; |
| 150 | }VdmNiaT; |
| 151 | |
| 152 | typedef struct |
| 153 | { |
| 154 | kal_uint8 Data[MAX_NIA_MSG_LEN]; |
| 155 | kal_uint16 DataLen; |
| 156 | }VdmNiaMsgT; |
| 157 | |
| 158 | typedef PACKED_PREFIX struct |
| 159 | { |
| 160 | kal_bool success; |
| 161 | } PACKED_POSTFIX VdmFumoReportMsgT; |
| 162 | |
| 163 | typedef enum |
| 164 | { |
| 165 | HFA_CIDC, |
| 166 | HFA_CIPRL, |
| 167 | HFA_CIFUMO, |
| 168 | VDM_NUM_HFA_TYPE |
| 169 | }VdmHfaTypeT; |
| 170 | |
| 171 | typedef PACKED_PREFIX struct |
| 172 | { |
| 173 | kal_uint32 TimerId; /* Expired timer Id */ |
| 174 | } PACKED_POSTFIX VdmTimerExpiredMsgT; |
| 175 | |
| 176 | typedef struct{ |
| 177 | kal_bool queued; |
| 178 | kal_uint8 Niadata[MAX_NIA_MSG_LEN]; |
| 179 | kal_uint16 NiadataLen; |
| 180 | } VdmNiaRequestT; |
| 181 | |
| 182 | void VdmInitialize(void); |
| 183 | void VdmResponse( VdmMsgIdT ExpectedMsgId ); |
| 184 | void VdmProcessNetMsg(DmMsgT *MsgP); |
| 185 | void VdmProcessSocketMsg(DmMsgT *MsgP); |
| 186 | void VdmProcessDNSMsg(DmMsgT *MsgP); |
| 187 | void VDM_NotifyAppMsg(kal_uint32 MailMsgId, kal_uint32 ParamA , kal_int32 ParamB); |
| 188 | void VdmSessionInitialize(void); |
| 189 | void dmc_registerCallbacks(void); |
| 190 | void VdmProcessCidcMsg(void); |
| 191 | void VdmProcessCiprlMsg(void); |
| 192 | void VdmProcessHfaCidcMsg(void); |
| 193 | void VdmProcessHfaCiprlMsg(void); |
| 194 | void VdmProcessWapPushMsg(ValSmsUserDataMsgT* MsgDataPtr); |
| 195 | void VdmProcessNiaMsg(VdmNiaMsgT* MsgP); |
| 196 | void VdmDoNiaSession(VdmNiaT* MsgP); |
| 197 | void VdmProcessFumoReportMsg(VdmFumoReportMsgT *MsgP); |
| 198 | void VdmMd5(char *data, kal_uint16 dataLen, char *b); |
| 199 | kal_uint32 base64_decode(kal_uint8 *bdata,kal_uint32 bdlen,kal_uint8 *outData); |
| 200 | kal_uint32 base64_encode(kal_uint8 *data, kal_uint32 dlen, kal_uint8 *outPut); |
| 201 | void VdmAuthSecretCalc(char *a, char *b, char *s, char* output); |
| 202 | void VdmProcessGetMobileIdRspMsg(PswGetMobileIDRspMsgT* Msg); |
| 203 | void VdmWriteMultipleBlocks(void); |
| 204 | kal_bool VdmInitiateSessionTrigger(VdmTriggerType TriggerType); |
| 205 | void VdmStartPrlUpdateTimer(kal_uint32 duration); |
| 206 | void VdmStopPrlUpdateTimer(void); |
| 207 | void VdmPrlUpdateTimerCallBack (kal_uint32 TimerId); |
| 208 | void VdmCreatPrlUpdateTimer(void); |
| 209 | void VdmCreatSessionRetryTimer(void); |
| 210 | void VdmStartSessionRetryTimer(kal_uint32 duration); |
| 211 | void VdmStopSessionRetryTimer(void); |
| 212 | void VdmStartHfaRetryTimer(kal_uint8 timeId, kal_uint32 duration); |
| 213 | void VdmStopHfaRetryTimer(kal_uint8 timeId); |
| 214 | void VdmCreatHfaRetryTimer(void); |
| 215 | void VdmHFACheck(void); |
| 216 | kal_bool VdmSetDcEnable(kal_bool enable); |
| 217 | kal_bool VdmSetPrlEnable(kal_bool enable); |
| 218 | kal_bool VdmSetFumoEnable(kal_bool enable); |
| 219 | kal_bool VdmSetLogEnable(kal_bool enable); |
| 220 | void VdmSetPrlAotoupdate(kal_uint32 time); |
| 221 | kal_bool VdmGetDcEnableValue(void); |
| 222 | kal_bool VdmGetCheckHfaValue(void); |
| 223 | VdmTriggerType VdmGetTriggerSessionType(void); |
| 224 | void VdmSaveTriggerSessionType(void); |
| 225 | void VdmPrintfile(char* sslbuffer, kal_uint32 length); |
| 226 | void VdmPrintfileRemove(void); |
| 227 | void VdmRtnReset(void); |
| 228 | void VdmProcessRTNRestMsg(void); |
| 229 | void VdmSetActiveProfileIdToZero(void); |
| 230 | void VdmResetActiveProfileId(void); |
| 231 | void VdmSetDmCmdRcvd(kal_bool value); |
| 232 | void VdmCloseCurConnection(void); |
| 233 | void VdmCreatDormancyTimer(void); |
| 234 | void VdmStartDormancyTimer(kal_uint32 duration); |
| 235 | void VdmStopDormancyTimer(void); |
| 236 | void VdmDormancyTimerCallBack (kal_uint32 TimerId); |
| 237 | void VdmProcessDormTimerExpiredMsg(void); |
| 238 | kal_bool VdmIsPendNiaRequest(void); |
| 239 | VdmTriggerType VdmGetSessionType(void); |
| 240 | void VdmCreateSessionDir(const char *dirP); |
| 241 | kal_bool VdmGetProxyEnableValue(void); |
| 242 | void VdmGetProxyAddress(char* proxyAdd); |
| 243 | kal_bool VdmIsDLSessionStarted(void); |
| 244 | void VdmCheckNia(void); |
| 245 | void VdmSetHFAEnable(kal_bool enable); |
| 246 | void VdmGetMobileId(void); |
| 247 | void VdmProcessHfaCheckMsg(void); |
| 248 | void VdmProcessSessionRetryTimerExpiredMsg(void); |
| 249 | void VdmProcessHfaRetryTimerExpiredMsg(VdmTimerExpiredMsgT *MsgP); |
| 250 | void VdmProcessPrlUpdateTimerExpiredMsg(void); |
| 251 | #endif |
| 252 | |