blob: fc3eca6b595b6607fbcb57fce1bc51c48c094760 [file] [log] [blame]
paulhuc8a58ff2022-02-09 18:37:27 +08001/**
2 * Copyright (c) 2022, The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
paulhu72742952022-02-09 21:24:09 +080019#include "MDnsEventReporter.h"
paulhu1ad658f2022-02-10 21:54:34 +080020#include "MDnsSdListener.h"
paulhu72742952022-02-09 21:24:09 +080021
paulhuc8a58ff2022-02-09 18:37:27 +080022#include <android/net/mdns/aidl/BnMDns.h>
23#include <binder/BinderService.h>
24
25namespace android::net {
26
27class MDnsService : public BinderService<MDnsService>, public android::net::mdns::aidl::BnMDns {
28 public:
29 static status_t start();
30 static char const* getServiceName() { return "mdns"; }
31
32 binder::Status startDaemon() override;
33 binder::Status stopDaemon() override;
34 binder::Status registerService(
35 const ::android::net::mdns::aidl::RegistrationInfo& info) override;
36 binder::Status discover(const ::android::net::mdns::aidl::DiscoveryInfo& info) override;
37 binder::Status resolve(const ::android::net::mdns::aidl::ResolutionInfo& info) override;
38 binder::Status getServiceAddress(
39 const ::android::net::mdns::aidl::GetAddressInfo& info) override;
40 binder::Status stopOperation(int32_t id) override;
41 binder::Status registerEventListener(
42 const android::sp<android::net::mdns::aidl::IMDnsEventListener>& listener) override;
43 binder::Status unregisterEventListener(
44 const android::sp<android::net::mdns::aidl::IMDnsEventListener>& listener) override;
paulhu1ad658f2022-02-10 21:54:34 +080045
46 private:
47 MDnsSdListener mListener;
paulhuc8a58ff2022-02-09 18:37:27 +080048};
49
50} // namespace android::net