]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOSX/D2D.h
mDNSResponder-878.30.4.tar.gz
[apple/mdnsresponder.git] / mDNSMacOSX / D2D.h
1 /* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2015-2016 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 #ifndef _D2D_H_
19 #define _D2D_H_
20
21 #include "mDNSEmbeddedAPI.h" // Defines the interface provided to the client layer above
22 #include "dnssd_ipc.h"
23 #include <DeviceToDeviceManager/DeviceToDeviceManager.h>
24
25 extern void internal_start_browsing_for_service(mDNSInterfaceID InterfaceID, const domainname *const type, DNS_TypeValues qtype, DNSServiceFlags flags);
26 extern void internal_stop_browsing_for_service(mDNSInterfaceID InterfaceID, const domainname *const type, DNS_TypeValues qtype, DNSServiceFlags flags);
27 extern void internal_start_advertising_service(const ResourceRecord *const resourceRecord, DNSServiceFlags flags);
28 extern void internal_stop_advertising_service(const ResourceRecord *const resourceRecord, DNSServiceFlags flags);
29
30 void xD2DAddToCache(D2DStatus result, D2DServiceInstance instanceHandle, D2DTransportType transportType, const Byte *key, size_t keySize, const Byte *value, size_t valueSize);
31 void xD2DRemoveFromCache(D2DStatus result, D2DServiceInstance instanceHandle, D2DTransportType transportType, const Byte *key, size_t keySize, const Byte *value, size_t valueSize);
32
33 #if ENABLE_BLE_TRIGGERED_BONJOUR
34 // Just define as the current max value for now for BLE.c prototype.
35 // TODO: Will need to define in DeviceToDeviceManager.framework if we convert the
36 // BLE discovery code to a D2D plugin.
37 #define D2DBLETransport D2DTransportMax
38 #endif // ENABLE_BLE_TRIGGERED_BONJOUR
39
40 #ifdef UNIT_TEST
41 #pragma mark - Unit test declarations
42
43 // Unit test entry points, which are not used in the mDNSResponder runtime code paths.
44 void D2D_unitTest(void);
45
46 #endif // UNIT_TEST
47
48 #endif /* _D2D_H_ */