1 /* 2 * Copyright 2015 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 #ifndef BUFFET_MDNS_CLIENT_H_ 18 #define BUFFET_MDNS_CLIENT_H_ 19 20 #include <map> 21 #include <memory> 22 #include <string> 23 24 #include <base/guid.h> 25 #include <base/memory/ref_counted.h> 26 #include <dbus/bus.h> 27 #include <weave/provider/dns_service_discovery.h> 28 29 namespace buffet { 30 31 // Stub MDNS implementation that does nothing on platform without MDNS support. 32 class MdnsClient : public weave::provider::DnsServiceDiscovery { 33 public: MdnsClient()34 MdnsClient() {} 35 ~MdnsClient() override = default; 36 37 // weave::provider::DnsServiceDiscovery implementation. PublishService(const std::string & service_type,uint16_t port,const std::vector<std::string> & txt)38 void PublishService(const std::string& service_type, uint16_t port, 39 const std::vector<std::string>& txt) override {} StopPublishing(const std::string & service_type)40 void StopPublishing(const std::string& service_type) override {} 41 42 static std::unique_ptr<MdnsClient> CreateInstance(); 43 44 protected: 45 DISALLOW_COPY_AND_ASSIGN(MdnsClient); 46 }; 47 48 } // namespace buffet 49 50 #endif // BUFFET_MDNS_CLIENT_H_ 51