diff options
author | Ken Chen <cken@google.com> | 2023-11-21 01:54:56 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-11-21 01:54:56 +0000 |
commit | e263d3d526c7af3776656c8c099e7abcca6103bd (patch) | |
tree | 38c2cf15cd432b1e02eee0e6fe816bc18ce84d68 | |
parent | 4c87963dbdb362e341ff9604e4c4aa1d8cc0afd3 (diff) | |
parent | 064d545a8e1f8921085b0bff16b42852957dbbd8 (diff) | |
download | netd-e263d3d526c7af3776656c8c099e7abcca6103bd.tar.gz |
Delete MDnsSdListener.h am: 064d545a8e
Original change: https://android-review.googlesource.com/c/platform/system/netd/+/2835835
Change-Id: Idfce2977fa4746058aa400ca08b03bb6d06aa71e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | server/Android.bp | 2 | ||||
-rw-r--r-- | server/MDnsSdListener.h | 121 | ||||
-rw-r--r-- | server/MDnsService.h | 4 |
3 files changed, 0 insertions, 127 deletions
diff --git a/server/Android.bp b/server/Android.bp index 7d3e926d..a143715d 100644 --- a/server/Android.bp +++ b/server/Android.bp @@ -92,7 +92,6 @@ cc_defaults { "netd_defaults", ], include_dirs: [ - "external/mdnsresponder/mDNSShared", "system/netd/include", ], shared_libs: [ @@ -106,7 +105,6 @@ cc_defaults { "libdl", "libhidlbase", "liblog", - "libmdnssd", "libnetd_updatable", "libnetd_resolv", "libnetdutils", diff --git a/server/MDnsSdListener.h b/server/MDnsSdListener.h deleted file mode 100644 index 860b97d3..00000000 --- a/server/MDnsSdListener.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _MDNSSDLISTENER_H__ -#define _MDNSSDLISTENER_H__ - -#include <android-base/thread_annotations.h> -#include <dns_sd.h> -#include <sysutils/FrameworkListener.h> -#include <mutex> -#include <string> -#include <thread> - -#include "NetdCommand.h" - -// callbacks -void MDnsSdListenerDiscoverCallback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t ifIndex, - DNSServiceErrorType errorCode, const char* serviceName, - const char* regType, const char* replyDomain, void* inContext); - -void MDnsSdListenerRegisterCallback(DNSServiceRef sdRef, DNSServiceFlags flags, - DNSServiceErrorType errorCode, const char *serviceName, const char *regType, - const char *domain, void *inContext); - -void MDnsSdListenerResolveCallback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t ifIndex, - DNSServiceErrorType errorCode, const char* fullname, - const char* hosttarget, uint16_t port, uint16_t txtLen, - const unsigned char* txtRecord, void* inContext); - -void MDnsSdListenerSetHostnameCallback(DNSServiceRef, DNSServiceFlags flags, - DNSServiceErrorType errorCode, const char *hostname, void *inContext); - -void MDnsSdListenerGetAddrInfoCallback(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t ifIndex, - DNSServiceErrorType errorCode, const char* hostname, - const struct sockaddr* const sa, uint32_t ttl, - void* inContext); - -class MDnsSdListener { - public: - class Context { - public: - int mRefNumber; - - Context(int refNumber) { mRefNumber = refNumber; } - - ~Context() { - } - }; - - int stop(int requestId); - - int discover(uint32_t ifIndex, const char* regType, const char* domain, const int requestId, - const int requestFlags); - - int serviceRegister(int requestId, const char* serviceName, const char* serviceType, - const char* domain, const char* host, int port, - const std::vector<unsigned char>& txtRecord, uint32_t ifIndex); - - int resolveService(int requestId, uint32_t ifIndex, const char* serviceName, - const char* regType, const char* domain); - - int getAddrInfo(int requestId, uint32_t ifIndex, uint32_t protocol, const char* hostname); - - int startDaemon(); - - int stopDaemon(); - - private: - class Monitor { - public: - Monitor(); - ~Monitor(); - DNSServiceRef *allocateServiceRef(int id, Context *c); - void startMonitoring(int id); - DNSServiceRef *lookupServiceRef(int id); - void freeServiceRef(int id); - int startService(); - int stopService(); - void run(); - void deallocateServiceRef(DNSServiceRef* ref); - std::string threadName() { return std::string("MDnsSdMonitor"); } - - private: - int rescan(); // returns the number of elements in the poll - - struct Element { - Element(int id, Context* context) : mId(id), mContext(context) {} - ~Element() { delete mContext; } - - int mId; - Element* mNext = nullptr; - DNSServiceRef mRef = nullptr; - Context *mContext; - int mReady = 0; - }; - Element* mHead GUARDED_BY(mMutex); - int mLiveCount; - struct pollfd *mPollFds; - DNSServiceRef **mPollRefs; - int mPollSize; - int mCtrlSocketPair[2]; - std::mutex mMutex; - std::thread* mRescanThread; - }; - Monitor mMonitor; -}; - -#endif diff --git a/server/MDnsService.h b/server/MDnsService.h index fc3eca6b..0c5a3dc4 100644 --- a/server/MDnsService.h +++ b/server/MDnsService.h @@ -17,7 +17,6 @@ #pragma once #include "MDnsEventReporter.h" -#include "MDnsSdListener.h" #include <android/net/mdns/aidl/BnMDns.h> #include <binder/BinderService.h> @@ -42,9 +41,6 @@ class MDnsService : public BinderService<MDnsService>, public android::net::mdns const android::sp<android::net::mdns::aidl::IMDnsEventListener>& listener) override; binder::Status unregisterEventListener( const android::sp<android::net::mdns::aidl::IMDnsEventListener>& listener) override; - - private: - MDnsSdListener mListener; }; } // namespace android::net |