• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 IDM_COMMON_H
17 #define IDM_COMMON_H
18 
19 #include <stdint.h>
20 #include "linked_list.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #define MAX_USER 32
27 #define MAX_CREDENTIAL 100
28 
29 typedef struct {
30     uint64_t credentialId;
31     uint64_t templateId;
32     uint32_t authType;
33     uint32_t executorSensorHint;
34     uint32_t executorMatcher;
35     uint32_t capabilityLevel;
36 } CredentialInfoHal;
37 
38 typedef struct {
39     uint32_t authType;
40     uint64_t enrolledId;
41 } EnrolledInfoHal;
42 
43 typedef struct {
44     int32_t userId;
45     uint64_t secUid;
46     uint64_t pinSubType;
47     LinkedList *credentialInfoList;
48     LinkedList *enrolledInfoList;
49 } UserInfo;
50 
51 void DestroyUserInfoNode(void *userInfo);
52 void DestroyCredentialNode(void *credential);
53 void DestroyEnrolledNode(void *enrolled);
54 UserInfo *InitUserInfoNode(void);
55 
56 #ifdef __cplusplus
57 }
58 #endif
59 
60 #endif // IDM_COMMON_H