1060ff233Sopenharmony_ci/* 2060ff233Sopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 3060ff233Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4060ff233Sopenharmony_ci * you may not use this file except in compliance with the License. 5060ff233Sopenharmony_ci * You may obtain a copy of the License at 6060ff233Sopenharmony_ci * 7060ff233Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8060ff233Sopenharmony_ci * 9060ff233Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10060ff233Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11060ff233Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12060ff233Sopenharmony_ci * See the License for the specific language governing permissions and 13060ff233Sopenharmony_ci * limitations under the License. 14060ff233Sopenharmony_ci */ 15060ff233Sopenharmony_ci 16060ff233Sopenharmony_ci/** 17060ff233Sopenharmony_ci * @addtogroup SoftBus 18060ff233Sopenharmony_ci * @{ 19060ff233Sopenharmony_ci * 20060ff233Sopenharmony_ci * @brief Provides secure, high-speed communications between devices. 21060ff233Sopenharmony_ci * 22060ff233Sopenharmony_ci * This module implements unified distributed communication management of nearby devices and provides link-independent 23060ff233Sopenharmony_ci * device discovery and transmission interfaces to support service publishing and data transmission. 24060ff233Sopenharmony_ci * @since 1.0 25060ff233Sopenharmony_ci * @version 1.0 26060ff233Sopenharmony_ci */ 27060ff233Sopenharmony_ci 28060ff233Sopenharmony_ci/** 29060ff233Sopenharmony_ci * @file inner_session.h 30060ff233Sopenharmony_ci * 31060ff233Sopenharmony_ci * @brief Declares the functions for DSoftBus identity authentication. The functions can be used to: 32060ff233Sopenharmony_ci * <ul> 33060ff233Sopenharmony_ci * <li>Open an identity authentication session.</li> 34060ff233Sopenharmony_ci * <li>Send an authentication success notification.</li> 35060ff233Sopenharmony_ci * 36060ff233Sopenharmony_ci * @since 1.0 37060ff233Sopenharmony_ci * @version 1.0 38060ff233Sopenharmony_ci */ 39060ff233Sopenharmony_ci#ifndef INNER_SESSION_H 40060ff233Sopenharmony_ci#define INNER_SESSION_H 41060ff233Sopenharmony_ci 42060ff233Sopenharmony_ci#include "softbus_common.h" 43060ff233Sopenharmony_ci 44060ff233Sopenharmony_ci#ifdef __cplusplus 45060ff233Sopenharmony_ciextern "C" { 46060ff233Sopenharmony_ci#endif 47060ff233Sopenharmony_ci 48060ff233Sopenharmony_ci/** 49060ff233Sopenharmony_ci * @example openauthsession_demo.c 50060ff233Sopenharmony_ci */ 51060ff233Sopenharmony_ci 52060ff233Sopenharmony_ci/** 53060ff233Sopenharmony_ci * @brief Opens a session for identity authentication. 54060ff233Sopenharmony_ci * 55060ff233Sopenharmony_ci * @param sessionName Indicates the pointer to the session name for identity authentication. 56060ff233Sopenharmony_ci * The session name uniquely identifies a session service. The value cannot be empty or exceed 256 characters. 57060ff233Sopenharmony_ci * @param addrInfo Indicates the pointer to the address information for the connection between devices. 58060ff233Sopenharmony_ci * @param num Indicates the number of device connection records. 59060ff233Sopenharmony_ci * @param mixAddr Indicates the pointer to the connection address information. 60060ff233Sopenharmony_ci * If the address information passed by <b>addrInfo</b> is invalid, 61060ff233Sopenharmony_ci * this parameter can be used to obtain the connection information. 62060ff233Sopenharmony_ci * 63060ff233Sopenharmony_ci * @return Returns <b>SOFTBUS_INVALID_PARAM</b> if invalid parameters are detected. 64060ff233Sopenharmony_ci * @return Returns <b>INVALID_SESSION_ID</b> if the session ID is invalid. 65060ff233Sopenharmony_ci * @return Returns the session ID (an integer greater than <b>0</b>) if the operation is successful; 66060ff233Sopenharmony_ci * return an error code otherwise. 67060ff233Sopenharmony_ci * 68060ff233Sopenharmony_ci * @since 1.0 69060ff233Sopenharmony_ci * @version 1.0 70060ff233Sopenharmony_ci */ 71060ff233Sopenharmony_ciint OpenAuthSession(const char *sessionName, const ConnectionAddr *addrInfo, int num, const char *mixAddr); 72060ff233Sopenharmony_ci 73060ff233Sopenharmony_ci/** 74060ff233Sopenharmony_ci * @brief Notifies the upper-layer service of the identity authentication success. 75060ff233Sopenharmony_ci * 76060ff233Sopenharmony_ci * @param sessionId Indicates the unique session ID. 77060ff233Sopenharmony_ci * 78060ff233Sopenharmony_ci * @since 1.0 79060ff233Sopenharmony_ci * @version 1.0 80060ff233Sopenharmony_ci */ 81060ff233Sopenharmony_civoid NotifyAuthSuccess(int sessionId); 82060ff233Sopenharmony_ci 83060ff233Sopenharmony_ci#ifdef __cplusplus 84060ff233Sopenharmony_ci} 85060ff233Sopenharmony_ci#endif 86060ff233Sopenharmony_ci#endif