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 COMMUNICATIONNETMANAGEREXT_MDNS_EXEC_H 17 #define COMMUNICATIONNETMANAGEREXT_MDNS_EXEC_H 18 19 #include <netdb.h> 20 21 #include "napi/native_api.h" 22 #include "nocopyable.h" 23 24 #include "mdns_addlocalservice_context.h" 25 #include "mdns_removelocalservice_context.h" 26 #include "mdns_resolvelocalservice_context.h" 27 #include "mdns_startsearching_context.h" 28 29 namespace OHOS { 30 namespace NetManagerStandard { 31 class MDnsExec final { 32 public: 33 DISALLOW_COPY_AND_MOVE(MDnsExec); 34 35 MDnsExec() = delete; 36 ~MDnsExec() = delete; 37 38 static bool ExecAddLocalService(MDnsAddLocalServiceContext *context); 39 static bool ExecRemoveLocalService(MDnsRemoveLocalServiceContext *context); 40 static bool ExecResolveLocalService(MDnsResolveLocalServiceContext *context); 41 static bool ExecStartSearchingMDNS(MDnsStartSearchingContext *context); 42 static bool ExecStopSearchingMDNS(MDnsStopSearchingContext *context); 43 44 static napi_value AddLocalServiceCallback(MDnsAddLocalServiceContext *context); 45 static napi_value RemoveLocalServiceCallback(MDnsRemoveLocalServiceContext *context); 46 static napi_value ResolveLocalServiceCallback(MDnsResolveLocalServiceContext *context); 47 static napi_value StartSearchingMDNSCallback(MDnsStartSearchingContext *context); 48 static napi_value StopSearchingMDNSCallback(MDnsStopSearchingContext *context); 49 }; 50 } // namespace NetManagerStandard 51 } // namespace OHOS 52 #endif // COMMUNICATIONNETMANAGEREXT_MDNS_EXEC_H 53