1 /* 2 * Copyright (c) 2021-2022 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 I_ETHERNET_SERVICE_H 17 #define I_ETHERNET_SERVICE_H 18 19 #include <string> 20 #include <vector> 21 22 #include "interface_configuration.h" 23 #include "interface_type.h" 24 #include "iremote_broker.h" 25 #include "iremote_object.h" 26 27 namespace OHOS { 28 namespace NetManagerStandard { 29 constexpr int32_t GET_CFG_SUC = 1; 30 class IEthernetService : public IRemoteBroker { 31 public: 32 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.NetManagerStandard.IEthernetService"); 33 enum { 34 CMD_SET_IF_CFG, 35 CMD_GET_IF_CFG, 36 CMD_IS_ACTIVATE, 37 CMD_GET_ACTIVATE_INTERFACE, 38 CMD_RESET_FACTORY, 39 CMD_SET_INTERFACE_UP, 40 CMD_SET_INTERFACE_DOWN, 41 CMD_GET_INTERFACE_CONFIG, 42 }; 43 44 public: 45 virtual int32_t SetIfaceConfig(const std::string &iface, sptr<InterfaceConfiguration> &ic) = 0; 46 virtual int32_t GetIfaceConfig(const std::string &iface, sptr<InterfaceConfiguration> &ifaceConfig) = 0; 47 virtual int32_t IsIfaceActive(const std::string &iface, int32_t &activeStatus) = 0; 48 virtual int32_t GetAllActiveIfaces(std::vector<std::string> &activeIfaces) = 0; 49 virtual int32_t ResetFactory() = 0; 50 virtual int32_t SetInterfaceUp(const std::string &iface) = 0; 51 virtual int32_t SetInterfaceDown(const std::string &iface) = 0; 52 virtual int32_t GetInterfaceConfig(const std::string &iface, OHOS::nmd::InterfaceConfigurationParcel &cfg) = 0; 53 }; 54 } // namespace NetManagerStandard 55 } // namespace OHOS 56 #endif // I_ETHERNET_SERVICE_H