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