• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 AUTH_COMMON_H
17 #define AUTH_COMMON_H
18 
19 #include <stdint.h>
20 #include <string.h>
21 
22 #include "auth_manager.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 int64_t GetSeq(AuthSideFlag flag);
29 uint16_t AuthGetNextConnectionId(void);
30 void UniqueIdInit(void);
31 void AuthGetAbility(void);
32 bool AuthIsSupportServerSide(void);
33 AuthSideFlag AuthGetSideByRemoteSeq(int64_t seq);
34 int32_t AuthGetDeviceKey(char *key, uint32_t size, uint32_t *len, const ConnectOption *option);
35 int32_t AuthConvertConnInfo(ConnectOption *option, const ConnectionInfo *connInfo);
36 
37 int32_t ConvertAuthConnInfoToOption(const AuthConnInfo *info, ConnectOption *option);
38 int32_t ConvertOptionToAuthConnInfo(const ConnectOption *option, bool isAuthP2p, AuthConnInfo *info);
39 bool CompareConnectOption(const ConnectOption *option1, const ConnectOption *option2);
40 
41 #ifdef __cplusplus
42 }
43 #endif
44 #endif /* AUTH_COMMON_H */
45