blob: ace634a8bd4921688d5f746f417042fb65d29128 [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001/*****************************************************************************
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
72typedef 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
122typedef 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
134typedef 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
146typedef struct
147 {
148 kal_uint8* Data;
149 kal_uint16 DataLen;
150 }VdmNiaT;
151
152typedef struct
153 {
154 kal_uint8 Data[MAX_NIA_MSG_LEN];
155 kal_uint16 DataLen;
156 }VdmNiaMsgT;
157
158typedef PACKED_PREFIX struct
159{
160 kal_bool success;
161} PACKED_POSTFIX VdmFumoReportMsgT;
162
163typedef enum
164{
165 HFA_CIDC,
166 HFA_CIPRL,
167 HFA_CIFUMO,
168 VDM_NUM_HFA_TYPE
169}VdmHfaTypeT;
170
171typedef PACKED_PREFIX struct
172{
173 kal_uint32 TimerId; /* Expired timer Id */
174} PACKED_POSTFIX VdmTimerExpiredMsgT;
175
176typedef struct{
177 kal_bool queued;
178 kal_uint8 Niadata[MAX_NIA_MSG_LEN];
179 kal_uint16 NiadataLen;
180} VdmNiaRequestT;
181
182void VdmInitialize(void);
183void VdmResponse( VdmMsgIdT ExpectedMsgId );
184void VdmProcessNetMsg(DmMsgT *MsgP);
185void VdmProcessSocketMsg(DmMsgT *MsgP);
186void VdmProcessDNSMsg(DmMsgT *MsgP);
187void VDM_NotifyAppMsg(kal_uint32 MailMsgId, kal_uint32 ParamA , kal_int32 ParamB);
188void VdmSessionInitialize(void);
189void dmc_registerCallbacks(void);
190void VdmProcessCidcMsg(void);
191void VdmProcessCiprlMsg(void);
192void VdmProcessHfaCidcMsg(void);
193void VdmProcessHfaCiprlMsg(void);
194void VdmProcessWapPushMsg(ValSmsUserDataMsgT* MsgDataPtr);
195void VdmProcessNiaMsg(VdmNiaMsgT* MsgP);
196void VdmDoNiaSession(VdmNiaT* MsgP);
197void VdmProcessFumoReportMsg(VdmFumoReportMsgT *MsgP);
198void VdmMd5(char *data, kal_uint16 dataLen, char *b);
199kal_uint32 base64_decode(kal_uint8 *bdata,kal_uint32 bdlen,kal_uint8 *outData);
200kal_uint32 base64_encode(kal_uint8 *data, kal_uint32 dlen, kal_uint8 *outPut);
201void VdmAuthSecretCalc(char *a, char *b, char *s, char* output);
202void VdmProcessGetMobileIdRspMsg(PswGetMobileIDRspMsgT* Msg);
203void VdmWriteMultipleBlocks(void);
204kal_bool VdmInitiateSessionTrigger(VdmTriggerType TriggerType);
205void VdmStartPrlUpdateTimer(kal_uint32 duration);
206void VdmStopPrlUpdateTimer(void);
207void VdmPrlUpdateTimerCallBack (kal_uint32 TimerId);
208void VdmCreatPrlUpdateTimer(void);
209void VdmCreatSessionRetryTimer(void);
210void VdmStartSessionRetryTimer(kal_uint32 duration);
211void VdmStopSessionRetryTimer(void);
212void VdmStartHfaRetryTimer(kal_uint8 timeId, kal_uint32 duration);
213void VdmStopHfaRetryTimer(kal_uint8 timeId);
214void VdmCreatHfaRetryTimer(void);
215void VdmHFACheck(void);
216kal_bool VdmSetDcEnable(kal_bool enable);
217kal_bool VdmSetPrlEnable(kal_bool enable);
218kal_bool VdmSetFumoEnable(kal_bool enable);
219kal_bool VdmSetLogEnable(kal_bool enable);
220void VdmSetPrlAotoupdate(kal_uint32 time);
221kal_bool VdmGetDcEnableValue(void);
222kal_bool VdmGetCheckHfaValue(void);
223VdmTriggerType VdmGetTriggerSessionType(void);
224void VdmSaveTriggerSessionType(void);
225void VdmPrintfile(char* sslbuffer, kal_uint32 length);
226void VdmPrintfileRemove(void);
227void VdmRtnReset(void);
228void VdmProcessRTNRestMsg(void);
229void VdmSetActiveProfileIdToZero(void);
230void VdmResetActiveProfileId(void);
231void VdmSetDmCmdRcvd(kal_bool value);
232void VdmCloseCurConnection(void);
233void VdmCreatDormancyTimer(void);
234void VdmStartDormancyTimer(kal_uint32 duration);
235void VdmStopDormancyTimer(void);
236void VdmDormancyTimerCallBack (kal_uint32 TimerId);
237void VdmProcessDormTimerExpiredMsg(void);
238kal_bool VdmIsPendNiaRequest(void);
239VdmTriggerType VdmGetSessionType(void);
240void VdmCreateSessionDir(const char *dirP);
241kal_bool VdmGetProxyEnableValue(void);
242void VdmGetProxyAddress(char* proxyAdd);
243kal_bool VdmIsDLSessionStarted(void);
244void VdmCheckNia(void);
245void VdmSetHFAEnable(kal_bool enable);
246void VdmGetMobileId(void);
247void VdmProcessHfaCheckMsg(void);
248void VdmProcessSessionRetryTimerExpiredMsg(void);
249void VdmProcessHfaRetryTimerExpiredMsg(VdmTimerExpiredMsgT *MsgP);
250void VdmProcessPrlUpdateTimerExpiredMsg(void);
251#endif
252