Skip to content

Commit

Permalink
Move protocol information to dedicated public protocol header.
Browse files Browse the repository at this point in the history
  • Loading branch information
abeltrano committed May 7, 2024
1 parent 8bddb75 commit 9ece533
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,43 @@ struct NetRemoteProtocol
#define xstr(s) str(s)
#define str(s) #s

/**
* @brief Primary service related definitions.
*/

/**
* @brief Default port if none specified.
*/
static constexpr uint32_t PortDefault{ PORT_DEFAULT };

/**
* @brief Port separator for address parsing.
*/
static constexpr std::string_view PortSeparator{ PORT_SEPARATOR };

/**
* @brief Default IP address if none specified.
*/
static constexpr std::string_view IpDefault{ IP_DEFAULT };

/**
* @brief Default address if none specified; includes default port.
*/
static constexpr std::string_view AddressDefault{ IP_DEFAULT PORT_SEPARATOR xstr(PORT_DEFAULT) };

/**
* @brief Discovery service related definitions.
*/

static constexpr auto DnssdServiceName = "netremote";

/**
* @brief Note that all non-TCP protocols must use "udp" as the protocol value, even if the protocol is not "udp".
* See RFC 6763 "DNS-Based Service Discovery", section 4.1.2 "Service Names" and and section 7 "Service Names" for
* additional details and reasoning.
*/
static constexpr auto DnssdServiceProtocol = "udp";

#undef IP_DEFAULT
#undef PORT_DEFAULT
#undef PORT_SEPARATOR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ namespace Microsoft::Net::Remote
{
struct DnssdServiceBuilder
{
static constexpr auto NetRemoteDnssdServiceName = "netremote";

/**
* @brief Note that all non-TCP protocols must use "udp" as the protocol value, even if the protocol is not "udp".
* See RFC 6763 "DNS-Based Service Discovery", section 4.1.2 "Service Names" and and section 7 "Service Names" for
* additional details and reasoning.
*/
static constexpr auto NetRemoteDnssdServiceProtocol = "udp";
};
} // namespace Microsoft::Net::Remote

Expand Down

0 comments on commit 9ece533

Please sign in to comment.