• 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 #define MAX_USER 1000
23 #define MAX_CREDENTIAL 5
24 
25 typedef struct {
26     uint64_t credentialId;
27     uint32_t authType;
28     uint64_t authSubType;
29     uint64_t templateId;
30     uint32_t capabilityLevel;
31 } CredentialInfoHal;
32 
33 typedef struct {
34     uint32_t authType;
35     uint64_t enrolledId;
36 } EnrolledInfoHal;
37 
38 typedef struct {
39     int32_t userId;
40     uint64_t secUid;
41     LinkedList *credentialInfoList;
42     LinkedList *enrolledInfoList;
43 } UserInfo;
44 
45 void DestroyUserInfoNode(void *userInfo);
46 void DestroyCredentialNode(void *credential);
47 void DestroyEnrolledNode(void *enrolled);
48 UserInfo *InitUserInfoNode(void);
49 
50 #endif // IDM_COMMON_H