1 /* 2 * Copyright (c) 2023 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 VPN_CONNECTION_H 17 #define VPN_CONNECTION_H 18 19 #include <napi/native_api.h> 20 21 namespace OHOS { 22 namespace NetManagerStandard { 23 namespace { 24 constexpr const char *VPN_EXT_MODULE_NAME = "net.vpnExtension"; 25 constexpr const char *CREATE_VPN_CONNECTION = "createVpnConnection"; 26 constexpr const char *START_VPN_EXTENSION = "startVpnExtensionAbility"; 27 constexpr const char *STOP_VPN_EXTENSION = "stopVpnExtensionAbility"; 28 constexpr const char *UPDATE_VPN_AUTHORIZE = "updateVpnAuthorizedState"; 29 constexpr const char *VPN_CONNECTION_EXT = "VpnConnectionExt"; 30 constexpr const char *PREPARE = "prepare"; 31 constexpr const char *SET_UP_EXT = "create"; 32 constexpr const char *PROTECT_EXT = "protect"; 33 constexpr const char *DESTROY_EXT = "destroy"; 34 constexpr const char *ON = "on"; 35 constexpr const char *OFF = "off"; 36 constexpr const char *VPNEXT_MODE_URI = 37 "datashare:///com.ohos.settingsdata/entry/settingsdata/SETTINGSDATA?Proxy=true&key=vpnext_mode"; 38 } // namespace 39 40 namespace VpnConnectionExt { 41 napi_value Prepare(napi_env env, napi_callback_info info); 42 napi_value SetUp(napi_env env, napi_callback_info info); 43 napi_value Protect(napi_env env, napi_callback_info info); 44 napi_value Destroy(napi_env env, napi_callback_info info); 45 napi_value On(napi_env env, napi_callback_info info); 46 napi_value Off(napi_env env, napi_callback_info info); 47 } // namespace VpnConnectionExt 48 } // namespace NetManagerStandard 49 } // namespace OHOS 50 #endif // VPN_CONNECTION_H