1 /* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef DEV_SLINFO_MGR_H 17 #define DEV_SLINFO_MGR_H 18 19 #include <stdint.h> 20 21 #ifdef __cplusplus 22 extern "C" { 23 #endif 24 25 #define MAX_UDID_LENGTH 64 26 27 #define DATA_SEC_LEVEL0 0 /* s0 */ 28 #define DATA_SEC_LEVEL1 1 /* s1 */ 29 #define DATA_SEC_LEVEL2 2 /* s2 */ 30 #define DATA_SEC_LEVEL3 3 /* s3 */ 31 #define DATA_SEC_LEVEL4 4 /* s4 */ 32 33 typedef struct { 34 uint8_t udid[MAX_UDID_LENGTH]; 35 uint32_t udidLen; 36 } DEVSLQueryParams; 37 38 enum { 39 DEVSL_SUCCESS = 0, 40 DEVSL_ERROR = 100, 41 DEVSL_ERR_REQUEST_DEVICE_EXCEED_LIMIT = 101, 42 DEVSL_ERR_DEVICE_SEC_SDK_INIT = 102, 43 DEVSL_ERR_OUT_OF_MEMORY = 103, 44 DEVSL_ERR_MUTEX_LOCK_INIT = 104, 45 DEVSL_ERR_BAD_PARAMETERS = 105, 46 }; 47 48 int32_t DATASL_GetHighestSecLevel(DEVSLQueryParams *queryParams, uint32_t *levelInfo); 49 50 int32_t DATASL_OnStart(void); 51 52 void DATASL_OnStop(void); 53 54 typedef void HigestSecInfoCallback(DEVSLQueryParams *queryParams, int32_t result, uint32_t levelInfo); 55 56 int32_t DATASL_GetHighestSecLevelAsync(DEVSLQueryParams *queryParams, HigestSecInfoCallback *callback); 57 58 #ifdef __cplusplus 59 } 60 #endif 61 #endif