2 * Copyright (c) 2018-2019 Apple Inc. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __ClientRequests_h
18 #define __ClientRequests_h
20 #include "mDNSEmbeddedAPI.h"
21 #include "dns_sd_internal.h"
23 typedef void (*QueryRecordResultHandler
)(mDNS
*const m
, DNSQuestion
*question
, const ResourceRecord
*const answer
, QC_result AddRecord
,
24 DNSServiceErrorType error
, void *context
);
28 DNSQuestion q
; // DNSQuestion for record query.
29 domainname
* qname
; // Name of the original record.
30 mDNSInterfaceID interfaceID
; // Interface over which to perform query.
31 QueryRecordResultHandler resultHandler
; // Handler for query record operation results.
32 void * resultContext
; // Context to pass to result handler.
34 int searchListIndex
; // Index that indicates the next search domain to try.
35 #if MDNSRESPONDER_SUPPORTS(APPLE, UNICAST_DOTLOCAL)
36 DNSQuestion
* q2
; // DNSQuestion for unicast version of a record with a dot-local name.
37 mDNSu16 q2Type
; // q2's original qtype value.
38 mDNSBool q2LongLived
; // q2's original LongLived value.
39 mDNSBool q2ReturnIntermed
; // q2's original ReturnIntermed value.
40 mDNSBool q2TimeoutQuestion
; // q2's original TimeoutQuestion value.
41 mDNSBool q2AppendSearchDomains
; // q2's original AppendSearchDomains value.
43 #if MDNSRESPONDER_SUPPORTS(APPLE, REACHABILITY_TRIGGER)
44 mDNSBool answered
; // True if the query was answered.
51 mDNSInterfaceID interfaceID
; // InterfaceID being used for query record operations.
52 mDNSu32 protocols
; // Protocols (IPv4, IPv6) specified by client.
53 QueryRecordOp
* op4
; // Query record operation object for A record.
54 QueryRecordOp
* op6
; // Query record operation object for AAAA record.
56 } GetAddrInfoClientRequest
;
60 QueryRecordOp op
; // Query record operation object.
62 } QueryRecordClientRequest
;
68 mDNSexport mStatus
GetAddrInfoClientRequestStart(GetAddrInfoClientRequest
*inRequest
, mDNSu32 inReqID
,
69 const char *inHostnameStr
, mDNSu32 inInterfaceIndex
, DNSServiceFlags inFlags
, mDNSu32 inProtocols
, mDNSs32 inPID
,
70 const mDNSu8 inUUID
[UUID_SIZE
], mDNSu32 inUID
, QueryRecordResultHandler inResultHandler
, void *inResultContext
);
71 mDNSexport
void GetAddrInfoClientRequestStop(GetAddrInfoClientRequest
*inRequest
);
72 mDNSexport
const domainname
* GetAddrInfoClientRequestGetQName(const GetAddrInfoClientRequest
*inRequest
);
73 mDNSexport mDNSBool
GetAddrInfoClientRequestIsMulticast(const GetAddrInfoClientRequest
*inRequest
);
75 mDNSexport mStatus
QueryRecordClientRequestStart(QueryRecordClientRequest
*inRequest
, mDNSu32 inReqID
,
76 const char *inQNameStr
, mDNSu32 inInterfaceIndex
, DNSServiceFlags inFlags
, mDNSu16 inQType
, mDNSu16 inQClass
,
77 mDNSs32 inPID
, mDNSu8 inUUID
[UUID_SIZE
], mDNSu32 inUID
, QueryRecordResultHandler inResultHandler
, void *inResultContext
);
78 mDNSexport
void QueryRecordClientRequestStop(QueryRecordClientRequest
*inRequest
);
79 mDNSexport
const domainname
* QueryRecordClientRequestGetQName(const QueryRecordClientRequest
*inRequest
);
80 mDNSexport mDNSu16
QueryRecordClientRequestGetType(const QueryRecordClientRequest
*inRequest
);
81 mDNSexport mDNSBool
QueryRecordClientRequestIsMulticast(QueryRecordClientRequest
*inRequest
);
87 #endif // __ClientRequests_h