| # Copyright (c) 2020 Project CHIP Authors |
| # |
| # 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. |
| |
| import("//build_overrides/chip.gni") |
| |
| declare_args() { |
| # Makes unicast queries use a separate UDP endpoint that have an ephemeral port |
| # |
| # In practice this means unicast replies will be received on a dedicated port |
| # and will work even if competing mdns servers (including other chip apps) |
| # run on the same machine. |
| # |
| # Downside is that replies sent to a port other than 5353 are considered |
| # LEGACY by mDNS and will include the query section in them (i.e. larger |
| # payloads) and clients need to allocate more resources for this (need one |
| # more UDP socket and corresponding code for the unicast query sending) |
| chip_use_ephemeral_port_for_mdns_unicast_query = |
| current_os == "mac" || current_os == "linux" || current_os == "android" |
| } |
| |
| config("config") { |
| defines = [] |
| |
| if (chip_use_ephemeral_port_for_mdns_unicast_query) { |
| defines += [ "CHIP_MINMDNS_USE_EPHEMERAL_UNICAST_PORT=1" ] |
| } else { |
| defines += [ "CHIP_MINMDNS_USE_EPHEMERAL_UNICAST_PORT=0" ] |
| } |
| } |
| |
| static_library("minimal_mdns") { |
| sources = [ |
| "ActiveResolveAttempts.cpp", |
| "ActiveResolveAttempts.h", |
| "Parser.cpp", |
| "Parser.h", |
| "Query.h", |
| "QueryBuilder.h", |
| "QueryReplyFilter.h", |
| "RecordData.cpp", |
| "RecordData.h", |
| "ResponseBuilder.h", |
| "ResponseSender.cpp", |
| "ResponseSender.h", |
| "Server.cpp", |
| "Server.h", |
| ] |
| |
| public_deps = [ |
| "${chip_root}/src/inet", |
| "${chip_root}/src/lib/core", |
| "${chip_root}/src/lib/dnssd/minimal_mdns/core", |
| "${chip_root}/src/lib/dnssd/minimal_mdns/responders", |
| "${chip_root}/src/platform", |
| ] |
| |
| public_configs = [ ":config" ] |
| } |