• 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_CONNECTION_H
17 #define AUTH_CONNECTION_H
18 
19 #include "auth_manager.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #define TAG "MsgGetDeviceId"
26 #define CMD_TAG "TECmd"
27 #define DATA_TAG "TEData"
28 #define TE_DEVICE_ID_TAG "TEDeviceId"
29 #define DATA_BUF_SIZE_TAG "DataBufSize"
30 #define CMD_GET_AUTH_INFO "getAuthInfo"
31 #define CMD_RET_AUTH_INFO "retAuthInfo"
32 #define SOFTBUS_VERSION_INFO "softbusVersion"
33 
34 #define CMD_TAG_LEN 30
35 #define PACKET_SIZE (64 * 1024)
36 
37 int32_t AuthSyncDeviceUuid(AuthManager *auth);
38 int32_t AuthUnpackDeviceInfo(AuthManager *auth, uint8_t *data);
39 char *AuthGenDeviceLevelParam(const AuthManager *auth, bool isClient);
40 void AuthTryCloseConnection(uint32_t connectionId);
41 bool AuthOnTransmit(int64_t authId, const uint8_t *data, uint32_t len);
42 void AuthSendCloseAck(uint32_t connectionId, AuthSideFlag side, int64_t authId);
43 
44 #ifdef __cplusplus
45 }
46 #endif
47 #endif /* AUTH_CONNECTION_H */
48