|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Definitions for Windows mDNS service registration. More...
#include <WinSock2.h>#include <Windows.h>#include <WinDNS.h>#include <winerror.h>#include "misc.h"#include "src/config.h"#include "src/logging.h"#include "src/network.h"#include "src/nvhttp.h"#include "src/platform/common.h"#include "src/thread_safe.h"#include "utf_utils.h"Classes | |
| struct | _DNS_SERVICE_CANCEL |
| Windows DNS-SD cancellation request data. More... | |
| struct | _DNS_SERVICE_INSTANCE |
| Windows DNS-SD service instance registration data. More... | |
| struct | _DNS_SERVICE_REGISTER_REQUEST |
| Windows DNS-SD service registration request data. More... | |
| class | platf::publish::mdns_registration_t |
| Windows DNS-SD registration lifetime for the advertised Sunshine service. More... | |
Macros | |
| #define | __SV(quote) |
| Macro for SV. | |
| #define | _FN(x, ret, args) |
| Macro for FN. | |
| #define | SV(quote) |
| Macro for SV. | |
Typedefs | |
| typedef DWORD(* | _DnsServiceDeRegister_fn) (_In_ PDNS_SERVICE_REGISTER_REQUEST pRequest, _Inout_opt_ PDNS_SERVICE_CANCEL pCancel) |
| Function pointer type for the dynamically loaded DNS-SD entry point. | |
| typedef VOID(* | _DnsServiceFreeInstance_fn) (_In_ PDNS_SERVICE_INSTANCE pInstance) |
| Function pointer type for the dynamically loaded DNS-SD entry point. | |
| typedef DWORD(* | _DnsServiceRegister_fn) (_In_ PDNS_SERVICE_REGISTER_REQUEST pRequest, _Inout_opt_ PDNS_SERVICE_CANCEL pCancel) |
| Function pointer type for the dynamically loaded DNS-SD entry point. | |
| typedef struct _DNS_SERVICE_CANCEL | DNS_SERVICE_CANCEL |
| Windows DNS-SD cancellation request data. | |
| typedef struct _DNS_SERVICE_INSTANCE | DNS_SERVICE_INSTANCE |
| Windows DNS-SD service instance registration data. | |
| typedef VOID WINAPI | DNS_SERVICE_REGISTER_COMPLETE(_In_ DWORD Status, _In_ PVOID pQueryContext, _In_ PDNS_SERVICE_INSTANCE pInstance) |
| DNS service registration completion callback. | |
| typedef struct _DNS_SERVICE_REGISTER_REQUEST | DNS_SERVICE_REGISTER_REQUEST |
| Windows DNS-SD service registration request data. | |
| typedef struct _DNS_SERVICE_CANCEL * | PDNS_SERVICE_CANCEL |
| Alias for DNS SERVICE CANCEL. | |
| typedef struct _DNS_SERVICE_INSTANCE * | PDNS_SERVICE_INSTANCE |
| Alias for DNS SERVICE INSTANCE. | |
| typedef DNS_SERVICE_REGISTER_COMPLETE * | PDNS_SERVICE_REGISTER_COMPLETE |
| Pointer to the Windows DNS-SD registration completion callback. | |
| typedef struct _DNS_SERVICE_REGISTER_REQUEST * | PDNS_SERVICE_REGISTER_REQUEST |
| Alias for DNS SERVICE REGISTER REQUEST. | |
Functions | |
| int | platf::publish::load_funcs (HMODULE handle) |
| Resolve required function pointers from the native library. | |
| VOID WINAPI | platf::publish::register_cb (DWORD status, PVOID pQueryContext, PDNS_SERVICE_INSTANCE pInstance) |
| Handle completion of a Windows DNS-SD registration request. | |
| std::unique_ptr< deinit_t > | platf::publish::start () |
| Main entry point for publication of our service on macOS. | |
Variables | |
| constexpr auto | DNS_QUERY_REQUEST_VERSION1 = 0x1 |
| Windows DNS API constant for query request version1. | |
| constexpr auto | DNS_QUERY_RESULTS_VERSION1 = 0x1 |
| Windows DNS API constant for query results version1. | |
| constexpr auto | DNS_REQUEST_PENDING = 9506L |
| Windows DNS API constant for request pending. | |
| constexpr auto | SERVICE_DOMAIN = "local" |
| Protocol or platform constant for service domain. | |
| const auto | SERVICE_TYPE_DOMAIN = std::format("{}.{}"sv, platf::SERVICE_TYPE, SERVICE_DOMAIN) |
| Protocol or platform constant for service type domain. | |
Definitions for Windows mDNS service registration.
| #define __SV | ( | quote | ) |
Macro for SV.
| #define _FN | ( | x, | |
| ret, | |||
| args ) |
| #define SV | ( | quote | ) |
| typedef DWORD(* _DnsServiceDeRegister_fn) (_In_ PDNS_SERVICE_REGISTER_REQUEST pRequest, _Inout_opt_ PDNS_SERVICE_CANCEL pCancel) |
Function pointer type for the dynamically loaded DNS-SD entry point.
| typedef VOID(* _DnsServiceFreeInstance_fn) (_In_ PDNS_SERVICE_INSTANCE pInstance) |
Function pointer type for the dynamically loaded DNS-SD entry point.
| typedef DWORD(* _DnsServiceRegister_fn) (_In_ PDNS_SERVICE_REGISTER_REQUEST pRequest, _Inout_opt_ PDNS_SERVICE_CANCEL pCancel) |
Function pointer type for the dynamically loaded DNS-SD entry point.
| typedef VOID WINAPI DNS_SERVICE_REGISTER_COMPLETE(_In_ DWORD Status, _In_ PVOID pQueryContext, _In_ PDNS_SERVICE_INSTANCE pInstance) |
DNS service registration completion callback.
| Status | Registration status. |
| pQueryContext | User query context. |
| pInstance | DNS service instance. |
| int platf::publish::load_funcs | ( | HMODULE | handle | ) |
Resolve required function pointers from the native library.
| handle | Native library or object handle used by the operation. |
| VOID WINAPI platf::publish::register_cb | ( | DWORD | status, |
| PVOID | pQueryContext, | ||
| PDNS_SERVICE_INSTANCE | pInstance ) |
Handle completion of a Windows DNS-SD registration request.
| status | Native status code returned by the platform API. |
| pQueryContext | Alarm object signaled when registration completes. |
| pInstance | Registered DNS-SD service instance returned by Windows. |
|
nodiscard |
Main entry point for publication of our service on macOS.
This function initiates a connection to the macOS mDNS service and requests to register our Sunshine service. Registration will occur asynchronously (unless it fails immediately, which is probably only possible if the host machine is misconfigured).
nullptr (if the registration fails immediately) or a uniqur_ptr<deinit_t>, which will manage polling for a response from the mDNS service, and then, when deconstructed, will deregister the service.