nmos-cpp icon indicating copy to clipboard operation
nmos-cpp copied to clipboard

Feature request: Compile-time option to exclude mDNS

Open DouglasHeriot opened this issue 5 years ago • 2 comments

In our environment we have no plans to use mDNS, as following JT-NM TR-1001 recommends we will use unicast DNS.

Our environment will run nmos-cpp inside Docker on a totally separate subnet to anything media related. To keep the container and runtime environment simple I'd like to build nmos-cpp without any mDNS support. It will avoid having to download either mDNSResponder or Avahi at build time, and avoid running them at runtime.

I plan to modify the CMake files so that if neither mDNSReponsder or Avahi libraries are discovered, the mdns_static library should not be built or linked. If detecting the presence of these libraries is too complicated, I may add it as a CMake manual option instead.

I see the BUILD_LLDP is a CMake cache option - maybe for consistency I'll go straight to implementing BUILD_MDNS in the same way.

DouglasHeriot avatar Jun 09 '20 16:06 DouglasHeriot

@DouglasHeriot You are aware you can easily disable mDNS support for the registry in the existing setups? Just set the following in the registry JSON configuration

"pri": 2147483647

rhastie avatar Jun 09 '20 16:06 rhastie

As @rhastie says, nmos-cpp uses either Avahi or mDNSResponder to implement both mDNS and unicast DNS-SD. You can disable browsing and advertisement via mDNS at run-time by configuring the pri in settings to the magic number, max int, 2147483647.

Service discovery would still be required even if mDNS were disabled at compile time. This would involve writing an alternative implementation of mdns::details::service_discovery_impl that used a different underlying library to do unicast DNS-SD which could be wired up to the Node behaviour thread, etc. Does that make sense?

garethsb avatar Jun 10 '20 16:06 garethsb