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