1 /* -*- Mode: C; tab-width: 4 -*-
3 * Copyright (c) 2015-2019 Apple Inc. All rights reserved.
6 #ifndef _DNS_SD_PRIVATE_H
7 #define _DNS_SD_PRIVATE_H
11 // Private flags (kDNSServiceFlagsPrivateOne, kDNSServiceFlagsPrivateTwo, kDNSServiceFlagsPrivateThree, kDNSServiceFlagsPrivateFour, kDNSServiceFlagsPrivateFive) from dns_sd.h
14 kDNSServiceFlagsDenyConstrained
= 0x2000,
16 * This flag is meaningful only for Unicast DNS queries. When set, the daemon will restrict
17 * DNS resolutions on interfaces defined as constrained for that request.
20 kDNSServiceFlagsDenyCellular
= 0x8000000,
22 * This flag is meaningful only for Unicast DNS queries. When set, the daemon will restrict
23 * DNS resolutions on the cellular interface for that request.
25 kDNSServiceFlagsServiceIndex
= 0x10000000,
27 * This flag is meaningful only for DNSServiceGetAddrInfo() for Unicast DNS queries.
28 * When set, DNSServiceGetAddrInfo() will interpret the "interfaceIndex" argument of the call
29 * as the "serviceIndex".
32 kDNSServiceFlagsDenyExpensive
= 0x20000000,
34 * This flag is meaningful only for Unicast DNS queries. When set, the daemon will restrict
35 * DNS resolutions on interfaces defined as expensive for that request.
38 kDNSServiceFlagsPathEvaluationDone
= 0x40000000
40 * This flag is meaningful for only Unicast DNS queries.
41 * When set, it indicates that Network PathEvaluation has already been performed.
45 #if !defined(DNSSD_NO_CREATE_DELEGATE_CONNECTION) || !DNSSD_NO_CREATE_DELEGATE_CONNECTION
46 /* DNSServiceCreateDelegateConnection()
50 * sdRef: A pointer to an uninitialized DNSServiceRef. Deallocating
51 * the reference (via DNSServiceRefDeallocate()) severs the
52 * connection and deregisters all records registered on this connection.
54 * pid : Process ID of the delegate
56 * uuid: UUID of the delegate
58 * Note that only one of the two arguments (pid or uuid) can be specified. If pid
59 * is zero, uuid will be assumed to be a valid value; otherwise pid will be used.
61 * return value: Returns kDNSServiceErr_NoError on success, otherwise returns
62 * an error code indicating the specific failure that occurred (in which
63 * case the DNSServiceRef is not initialized). kDNSServiceErr_NotAuth is
64 * returned to indicate that the calling process does not have entitlements
68 DNSServiceErrorType DNSSD_API
DNSServiceCreateDelegateConnection(DNSServiceRef
*sdRef
, int32_t pid
, uuid_t uuid
);
71 // Map the source port of the local UDP socket that was opened for sending the DNS query
72 // to the process ID of the application that triggered the DNS resolution.
74 /* DNSServiceGetPID() Parameters:
76 * srcport: Source port (in network byte order) of the UDP socket that was created by
77 * the daemon to send the DNS query on the wire.
79 * pid: Process ID of the application that started the name resolution which triggered
80 * the daemon to send the query on the wire. The value can be -1 if the srcport
83 * return value: Returns kDNSServiceErr_NoError on success, or kDNSServiceErr_ServiceNotRunning
84 * if the daemon is not running. The value of the pid is undefined if the return
88 DNSServiceErrorType DNSSD_API DNSServiceGetPID
95 DNSServiceErrorType DNSSD_API
DNSServiceSetDefaultDomainForUser(DNSServiceFlags flags
, const char *domain
);
97 #define kDNSServiceCompPrivateDNS "PrivateDNS"
98 #define kDNSServiceCompMulticastDNS "MulticastDNS"