1 /* 2 * Copyright (c) 2022-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 I_NETSHARE_SERVICE_H 17 #define I_NETSHARE_SERVICE_H 18 19 #include <string> 20 #include <vector> 21 22 #include "iremote_broker.h" 23 #include "iremote_object.h" 24 25 #include "net_manager_ext_constants.h" 26 #include "i_netshare_result_callback.h" 27 #include "i_sharing_event_callback.h" 28 #include "tethering_ipc_interface_code.h" 29 30 namespace OHOS { 31 namespace NetManagerStandard { 32 class INetworkShareService : public IRemoteBroker { 33 public: 34 virtual int32_t IsNetworkSharingSupported(int32_t &supported) = 0; 35 virtual int32_t IsSharing(int32_t &sharingStatus) = 0; 36 virtual int32_t StartNetworkSharing(const SharingIfaceType &type) = 0; 37 virtual int32_t StopNetworkSharing(const SharingIfaceType &type) = 0; 38 virtual int32_t GetSharableRegexs(SharingIfaceType type, std::vector<std::string> &ifaceRegexs) = 0; 39 virtual int32_t GetSharingState(SharingIfaceType type, SharingIfaceState &state) = 0; 40 virtual int32_t GetNetSharingIfaces(const SharingIfaceState &state, std::vector<std::string> &ifaces) = 0; 41 virtual int32_t RegisterSharingEvent(sptr<ISharingEventCallback> callback) = 0; 42 virtual int32_t UnregisterSharingEvent(sptr<ISharingEventCallback> callback) = 0; 43 virtual int32_t GetStatsRxBytes(int32_t &bytes) = 0; 44 virtual int32_t GetStatsTxBytes(int32_t &bytes) = 0; 45 virtual int32_t GetStatsTotalBytes(int32_t &bytes) = 0; 46 47 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.NetManagerStandard.INetworkShareService"); 48 }; 49 } // namespace NetManagerStandard 50 } // namespace OHOS 51 #endif // I_NETSHARE_SERVICE_H 52