• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 L2TP_VPN_INTERFACE_H
17 #define L2TP_VPN_INTERFACE_H
18 
19 #include <cstdint>
20 
21 #include "ipsecvpn_config.h"
22 #include "ipsec_vpn_ctl.h"
23 #include "l2tpvpn_config.h"
24 #include "net_vpn_impl.h"
25 
26 namespace OHOS {
27 namespace NetManagerStandard {
28 namespace {
29 const std::string L2TP_IPSEC_CONFIGURED_TAG = "xl2tpdstart";
30 const std::string L2TP_IPSEC_CONNECTED_TAG = "pppdstart";
31 } // namespace
32 class L2tpVpnCtl : public IpsecVpnCtl {
33 public:
34     L2tpVpnCtl(sptr<VpnConfig> config, const std::string &pkg, int32_t userId, std::vector<int32_t> &activeUserIds);
35     ~L2tpVpnCtl() = default;
36 
37     int32_t GetConnectedSysVpnConfig(sptr<SysVpnConfig> &sysVpnConfig) override;
38     int32_t NotifyConnectStage(const std::string &stage, const int32_t &result) override;
39     int32_t GetSysVpnCertUri(const int32_t certType, std::string &certUri) override;
40 
41 private:
42     int32_t StartSysVpn() override;
43     int32_t StopSysVpn() override;
44     int32_t InitConfigFile() override;
45 };
46 } // namespace NetManagerStandard
47 } // namespace OHOS
48 #endif // L2TP_VPN_INTERFACE_H
49