source: rtems-libbsd/mDNSResponder/mDNSMacOSX/DNSServiceDiscovery.h @ 4a5f546

55-freebsd-126-freebsd-12
Last change on this file since 4a5f546 was f01edf1, checked in by Sebastian Huber <sebastian.huber@…>, on 09/19/18 at 06:53:26

mDNSResponder: Update to v765.1.2

The sources can be obtained via:

https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-765.1.2.tar.gz

Move mDNS_StartResolveService() and mDNS_StopResolveService() to an
RTEMS-specific file (rtemsbsd/mdns/mDNSResolveService.c) using the
v576.30.4 implementation. Apple removed these functions without
explanation.

Update #3522.

  • Property mode set to 100644
File size: 6.7 KB
Line 
1/* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2002, 2004, 2006, 2011 Apple Inc. All rights reserved.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*!     @header         DNS Service Discovery (Deprecated Mach-based API)
19 *
20 * @discussion  Note that this API was deprecated in Mac OS X 10.3, and replaced
21 *                              by the portable cross-platform /usr/include/dns_sd.h API.
22 */
23
24#ifndef __DNS_SERVICE_DISCOVERY_H
25#define __DNS_SERVICE_DISCOVERY_H
26
27#include <mach/mach_types.h>
28
29#include <sys/types.h>
30#include <sys/socket.h>
31#include <sys/cdefs.h>
32
33#include <netinet/in.h>
34
35#include <AvailabilityMacros.h>
36
37__BEGIN_DECLS
38
39/* Opaque internal data type */
40typedef struct _dns_service_discovery_t * dns_service_discovery_ref;
41
42/* possible reply flags values */
43
44enum {
45    kDNSServiceDiscoveryNoFlags         = 0,
46    kDNSServiceDiscoveryMoreRepliesImmediately  = 1 << 0,
47};
48
49
50typedef enum
51{
52    DNSServiceDomainEnumerationReplyAddDomain,
53    DNSServiceDomainEnumerationReplyAddDomainDefault,
54    DNSServiceDomainEnumerationReplyRemoveDomain,
55} DNSServiceDomainEnumerationReplyResultType;
56
57typedef enum
58{
59    DNSServiceDiscoverReplyFlagsFinished,
60    DNSServiceDiscoverReplyFlagsMoreComing,
61} DNSServiceDiscoveryReplyFlags;
62
63typedef void (*DNSServiceDomainEnumerationReply)(
64    DNSServiceDomainEnumerationReplyResultType resultType,  // One of DNSServiceDomainEnumerationReplyResultType
65    const char                                *replyDomain,
66    DNSServiceDiscoveryReplyFlags              flags,       // DNS Service Discovery reply flags information
67    void                                      *context
68);
69
70
71/* possible error code values */
72typedef enum
73{
74    kDNSServiceDiscoveryNoError     = 0,
75} DNSServiceRegistrationReplyErrorType;
76
77typedef void (*DNSServiceRegistrationReply)(
78    DNSServiceRegistrationReplyErrorType errorCode,
79    void                                        *context
80);
81
82typedef uint32_t DNSRecordReference;
83
84
85/*!
86   @function DNSServiceResolver_handleReply
87   @discussion This function should be called with the Mach message sent
88   to the port returned by the call to DNSServiceResolverResolve.
89   The reply message will be interpreted and will result in a
90   call to the specified callout function.
91   @param replyMsg The Mach message.
92 */
93void DNSServiceDiscovery_handleReply(void *replyMsg);
94
95/***************************************************************************/
96/*   DNS Service Browser   */
97
98typedef enum
99{
100    DNSServiceBrowserReplyAddInstance,  // Instance of service found
101    DNSServiceBrowserReplyRemoveInstance    // Instance has been removed from network
102} DNSServiceBrowserReplyResultType;
103
104typedef void (*DNSServiceBrowserReply)(
105    DNSServiceBrowserReplyResultType resultType,                // One of DNSServiceBrowserReplyResultType
106    const char      *replyName,
107    const char      *replyType,
108    const char      *replyDomain,
109    DNSServiceDiscoveryReplyFlags flags,                        // DNS Service Discovery reply flags information
110    void            *context
111    );
112
113/*!
114    @function DNSServiceBrowserCreate
115    @discussion Asynchronously create a DNS Service browser
116    @param regtype The type of service
117    @param domain The domain in which to find the service
118    @param callBack The function to be called when service instances are found or removed
119    @param context A user specified context which will be passed to the callout function.
120    @result A dns_registration_t
121 */
122dns_service_discovery_ref DNSServiceBrowserCreate
123(
124    const char      *regtype,
125    const char      *domain,
126    DNSServiceBrowserReply callBack,
127    void        *context
128) AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3;
129
130/***************************************************************************/
131/* Resolver requests */
132
133typedef void (*DNSServiceResolverReply)(
134    struct sockaddr     *interface,     // Needed for scoped addresses like link-local
135    struct sockaddr     *address,
136    const char          *txtRecord,
137    DNSServiceDiscoveryReplyFlags flags,                        // DNS Service Discovery reply flags information
138    void                *context
139    );
140
141/*!
142   @function DNSServiceResolverResolve
143    @discussion Resolved a named instance of a service to its address, port, and
144        (optionally) other demultiplexing information contained in the TXT record.
145    @param name The name of the service instance
146    @param regtype The type of service
147    @param domain The domain in which to find the service
148    @param callBack The DNSServiceResolverReply function to be called when the specified
149        address has been resolved.
150    @param context A user specified context which will be passed to the callout function.
151    @result A dns_registration_t
152 */
153
154dns_service_discovery_ref DNSServiceResolverResolve
155(
156    const char      *name,
157    const char      *regtype,
158    const char      *domain,
159    DNSServiceResolverReply callBack,
160    void        *context
161) AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3;
162
163/***************************************************************************/
164/* Mach port accessor and deallocation */
165
166/*!
167    @function DNSServiceDiscoveryMachPort
168    @discussion Returns the mach port for a dns_service_discovery_ref
169    @param registration A dns_service_discovery_ref as returned from DNSServiceRegistrationCreate
170    @result A mach reply port which will be sent messages as appropriate.
171        These messages should be passed to the DNSServiceDiscovery_handleReply
172        function.  A NULL value indicates that no address was
173        specified or some other error occurred which prevented the
174        resolution from being started.
175 */
176mach_port_t DNSServiceDiscoveryMachPort(dns_service_discovery_ref dnsServiceDiscovery) AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3;
177
178/*!
179    @function DNSServiceDiscoveryDeallocate
180    @discussion Deallocates the DNS Service Discovery type / closes the connection to the server
181    @param dnsServiceDiscovery A dns_service_discovery_ref as returned from a creation or enumeration call
182    @result void
183 */
184void DNSServiceDiscoveryDeallocate(dns_service_discovery_ref dnsServiceDiscovery) AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3;
185
186__END_DECLS
187
188#endif  /* __DNS_SERVICE_DISCOVERY_H */
Note: See TracBrowser for help on using the repository browser.