astro-dnssd 0.1.3

Simple & safe DNS-SD wrapper
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
/* automatically generated by rust-bindgen */
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(dead_code)]

pub const kDNSServiceMaxServiceName: u32 = 64;
pub const kDNSServiceMaxDomainName: u32 = 1009;
pub const kDNSServiceInterfaceIndexAny: u32 = 0;
pub const kDNSServiceProperty_DaemonVersion: &'static [u8; 14usize] = b"DaemonVersion\0";
pub type dnssd_sock_t = ::std::os::raw::c_int;
pub type dispatch_queue_t = *mut dispatch_queue_s;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dispatch_queue_s {
    pub _address: u8,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _DNSServiceRef_t {
    _unused: [u8; 0],
}
pub type DNSServiceRef = *mut _DNSServiceRef_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _DNSRecordRef_t {
    _unused: [u8; 0],
}
pub type DNSRecordRef = *mut _DNSRecordRef_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sockaddr {
    _unused: [u8; 0],
}
pub const kDNSServiceFlagsMoreComing: _bindgen_ty_3 = 1;
pub const kDNSServiceFlagsAutoTrigger: _bindgen_ty_3 = 1;
pub const kDNSServiceFlagsAdd: _bindgen_ty_3 = 2;
pub const kDNSServiceFlagsDefault: _bindgen_ty_3 = 4;
pub const kDNSServiceFlagsNoAutoRename: _bindgen_ty_3 = 8;
pub const kDNSServiceFlagsShared: _bindgen_ty_3 = 16;
pub const kDNSServiceFlagsUnique: _bindgen_ty_3 = 32;
pub const kDNSServiceFlagsBrowseDomains: _bindgen_ty_3 = 64;
pub const kDNSServiceFlagsRegistrationDomains: _bindgen_ty_3 = 128;
pub const kDNSServiceFlagsLongLivedQuery: _bindgen_ty_3 = 256;
pub const kDNSServiceFlagsAllowRemoteQuery: _bindgen_ty_3 = 512;
pub const kDNSServiceFlagsForceMulticast: _bindgen_ty_3 = 1024;
pub const kDNSServiceFlagsForce: _bindgen_ty_3 = 2048;
pub const kDNSServiceFlagsKnownUnique: _bindgen_ty_3 = 2048;
pub const kDNSServiceFlagsReturnIntermediates: _bindgen_ty_3 = 4096;
pub const kDNSServiceFlagsShareConnection: _bindgen_ty_3 = 16384;
pub const kDNSServiceFlagsSuppressUnusable: _bindgen_ty_3 = 32768;
pub const kDNSServiceFlagsTimeout: _bindgen_ty_3 = 65536;
pub const kDNSServiceFlagsIncludeP2P: _bindgen_ty_3 = 131072;
pub const kDNSServiceFlagsWakeOnResolve: _bindgen_ty_3 = 262144;
pub const kDNSServiceFlagsBackgroundTrafficClass: _bindgen_ty_3 = 524288;
pub const kDNSServiceFlagsIncludeAWDL: _bindgen_ty_3 = 1048576;
pub const kDNSServiceFlagsValidate: _bindgen_ty_3 = 2097152;
pub const kDNSServiceFlagsSecure: _bindgen_ty_3 = 2097168;
pub const kDNSServiceFlagsInsecure: _bindgen_ty_3 = 2097184;
pub const kDNSServiceFlagsBogus: _bindgen_ty_3 = 2097216;
pub const kDNSServiceFlagsIndeterminate: _bindgen_ty_3 = 2097280;
pub const kDNSServiceFlagsUnicastResponse: _bindgen_ty_3 = 4194304;
pub const kDNSServiceFlagsValidateOptional: _bindgen_ty_3 = 8388608;
pub const kDNSServiceFlagsWakeOnlyService: _bindgen_ty_3 = 16777216;
pub const kDNSServiceFlagsThresholdOne: _bindgen_ty_3 = 33554432;
pub const kDNSServiceFlagsThresholdFinder: _bindgen_ty_3 = 67108864;
pub const kDNSServiceFlagsThresholdReached: _bindgen_ty_3 = 33554432;
pub const kDNSServiceFlagsPrivateOne: _bindgen_ty_3 = 8192;
pub const kDNSServiceFlagsPrivateTwo: _bindgen_ty_3 = 134217728;
pub const kDNSServiceFlagsPrivateThree: _bindgen_ty_3 = 268435456;
pub const kDNSServiceFlagsPrivateFour: _bindgen_ty_3 = 536870912;
pub const kDNSServiceFlagsPrivateFive: _bindgen_ty_3 = 1073741824;
pub const kDNSServiceFlagAnsweredFromCache: _bindgen_ty_3 = 1073741824;
pub const kDNSServiceFlagsAllowExpiredAnswers: _bindgen_ty_3 = 2147483648;
pub const kDNSServiceFlagsExpiredAnswer: _bindgen_ty_3 = 2147483648;
pub type _bindgen_ty_3 = u32;
pub const kDNSServiceProtocol_IPv4: _bindgen_ty_4 = 1;
pub const kDNSServiceProtocol_IPv6: _bindgen_ty_4 = 2;
pub const kDNSServiceProtocol_UDP: _bindgen_ty_4 = 16;
pub const kDNSServiceProtocol_TCP: _bindgen_ty_4 = 32;
pub type _bindgen_ty_4 = u32;
pub const kDNSServiceClass_IN: _bindgen_ty_5 = 1;
pub type _bindgen_ty_5 = u32;
pub const kDNSServiceType_A: _bindgen_ty_6 = 1;
pub const kDNSServiceType_NS: _bindgen_ty_6 = 2;
pub const kDNSServiceType_MD: _bindgen_ty_6 = 3;
pub const kDNSServiceType_MF: _bindgen_ty_6 = 4;
pub const kDNSServiceType_CNAME: _bindgen_ty_6 = 5;
pub const kDNSServiceType_SOA: _bindgen_ty_6 = 6;
pub const kDNSServiceType_MB: _bindgen_ty_6 = 7;
pub const kDNSServiceType_MG: _bindgen_ty_6 = 8;
pub const kDNSServiceType_MR: _bindgen_ty_6 = 9;
pub const kDNSServiceType_NULL: _bindgen_ty_6 = 10;
pub const kDNSServiceType_WKS: _bindgen_ty_6 = 11;
pub const kDNSServiceType_PTR: _bindgen_ty_6 = 12;
pub const kDNSServiceType_HINFO: _bindgen_ty_6 = 13;
pub const kDNSServiceType_MINFO: _bindgen_ty_6 = 14;
pub const kDNSServiceType_MX: _bindgen_ty_6 = 15;
pub const kDNSServiceType_TXT: _bindgen_ty_6 = 16;
pub const kDNSServiceType_RP: _bindgen_ty_6 = 17;
pub const kDNSServiceType_AFSDB: _bindgen_ty_6 = 18;
pub const kDNSServiceType_X25: _bindgen_ty_6 = 19;
pub const kDNSServiceType_ISDN: _bindgen_ty_6 = 20;
pub const kDNSServiceType_RT: _bindgen_ty_6 = 21;
pub const kDNSServiceType_NSAP: _bindgen_ty_6 = 22;
pub const kDNSServiceType_NSAP_PTR: _bindgen_ty_6 = 23;
pub const kDNSServiceType_SIG: _bindgen_ty_6 = 24;
pub const kDNSServiceType_KEY: _bindgen_ty_6 = 25;
pub const kDNSServiceType_PX: _bindgen_ty_6 = 26;
pub const kDNSServiceType_GPOS: _bindgen_ty_6 = 27;
pub const kDNSServiceType_AAAA: _bindgen_ty_6 = 28;
pub const kDNSServiceType_LOC: _bindgen_ty_6 = 29;
pub const kDNSServiceType_NXT: _bindgen_ty_6 = 30;
pub const kDNSServiceType_EID: _bindgen_ty_6 = 31;
pub const kDNSServiceType_NIMLOC: _bindgen_ty_6 = 32;
pub const kDNSServiceType_SRV: _bindgen_ty_6 = 33;
pub const kDNSServiceType_ATMA: _bindgen_ty_6 = 34;
pub const kDNSServiceType_NAPTR: _bindgen_ty_6 = 35;
pub const kDNSServiceType_KX: _bindgen_ty_6 = 36;
pub const kDNSServiceType_CERT: _bindgen_ty_6 = 37;
pub const kDNSServiceType_A6: _bindgen_ty_6 = 38;
pub const kDNSServiceType_DNAME: _bindgen_ty_6 = 39;
pub const kDNSServiceType_SINK: _bindgen_ty_6 = 40;
pub const kDNSServiceType_OPT: _bindgen_ty_6 = 41;
pub const kDNSServiceType_APL: _bindgen_ty_6 = 42;
pub const kDNSServiceType_DS: _bindgen_ty_6 = 43;
pub const kDNSServiceType_SSHFP: _bindgen_ty_6 = 44;
pub const kDNSServiceType_IPSECKEY: _bindgen_ty_6 = 45;
pub const kDNSServiceType_RRSIG: _bindgen_ty_6 = 46;
pub const kDNSServiceType_NSEC: _bindgen_ty_6 = 47;
pub const kDNSServiceType_DNSKEY: _bindgen_ty_6 = 48;
pub const kDNSServiceType_DHCID: _bindgen_ty_6 = 49;
pub const kDNSServiceType_NSEC3: _bindgen_ty_6 = 50;
pub const kDNSServiceType_NSEC3PARAM: _bindgen_ty_6 = 51;
pub const kDNSServiceType_HIP: _bindgen_ty_6 = 55;
pub const kDNSServiceType_SPF: _bindgen_ty_6 = 99;
pub const kDNSServiceType_UINFO: _bindgen_ty_6 = 100;
pub const kDNSServiceType_UID: _bindgen_ty_6 = 101;
pub const kDNSServiceType_GID: _bindgen_ty_6 = 102;
pub const kDNSServiceType_UNSPEC: _bindgen_ty_6 = 103;
pub const kDNSServiceType_TKEY: _bindgen_ty_6 = 249;
pub const kDNSServiceType_TSIG: _bindgen_ty_6 = 250;
pub const kDNSServiceType_IXFR: _bindgen_ty_6 = 251;
pub const kDNSServiceType_AXFR: _bindgen_ty_6 = 252;
pub const kDNSServiceType_MAILB: _bindgen_ty_6 = 253;
pub const kDNSServiceType_MAILA: _bindgen_ty_6 = 254;
pub const kDNSServiceType_ANY: _bindgen_ty_6 = 255;
pub type _bindgen_ty_6 = u32;
pub const kDNSServiceErr_NoError: _bindgen_ty_7 = 0;
pub const kDNSServiceErr_Unknown: _bindgen_ty_7 = -65537;
pub const kDNSServiceErr_NoSuchName: _bindgen_ty_7 = -65538;
pub const kDNSServiceErr_NoMemory: _bindgen_ty_7 = -65539;
pub const kDNSServiceErr_BadParam: _bindgen_ty_7 = -65540;
pub const kDNSServiceErr_BadReference: _bindgen_ty_7 = -65541;
pub const kDNSServiceErr_BadState: _bindgen_ty_7 = -65542;
pub const kDNSServiceErr_BadFlags: _bindgen_ty_7 = -65543;
pub const kDNSServiceErr_Unsupported: _bindgen_ty_7 = -65544;
pub const kDNSServiceErr_NotInitialized: _bindgen_ty_7 = -65545;
pub const kDNSServiceErr_AlreadyRegistered: _bindgen_ty_7 = -65547;
pub const kDNSServiceErr_NameConflict: _bindgen_ty_7 = -65548;
pub const kDNSServiceErr_Invalid: _bindgen_ty_7 = -65549;
pub const kDNSServiceErr_Firewall: _bindgen_ty_7 = -65550;
pub const kDNSServiceErr_Incompatible: _bindgen_ty_7 = -65551;
pub const kDNSServiceErr_BadInterfaceIndex: _bindgen_ty_7 = -65552;
pub const kDNSServiceErr_Refused: _bindgen_ty_7 = -65553;
pub const kDNSServiceErr_NoSuchRecord: _bindgen_ty_7 = -65554;
pub const kDNSServiceErr_NoAuth: _bindgen_ty_7 = -65555;
pub const kDNSServiceErr_NoSuchKey: _bindgen_ty_7 = -65556;
pub const kDNSServiceErr_NATTraversal: _bindgen_ty_7 = -65557;
pub const kDNSServiceErr_DoubleNAT: _bindgen_ty_7 = -65558;
pub const kDNSServiceErr_BadTime: _bindgen_ty_7 = -65559;
pub const kDNSServiceErr_BadSig: _bindgen_ty_7 = -65560;
pub const kDNSServiceErr_BadKey: _bindgen_ty_7 = -65561;
pub const kDNSServiceErr_Transient: _bindgen_ty_7 = -65562;
pub const kDNSServiceErr_ServiceNotRunning: _bindgen_ty_7 = -65563;
pub const kDNSServiceErr_NATPortMappingUnsupported: _bindgen_ty_7 = -65564;
pub const kDNSServiceErr_NATPortMappingDisabled: _bindgen_ty_7 = -65565;
pub const kDNSServiceErr_NoRouter: _bindgen_ty_7 = -65566;
pub const kDNSServiceErr_PollingMode: _bindgen_ty_7 = -65567;
pub const kDNSServiceErr_Timeout: _bindgen_ty_7 = -65568;
pub const kDNSServiceErr_DefunctConnection: _bindgen_ty_7 = -65569;
pub type _bindgen_ty_7 = i32;
pub type DNSServiceFlags = u32;
pub type DNSServiceProtocol = u32;
pub type DNSServiceErrorType = i32;
extern "C" {
    pub fn DNSServiceGetProperty(
        property: *const ::std::os::raw::c_char,
        result: *mut ::std::os::raw::c_void,
        size: *mut u32,
    ) -> DNSServiceErrorType;
}
extern "C" {
    pub fn DNSServiceRefSockFD(sdRef: DNSServiceRef) -> dnssd_sock_t;
}
extern "C" {
    pub fn DNSServiceProcessResult(sdRef: DNSServiceRef) -> DNSServiceErrorType;
}
extern "C" {
    pub fn DNSServiceRefDeallocate(sdRef: DNSServiceRef);
}
pub type DNSServiceDomainEnumReply = ::std::option::Option<
    unsafe extern "C" fn(
        sdRef: DNSServiceRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        errorCode: DNSServiceErrorType,
        replyDomain: *const ::std::os::raw::c_char,
        context: *mut ::std::os::raw::c_void,
    ),
>;
extern "C" {
    pub fn DNSServiceEnumerateDomains(
        sdRef: *mut DNSServiceRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        callBack: DNSServiceDomainEnumReply,
        context: *mut ::std::os::raw::c_void,
    ) -> DNSServiceErrorType;
}
pub type DNSServiceRegisterReply = ::std::option::Option<
    unsafe extern "C" fn(
        sdRef: DNSServiceRef,
        flags: DNSServiceFlags,
        errorCode: DNSServiceErrorType,
        name: *const ::std::os::raw::c_char,
        regtype: *const ::std::os::raw::c_char,
        domain: *const ::std::os::raw::c_char,
        context: *mut ::std::os::raw::c_void,
    ),
>;
extern "C" {
    pub fn DNSServiceRegister(
        sdRef: *mut DNSServiceRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        name: *const ::std::os::raw::c_char,
        regtype: *const ::std::os::raw::c_char,
        domain: *const ::std::os::raw::c_char,
        host: *const ::std::os::raw::c_char,
        port: u16,
        txtLen: u16,
        txtRecord: *const ::std::os::raw::c_void,
        callBack: DNSServiceRegisterReply,
        context: *mut ::std::os::raw::c_void,
    ) -> DNSServiceErrorType;
}
extern "C" {
    pub fn DNSServiceAddRecord(
        sdRef: DNSServiceRef,
        RecordRef: *mut DNSRecordRef,
        flags: DNSServiceFlags,
        rrtype: u16,
        rdlen: u16,
        rdata: *const ::std::os::raw::c_void,
        ttl: u32,
    ) -> DNSServiceErrorType;
}
extern "C" {
    pub fn DNSServiceUpdateRecord(
        sdRef: DNSServiceRef,
        RecordRef: DNSRecordRef,
        flags: DNSServiceFlags,
        rdlen: u16,
        rdata: *const ::std::os::raw::c_void,
        ttl: u32,
    ) -> DNSServiceErrorType;
}
extern "C" {
    pub fn DNSServiceRemoveRecord(
        sdRef: DNSServiceRef,
        RecordRef: DNSRecordRef,
        flags: DNSServiceFlags,
    ) -> DNSServiceErrorType;
}
pub type DNSServiceBrowseReply = ::std::option::Option<
    unsafe extern "C" fn(
        sdRef: DNSServiceRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        errorCode: DNSServiceErrorType,
        serviceName: *const ::std::os::raw::c_char,
        regtype: *const ::std::os::raw::c_char,
        replyDomain: *const ::std::os::raw::c_char,
        context: *mut ::std::os::raw::c_void,
    ),
>;
extern "C" {
    pub fn DNSServiceBrowse(
        sdRef: *mut DNSServiceRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        regtype: *const ::std::os::raw::c_char,
        domain: *const ::std::os::raw::c_char,
        callBack: DNSServiceBrowseReply,
        context: *mut ::std::os::raw::c_void,
    ) -> DNSServiceErrorType;
}
pub type DNSServiceResolveReply = ::std::option::Option<
    unsafe extern "C" fn(
        sdRef: DNSServiceRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        errorCode: DNSServiceErrorType,
        fullname: *const ::std::os::raw::c_char,
        hosttarget: *const ::std::os::raw::c_char,
        port: u16,
        txtLen: u16,
        txtRecord: *const ::std::os::raw::c_uchar,
        context: *mut ::std::os::raw::c_void,
    ),
>;
extern "C" {
    pub fn DNSServiceResolve(
        sdRef: *mut DNSServiceRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        name: *const ::std::os::raw::c_char,
        regtype: *const ::std::os::raw::c_char,
        domain: *const ::std::os::raw::c_char,
        callBack: DNSServiceResolveReply,
        context: *mut ::std::os::raw::c_void,
    ) -> DNSServiceErrorType;
}
pub type DNSServiceQueryRecordReply = ::std::option::Option<
    unsafe extern "C" fn(
        sdRef: DNSServiceRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        errorCode: DNSServiceErrorType,
        fullname: *const ::std::os::raw::c_char,
        rrtype: u16,
        rrclass: u16,
        rdlen: u16,
        rdata: *const ::std::os::raw::c_void,
        ttl: u32,
        context: *mut ::std::os::raw::c_void,
    ),
>;
extern "C" {
    pub fn DNSServiceQueryRecord(
        sdRef: *mut DNSServiceRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        fullname: *const ::std::os::raw::c_char,
        rrtype: u16,
        rrclass: u16,
        callBack: DNSServiceQueryRecordReply,
        context: *mut ::std::os::raw::c_void,
    ) -> DNSServiceErrorType;
}
pub type DNSServiceGetAddrInfoReply = ::std::option::Option<
    unsafe extern "C" fn(
        sdRef: DNSServiceRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        errorCode: DNSServiceErrorType,
        hostname: *const ::std::os::raw::c_char,
        address: *const sockaddr,
        ttl: u32,
        context: *mut ::std::os::raw::c_void,
    ),
>;
extern "C" {
    pub fn DNSServiceGetAddrInfo(
        sdRef: *mut DNSServiceRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        protocol: DNSServiceProtocol,
        hostname: *const ::std::os::raw::c_char,
        callBack: DNSServiceGetAddrInfoReply,
        context: *mut ::std::os::raw::c_void,
    ) -> DNSServiceErrorType;
}
extern "C" {
    pub fn DNSServiceCreateConnection(sdRef: *mut DNSServiceRef) -> DNSServiceErrorType;
}
pub type DNSServiceRegisterRecordReply = ::std::option::Option<
    unsafe extern "C" fn(
        sdRef: DNSServiceRef,
        RecordRef: DNSRecordRef,
        flags: DNSServiceFlags,
        errorCode: DNSServiceErrorType,
        context: *mut ::std::os::raw::c_void,
    ),
>;
extern "C" {
    pub fn DNSServiceRegisterRecord(
        sdRef: DNSServiceRef,
        RecordRef: *mut DNSRecordRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        fullname: *const ::std::os::raw::c_char,
        rrtype: u16,
        rrclass: u16,
        rdlen: u16,
        rdata: *const ::std::os::raw::c_void,
        ttl: u32,
        callBack: DNSServiceRegisterRecordReply,
        context: *mut ::std::os::raw::c_void,
    ) -> DNSServiceErrorType;
}
extern "C" {
    pub fn DNSServiceReconfirmRecord(
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        fullname: *const ::std::os::raw::c_char,
        rrtype: u16,
        rrclass: u16,
        rdlen: u16,
        rdata: *const ::std::os::raw::c_void,
    ) -> DNSServiceErrorType;
}
pub type DNSServiceNATPortMappingReply = ::std::option::Option<
    unsafe extern "C" fn(
        sdRef: DNSServiceRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        errorCode: DNSServiceErrorType,
        externalAddress: u32,
        protocol: DNSServiceProtocol,
        internalPort: u16,
        externalPort: u16,
        ttl: u32,
        context: *mut ::std::os::raw::c_void,
    ),
>;
extern "C" {
    pub fn DNSServiceNATPortMappingCreate(
        sdRef: *mut DNSServiceRef,
        flags: DNSServiceFlags,
        interfaceIndex: u32,
        protocol: DNSServiceProtocol,
        internalPort: u16,
        externalPort: u16,
        ttl: u32,
        callBack: DNSServiceNATPortMappingReply,
        context: *mut ::std::os::raw::c_void,
    ) -> DNSServiceErrorType;
}
extern "C" {
    pub fn DNSServiceConstructFullName(
        fullName: *mut ::std::os::raw::c_char,
        service: *const ::std::os::raw::c_char,
        regtype: *const ::std::os::raw::c_char,
        domain: *const ::std::os::raw::c_char,
    ) -> DNSServiceErrorType;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union _TXTRecordRef_t {
    pub PrivateData: [::std::os::raw::c_char; 16usize],
    pub ForceNaturalAlignment: *mut ::std::os::raw::c_char,
    _bindgen_union_align: [u64; 2usize],
}
#[test]
fn bindgen_test_layout__TXTRecordRef_t() {
    assert_eq!(
        ::std::mem::size_of::<_TXTRecordRef_t>(),
        16usize,
        concat!("Size of: ", stringify!(_TXTRecordRef_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_TXTRecordRef_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_TXTRecordRef_t))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<_TXTRecordRef_t>())).PrivateData as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(_TXTRecordRef_t),
            "::",
            stringify!(PrivateData)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<_TXTRecordRef_t>())).ForceNaturalAlignment as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(_TXTRecordRef_t),
            "::",
            stringify!(ForceNaturalAlignment)
        )
    );
}
pub type TXTRecordRef = _TXTRecordRef_t;
extern "C" {
    pub fn TXTRecordCreate(
        txtRecord: *mut TXTRecordRef,
        bufferLen: u16,
        buffer: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn TXTRecordDeallocate(txtRecord: *mut TXTRecordRef);
}
extern "C" {
    pub fn TXTRecordSetValue(
        txtRecord: *mut TXTRecordRef,
        key: *const ::std::os::raw::c_char,
        valueSize: u8,
        value: *const ::std::os::raw::c_void,
    ) -> DNSServiceErrorType;
}
extern "C" {
    pub fn TXTRecordRemoveValue(
        txtRecord: *mut TXTRecordRef,
        key: *const ::std::os::raw::c_char,
    ) -> DNSServiceErrorType;
}
extern "C" {
    pub fn TXTRecordGetLength(txtRecord: *const TXTRecordRef) -> u16;
}
extern "C" {
    pub fn TXTRecordGetBytesPtr(txtRecord: *const TXTRecordRef) -> *const ::std::os::raw::c_void;
}
extern "C" {
    pub fn TXTRecordContainsKey(
        txtLen: u16,
        txtRecord: *const ::std::os::raw::c_void,
        key: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn TXTRecordGetValuePtr(
        txtLen: u16,
        txtRecord: *const ::std::os::raw::c_void,
        key: *const ::std::os::raw::c_char,
        valueLen: *mut u8,
    ) -> *const ::std::os::raw::c_void;
}
extern "C" {
    pub fn TXTRecordGetCount(txtLen: u16, txtRecord: *const ::std::os::raw::c_void) -> u16;
}
extern "C" {
    pub fn TXTRecordGetItemAtIndex(
        txtLen: u16,
        txtRecord: *const ::std::os::raw::c_void,
        itemIndex: u16,
        keyBufLen: u16,
        key: *mut ::std::os::raw::c_char,
        valueLen: *mut u8,
        value: *mut *const ::std::os::raw::c_void,
    ) -> DNSServiceErrorType;
}
extern "C" {
    pub fn DNSServiceSetDispatchQueue(
        service: DNSServiceRef,
        queue: dispatch_queue_t,
    ) -> DNSServiceErrorType;
}
pub type DNSServiceSleepKeepaliveReply = ::std::option::Option<
    unsafe extern "C" fn(
        sdRef: DNSServiceRef,
        errorCode: DNSServiceErrorType,
        context: *mut ::std::os::raw::c_void,
    ),
>;
extern "C" {
    pub fn DNSServiceSleepKeepalive(
        sdRef: *mut DNSServiceRef,
        flags: DNSServiceFlags,
        fd: ::std::os::raw::c_int,
        timeout: ::std::os::raw::c_uint,
        callBack: DNSServiceSleepKeepaliveReply,
        context: *mut ::std::os::raw::c_void,
    ) -> DNSServiceErrorType;
}