18e745fdaSopenharmony_ci/* 28e745fdaSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 38e745fdaSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 48e745fdaSopenharmony_ci * you may not use this file except in compliance with the License. 58e745fdaSopenharmony_ci * You may obtain a copy of the License at 68e745fdaSopenharmony_ci * 78e745fdaSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 88e745fdaSopenharmony_ci * 98e745fdaSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 108e745fdaSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 118e745fdaSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 128e745fdaSopenharmony_ci * See the License for the specific language governing permissions and 138e745fdaSopenharmony_ci * limitations under the License. 148e745fdaSopenharmony_ci */ 158e745fdaSopenharmony_ci 168e745fdaSopenharmony_ci#include "networkvpn_hisysevent.h" 178e745fdaSopenharmony_ci#include "net_event_report.h" 188e745fdaSopenharmony_ci 198e745fdaSopenharmony_cinamespace OHOS { 208e745fdaSopenharmony_cinamespace NetManagerStandard { 218e745fdaSopenharmony_ci 228e745fdaSopenharmony_civoid VpnHisysEvent::SendFaultEvent(const VpnEventType &isLegacy, const VpnEventOperator &operatorType, 238e745fdaSopenharmony_ci const VpnEventErrorType &errorCode, const std::string &errorMsg) 248e745fdaSopenharmony_ci{ 258e745fdaSopenharmony_ci VpnEventInfo eventInfo; 268e745fdaSopenharmony_ci eventInfo.legacy = static_cast<int32_t>(isLegacy); 278e745fdaSopenharmony_ci eventInfo.operatorType = static_cast<int32_t>(operatorType); 288e745fdaSopenharmony_ci eventInfo.errorType = static_cast<int32_t>(errorCode); 298e745fdaSopenharmony_ci eventInfo.errorMsg = errorMsg; 308e745fdaSopenharmony_ci NetEventReport::SendVpnConnectEvent(eventInfo); 318e745fdaSopenharmony_ci} 328e745fdaSopenharmony_ci 338e745fdaSopenharmony_civoid VpnHisysEvent::SendFaultEventConnSetting(const VpnEventType &isLegacy, const VpnEventErrorType &errorCode, 348e745fdaSopenharmony_ci const std::string &errorMsg) 358e745fdaSopenharmony_ci{ 368e745fdaSopenharmony_ci VpnEventInfo eventInfo; 378e745fdaSopenharmony_ci eventInfo.legacy = static_cast<int32_t>(isLegacy); 388e745fdaSopenharmony_ci eventInfo.operatorType = static_cast<int32_t>(VpnEventOperator::OPERATION_CONNECT_SETTING); 398e745fdaSopenharmony_ci eventInfo.errorType = static_cast<int32_t>(errorCode); 408e745fdaSopenharmony_ci eventInfo.errorMsg = errorMsg; 418e745fdaSopenharmony_ci NetEventReport::SendVpnConnectEvent(eventInfo); 428e745fdaSopenharmony_ci} 438e745fdaSopenharmony_ci 448e745fdaSopenharmony_civoid VpnHisysEvent::SendFaultEventConnDestroy(const VpnEventType &isLegacy, const VpnEventErrorType &errorCode, 458e745fdaSopenharmony_ci const std::string &errorMsg) 468e745fdaSopenharmony_ci{ 478e745fdaSopenharmony_ci VpnEventInfo eventInfo; 488e745fdaSopenharmony_ci eventInfo.legacy = static_cast<int32_t>(isLegacy); 498e745fdaSopenharmony_ci eventInfo.operatorType = static_cast<int32_t>(VpnEventOperator::OPERATION_CONNECT_DESTROY); 508e745fdaSopenharmony_ci eventInfo.errorType = static_cast<int32_t>(errorCode); 518e745fdaSopenharmony_ci eventInfo.errorMsg = errorMsg; 528e745fdaSopenharmony_ci NetEventReport::SendVpnConnectEvent(eventInfo); 538e745fdaSopenharmony_ci} 548e745fdaSopenharmony_ci 558e745fdaSopenharmony_ci} // namespace NetManagerStandard 568e745fdaSopenharmony_ci} // namespace OHOS