b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | /************************************************************************
|
| 2 |
|
| 3 | (c) Copyright 2021 by 天翼物联科技有限公司. All rights reserved.
|
| 4 |
|
| 5 | **************************************************************************/
|
| 6 |
|
| 7 | #ifndef _LPADES9_H
|
| 8 | #define _LPADES9_H
|
| 9 | #include <stdint.h>
|
| 10 |
|
| 11 | #include "LPAd.h"
|
| 12 | #include "LPAd_internal.h"
|
| 13 |
|
| 14 |
|
| 15 | /************************************** ES9 struct ****************************/
|
| 16 |
|
| 17 | typedef struct FunctionExecutionStatus
|
| 18 | {
|
| 19 | uint8_t* status; //string
|
| 20 |
|
| 21 | //statusCodeData
|
| 22 | uint8_t* subjectIdentifier; //string
|
| 23 | uint8_t* reasonCode; //string
|
| 24 | uint8_t* message; //string
|
| 25 | uint8_t* subjectCode; //string
|
| 26 | }funExecStatus_t;
|
| 27 |
|
| 28 | typedef struct InitiateAuthentication
|
| 29 | {
|
| 30 | uint8_t* euiccChallenge; //base64 string
|
| 31 | uint8_t* euiccInfo1; //base64 string
|
| 32 | uint8_t* smdpAddress; //string
|
| 33 | }initAuthReq_t;
|
| 34 |
|
| 35 | typedef struct InitiateAuthenticationRsp
|
| 36 | {
|
| 37 | funExecStatus_t* funES;
|
| 38 |
|
| 39 | uint8_t* transactionId; //string
|
| 40 | uint8_t* serverSigned1; //base64 string
|
| 41 | uint8_t* serverSignature1; //base64 string
|
| 42 | uint8_t* euiccCiPKIdToBeUsed; //base64 string
|
| 43 | uint8_t* serverCertificate; //base64 string
|
| 44 | }initAuthRsp_t;
|
| 45 |
|
| 46 | typedef struct AuthenticateClient
|
| 47 | {
|
| 48 | uint8_t* transactionId; //string
|
| 49 | uint8_t* authenticateServerResponse; //string
|
| 50 | }authClientReq_t;
|
| 51 |
|
| 52 | typedef struct AuthenticateClientRsp
|
| 53 | {
|
| 54 | funExecStatus_t* funES;
|
| 55 |
|
| 56 | uint8_t* transactionId; //string
|
| 57 | uint8_t* profileMetadata; //base64 string
|
| 58 | uint8_t* smdpSigned2; //base64 string
|
| 59 | uint8_t* smdpSignature2; //base64 string
|
| 60 | uint8_t* smdpCertificate; //base64 string
|
| 61 | }authClientRsp_t;
|
| 62 |
|
| 63 | typedef struct GetBoundProfilePackage
|
| 64 | {
|
| 65 | uint8_t* transactionId; //string
|
| 66 | uint8_t* prepareDownloadResponse; //string
|
| 67 | }getBPPReq_t;
|
| 68 |
|
| 69 | typedef struct GetBoundProfilePackageRsp
|
| 70 | {
|
| 71 | funExecStatus_t* funES;
|
| 72 |
|
| 73 | uint8_t* transactionId; //string
|
| 74 | uint8_t* boundProfilePackage; //base64 string
|
| 75 | }getBPPRsp_t;
|
| 76 |
|
| 77 | typedef struct CancelSession
|
| 78 | {
|
| 79 | uint8_t* transactionId; //string
|
| 80 | uint8_t* cancelSessionResponse; //string
|
| 81 | }cancelSession_t;
|
| 82 |
|
| 83 | typedef struct HandleNotification
|
| 84 | {
|
| 85 | uint8_t* pendingNotification; //base64 string
|
| 86 | }handleNotificationReq_t;
|
| 87 |
|
| 88 | #if 0
|
| 89 | typedef struct HandleNotificationRsp
|
| 90 | {
|
| 91 | int16_t httpRspCode;
|
| 92 | }handleNotificationRsp_t;
|
| 93 | #endif
|
| 94 |
|
| 95 | /******************************* ES9 API ******************************************/
|
| 96 | int LPAd_ES9_low_level_init(CT_LPAd_sys_hooks_t *sysHooks);
|
| 97 |
|
| 98 | int LPAd_ES9_InitiateAuthentication(CT_LPAd_session_t* LPASession, initAuthReq_t* req, initAuthRsp_t* rsp);
|
| 99 |
|
| 100 | int LPAd_ES9_AuthenticateClient(CT_LPAd_session_t* LPASession, authClientReq_t* req, authClientRsp_t* rsp);
|
| 101 |
|
| 102 | int LPAd_ES9_GetBoundProfilePackage(CT_LPAd_session_t* LPASession, getBPPReq_t* req, getBPPRsp_t* rsp);
|
| 103 |
|
| 104 | int LPAd_ES9_HandleNotification(CT_LPAd_session_t* LPASession, handleNotificationReq_t* req);
|
| 105 |
|
| 106 | void free_InitAuthRsp(initAuthRsp_t* p);
|
| 107 |
|
| 108 | void free_AuthClientRsp(authClientRsp_t* p);
|
| 109 |
|
| 110 | void free_GetBPPRsp(getBPPRsp_t* p);
|
| 111 |
|
| 112 | #endif
|