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