]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOSX/DNSServiceDiscovery.c
mDNSResponder-878.50.17.tar.gz
[apple/mdnsresponder.git] / mDNSMacOSX / DNSServiceDiscovery.c
1 /* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2002-2012 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 // Suppress "warning: 'DNSServiceDiscoveryMachPort' is deprecated" messages -- we already know this code is building the deprecated API
19 // Since we compile with all warnings treated as errors, we have to turn off the warnings here or the project won't compile
20 #include <AvailabilityMacros.h>
21 #undef AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED
22 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED
23 #undef AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
24 #define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
25
26 #include "../mDNSMacOSX/DNSServiceDiscovery.h"
27 #include "DNSServiceDiscoveryDefines.h"
28
29 #include <stdlib.h>
30 #include <stdio.h>
31 #include <servers/bootstrap.h>
32 #include <mach/mach.h>
33 #include <mach/mach_error.h>
34 #include <pthread.h>
35
36 #include <netinet/in.h>
37
38 extern boolean_t DNSServiceDiscoveryReply_server(
39 mach_msg_header_t *InHeadP,
40 mach_msg_header_t *OutHeadP);
41
42 extern
43 kern_return_t DNSServiceBrowserCreate_rpc
44 (
45 mach_port_t server,
46 mach_port_t client,
47 DNSCString regtype,
48 DNSCString domain
49 );
50
51
52 extern
53 kern_return_t DNSServiceResolverResolve_rpc
54 (
55 mach_port_t server,
56 mach_port_t client,
57 DNSCString name,
58 DNSCString regtype,
59 DNSCString domain
60 );
61
62
63 struct a_requests {
64 struct a_requests *next;
65 mach_port_t client_port;
66 union {
67 DNSServiceBrowserReply browserCallback;
68 DNSServiceDomainEnumerationReply enumCallback;
69 DNSServiceRegistrationReply regCallback;
70 DNSServiceResolverReply resolveCallback;
71 } callout;
72 void *context;
73 };
74
75 typedef struct _dns_service_discovery_t {
76 mach_port_t port;
77 } dns_service_discovery_t;
78
79
80 dns_service_discovery_ref DNSServiceBrowserCreate (const char *regtype, const char *domain, DNSServiceBrowserReply callBack,void *context)
81 {
82
83 (void) regtype; // Unused
84 (void) domain; // Unused
85 (void) callBack; // Unused
86 (void) context; // Unused
87
88 printf("DNSServiceBrowserCreate deprecated since 10.3 \n");
89 return NULL;
90
91 }
92
93 dns_service_discovery_ref DNSServiceResolverResolve(const char *name, const char *regtype, const char *domain, DNSServiceResolverReply callBack, void *context)
94 {
95 (void) name; // Unused
96 (void) regtype; // Unused
97 (void) domain; // Unused
98 (void) callBack; // Unused
99 (void) context; // Unused
100
101 printf("DNSServiceResolverResolve deprecated since 10.3 \n");
102 return NULL;
103
104 }
105
106 void DNSServiceDiscovery_handleReply(void *replyMsg)
107 {
108 (void) replyMsg; // Unused
109 printf("DNSServiceDiscovery_handleReply deprecated since 10.3 \n");
110 }
111
112 mach_port_t DNSServiceDiscoveryMachPort(dns_service_discovery_ref dnsServiceDiscovery)
113 {
114 printf("DNSServiceDiscoveryMachPort deprecated since 10.3 \n");
115 return dnsServiceDiscovery->port;
116 }
117
118 void DNSServiceDiscoveryDeallocate(dns_service_discovery_ref dnsServiceDiscovery)
119 {
120 (void) dnsServiceDiscovery; // Unused
121 printf("DNSServiceDiscoveryDeallocate deprecated since 10.3 \n");
122 }