fix(mdns): don't hardcode mDNS instance name (#3084)

This commit is contained in:
Cameron Gutman
2024-08-25 18:20:33 -05:00
committed by GitHub
parent f048510ef7
commit 88ce5077b0
6 changed files with 71 additions and 5 deletions

View File

@@ -105,4 +105,12 @@ namespace net {
*/
int
encryption_mode_for_address(boost::asio::ip::address address);
/**
* @brief Returns a string for use as the instance name for mDNS.
* @param hostname The hostname to use for instance name generation.
* @return Hostname-based instance name or "Sunshine" if hostname is invalid.
*/
std::string
mdns_instance_name(const std::string_view &hostname);
} // namespace net