1/* 2 * Copyright (c) 2025 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 16import IVpnEventCallback; 17sequenceable VpnConfig..OHOS.NetManagerStandard.VpnConfig; 18sequenceable SysvpnConfig..OHOS.NetManagerStandard.SysVpnConfig; 19interface OHOS.NetManagerStandard.INetworkVpnService { 20 void Prepare([out] boolean isExistVpn, [out] boolean isRun, [out] String pkg); 21 void SetUpVpn([in] VpnConfig config, [in] boolean isVpnExtCall); 22 void Protect([in] boolean isVpnExtCall); 23 void DestroyVpn([in] boolean isVpnExtCall); 24 void RegisterVpnEvent([in] IVpnEventCallback callbackparam); 25 void UnregisterVpnEvent([in] IVpnEventCallback callbackparam); 26 void CreateVpnConnection([in] boolean isVpnExtCall); 27 void FactoryResetVpn(); 28 void RegisterBundleName([in] String bundleName, [in] String abilityName); 29 void GetSelfAppName([out] String selfAppName, [out] String selfBundleName); 30 void SetSelfVpnPid(); 31 [macrodef SUPPORT_SYSVPN] void GetVpnCertData([in] int certType, [out] byte[] certData); 32 [macrodef SUPPORT_SYSVPN] void SetUpSysVpn([in] sptr<SysVpnConfig> config, [in] boolean isVpnExtCall); 33 [macrodef SUPPORT_SYSVPN] void AddSysVpnConfig([in] sptr<SysVpnConfig> config); 34 [macrodef SUPPORT_SYSVPN] void DeleteSysVpnConfig([in] String vpnId); 35 [macrodef SUPPORT_SYSVPN] void GetConnectedVpnAppInfo([out]List<String> bundleNameList); 36 [macrodef SUPPORT_SYSVPN] void GetSysVpnConfigList([out] List<sptr<SysVpnConfig>> vpnList); 37 [macrodef SUPPORT_SYSVPN] void GetSysVpnConfig([out] sptr<SysVpnConfig> config, [in] String vpnId); 38 [macrodef SUPPORT_SYSVPN] void GetConnectedSysVpnConfig([out] sptr<SysVpnConfig> config); 39 [macrodef SUPPORT_SYSVPN] void NotifyConnectStage([in] String stage, [in] int resultIpc); 40 [macrodef SUPPORT_SYSVPN] void GetSysVpnCertUri([in] int certType, [out] String certUri); 41 [macrodef SUPPORT_SYSVPN] void DestroyVpn([in] String vpnId); 42 [macrodef SUPPORT_SYSVPN] void RegisterMultiVpnEvent([in] IVpnEventCallback callbackparam); 43 [macrodef SUPPORT_SYSVPN] void UnregisterMultiVpnEvent([in] IVpnEventCallback callbackparam); 44}