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 /** 17 * @addtogroup SoftBus 18 * @{ 19 * 20 * @brief Provides secure, high-speed communications between devices. 21 * 22 * This module implements unified distributed communication management of nearby devices and provides link-independent 23 * device discovery and transmission interfaces to support service publishing and data transmission. 24 * @since 1.0 25 * @version 1.0 26 */ 27 28 /** 29 * @file inner_session.h 30 * 31 * @brief Declares the functions for DSoftBus identity authentication. The functions can be used to: 32 * <ul> 33 * <li>Open an identity authentication session.</li> 34 * <li>Send an authentication success notification.</li> 35 * 36 * @since 1.0 37 * @version 1.0 38 */ 39 #ifndef INNER_SESSION_H 40 #define INNER_SESSION_H 41 42 #include "softbus_common.h" 43 44 #ifdef __cplusplus 45 extern "C" { 46 #endif 47 48 /** 49 * @example openauthsession_demo.c 50 */ 51 52 /** 53 * @brief Opens a session for identity authentication. 54 * 55 * @param sessionName Indicates the pointer to the session name for identity authentication. 56 * The session name uniquely identifies a session service. The value cannot be empty or exceed 256 characters. 57 * @param addrInfo Indicates the pointer to the address information for the connection between devices. 58 * @param num Indicates the number of device connection records. 59 * @param mixAddr Indicates the pointer to the connection address information. 60 * If the address information passed by <b>addrInfo</b> is invalid, this parameter can be used to obtain the connection information. 61 * 62 * @return Returns <b>SOFTBUS_INVALID_PARAM</b> if invalid parameters are detected. 63 * @return Returns <b>INVALID_SESSION_ID</b> if the session ID is invalid. 64 * @return Returns the session ID (an integer greater than <b>0</b>) if the operation is successful; 65 * return an error code otherwise. 66 * 67 * @since 1.0 68 * @version 1.0 69 */ 70 int OpenAuthSession(const char *sessionName, const ConnectionAddr *addrInfo, int num, const char *mixAddr); 71 72 /** 73 * @brief Notifies the upper-layer service of the identity authentication success. 74 * 75 * @param sessionId Indicates the unique session ID. 76 * 77 * @since 1.0 78 * @version 1.0 79 */ 80 void NotifyAuthSuccess(int sessionId); 81 82 #ifdef __cplusplus 83 } 84 #endif 85 #endif