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
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
/* automatically generated by rust-bindgen 0.69.4 */
#![allow(non_camel_case_types, non_snake_case)]
use c_types::fd_set;
use c_types::hostent;
use c_types::in_addr;
use c_types::iovec;
use c_types::sockaddr;
use c_types::socklen_t;
use libc::timeval;

#[cfg(target_os = "android")]
use jni_sys;

#[cfg(windows)]
pub type ares_socket_t = ::std::os::windows::io::RawSocket;
#[cfg(unix)]
pub type ares_socket_t = ::std::os::unix::io::RawFd;

pub type ares_socklen_t = socklen_t;
pub type ares_ssize_t = isize;

#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_status_t {
    ARES_SUCCESS = 0,
    ARES_ENODATA = 1,
    ARES_EFORMERR = 2,
    ARES_ESERVFAIL = 3,
    ARES_ENOTFOUND = 4,
    ARES_ENOTIMP = 5,
    ARES_EREFUSED = 6,
    ARES_EBADQUERY = 7,
    ARES_EBADNAME = 8,
    ARES_EBADFAMILY = 9,
    ARES_EBADRESP = 10,
    ARES_ECONNREFUSED = 11,
    ARES_ETIMEOUT = 12,
    ARES_EOF = 13,
    ARES_EFILE = 14,
    ARES_ENOMEM = 15,
    ARES_EDESTRUCTION = 16,
    ARES_EBADSTR = 17,
    ARES_EBADFLAGS = 18,
    ARES_ENONAME = 19,
    ARES_EBADHINTS = 20,
    ARES_ENOTINITIALIZED = 21,
    ARES_ELOADIPHLPAPI = 22,
    ARES_EADDRGETNETWORKPARAMS = 23,
    ARES_ECANCELLED = 24,
    ARES_ESERVICE = 25,
    ARES_ENOSERVER = 26,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_bool_t {
    ARES_FALSE = 0,
    ARES_TRUE = 1,
}
#[repr(u32)]
#[doc = " Values for ARES_OPT_EVENT_THREAD"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_evsys_t {
    #[doc = " Default (best choice) event system"]
    ARES_EVSYS_DEFAULT = 0,
    #[doc = " Win32 IOCP/AFD_POLL event system"]
    ARES_EVSYS_WIN32 = 1,
    #[doc = " Linux epoll"]
    ARES_EVSYS_EPOLL = 2,
    #[doc = " BSD/MacOS kqueue"]
    ARES_EVSYS_KQUEUE = 3,
    #[doc = " POSIX poll()"]
    ARES_EVSYS_POLL = 4,
    #[doc = " last fallback on Unix-like systems, select()"]
    ARES_EVSYS_SELECT = 5,
}
pub type ares_sock_state_cb = ::std::option::Option<
    unsafe extern "C" fn(
        data: *mut ::std::os::raw::c_void,
        socket_fd: ares_socket_t,
        readable: ::std::os::raw::c_int,
        writable: ::std::os::raw::c_int,
    ),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct apattern {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_options {
    pub flags: ::std::os::raw::c_int,
    pub timeout: ::std::os::raw::c_int,
    pub tries: ::std::os::raw::c_int,
    pub ndots: ::std::os::raw::c_int,
    pub udp_port: ::std::os::raw::c_ushort,
    pub tcp_port: ::std::os::raw::c_ushort,
    pub socket_send_buffer_size: ::std::os::raw::c_int,
    pub socket_receive_buffer_size: ::std::os::raw::c_int,
    pub servers: *mut in_addr,
    pub nservers: ::std::os::raw::c_int,
    pub domains: *mut *mut ::std::os::raw::c_char,
    pub ndomains: ::std::os::raw::c_int,
    pub lookups: *mut ::std::os::raw::c_char,
    pub sock_state_cb: ares_sock_state_cb,
    pub sock_state_cb_data: *mut ::std::os::raw::c_void,
    pub sortlist: *mut apattern,
    pub nsort: ::std::os::raw::c_int,
    pub ednspsz: ::std::os::raw::c_int,
    #[cfg(cares1_15)]
    pub resolvconf_path: *mut ::std::os::raw::c_char,
    #[cfg(cares1_19)]
    pub hosts_path: *mut ::std::os::raw::c_char,
    #[cfg(cares1_20)]
    pub udp_max_queries: ::std::os::raw::c_int,
    #[cfg(cares1_22)]
    pub maxtimeout: ::std::os::raw::c_int,
    #[cfg(cares1_23)]
    pub qcache_max_ttl: ::std::os::raw::c_uint,
    #[cfg(cares1_26)]
    pub evsys: ares_evsys_t,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_channeldata {
    _unused: [u8; 0],
}
pub type ares_channel = *mut ares_channeldata;
pub type ares_channel_t = ares_channeldata;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ares_in6_addr {
    pub _S6_un: ares_in6_addr__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union ares_in6_addr__bindgen_ty_1 {
    pub _S6_u8: [::std::os::raw::c_uchar; 16usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ares_addr {
    pub family: ::std::os::raw::c_int,
    pub addr: ares_addr__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union ares_addr__bindgen_ty_1 {
    pub addr4: in_addr,
    pub addr6: ares_in6_addr,
}
#[repr(u32)]
#[doc = " DNS Record types handled by c-ares.  Some record types may only be valid\n  on requests (e.g. ARES_REC_TYPE_ANY), and some may only be valid on\n  responses"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_dns_rec_type_t {
    #[doc = "< Host address."]
    ARES_REC_TYPE_A = 1,
    #[doc = "< Authoritative server."]
    ARES_REC_TYPE_NS = 2,
    #[doc = "< Canonical name."]
    ARES_REC_TYPE_CNAME = 5,
    #[doc = "< Start of authority zone."]
    ARES_REC_TYPE_SOA = 6,
    #[doc = "< Domain name pointer."]
    ARES_REC_TYPE_PTR = 12,
    #[doc = "< Host information."]
    ARES_REC_TYPE_HINFO = 13,
    #[doc = "< Mail routing information."]
    ARES_REC_TYPE_MX = 15,
    #[doc = "< Text strings."]
    ARES_REC_TYPE_TXT = 16,
    #[doc = "< RFC 3596. Ip6 Address."]
    ARES_REC_TYPE_AAAA = 28,
    #[doc = "< RFC 2782. Server Selection."]
    ARES_REC_TYPE_SRV = 33,
    #[doc = "< RFC 3403. Naming Authority Pointer"]
    ARES_REC_TYPE_NAPTR = 35,
    #[doc = "< RFC 6891. EDNS0 option (meta-RR)"]
    ARES_REC_TYPE_OPT = 41,
    #[doc = "< RFC 6698. DNS-Based Authentication of Named\n   Entities (DANE) Transport Layer Security\n   (TLS) Protocol: TLSA"]
    ARES_REC_TYPE_TLSA = 52,
    #[doc = "< RFC 9460. General Purpose Service Binding"]
    ARES_REC_TYPE_SVCB = 64,
    #[doc = "< RFC 9460. Service Binding type for use with\n   HTTPS"]
    ARES_REC_TYPE_HTTPS = 65,
    #[doc = "< Wildcard match.  Not response RR."]
    ARES_REC_TYPE_ANY = 255,
    #[doc = "< RFC 7553. Uniform Resource Identifier"]
    ARES_REC_TYPE_URI = 256,
    #[doc = "< RFC 6844. Certification Authority\n   Authorization."]
    ARES_REC_TYPE_CAA = 257,
    #[doc = "< Used as an indicator that the RR record\n   is not parsed, but provided in wire\n   format"]
    ARES_REC_TYPE_RAW_RR = 65536,
}
#[repr(u32)]
#[doc = " DNS Classes for requests and responses."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_dns_class_t {
    #[doc = "< Internet"]
    ARES_CLASS_IN = 1,
    #[doc = "< CHAOS"]
    ARES_CLASS_CHAOS = 3,
    #[doc = "< Hesoid [Dyer 87]"]
    ARES_CLASS_HESOID = 4,
    #[doc = "< RFC 2136"]
    ARES_CLASS_NONE = 254,
    #[doc = "< Any class (requests only)"]
    ARES_CLASS_ANY = 255,
}
#[repr(u32)]
#[doc = " DNS RR Section type"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_dns_section_t {
    #[doc = "< Answer section"]
    ARES_SECTION_ANSWER = 1,
    #[doc = "< Authority section"]
    ARES_SECTION_AUTHORITY = 2,
    #[doc = "< Additional information section"]
    ARES_SECTION_ADDITIONAL = 3,
}
#[repr(u32)]
#[doc = " DNS Header opcodes"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_dns_opcode_t {
    #[doc = "< Standard query"]
    ARES_OPCODE_QUERY = 0,
    #[doc = "< Inverse query. Obsolete."]
    ARES_OPCODE_IQUERY = 1,
    #[doc = "< Name server status query"]
    ARES_OPCODE_STATUS = 2,
    #[doc = "< Zone change notification (RFC 1996)"]
    ARES_OPCODE_NOTIFY = 4,
    #[doc = "< Zone update message (RFC2136)"]
    ARES_OPCODE_UPDATE = 5,
}
#[repr(u32)]
#[doc = " DNS Header flags"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_dns_flags_t {
    #[doc = "< QR. If set, is a response"]
    ARES_FLAG_QR = 1,
    #[doc = "< Authoritative Answer. If set, is authoritative"]
    ARES_FLAG_AA = 2,
    #[doc = "< Truncation. If set, is truncated response"]
    ARES_FLAG_TC = 4,
    #[doc = "< Recursion Desired. If set, recursion is desired"]
    ARES_FLAG_RD = 8,
    #[doc = "< Recursion Available. If set, server supports\n   recursion"]
    ARES_FLAG_RA = 16,
    #[doc = "< RFC 2065. Authentic Data bit indicates in a\n response that the data included has been verified by\n the server providing it"]
    ARES_FLAG_AD = 32,
    #[doc = "< RFC 2065. Checking Disabled bit indicates in a\n query that non-verified data is acceptable to the\n resolver sending the query."]
    ARES_FLAG_CD = 64,
}
#[repr(u32)]
#[doc = " DNS Response Codes from server"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_dns_rcode_t {
    #[doc = "< Success"]
    ARES_RCODE_NOERROR = 0,
    #[doc = "< Format error. The name server was unable\n   to interpret the query."]
    ARES_RCODE_FORMERR = 1,
    #[doc = "< Server Failure. The name server was\n   unable to process this query due to a\n   problem with the nameserver"]
    ARES_RCODE_SERVFAIL = 2,
    #[doc = "< Name Error.  Meaningful only for\n   responses from an authoritative name\n   server, this code signifies that the\n   domain name referenced in the query does\n   not exist."]
    ARES_RCODE_NXDOMAIN = 3,
    #[doc = "< Not implemented.  The name server does\n   not support the requested kind of\n   query"]
    ARES_RCODE_NOTIMP = 4,
    #[doc = "< Refused. The name server refuses to\n   perform the specified operation for\n   policy reasons."]
    ARES_RCODE_REFUSED = 5,
    #[doc = "< RFC 2136. Some name that ought not to\n   exist, does exist."]
    ARES_RCODE_YXDOMAIN = 6,
    #[doc = "< RFC 2136. Some RRset that ought to not\n   exist, does exist."]
    ARES_RCODE_YXRRSET = 7,
    #[doc = "< RFC 2136. Some RRset that ought to exist,\n   does not exist."]
    ARES_RCODE_NXRRSET = 8,
    #[doc = "< RFC 2136. The server is not authoritative\n   for the zone named in the Zone section."]
    ARES_RCODE_NOTAUTH = 9,
    #[doc = "< RFC 2136. A name used in the Prerequisite\n   or Update Section is not within the zone\n   denoted by the Zone Section."]
    ARES_RCODE_NOTZONE = 10,
    #[doc = "< RFC 8409. DSO-TYPE Not implemented"]
    ARES_RCODE_DSOTYPEI = 11,
    #[doc = "< RFC 8945. TSIG Signature Failure"]
    ARES_RCODE_BADSIG = 16,
    #[doc = "< RFC 8945. Key not recognized."]
    ARES_RCODE_BADKEY = 17,
    #[doc = "< RFC 8945. Signature out of time window."]
    ARES_RCODE_BADTIME = 18,
    #[doc = "< RFC 2930. Bad TKEY Mode"]
    ARES_RCODE_BADMODE = 19,
    #[doc = "< RFC 2930. Duplicate Key Name"]
    ARES_RCODE_BADNAME = 20,
    #[doc = "< RFC 2930. Algorithm not supported"]
    ARES_RCODE_BADALG = 21,
    #[doc = "< RFC 8945. Bad Truncation"]
    ARES_RCODE_BADTRUNC = 22,
    #[doc = "< RVC 7973. Bad/missing Server Cookie"]
    ARES_RCODE_BADCOOKIE = 23,
}
#[repr(u32)]
#[doc = " Data types used"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_dns_datatype_t {
    #[doc = "< struct in_addr * type"]
    ARES_DATATYPE_INADDR = 1,
    #[doc = "< struct ares_in6_addr * type"]
    ARES_DATATYPE_INADDR6 = 2,
    #[doc = "< 8bit unsigned integer"]
    ARES_DATATYPE_U8 = 3,
    #[doc = "< 16bit unsigned integer"]
    ARES_DATATYPE_U16 = 4,
    #[doc = "< 32bit unsigned integer"]
    ARES_DATATYPE_U32 = 5,
    #[doc = "< Null-terminated string of a domain name"]
    ARES_DATATYPE_NAME = 6,
    #[doc = "< Null-terminated string"]
    ARES_DATATYPE_STR = 7,
    #[doc = "< Binary data"]
    ARES_DATATYPE_BIN = 8,
    #[doc = "< Officially defined as binary data, but likely\n   printable. Guaranteed to have a NULL\n   terminator for convenience (not included in\n   length)"]
    ARES_DATATYPE_BINP = 9,
    #[doc = "< Array of options.  16bit identifier, BIN\n   data."]
    ARES_DATATYPE_OPT = 10,
}
#[repr(u32)]
#[doc = " Keys used for all RR Types.  We take the record type and multiply by 100\n  to ensure we have a proper offset between keys so we can keep these sorted"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_dns_rr_key_t {
    #[doc = " A Record. Address. Datatype: INADDR"]
    ARES_RR_A_ADDR = 101,
    #[doc = " NS Record. Name. Datatype: NAME"]
    ARES_RR_NS_NSDNAME = 201,
    #[doc = " CNAME Record. CName. Datatype: NAME"]
    ARES_RR_CNAME_CNAME = 501,
    #[doc = " SOA Record. MNAME, Primary Source of Data. Datatype: NAME"]
    ARES_RR_SOA_MNAME = 601,
    #[doc = " SOA Record. RNAME, Mailbox of person responsible. Datatype: NAME"]
    ARES_RR_SOA_RNAME = 602,
    #[doc = " SOA Record. Serial, version. Datatype: U32"]
    ARES_RR_SOA_SERIAL = 603,
    #[doc = " SOA Record. Refresh, zone refersh interval. Datatype: U32"]
    ARES_RR_SOA_REFRESH = 604,
    #[doc = " SOA Record. Retry, failed refresh retry interval. Datatype: U32"]
    ARES_RR_SOA_RETRY = 605,
    #[doc = " SOA Record. Expire, upper limit on authority. Datatype: U32"]
    ARES_RR_SOA_EXPIRE = 606,
    #[doc = " SOA Record. Minimum, RR TTL. Datatype: U32"]
    ARES_RR_SOA_MINIMUM = 607,
    #[doc = " PTR Record. DNAME, pointer domain. Datatype: NAME"]
    ARES_RR_PTR_DNAME = 1201,
    #[doc = " HINFO Record. CPU. Datatype: STR"]
    ARES_RR_HINFO_CPU = 1301,
    #[doc = " HINFO Record. OS. Datatype: STR"]
    ARES_RR_HINFO_OS = 1302,
    #[doc = " MX Record. Preference. Datatype: U16"]
    ARES_RR_MX_PREFERENCE = 1501,
    #[doc = " MX Record. Exchange, domain. Datatype: NAME"]
    ARES_RR_MX_EXCHANGE = 1502,
    #[doc = " TXT Record. Data. Datatype: BINP"]
    ARES_RR_TXT_DATA = 1601,
    #[doc = " AAAA Record. Address. Datatype: INADDR6"]
    ARES_RR_AAAA_ADDR = 2801,
    #[doc = " SRV Record. Priority. Datatype: U16"]
    ARES_RR_SRV_PRIORITY = 3302,
    #[doc = " SRV Record. Weight. Datatype: U16"]
    ARES_RR_SRV_WEIGHT = 3303,
    #[doc = " SRV Record. Port. Datatype: U16"]
    ARES_RR_SRV_PORT = 3304,
    #[doc = " SRV Record. Target domain. Datatype: NAME"]
    ARES_RR_SRV_TARGET = 3305,
    #[doc = " NAPTR Record. Order. Datatype: U16"]
    ARES_RR_NAPTR_ORDER = 3501,
    #[doc = " NAPTR Record. Preference. Datatype: U16"]
    ARES_RR_NAPTR_PREFERENCE = 3502,
    #[doc = " NAPTR Record. Flags. Datatype: STR"]
    ARES_RR_NAPTR_FLAGS = 3503,
    #[doc = " NAPTR Record. Services. Datatype: STR"]
    ARES_RR_NAPTR_SERVICES = 3504,
    #[doc = " NAPTR Record. Regexp. Datatype: STR"]
    ARES_RR_NAPTR_REGEXP = 3505,
    #[doc = " NAPTR Record. Replacement. Datatype: NAME"]
    ARES_RR_NAPTR_REPLACEMENT = 3506,
    #[doc = " OPT Record. UDP Size. Datatype: U16"]
    ARES_RR_OPT_UDP_SIZE = 4101,
    #[doc = " OPT Record. Version. Datatype: U8"]
    ARES_RR_OPT_VERSION = 4103,
    #[doc = " OPT Record. Flags. Datatype: U16"]
    ARES_RR_OPT_FLAGS = 4104,
    #[doc = " OPT Record. Options. Datatype: OPT"]
    ARES_RR_OPT_OPTIONS = 4105,
    #[doc = " TLSA Record. Certificate Usage. Datatype: U8"]
    ARES_RR_TLSA_CERT_USAGE = 5201,
    #[doc = " TLSA Record. Selector. Datatype: U8"]
    ARES_RR_TLSA_SELECTOR = 5202,
    #[doc = " TLSA Record. Matching Type. Datatype: U8"]
    ARES_RR_TLSA_MATCH = 5203,
    #[doc = " TLSA Record. Certificate Association Data. Datatype: BIN"]
    ARES_RR_TLSA_DATA = 5204,
    #[doc = " SVCB Record. SvcPriority. Datatype: U16"]
    ARES_RR_SVCB_PRIORITY = 6401,
    #[doc = " SVCB Record. TargetName. Datatype: NAME"]
    ARES_RR_SVCB_TARGET = 6402,
    #[doc = " SVCB Record. SvcParams. Datatype: OPT"]
    ARES_RR_SVCB_PARAMS = 6403,
    #[doc = " HTTPS Record. SvcPriority. Datatype: U16"]
    ARES_RR_HTTPS_PRIORITY = 6501,
    #[doc = " HTTPS Record. TargetName. Datatype: NAME"]
    ARES_RR_HTTPS_TARGET = 6502,
    #[doc = " HTTPS Record. SvcParams. Datatype: OPT"]
    ARES_RR_HTTPS_PARAMS = 6503,
    #[doc = " URI Record. Priority. Datatype: U16"]
    ARES_RR_URI_PRIORITY = 25601,
    #[doc = " URI Record. Weight. Datatype: U16"]
    ARES_RR_URI_WEIGHT = 25602,
    #[doc = " URI Record. Target domain. Datatype: NAME"]
    ARES_RR_URI_TARGET = 25603,
    #[doc = " CAA Record. Critical flag. Datatype: U8"]
    ARES_RR_CAA_CRITICAL = 25701,
    #[doc = " CAA Record. Tag/Property. Datatype: STR"]
    ARES_RR_CAA_TAG = 25702,
    #[doc = " CAA Record. Value. Datatype: BINP"]
    ARES_RR_CAA_VALUE = 25703,
    #[doc = " RAW Record. RR Type. Datatype: U16"]
    ARES_RR_RAW_RR_TYPE = 6553601,
    #[doc = " RAW Record. RR Data. Datatype: BIN"]
    ARES_RR_RAW_RR_DATA = 6553602,
}
#[repr(u32)]
#[doc = " TLSA Record ARES_RR_TLSA_CERT_USAGE known values"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_tlsa_usage_t {
    #[doc = " Certificate Usage 0. CA Constraint."]
    ARES_TLSA_USAGE_CA = 0,
    #[doc = " Certificate Usage 1. Service Certificate Constraint."]
    ARES_TLSA_USAGE_SERVICE = 1,
    #[doc = " Certificate Usage 2. Trust Anchor Assertion."]
    ARES_TLSA_USAGE_TRUSTANCHOR = 2,
    #[doc = " Certificate Usage 3. Domain-issued certificate."]
    ARES_TLSA_USAGE_DOMAIN = 3,
}
#[repr(u32)]
#[doc = " TLSA Record ARES_RR_TLSA_SELECTOR known values"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_tlsa_selector_t {
    #[doc = " Full Certificate"]
    ARES_TLSA_SELECTOR_FULL = 0,
    #[doc = " DER-encoded SubjectPublicKeyInfo"]
    ARES_TLSA_SELECTOR_SUBJPUBKEYINFO = 1,
}
#[repr(u32)]
#[doc = " TLSA Record ARES_RR_TLSA_MATCH known values"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_tlsa_match_t {
    #[doc = " Exact match"]
    ARES_TLSA_MATCH_EXACT = 0,
    #[doc = " Sha256 match"]
    ARES_TLSA_MATCH_SHA256 = 1,
    #[doc = " Sha512 match"]
    ARES_TLSA_MATCH_SHA512 = 2,
}
#[repr(u32)]
#[doc = " SVCB (and HTTPS) RR known parameters"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_svcb_param_t {
    #[doc = " Mandatory keys in this RR (RFC 9460 Section 8)"]
    ARES_SVCB_PARAM_MANDATORY = 0,
    #[doc = " Additional supported protocols (RFC 9460 Section 7.1)"]
    ARES_SVCB_PARAM_ALPN = 1,
    #[doc = " No support for default protocol (RFC 9460 Section 7.1)"]
    ARES_SVCB_PARAM_NO_DEFAULT_ALPN = 2,
    #[doc = " Port for alternative endpoint (RFC 9460 Section 7.2)"]
    ARES_SVCB_PARAM_PORT = 3,
    #[doc = " IPv4 address hints (RFC 9460 Section 7.3)"]
    ARES_SVCB_PARAM_IPV4HINT = 4,
    #[doc = " RESERVED (held for Encrypted ClientHello)"]
    ARES_SVCB_PARAM_ECH = 5,
    #[doc = " IPv6 address hints (RFC 9460 Section 7.3)"]
    ARES_SVCB_PARAM_IPV6HINT = 6,
}
#[repr(u32)]
#[doc = " OPT RR known parameters"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_opt_param_t {
    #[doc = " RFC 8764. Apple's DNS Long-Lived Queries Protocol"]
    ARES_OPT_PARAM_LLQ = 1,
    #[doc = " http://files.dns-sd.org/draft-sekar-dns-ul.txt: Update Lease"]
    ARES_OPT_PARAM_UL = 2,
    #[doc = " RFC 5001. Name Server Identification"]
    ARES_OPT_PARAM_NSID = 3,
    #[doc = " RFC 6975. DNSSEC Algorithm Understood"]
    ARES_OPT_PARAM_DAU = 5,
    #[doc = " RFC 6975. DS Hash Understood"]
    ARES_OPT_PARAM_DHU = 6,
    #[doc = " RFC 6975. NSEC3 Hash Understood"]
    ARES_OPT_PARAM_N3U = 7,
    #[doc = " RFC 7871. Client Subnet"]
    ARES_OPT_PARAM_EDNS_CLIENT_SUBNET = 8,
    #[doc = " RFC 7314. Expire Timer"]
    ARES_OPT_PARAM_EDNS_EXPIRE = 9,
    #[doc = " RFC 7873. Client and Server Cookies"]
    ARES_OPT_PARAM_COOKIE = 10,
    #[doc = " RFC 7828. TCP Keepalive timeout"]
    ARES_OPT_PARAM_EDNS_TCP_KEEPALIVE = 11,
    #[doc = " RFC 7830. Padding"]
    ARES_OPT_PARAM_PADDING = 12,
    #[doc = " RFC 7901. Chain query requests"]
    ARES_OPT_PARAM_CHAIN = 13,
    #[doc = " RFC 8145. Signaling Trust Anchor Knowledge in DNSSEC"]
    ARES_OPT_PARAM_EDNS_KEY_TAG = 14,
    #[doc = " RFC 8914. Extended ERROR code and message"]
    ARES_OPT_PARAM_EXTENDED_DNS_ERROR = 15,
}
#[repr(u32)]
#[doc = " Data type for option records for keys like ARES_RR_OPT_OPTIONS and\n  ARES_RR_HTTPS_PARAMS returned by ares_dns_opt_get_datatype()"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_dns_opt_datatype_t {
    #[doc = " No value allowed for this option"]
    ARES_OPT_DATATYPE_NONE = 1,
    #[doc = " List of strings, each prefixed with a single octet representing the length"]
    ARES_OPT_DATATYPE_STR_LIST = 2,
    #[doc = " List of 8bit integers, concatenated"]
    ARES_OPT_DATATYPE_U8_LIST = 3,
    #[doc = " 16bit integer in network byte order"]
    ARES_OPT_DATATYPE_U16 = 4,
    #[doc = " list of 16bit integer in network byte order, concatenated."]
    ARES_OPT_DATATYPE_U16_LIST = 5,
    #[doc = " 32bit integer in network byte order"]
    ARES_OPT_DATATYPE_U32 = 6,
    #[doc = " list 32bit integer in network byte order, concatenated"]
    ARES_OPT_DATATYPE_U32_LIST = 7,
    #[doc = " List of ipv4 addresses in network byte order, concatenated"]
    ARES_OPT_DATATYPE_INADDR4_LIST = 8,
    #[doc = " List of ipv6 addresses in network byte order, concatenated"]
    ARES_OPT_DATATYPE_INADDR6_LIST = 9,
    #[doc = " Binary Data"]
    ARES_OPT_DATATYPE_BIN = 10,
    #[doc = " DNS Domain Name Format"]
    ARES_OPT_DATATYPE_NAME = 11,
}
#[repr(u32)]
#[doc = " Data type for flags to ares_dns_parse()"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ares_dns_parse_flags_t {
    #[doc = " Parse Answers from RFC 1035 that allow name compression as RAW"]
    ARES_DNS_PARSE_AN_BASE_RAW = 1,
    #[doc = " Parse Authority from RFC 1035 that allow name compression as RAW"]
    ARES_DNS_PARSE_NS_BASE_RAW = 2,
    #[doc = " Parse Additional from RFC 1035 that allow name compression as RAW"]
    ARES_DNS_PARSE_AR_BASE_RAW = 4,
    #[doc = " Parse Answers from later RFCs (no name compression) RAW"]
    ARES_DNS_PARSE_AN_EXT_RAW = 8,
    #[doc = " Parse Authority from later RFCs (no name compression) as RAW"]
    ARES_DNS_PARSE_NS_EXT_RAW = 16,
    #[doc = " Parse Additional from later RFCs (no name compression) as RAW"]
    ARES_DNS_PARSE_AR_EXT_RAW = 32,
}
extern "C" {
    #[doc = " String representation of DNS Record Type\n\n  \\param[in] type  DNS Record Type\n  \\return string"]
    pub fn ares_dns_rec_type_tostr(type_: ares_dns_rec_type_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " String representation of DNS Class\n\n  \\param[in] qclass  DNS Class\n  \\return string"]
    pub fn ares_dns_class_tostr(qclass: ares_dns_class_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " String representation of DNS OpCode\n\n  \\param[in] opcode  DNS OpCode\n  \\return string"]
    pub fn ares_dns_opcode_tostr(opcode: ares_dns_opcode_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " String representation of DNS Resource Record Parameter\n\n  \\param[in] key  DNS Resource Record parameter\n  \\return string"]
    pub fn ares_dns_rr_key_tostr(key: ares_dns_rr_key_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " String representation of DNS Resource Record section\n\n \\param[in] section  Section\n \\return string"]
    pub fn ares_dns_section_tostr(section: ares_dns_section_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " Convert DNS class name as string to ares_dns_class_t\n\n  \\param[out] qclass  Pointer passed by reference to write class\n  \\param[in]  str     String to convert\n  \\return ARES_TRUE on success"]
    pub fn ares_dns_class_fromstr(
        qclass: *mut ares_dns_class_t,
        str_: *const ::std::os::raw::c_char,
    ) -> ares_bool_t;
}
extern "C" {
    #[doc = " Convert DNS record type as string to ares_dns_rec_type_t\n\n  \\param[out] qtype   Pointer passed by reference to write record type\n  \\param[in]  str     String to convert\n  \\return ARES_TRUE on success"]
    pub fn ares_dns_rec_type_fromstr(
        qtype: *mut ares_dns_rec_type_t,
        str_: *const ::std::os::raw::c_char,
    ) -> ares_bool_t;
}
extern "C" {
    #[doc = " Convert DNS response code as string to from ares_dns_rcode_t\n\n  \\param[in] rcode  Response code to convert\n  \\return ARES_TRUE on success"]
    pub fn ares_dns_rcode_tostr(rcode: ares_dns_rcode_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " Convert any valid ip address (ipv4 or ipv6) into struct ares_addr and\n  return the starting pointer of the network byte order address and the\n  length of the address (4 or 16).\n\n  \\param[in]     ipaddr  ASCII string form of the ip address\n  \\param[in,out] addr    Must set \"family\" member to one of AF_UNSPEC,\n                         AF_INET, AF_INET6 on input.\n  \\param[out]    out_len Length of binary form address\n  \\return Pointer to start of binary address or NULL on error."]
    pub fn ares_dns_pton(
        ipaddr: *const ::std::os::raw::c_char,
        addr: *mut ares_addr,
        out_len: *mut usize,
    ) -> *const ::std::os::raw::c_void;
}
extern "C" {
    #[doc = " Convert an ip address into the PTR format for in-addr.arpa or in6.arpa\n\n  \\param[in]  addr  properly filled address structure\n  \\return  String representing PTR, use ares_free_string() to free"]
    pub fn ares_dns_addr_to_ptr(addr: *const ares_addr) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " The options/parameters extensions to some RRs can be somewhat opaque, this\n  is a helper to return the best match for a datatype for interpreting the\n  option record.\n\n  \\param[in] key  Key associated with options/parameters\n  \\param[in] opt  Option Key/Parameter\n  \\return Datatype"]
    pub fn ares_dns_opt_get_datatype(
        key: ares_dns_rr_key_t,
        opt: ::std::os::raw::c_ushort,
    ) -> ares_dns_opt_datatype_t;
}
extern "C" {
    #[doc = " The options/parameters extensions to some RRs can be somewhat opaque, this\n  is a helper to return the name if the option is known.\n\n  \\param[in] key  Key associated with options/parameters\n  \\param[in] opt  Option Key/Parameter\n  \\return name, or NULL if not known."]
    pub fn ares_dns_opt_get_name(
        key: ares_dns_rr_key_t,
        opt: ::std::os::raw::c_ushort,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " Retrieve a list of Resource Record keys that can be set or retrieved for\n  the Resource record type.\n\n  \\param[in]  type  Record Type\n  \\param[out] cnt   Number of keys returned\n  \\return array of keys associated with Resource Record"]
    pub fn ares_dns_rr_get_keys(
        type_: ares_dns_rec_type_t,
        cnt: *mut usize,
    ) -> *const ares_dns_rr_key_t;
}
extern "C" {
    #[doc = " Retrieve the datatype associated with a Resource Record key.\n\n  \\param[in] key   Resource Record Key\n  \\return datatype"]
    pub fn ares_dns_rr_key_datatype(key: ares_dns_rr_key_t) -> ares_dns_datatype_t;
}
extern "C" {
    #[doc = " Retrieve the DNS Resource Record type associated with a Resource Record key.\n\n  \\param[in] key   Resource Record Key\n  \\return DNS Resource Record Type"]
    pub fn ares_dns_rr_key_to_rec_type(key: ares_dns_rr_key_t) -> ares_dns_rec_type_t;
}
#[doc = " Opaque data type representing a DNS RR (Resource Record)"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_dns_rr {
    _unused: [u8; 0],
}
#[doc = " Typedef for opaque data type representing a DNS RR (Resource Record)"]
pub type ares_dns_rr_t = ares_dns_rr;
#[doc = " Opaque data type representing a DNS Query Data QD Packet"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_dns_qd {
    _unused: [u8; 0],
}
#[doc = " Typedef for opaque data type representing a DNS Query Data QD Packet"]
pub type ares_dns_qd_t = ares_dns_qd;
#[doc = " Opaque data type representing a DNS Packet"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_dns_record {
    _unused: [u8; 0],
}
#[doc = " Typedef for opaque data type representing a DNS Packet"]
pub type ares_dns_record_t = ares_dns_record;
extern "C" {
    #[doc = " Create a new DNS record object\n\n  \\param[out] dnsrec  Pointer passed by reference for a newly allocated\n                      record object.  Must be ares_dns_record_destroy()'d by\n                      caller.\n  \\param[in]  id      DNS Query ID.  If structuring a new query to be sent\n                      with ares_send(), this value should be zero.\n  \\param[in]  flags   DNS Flags from \\ares_dns_flags_t\n  \\param[in]  opcode  DNS OpCode (typically ARES_OPCODE_QUERY)\n  \\param[in]  rcode   DNS RCode\n  \\return ARES_SUCCESS on success"]
    pub fn ares_dns_record_create(
        dnsrec: *mut *mut ares_dns_record_t,
        id: ::std::os::raw::c_ushort,
        flags: ::std::os::raw::c_ushort,
        opcode: ares_dns_opcode_t,
        rcode: ares_dns_rcode_t,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Destroy a DNS record object\n\n  \\param[in] dnsrec  Initialized record object"]
    pub fn ares_dns_record_destroy(dnsrec: *mut ares_dns_record_t);
}
extern "C" {
    #[doc = " Get the DNS Query ID\n\n  \\param[in] dnsrec  Initialized record object\n  \\return DNS query id"]
    pub fn ares_dns_record_get_id(dnsrec: *const ares_dns_record_t) -> ::std::os::raw::c_ushort;
}
extern "C" {
    #[doc = " Get the DNS Record Flags\n\n  \\param[in] dnsrec  Initialized record object\n  \\return One or more \\ares_dns_flags_t"]
    pub fn ares_dns_record_get_flags(dnsrec: *const ares_dns_record_t) -> ::std::os::raw::c_ushort;
}
extern "C" {
    #[doc = " Get the DNS Record OpCode\n\n  \\param[in] dnsrec  Initialized record object\n  \\return opcode"]
    pub fn ares_dns_record_get_opcode(dnsrec: *const ares_dns_record_t) -> ares_dns_opcode_t;
}
extern "C" {
    #[doc = " Get the DNS Record RCode\n\n  \\param[in] dnsrec  Initialized record object\n  \\return rcode"]
    pub fn ares_dns_record_get_rcode(dnsrec: *const ares_dns_record_t) -> ares_dns_rcode_t;
}
extern "C" {
    #[doc = " Add a query to the DNS Record.  Typically a record will have only 1\n  query. Most DNS servers will reject queries with more than 1 question.\n\n \\param[in] dnsrec  Initialized record object\n \\param[in] name    Name/Hostname of request\n \\param[in] qtype   Type of query\n \\param[in] qclass  Class of query (typically ARES_CLASS_IN)\n \\return ARES_SUCCESS on success"]
    pub fn ares_dns_record_query_add(
        dnsrec: *mut ares_dns_record_t,
        name: *const ::std::os::raw::c_char,
        qtype: ares_dns_rec_type_t,
        qclass: ares_dns_class_t,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Replace the question name with a new name.  This may be used when performing\n  a search with aliases.\n\n  Note that this will invalidate the name pointer returned from\n  ares_dns_record_query_get().\n\n \\param[in] dnsrec  Initialized record object\n \\param[in] idx     Index of question (typically 0)\n \\param[in] name    Name to use as replacement.\n \\return ARES_SUCCESS on success"]
    pub fn ares_dns_record_query_set_name(
        dnsrec: *mut ares_dns_record_t,
        idx: usize,
        name: *const ::std::os::raw::c_char,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Replace the question type with a different type.  This may be used when\n  needing to query more than one address class (e.g. A and AAAA)\n\n \\param[in] dnsrec  Initialized record object\n \\param[in] idx     Index of question (typically 0)\n \\param[in] qtype   Record Type to use as replacement.\n \\return ARES_SUCCESS on success"]
    pub fn ares_dns_record_query_set_type(
        dnsrec: *mut ares_dns_record_t,
        idx: usize,
        qtype: ares_dns_rec_type_t,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Get the count of queries in the DNS Record\n\n \\param[in] dnsrec  Initialized record object\n \\return count of queries"]
    pub fn ares_dns_record_query_cnt(dnsrec: *const ares_dns_record_t) -> usize;
}
extern "C" {
    #[doc = " Get the data about the query at the provided index.\n\n \\param[in]  dnsrec  Initialized record object\n \\param[in]  idx     Index of query\n \\param[out] name    Optional.  Returns name, may pass NULL if not desired.\n                     This pointer will be invalided by any call to\n                     ares_dns_record_query_set_name().\n \\param[out] qtype   Optional.  Returns record type, may pass NULL.\n \\param[out] qclass  Optional.  Returns class, may pass NULL.\n \\return ARES_SUCCESS on success"]
    pub fn ares_dns_record_query_get(
        dnsrec: *const ares_dns_record_t,
        idx: usize,
        name: *mut *const ::std::os::raw::c_char,
        qtype: *mut ares_dns_rec_type_t,
        qclass: *mut ares_dns_class_t,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Get the count of Resource Records in the provided section\n\n \\param[in] dnsrec  Initialized record object\n \\param[in] sect    Section.  ARES_SECTION_ANSWER is most used.\n \\return count of resource records."]
    pub fn ares_dns_record_rr_cnt(
        dnsrec: *const ares_dns_record_t,
        sect: ares_dns_section_t,
    ) -> usize;
}
extern "C" {
    #[doc = " Add a Resource Record to the DNS Record.\n\n  \\param[out] rr_out   Pointer to created resource record.  This pointer\n                       is owned by the DNS record itself, this is just made\n                       available to facilitate adding RR-specific fields.\n  \\param[in]  dnsrec   Initialized record object\n  \\param[in]  sect     Section to add resource record to\n  \\param[in]  name     Resource Record name/hostname\n  \\param[in]  type     Record Type\n  \\param[in]  rclass   Class\n  \\param[in]  ttl      TTL\n  \\return ARES_SUCCESS on success"]
    pub fn ares_dns_record_rr_add(
        rr_out: *mut *mut ares_dns_rr_t,
        dnsrec: *mut ares_dns_record_t,
        sect: ares_dns_section_t,
        name: *const ::std::os::raw::c_char,
        type_: ares_dns_rec_type_t,
        rclass: ares_dns_class_t,
        ttl: ::std::os::raw::c_uint,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Fetch a writable resource record based on the section and index.\n\n  \\param[in]  dnsrec   Initialized record object\n  \\param[in]  sect     Section for resource record\n  \\param[in]  idx      Index of resource record in section\n  \\return NULL on misuse, otherwise a writable pointer to the resource record"]
    pub fn ares_dns_record_rr_get(
        dnsrec: *mut ares_dns_record_t,
        sect: ares_dns_section_t,
        idx: usize,
    ) -> *mut ares_dns_rr_t;
}
extern "C" {
    #[doc = " Fetch a non-writeable resource record based on the section and index.\n\n  \\param[in]  dnsrec   Initialized record object\n  \\param[in]  sect     Section for resource record\n  \\param[in]  idx      Index of resource record in section\n  \\return NULL on misuse, otherwise a const pointer to the resource record"]
    pub fn ares_dns_record_rr_get_const(
        dnsrec: *const ares_dns_record_t,
        sect: ares_dns_section_t,
        idx: usize,
    ) -> *const ares_dns_rr_t;
}
extern "C" {
    #[doc = " Remove the resource record based on the section and index\n\n  \\param[in]  dnsrec   Initialized record object\n  \\param[in]  sect     Section for resource record\n  \\param[in]  idx      Index of resource record in section\n  \\return ARES_SUCCESS on success, otherwise an error code."]
    pub fn ares_dns_record_rr_del(
        dnsrec: *mut ares_dns_record_t,
        sect: ares_dns_section_t,
        idx: usize,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Retrieve the resource record Name/Hostname\n\n  \\param[in] rr  Pointer to resource record\n  \\return Name"]
    pub fn ares_dns_rr_get_name(rr: *const ares_dns_rr_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " Retrieve the resource record type\n\n  \\param[in] rr  Pointer to resource record\n  \\return type"]
    pub fn ares_dns_rr_get_type(rr: *const ares_dns_rr_t) -> ares_dns_rec_type_t;
}
extern "C" {
    #[doc = " Retrieve the resource record class\n\n  \\param[in] rr  Pointer to resource record\n  \\return class"]
    pub fn ares_dns_rr_get_class(rr: *const ares_dns_rr_t) -> ares_dns_class_t;
}
extern "C" {
    #[doc = " Retrieve the resource record TTL\n\n  \\param[in] rr  Pointer to resource record\n  \\return TTL"]
    pub fn ares_dns_rr_get_ttl(rr: *const ares_dns_rr_t) -> ::std::os::raw::c_uint;
}
extern "C" {
    #[doc = " Set ipv4 address data type for specified resource record and key.  Can\n  only be used on keys with datatype ARES_DATATYPE_INADDR\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\param[in] addr   Pointer to ipv4 address to use.\n  \\return ARES_SUCCESS on success"]
    pub fn ares_dns_rr_set_addr(
        dns_rr: *mut ares_dns_rr_t,
        key: ares_dns_rr_key_t,
        addr: *const in_addr,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Set ipv6 address data type for specified resource record and key.  Can\n  only be used on keys with datatype ARES_DATATYPE_INADDR6\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\param[in] addr   Pointer to ipv6 address to use.\n  \\return ARES_SUCCESS on success"]
    pub fn ares_dns_rr_set_addr6(
        dns_rr: *mut ares_dns_rr_t,
        key: ares_dns_rr_key_t,
        addr: *const ares_in6_addr,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Set string data for specified resource record and key.  Can\n  only be used on keys with datatype ARES_DATATYPE_STR or ARES_DATATYPE_NAME.\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\param[in] val    Pointer to string to set.\n  \\return ARES_SUCCESS on success"]
    pub fn ares_dns_rr_set_str(
        dns_rr: *mut ares_dns_rr_t,
        key: ares_dns_rr_key_t,
        val: *const ::std::os::raw::c_char,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Set 8bit unsigned integer for specified resource record and key.  Can\n  only be used on keys with datatype ARES_DATATYPE_U8\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\param[in] val    8bit unsigned integer\n  \\return ARES_SUCCESS on success"]
    pub fn ares_dns_rr_set_u8(
        dns_rr: *mut ares_dns_rr_t,
        key: ares_dns_rr_key_t,
        val: ::std::os::raw::c_uchar,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Set 16bit unsigned integer for specified resource record and key.  Can\n  only be used on keys with datatype ARES_DATATYPE_U16\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\param[in] val    16bit unsigned integer\n  \\return ARES_SUCCESS on success"]
    pub fn ares_dns_rr_set_u16(
        dns_rr: *mut ares_dns_rr_t,
        key: ares_dns_rr_key_t,
        val: ::std::os::raw::c_ushort,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Set 32bit unsigned integer for specified resource record and key.  Can\n  only be used on keys with datatype ARES_DATATYPE_U32\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\param[in] val    32bit unsigned integer\n  \\return ARES_SUCCESS on success"]
    pub fn ares_dns_rr_set_u32(
        dns_rr: *mut ares_dns_rr_t,
        key: ares_dns_rr_key_t,
        val: ::std::os::raw::c_uint,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Set binary (BIN or BINP) data for specified resource record and key.  Can\n  only be used on keys with datatype ARES_DATATYPE_BIN or ARES_DATATYPE_BINP.\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\param[in] val    Pointer to binary data.\n  \\param[in] len    Length of binary data\n  \\return ARES_SUCCESS on success"]
    pub fn ares_dns_rr_set_bin(
        dns_rr: *mut ares_dns_rr_t,
        key: ares_dns_rr_key_t,
        val: *const ::std::os::raw::c_uchar,
        len: usize,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Set the option for the RR\n\n  \\param[in]  dns_rr   Pointer to resource record\n  \\param[in]  key      DNS Resource Record Key\n  \\param[in]  opt      Option record key id.\n  \\param[out] val      Optional. Value to associate with option.\n  \\param[out] val_len  Length of value passed.\n  \\return ARES_SUCCESS on success"]
    pub fn ares_dns_rr_set_opt(
        dns_rr: *mut ares_dns_rr_t,
        key: ares_dns_rr_key_t,
        opt: ::std::os::raw::c_ushort,
        val: *const ::std::os::raw::c_uchar,
        val_len: usize,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Retrieve a pointer to the ipv4 address.  Can only be used on keys with\n  datatype ARES_DATATYPE_INADDR.\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\return pointer to ipv4 address or NULL on error"]
    pub fn ares_dns_rr_get_addr(
        dns_rr: *const ares_dns_rr_t,
        key: ares_dns_rr_key_t,
    ) -> *const in_addr;
}
extern "C" {
    #[doc = " Retrieve a pointer to the ipv6 address.  Can only be used on keys with\n  datatype ARES_DATATYPE_INADDR6.\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\return pointer to ipv6 address or NULL on error"]
    pub fn ares_dns_rr_get_addr6(
        dns_rr: *const ares_dns_rr_t,
        key: ares_dns_rr_key_t,
    ) -> *const ares_in6_addr;
}
extern "C" {
    #[doc = " Retrieve a pointer to the string.  Can only be used on keys with\n  datatype ARES_DATATYPE_STR and ARES_DATATYPE_NAME.\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\return pointer string or NULL on error"]
    pub fn ares_dns_rr_get_str(
        dns_rr: *const ares_dns_rr_t,
        key: ares_dns_rr_key_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " Retrieve an 8bit unsigned integer.  Can only be used on keys with\n  datatype ARES_DATATYPE_U8.\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\return 8bit unsigned integer"]
    pub fn ares_dns_rr_get_u8(
        dns_rr: *const ares_dns_rr_t,
        key: ares_dns_rr_key_t,
    ) -> ::std::os::raw::c_uchar;
}
extern "C" {
    #[doc = " Retrieve an 16bit unsigned integer.  Can only be used on keys with\n  datatype ARES_DATATYPE_U16.\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\return 16bit unsigned integer"]
    pub fn ares_dns_rr_get_u16(
        dns_rr: *const ares_dns_rr_t,
        key: ares_dns_rr_key_t,
    ) -> ::std::os::raw::c_ushort;
}
extern "C" {
    #[doc = " Retrieve an 32bit unsigned integer.  Can only be used on keys with\n  datatype ARES_DATATYPE_U32.\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\return 32bit unsigned integer"]
    pub fn ares_dns_rr_get_u32(
        dns_rr: *const ares_dns_rr_t,
        key: ares_dns_rr_key_t,
    ) -> ::std::os::raw::c_uint;
}
extern "C" {
    #[doc = " Retrieve a pointer to the binary data.  Can only be used on keys with\n  datatype ARES_DATATYPE_BIN or ARES_DATATYPE_BINP.  If BINP, the data is\n  guaranteed to have a NULL terminator which is NOT included in the length.\n\n  \\param[in]  dns_rr Pointer to resource record\n  \\param[in]  key    DNS Resource Record Key\n  \\param[out] len    Length of binary data returned\n  \\return pointer binary data or NULL on error"]
    pub fn ares_dns_rr_get_bin(
        dns_rr: *const ares_dns_rr_t,
        key: ares_dns_rr_key_t,
        len: *mut usize,
    ) -> *const ::std::os::raw::c_uchar;
}
extern "C" {
    #[doc = " Retrieve the number of options stored for the RR.\n\n  \\param[in] dns_rr Pointer to resource record\n  \\param[in] key    DNS Resource Record Key\n  \\return count, or 0 if none."]
    pub fn ares_dns_rr_get_opt_cnt(dns_rr: *const ares_dns_rr_t, key: ares_dns_rr_key_t) -> usize;
}
extern "C" {
    #[doc = " Retrieve the option for the RR by index.\n\n  \\param[in]  dns_rr  Pointer to resource record\n  \\param[in]  key     DNS Resource Record Key\n  \\param[in]  idx     Index of option record\n  \\param[out] val     Optional. Pointer passed by reference to hold value.\n                      Options may not have values.  Value if returned is\n                      guaranteed to be NULL terminated, however in most\n                      cases it is not printable.\n  \\param[out] val_len Optional. Pointer passed by reference to hold value\n                      length.\n  \\return option key/id on success, 65535 on misuse."]
    pub fn ares_dns_rr_get_opt(
        dns_rr: *const ares_dns_rr_t,
        key: ares_dns_rr_key_t,
        idx: usize,
        val: *mut *const ::std::os::raw::c_uchar,
        val_len: *mut usize,
    ) -> ::std::os::raw::c_ushort;
}
extern "C" {
    #[doc = " Retrieve the option for the RR by the option key/id.\n\n  \\param[in]  dns_rr  Pointer to resource record\n  \\param[in]  key     DNS Resource Record Key\n  \\param[in]  opt     Option record key id (this is not the index).\n  \\param[out] val     Optional. Pointer passed by reference to hold value.\n                      Options may not have values. Value if returned is\n                      guaranteed to be NULL terminated, however in most cases\n                      it is not printable.\n  \\param[out] val_len Optional. Pointer passed by reference to hold value\n                      length.\n  \\return ARES_TRUE on success, ARES_FALSE on misuse."]
    pub fn ares_dns_rr_get_opt_byid(
        dns_rr: *const ares_dns_rr_t,
        key: ares_dns_rr_key_t,
        opt: ::std::os::raw::c_ushort,
        val: *mut *const ::std::os::raw::c_uchar,
        val_len: *mut usize,
    ) -> ares_bool_t;
}
extern "C" {
    #[doc = " Parse a complete DNS message.\n\n  \\param[in]  buf      pointer to bytes to be parsed\n  \\param[in]  buf_len  Length of buf provided\n  \\param[in]  flags    Flags dictating how the message should be parsed.\n  \\param[out] dnsrec   Pointer passed by reference for a new DNS record object\n                       that must be ares_dns_record_destroy()'d by caller.\n  \\return ARES_SUCCESS on success"]
    pub fn ares_dns_parse(
        buf: *const ::std::os::raw::c_uchar,
        buf_len: usize,
        flags: ::std::os::raw::c_uint,
        dnsrec: *mut *mut ares_dns_record_t,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Write a complete DNS message\n\n  \\param[in]  dnsrec   Pointer to initialized and filled DNS record object.\n  \\param[out] buf      Pointer passed by reference to be filled in with with\n                       DNS message.  Must be ares_free()'d by caller.\n  \\param[out] buf_len  Length of returned buffer containing DNS message.\n  \\return ARES_SUCCESS on success"]
    pub fn ares_dns_write(
        dnsrec: *const ares_dns_record_t,
        buf: *mut *mut ::std::os::raw::c_uchar,
        buf_len: *mut usize,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Duplicate a complete DNS message.  This does not copy internal members\n  (such as the ttl decrement capability).\n\n  \\param[in] dnsrec Pointer to initialized and filled DNS record object.\n  \\return duplicted DNS record object, or NULL on out of memory."]
    pub fn ares_dns_record_duplicate(dnsrec: *const ares_dns_record_t) -> *mut ares_dns_record_t;
}
pub type ares_callback = ::std::option::Option<
    unsafe extern "C" fn(
        arg: *mut ::std::os::raw::c_void,
        status: ::std::os::raw::c_int,
        timeouts: ::std::os::raw::c_int,
        abuf: *mut ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
    ),
>;
pub type ares_callback_dnsrec = ::std::option::Option<
    unsafe extern "C" fn(
        arg: *mut ::std::os::raw::c_void,
        status: ares_status_t,
        timeouts: usize,
        dnsrec: *const ares_dns_record_t,
    ),
>;
pub type ares_host_callback = ::std::option::Option<
    unsafe extern "C" fn(
        arg: *mut ::std::os::raw::c_void,
        status: ::std::os::raw::c_int,
        timeouts: ::std::os::raw::c_int,
        hostent: *mut hostent,
    ),
>;
pub type ares_nameinfo_callback = ::std::option::Option<
    unsafe extern "C" fn(
        arg: *mut ::std::os::raw::c_void,
        status: ::std::os::raw::c_int,
        timeouts: ::std::os::raw::c_int,
        node: *mut ::std::os::raw::c_char,
        service: *mut ::std::os::raw::c_char,
    ),
>;
pub type ares_sock_create_callback = ::std::option::Option<
    unsafe extern "C" fn(
        socket_fd: ares_socket_t,
        type_: ::std::os::raw::c_int,
        data: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int,
>;
pub type ares_sock_config_callback = ::std::option::Option<
    unsafe extern "C" fn(
        socket_fd: ares_socket_t,
        type_: ::std::os::raw::c_int,
        data: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int,
>;
pub type ares_addrinfo_callback = ::std::option::Option<
    unsafe extern "C" fn(
        arg: *mut ::std::os::raw::c_void,
        status: ::std::os::raw::c_int,
        timeouts: ::std::os::raw::c_int,
        res: *mut ares_addrinfo,
    ),
>;
extern "C" {
    pub fn ares_library_init(flags: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_library_init_mem(
        flags: ::std::os::raw::c_int,
        amalloc: ::std::option::Option<
            unsafe extern "C" fn(size: usize) -> *mut ::std::os::raw::c_void,
        >,
        afree: ::std::option::Option<unsafe extern "C" fn(ptr: *mut ::std::os::raw::c_void)>,
        arealloc: ::std::option::Option<
            unsafe extern "C" fn(
                ptr: *mut ::std::os::raw::c_void,
                size: usize,
            ) -> *mut ::std::os::raw::c_void,
        >,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_library_initialized() -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_library_cleanup();
}
extern "C" {
    pub fn ares_version(version: *mut ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn ares_init(channelptr: *mut *mut ares_channel_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_init_options(
        channelptr: *mut *mut ares_channel_t,
        options: *const ares_options,
        optmask: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_save_options(
        channel: *const ares_channel_t,
        options: *mut ares_options,
        optmask: *mut ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_destroy_options(options: *mut ares_options);
}
extern "C" {
    pub fn ares_dup(
        dest: *mut *mut ares_channel_t,
        src: *const ares_channel_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_reinit(channel: *mut ares_channel_t) -> ares_status_t;
}
extern "C" {
    pub fn ares_destroy(channel: *mut ares_channel_t);
}
extern "C" {
    pub fn ares_cancel(channel: *mut ares_channel_t);
}
extern "C" {
    pub fn ares_set_local_ip4(channel: *mut ares_channel_t, local_ip: ::std::os::raw::c_uint);
}
extern "C" {
    pub fn ares_set_local_ip6(
        channel: *mut ares_channel_t,
        local_ip6: *const ::std::os::raw::c_uchar,
    );
}
extern "C" {
    pub fn ares_set_local_dev(
        channel: *mut ares_channel_t,
        local_dev_name: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    pub fn ares_set_socket_callback(
        channel: *mut ares_channel_t,
        callback: ares_sock_create_callback,
        user_data: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn ares_set_socket_configure_callback(
        channel: *mut ares_channel_t,
        callback: ares_sock_config_callback,
        user_data: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn ares_set_sortlist(
        channel: *mut ares_channel_t,
        sortstr: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_getaddrinfo(
        channel: *mut ares_channel_t,
        node: *const ::std::os::raw::c_char,
        service: *const ::std::os::raw::c_char,
        hints: *const ares_addrinfo_hints,
        callback: ares_addrinfo_callback,
        arg: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn ares_freeaddrinfo(ai: *mut ares_addrinfo);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_socket_functions {
    pub asocket: ::std::option::Option<
        unsafe extern "C" fn(
            arg1: ::std::os::raw::c_int,
            arg2: ::std::os::raw::c_int,
            arg3: ::std::os::raw::c_int,
            arg4: *mut ::std::os::raw::c_void,
        ) -> ares_socket_t,
    >,
    pub aclose: ::std::option::Option<
        unsafe extern "C" fn(
            arg1: ares_socket_t,
            arg2: *mut ::std::os::raw::c_void,
        ) -> ::std::os::raw::c_int,
    >,
    pub aconnect: ::std::option::Option<
        unsafe extern "C" fn(
            arg1: ares_socket_t,
            arg2: *const sockaddr,
            arg3: ares_socklen_t,
            arg4: *mut ::std::os::raw::c_void,
        ) -> ::std::os::raw::c_int,
    >,
    pub arecvfrom: ::std::option::Option<
        unsafe extern "C" fn(
            arg1: ares_socket_t,
            arg2: *mut ::std::os::raw::c_void,
            arg3: usize,
            arg4: ::std::os::raw::c_int,
            arg5: *mut sockaddr,
            arg6: *mut ares_socklen_t,
            arg7: *mut ::std::os::raw::c_void,
        ) -> ares_ssize_t,
    >,
    pub asendv: ::std::option::Option<
        unsafe extern "C" fn(
            arg1: ares_socket_t,
            arg2: *const iovec,
            arg3: ::std::os::raw::c_int,
            arg4: *mut ::std::os::raw::c_void,
        ) -> ares_ssize_t,
    >,
}
extern "C" {
    pub fn ares_set_socket_functions(
        channel: *mut ares_channel_t,
        funcs: *const ares_socket_functions,
        user_data: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn ares_send(
        channel: *mut ares_channel_t,
        qbuf: *const ::std::os::raw::c_uchar,
        qlen: ::std::os::raw::c_int,
        callback: ares_callback,
        arg: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    #[doc = " Send a DNS query as an ares_dns_record_t with a callback containing the\n  parsed DNS record.\n\n  \\param[in]  channel  Pointer to channel on which queries will be sent.\n  \\param[in]  dnsrec   DNS Record to send\n  \\param[in]  callback Callback function invoked on completion or failure of\n                       the query sequence.\n  \\param[in]  arg      Additional argument passed to the callback function.\n  \\param[out] qid      Query ID\n  \\return One of the c-ares status codes."]
    pub fn ares_send_dnsrec(
        channel: *mut ares_channel_t,
        dnsrec: *const ares_dns_record_t,
        callback: ares_callback_dnsrec,
        arg: *mut ::std::os::raw::c_void,
        qid: *mut ::std::os::raw::c_ushort,
    ) -> ares_status_t;
}
extern "C" {
    pub fn ares_query(
        channel: *mut ares_channel_t,
        name: *const ::std::os::raw::c_char,
        dnsclass: ::std::os::raw::c_int,
        type_: ::std::os::raw::c_int,
        callback: ares_callback,
        arg: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    #[doc = " Perform a DNS query with a callback containing the parsed DNS record.\n\n  \\param[in]  channel  Pointer to channel on which queries will be sent.\n  \\param[in]  name     Query name\n  \\param[in]  dnsclass DNS Class\n  \\param[in]  type     DNS Record Type\n  \\param[in]  callback Callback function invoked on completion or failure of\n                       the query sequence.\n  \\param[in]  arg      Additional argument passed to the callback function.\n  \\param[out] qid      Query ID\n  \\return One of the c-ares status codes."]
    pub fn ares_query_dnsrec(
        channel: *mut ares_channel_t,
        name: *const ::std::os::raw::c_char,
        dnsclass: ares_dns_class_t,
        type_: ares_dns_rec_type_t,
        callback: ares_callback_dnsrec,
        arg: *mut ::std::os::raw::c_void,
        qid: *mut ::std::os::raw::c_ushort,
    ) -> ares_status_t;
}
extern "C" {
    pub fn ares_search(
        channel: *mut ares_channel_t,
        name: *const ::std::os::raw::c_char,
        dnsclass: ::std::os::raw::c_int,
        type_: ::std::os::raw::c_int,
        callback: ares_callback,
        arg: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    #[doc = " Search for a complete DNS message.\n\n  \\param[in] channel  Pointer to channel on which queries will be sent.\n  \\param[in] dnsrec   Pointer to initialized and filled DNS record object.\n  \\param[in] callback Callback function invoked on completion or failure of\n                      the query sequence.\n  \\param[in] arg      Additional argument passed to the callback function.\n  \\return One of the c-ares status codes.  In all cases, except\n          ARES_EFORMERR due to misuse, this error code will also be sent\n          to the provided callback."]
    pub fn ares_search_dnsrec(
        channel: *mut ares_channel_t,
        dnsrec: *const ares_dns_record_t,
        callback: ares_callback_dnsrec,
        arg: *mut ::std::os::raw::c_void,
    ) -> ares_status_t;
}
extern "C" {
    pub fn ares_gethostbyname(
        channel: *mut ares_channel_t,
        name: *const ::std::os::raw::c_char,
        family: ::std::os::raw::c_int,
        callback: ares_host_callback,
        arg: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn ares_gethostbyname_file(
        channel: *mut ares_channel_t,
        name: *const ::std::os::raw::c_char,
        family: ::std::os::raw::c_int,
        host: *mut *mut hostent,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_gethostbyaddr(
        channel: *mut ares_channel_t,
        addr: *const ::std::os::raw::c_void,
        addrlen: ::std::os::raw::c_int,
        family: ::std::os::raw::c_int,
        callback: ares_host_callback,
        arg: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn ares_getnameinfo(
        channel: *mut ares_channel_t,
        sa: *const sockaddr,
        salen: ares_socklen_t,
        flags: ::std::os::raw::c_int,
        callback: ares_nameinfo_callback,
        arg: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn ares_fds(
        channel: *const ares_channel_t,
        read_fds: *mut fd_set,
        write_fds: *mut fd_set,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_getsock(
        channel: *const ares_channel_t,
        socks: *mut ares_socket_t,
        numsocks: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_timeout(
        channel: *const ares_channel_t,
        maxtv: *mut timeval,
        tv: *mut timeval,
    ) -> *mut timeval;
}
extern "C" {
    pub fn ares_process(
        channel: *mut ares_channel_t,
        read_fds: *mut fd_set,
        write_fds: *mut fd_set,
    );
}
extern "C" {
    pub fn ares_process_fd(
        channel: *mut ares_channel_t,
        read_fd: ares_socket_t,
        write_fd: ares_socket_t,
    );
}
extern "C" {
    pub fn ares_create_query(
        name: *const ::std::os::raw::c_char,
        dnsclass: ::std::os::raw::c_int,
        type_: ::std::os::raw::c_int,
        id: ::std::os::raw::c_ushort,
        rd: ::std::os::raw::c_int,
        buf: *mut *mut ::std::os::raw::c_uchar,
        buflen: *mut ::std::os::raw::c_int,
        max_udp_size: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_mkquery(
        name: *const ::std::os::raw::c_char,
        dnsclass: ::std::os::raw::c_int,
        type_: ::std::os::raw::c_int,
        id: ::std::os::raw::c_ushort,
        rd: ::std::os::raw::c_int,
        buf: *mut *mut ::std::os::raw::c_uchar,
        buflen: *mut ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_expand_name(
        encoded: *const ::std::os::raw::c_uchar,
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        s: *mut *mut ::std::os::raw::c_char,
        enclen: *mut ::std::os::raw::c_long,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_expand_string(
        encoded: *const ::std::os::raw::c_uchar,
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        s: *mut *mut ::std::os::raw::c_uchar,
        enclen: *mut ::std::os::raw::c_long,
    ) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ares_addrttl {
    pub ipaddr: in_addr,
    pub ttl: ::std::os::raw::c_int,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ares_addr6ttl {
    pub ip6addr: ares_in6_addr,
    pub ttl: ::std::os::raw::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_caa_reply {
    pub next: *mut ares_caa_reply,
    pub critical: ::std::os::raw::c_int,
    pub property: *mut ::std::os::raw::c_uchar,
    pub plength: usize,
    pub value: *mut ::std::os::raw::c_uchar,
    pub length: usize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_srv_reply {
    pub next: *mut ares_srv_reply,
    pub host: *mut ::std::os::raw::c_char,
    pub priority: ::std::os::raw::c_ushort,
    pub weight: ::std::os::raw::c_ushort,
    pub port: ::std::os::raw::c_ushort,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_mx_reply {
    pub next: *mut ares_mx_reply,
    pub host: *mut ::std::os::raw::c_char,
    pub priority: ::std::os::raw::c_ushort,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_txt_reply {
    pub next: *mut ares_txt_reply,
    pub txt: *mut ::std::os::raw::c_uchar,
    pub length: usize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_txt_ext {
    pub next: *mut ares_txt_ext,
    pub txt: *mut ::std::os::raw::c_uchar,
    pub length: usize,
    pub record_start: ::std::os::raw::c_uchar,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_naptr_reply {
    pub next: *mut ares_naptr_reply,
    pub flags: *mut ::std::os::raw::c_uchar,
    pub service: *mut ::std::os::raw::c_uchar,
    pub regexp: *mut ::std::os::raw::c_uchar,
    pub replacement: *mut ::std::os::raw::c_char,
    pub order: ::std::os::raw::c_ushort,
    pub preference: ::std::os::raw::c_ushort,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_soa_reply {
    pub nsname: *mut ::std::os::raw::c_char,
    pub hostmaster: *mut ::std::os::raw::c_char,
    pub serial: ::std::os::raw::c_uint,
    pub refresh: ::std::os::raw::c_uint,
    pub retry: ::std::os::raw::c_uint,
    pub expire: ::std::os::raw::c_uint,
    pub minttl: ::std::os::raw::c_uint,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_uri_reply {
    pub next: *mut ares_uri_reply,
    pub priority: ::std::os::raw::c_ushort,
    pub weight: ::std::os::raw::c_ushort,
    pub uri: *mut ::std::os::raw::c_char,
    pub ttl: ::std::os::raw::c_int,
}
#[repr(C)]
pub struct ares_addrinfo_node {
    pub ai_ttl: ::std::os::raw::c_int,
    pub ai_flags: ::std::os::raw::c_int,
    pub ai_family: ::std::os::raw::c_int,
    pub ai_socktype: ::std::os::raw::c_int,
    pub ai_protocol: ::std::os::raw::c_int,
    pub ai_addrlen: ares_socklen_t,
    pub ai_addr: *mut sockaddr,
    pub ai_next: *mut ares_addrinfo_node,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_addrinfo_cname {
    pub ttl: ::std::os::raw::c_int,
    pub alias: *mut ::std::os::raw::c_char,
    pub name: *mut ::std::os::raw::c_char,
    pub next: *mut ares_addrinfo_cname,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_addrinfo {
    pub cnames: *mut ares_addrinfo_cname,
    pub nodes: *mut ares_addrinfo_node,
    #[cfg(cares1_18)]
    pub name: *mut ::std::os::raw::c_char,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ares_addrinfo_hints {
    pub ai_flags: ::std::os::raw::c_int,
    pub ai_family: ::std::os::raw::c_int,
    pub ai_socktype: ::std::os::raw::c_int,
    pub ai_protocol: ::std::os::raw::c_int,
}
extern "C" {
    pub fn ares_parse_a_reply(
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        host: *mut *mut hostent,
        addrttls: *mut ares_addrttl,
        naddrttls: *mut ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_parse_aaaa_reply(
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        host: *mut *mut hostent,
        addrttls: *mut ares_addr6ttl,
        naddrttls: *mut ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_parse_caa_reply(
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        caa_out: *mut *mut ares_caa_reply,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_parse_ptr_reply(
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        addr: *const ::std::os::raw::c_void,
        addrlen: ::std::os::raw::c_int,
        family: ::std::os::raw::c_int,
        host: *mut *mut hostent,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_parse_ns_reply(
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        host: *mut *mut hostent,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_parse_srv_reply(
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        srv_out: *mut *mut ares_srv_reply,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_parse_mx_reply(
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        mx_out: *mut *mut ares_mx_reply,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_parse_txt_reply(
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        txt_out: *mut *mut ares_txt_reply,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_parse_txt_reply_ext(
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        txt_out: *mut *mut ares_txt_ext,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_parse_naptr_reply(
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        naptr_out: *mut *mut ares_naptr_reply,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_parse_soa_reply(
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        soa_out: *mut *mut ares_soa_reply,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_parse_uri_reply(
        abuf: *const ::std::os::raw::c_uchar,
        alen: ::std::os::raw::c_int,
        uri_out: *mut *mut ares_uri_reply,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_free_string(str_: *mut ::std::os::raw::c_void);
}
extern "C" {
    pub fn ares_free_hostent(host: *mut hostent);
}
extern "C" {
    pub fn ares_free_data(dataptr: *mut ::std::os::raw::c_void);
}
extern "C" {
    pub fn ares_strerror(code: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ares_addr_node {
    pub next: *mut ares_addr_node,
    pub family: ::std::os::raw::c_int,
    pub addr: ares_addr_node__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union ares_addr_node__bindgen_ty_1 {
    pub addr4: in_addr,
    pub addr6: ares_in6_addr,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ares_addr_port_node {
    pub next: *mut ares_addr_port_node,
    pub family: ::std::os::raw::c_int,
    pub addr: ares_addr_port_node__bindgen_ty_1,
    pub udp_port: ::std::os::raw::c_int,
    pub tcp_port: ::std::os::raw::c_int,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union ares_addr_port_node__bindgen_ty_1 {
    pub addr4: in_addr,
    pub addr6: ares_in6_addr,
}
extern "C" {
    pub fn ares_set_servers(
        channel: *mut ares_channel_t,
        servers: *const ares_addr_node,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_set_servers_ports(
        channel: *mut ares_channel_t,
        servers: *const ares_addr_port_node,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_set_servers_csv(
        channel: *mut ares_channel_t,
        servers: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_set_servers_ports_csv(
        channel: *mut ares_channel_t,
        servers: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_get_servers_csv(channel: *mut ares_channel_t) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn ares_get_servers(
        channel: *const ares_channel_t,
        servers: *mut *mut ares_addr_node,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_get_servers_ports(
        channel: *const ares_channel_t,
        servers: *mut *mut ares_addr_port_node,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn ares_inet_ntop(
        af: ::std::os::raw::c_int,
        src: *const ::std::os::raw::c_void,
        dst: *mut ::std::os::raw::c_char,
        size: ares_socklen_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn ares_inet_pton(
        af: ::std::os::raw::c_int,
        src: *const ::std::os::raw::c_char,
        dst: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " Whether or not the c-ares library was built with threadsafety\n\n  \\return ARES_TRUE if built with threadsafety, ARES_FALSE if not"]
    pub fn ares_threadsafety() -> ares_bool_t;
}
extern "C" {
    #[doc = " Block until notified that there are no longer any queries in queue, or\n  the specified timeout has expired.\n\n  \\param[in] channel    Initialized ares channel\n  \\param[in] timeout_ms Number of milliseconds to wait for the queue to be\n                        empty. -1 for Infinite.\n  \\return ARES_ENOTIMP if not built with threading support, ARES_ETIMEOUT\n          if requested timeout expires, ARES_SUCCESS when queue is empty."]
    pub fn ares_queue_wait_empty(
        channel: *mut ares_channel_t,
        timeout_ms: ::std::os::raw::c_int,
    ) -> ares_status_t;
}
extern "C" {
    #[doc = " Retrieve the total number of active queries pending answers from servers.\n  Some c-ares requests may spawn multiple queries, such as ares_getaddrinfo()\n  when using AF_UNSPEC, which will be reflected in this number.\n\n  \\param[in] channel Initialized ares channel\n  \\return Number of active queries to servers"]
    pub fn ares_queue_active_queries(channel: *const ares_channel_t) -> usize;
}
#[cfg(target_os = "android")]
extern "C" {
    pub fn ares_library_init_jvm(jvm: *mut jni_sys::JavaVM);
}
#[cfg(target_os = "android")]
extern "C" {
    pub fn ares_library_init_android(
        connectivity_manager: jni_sys::jobject,
    ) -> ::std::os::raw::c_int;
}
#[cfg(target_os = "android")]
extern "C" {
    pub fn ares_library_android_initialized() -> ::std::os::raw::c_int;
}