blob: 40193661007db98e993e10c129fe27c127024e87 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001/*****************************************************************************
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/*************************************************************
36*
37* This Software is the property of VIA Telecom, Inc. and may only be used pursuant to a license from VIA Telecom, Inc.
38*
39* Any unauthorized use inconsistent with the terms of such license is strictly prohibited.
40*
41* Copyright (c) 2006-2010 VIA Telecom, Inc. All rights reserved.
42*
43*************************************************************/
44#ifndef _HLPMIP_H_
45#define _HLPMIP_H_
46/*****************************************************************************
47*
48* FILE NAME : hlpmip.h
49*
50* DESCRIPTION :
51*
52* This include file provides type declarations and constants for Mobile IP
53*
54* HISTORY :
55* See Log at end of file.
56*
57*****************************************************************************/
58
59/*----------------------------------------------------------------------------
60 Include Files
61----------------------------------------------------------------------------*/
62#include "pswnam.h"
63
64/*----------------------------------------------------------------------------
65 Global Defines and Macros
66----------------------------------------------------------------------------*/
67#define AAA_AUTH_MAX_SIZE 8
68#define DMU_ENCRYPTED_DATA_MAX_SIZE 128
69
70#define MAX_RSA_PUBLIC_KEY_SUPPORTED 2
71
72#define HLP_DEFAULT_INLAND_NAI_REALM "@inland3g.com"
73#define HLP_DEFAULT_IVC_NAI_REALM "@ivcdata.com" /* IIIinois Valley Cellular */
74#define HLP_DEFAULT_APPALACHIAN_NAI_REALM "@myawi.com" /* Applalachian */
75typedef struct {
76 kal_uint8 MN_AAAH_Key[MN_PASSWD_MAX_SIZE];
77 kal_uint8 MN_HA_Key[MN_PASSWD_MAX_SIZE];
78 kal_uint8 CHAP_Key[MN_PASSWD_MAX_SIZE];
79 kal_uint8 MN_Authenticator[MN_AUTH_MAX_SIZE];
80 kal_uint8 AAA_Authenticator[AAA_AUTH_MAX_SIZE];
81} HlpDMUKeyDataT;
82
83typedef struct {
84 kal_uint8 MN_AAA_PASSWORD[HLP_MN_PASSWD_MAX_SIZE];
85 kal_uint8 MN_HA_PASSWORD[HLP_MN_PASSWD_MAX_SIZE];
86 kal_uint8 MN_SIP_PASSWORD[HLP_MN_PASSWD_MAX_SIZE];
87 kal_uint8 MN_AN_PASSWORD[HLP_MN_PASSWD_MAX_SIZE];
88} HlpDmuSecureDataMsgT;
89
90typedef enum
91{
92 MIP_WFR_REREG_WINDOW,
93 MIP_REREG_WINDOW,
94 MIP_REREG_RRQ_SENT_WINDOW,
95 MIP_REREG_LIFETIME_EXPIRED,
96 MIP_DEREG_ALREADY
97} ReRegStateT;
98
99typedef enum
100{
101 MIP_RRP_TYPE,
102 MIP_RRP_CODE,
103 MIP_RRP_IDENT,
104 MIP_RRP_VENDOR_ID,
105 MIP_RRP_PUBLIC_KEY,
106 MIP_RRP_KEY_ENCRYPT,
107 MIP_RRP_CVSE_LEN,
108 MIP_RRP_AAA_AUTHENTICATOR,
109 MIP_RRP_CVSE_VENDOR_TYPE,
110 MIP_RRP_CVSE_TYPE_NUMBER,
111 MIP_RRP_LIFETIME,
112 MIP_RRP_AUTH_DATA,
113 MIP_RRP_EXT_TYPE,
114 MIP_RRP_EXT_LEN,
115 MIP_RRP_MAX_NUM
116} HlpMipRrpErrTypeT;
117
118typedef enum
119{
120 MIP_ADV_TYPE,
121 MIP_ADV_CODE,
122 MIP_ADV_ROUTER_NUM,
123 MIP_ADV_ENTRY_SIZE,
124 MIP_ADV_MOB_EXT_TYPE,
125 MIP_ADV_CHALL_EXT_TYPE,
126 MIP_ADV_FA_BUSY,
127 MIP_ADV_COA_NUM,
128 MIP_ADV_EXT_LEN,
129 MIP_ADV_MAX_NUM
130} HlpMipAdvErrTypeT;
131
132#define SECURE_DATA_SIP_PWD_BIT (1<<0)
133#define SECURE_DATA_AN_PWD_BIT (1<<1)
134#define SECURE_PROFILE_BIT (1<<2)
135#ifdef CBP7_EHRPD
136#define SECURE_DATA_AKA_PWD_BIT (1<<3)
137#endif
138
139typedef enum
140{
141 SECURE_DATA_SIP_PWD_SET = SECURE_DATA_SIP_PWD_BIT,
142 SECURE_DATA_AN_PWD_SET = SECURE_DATA_AN_PWD_BIT,
143#ifdef CBP7_EHRPD
144 SECURE_DATA_AKA_PWD_SET = SECURE_DATA_AKA_PWD_BIT,
145#endif
146 SECURE_SET_BOTH = RSA_PUBLIC_KEY_BIT|SECURE_DATA_SIP_PWD_BIT|SECURE_DATA_AN_PWD_BIT,
147 SECURE_PROFILE_SET = SECURE_PROFILE_BIT,
148#ifdef CBP7_EHRPD
149 SET_ALL = SECURE_DATA_SIP_PWD_BIT|SECURE_DATA_AN_PWD_BIT|SECURE_PROFILE_BIT|SECURE_DATA_AKA_PWD_BIT
150#else
151 SET_ALL = SECURE_DATA_SIP_PWD_BIT|SECURE_DATA_AN_PWD_BIT|SECURE_PROFILE_BIT
152#endif
153}SecureDataSetE;
154
155typedef enum
156{
157 HLP_MIP_ERR_INVALID_STATE, /* MIP error codes */
158 HLP_MIP_ERR_INVALID_TIMER_ID,
159 HLP_MIP_ERR_AGENT_ADV_INVALID_TYPE,
160 HLP_MIP_ERR_AGENT_ADV_INVALID_CODE,
161 HLP_MIP_ERR_AGENT_ADV_INVALID_NUM_ROUTER,
162 HLP_MIP_ERR_AGENT_ADV_INVALID_ENTRY_SIZE,
163 HLP_MIP_ERR_AGENT_ADV_INVALID_NUM_COA,
164 HLP_MIP_ERR_AGENT_ADV_INVALID_EXT_TYPE, /* 0x10 */
165 HLP_MIP_ERR_AGENT_ADV_INVALID_EXT_LEN,
166 HLP_MIP_ERR_AGENT_ADV_INVALID_AGENT,
167 HLP_MIP_ERR_AGENT_ADV_FA_BUSY,
168 HLP_MIP_ERR_AGENT_SOL_BUFFER_BUSY,
169 HLP_MIP_ERR_RRP_INVALID_TYPE,
170 HLP_MIP_ERR_RRP_INVALID_CODE,
171 HLP_MIP_ERR_RRP_INVALID_LIFETIME,
172 HLP_MIP_ERR_RRP_INVALID_IDENT,
173 HLP_MIP_ERR_RRP_INVALID_EXT_TYPE,
174 HLP_MIP_ERR_RRP_INVALID_EXT_LEN,
175 HLP_MIP_ERR_RRP_INVALID_AUTH_DATA,
176 HLP_MIP_ERR_RRP_INVALID_CHALLENGE_DATA,
177 HLP_MIP_ERR_RRQ_TOO_LARGE,
178 HLP_MIP_ERR_RRQ_BUFFER_BUSY,
179 HLP_MIP_ERR_USER_DATA_GET_FAILED,
180 HLP_MIP_ERR_INVALID_CVSE_TYPE_NUMBER, /* 0x20 */
181 HLP_MIP_ERR_INVALID_VENDOR_ID,
182 HLP_MIP_ERR_INVALID_CVSE_VENDOR_TYPE,
183 HLP_MIP_ERR_INVALID_PUBLIC_KEY,
184 HLP_MIP_ERR_INVALID_CVSE_LEN,
185 HLP_MIP_ERR_MIP_KEY_ENCRYPT_INVALID,
186 HLP_MIP_ERR_INVALID_AAA_AUTHENTICATOR,
187} HlpMipErrCodeE;
188
189/*----------------------------------------------------------------------------
190 Externs Declarations
191----------------------------------------------------------------------------*/
192extern void HlpMipInit(void);
193extern void HlpMipFallbackSipSet(kal_bool bEnable);
194extern kal_bool HlpMipFallbackSipGet(void);
195extern void HlpMipFallbackSipActive(void);
196
197extern void HlpMipRrpMsg(void *MsgDataP);
198extern void HlpMipAgentAdvMsg(void *MsgDataP);
199extern void HlpMipUmPppStatusMsg(void *MsgDataP);
200extern void HlpMipNvmMiscData(void* MsgDataP);
201extern void HlpMipNvmRRAUpdate(kal_uint16 Rra);
202extern void HlpMipNvmNumRegRetriesUpdate(kal_uint8 Num);
203extern void HlpMipNvmDeRegRetriesUpdate(kal_uint8 Num);
204extern void HlpMipNvmReRegOnlyIfTrafficUpdate(kal_bool ReRegOnlyIfTraffic);
205extern void HlpMipNvmMipNaiEnabledUpdate(kal_bool NaiEnabled);
206extern void HlpMipNvmRegTimeoutUpdate(kal_uint8 Timeout);
207extern void HlpMipNvmActivedProfileDataUpdate(HlpHspdSegData * MsgDataP);
208extern void HlpMipNvmSecureProfileDataUpdate(kal_uint8 SetType, HlpHspdSecureSegData* MsgDataP);
209
210extern void HlpDMUInit(void);
211extern void HlpMipKeysGenEnc(void);
212/*extern void HlpResetMNAuthMsg(void *MsgDataP);*/
213/*extern void HlpSetMNAuthMsg(void *MsgDataP);*/
214extern void HlpPswSDmuKeyGenRspMsg(void);
215extern void HlpPswSDmuKeyEncRspMsg(void);
216extern void HlpDmuRsaPublicKeyActiveAndMNAuthSetMsg(kal_uint8 SetType, HlpRSAPublicKeyOrgIdInfoT *MsgDataP);
217
218extern void HlpMipStartRrpAdminProhibRetry(void);
219extern kal_bool HlpMipCheckRrpAdminProhibRetry(void);
220extern kal_bool HlpMipCheckRrpAdminProhibRetryOtherErr(void);
221extern void HlpMipClearRrpAdminProhibRetry(void);
222
223extern void HlpMipResetRrpCode(void);
224extern void HlpMipSetRrpCode(kal_uint8 RrpCode);
225extern kal_uint8 HlpMipGetRrpCode(void);
226extern void HlpMIPReRegistration(MipReRegReasonT Reason);
227extern void HlpReturnToService(void);
228
229extern void HlpToReadNVRSAPublicKeyInfo(void);
230extern kal_bool HlpCheckRSAPublicKeyInfo(kal_uint8 nPKOID);
231extern kal_bool HlpIsAcgOpTetheringMode(void);
232extern kal_bool HlpIsAcgOpMipOnlyMode(void);
233extern kal_bool HlpCheckIsAcgSpecialNAI(char *pStr);
234extern kal_uint8 HlpDeriveTetheredNAIForACG(kal_uint8 *InputNAI, kal_uint8 InNAILen);
235/*****************************************************************************
236* $Log: hlpmip.h $
237*
238* 11 09 2016 sue.zhong
239* [MOLY00208435] [6293][C2K]Sync C2K code to UMOLYA TRUNK
240* Update C2K PS code (1/2)
241*****************************************************************************/
242
243/*****************************************************************************
244* End of File
245*****************************************************************************/
246#endif
247
248
249