]> git.saurik.com Git - apple/mdnsresponder.git/blame - mDNSMacOSX/DNSServiceDiscovery.c
mDNSResponder-878.270.2.tar.gz
[apple/mdnsresponder.git] / mDNSMacOSX / DNSServiceDiscovery.c
CommitLineData
67c8f8a1
A
1/* -*- Mode: C; tab-width: 4 -*-
2 *
2682e09e 3 * Copyright (c) 2002-2018 Apple Inc. All rights reserved.
67c8f8a1
A
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
83fb1e36 8 *
67c8f8a1 9 * http://www.apache.org/licenses/LICENSE-2.0
83fb1e36 10 *
67c8f8a1
A
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
51601d48 18#include "../mDNSMacOSX/DNSServiceDiscovery.h"
67c8f8a1 19#include "DNSServiceDiscoveryDefines.h"
67c8f8a1
A
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
30extern boolean_t DNSServiceDiscoveryReply_server(
83fb1e36
A
31 mach_msg_header_t *InHeadP,
32 mach_msg_header_t *OutHeadP);
67c8f8a1
A
33
34extern
35kern_return_t DNSServiceBrowserCreate_rpc
36(
37 mach_port_t server,
38 mach_port_t client,
39 DNSCString regtype,
40 DNSCString domain
41);
42
67c8f8a1
A
43
44extern
45kern_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
67c8f8a1
A
54
55struct a_requests {
83fb1e36
A
56 struct a_requests *next;
57 mach_port_t client_port;
67c8f8a1 58 union {
83fb1e36
A
59 DNSServiceBrowserReply browserCallback;
60 DNSServiceDomainEnumerationReply enumCallback;
61 DNSServiceRegistrationReply regCallback;
62 DNSServiceResolverReply resolveCallback;
67c8f8a1 63 } callout;
83fb1e36 64 void *context;
67c8f8a1
A
65};
66
67c8f8a1 67typedef struct _dns_service_discovery_t {
83fb1e36 68 mach_port_t port;
67c8f8a1
A
69} dns_service_discovery_t;
70
67c8f8a1
A
71
72dns_service_discovery_ref DNSServiceBrowserCreate (const char *regtype, const char *domain, DNSServiceBrowserReply callBack,void *context)
73{
9f221bca
A
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
67c8f8a1
A
83}
84
67c8f8a1
A
85dns_service_discovery_ref DNSServiceResolverResolve(const char *name, const char *regtype, const char *domain, DNSServiceResolverReply callBack, void *context)
86{
9f221bca
A
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;
67c8f8a1 95
67c8f8a1
A
96}
97
98void DNSServiceDiscovery_handleReply(void *replyMsg)
99{
9f221bca
A
100 (void) replyMsg; // Unused
101 printf("DNSServiceDiscovery_handleReply deprecated since 10.3 \n");
67c8f8a1
A
102}
103
104mach_port_t DNSServiceDiscoveryMachPort(dns_service_discovery_ref dnsServiceDiscovery)
105{
9f221bca 106 printf("DNSServiceDiscoveryMachPort deprecated since 10.3 \n");
67c8f8a1
A
107 return dnsServiceDiscovery->port;
108}
109
110void DNSServiceDiscoveryDeallocate(dns_service_discovery_ref dnsServiceDiscovery)
111{
9f221bca
A
112 (void) dnsServiceDiscovery; // Unused
113 printf("DNSServiceDiscoveryDeallocate deprecated since 10.3 \n");
67c8f8a1 114}