Compare commits
2226 Commits
curl-7_18_
...
curl-7_19_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bf9d56485 | ||
|
|
367114bc87 | ||
|
|
81d45ed3a2 | ||
|
|
7d74e02519 | ||
|
|
7611d30a05 | ||
|
|
3704375292 | ||
|
|
ea1f30e686 | ||
|
|
9732b7cebe | ||
|
|
f39380b1ac | ||
|
|
c8da2980ed | ||
|
|
b19dc0eeb0 | ||
|
|
41de897b6b | ||
|
|
108b414bb8 | ||
|
|
be7af8beaa | ||
|
|
db1281fa9b | ||
|
|
223d848104 | ||
|
|
d8884168e3 | ||
|
|
5dd64e9e4b | ||
|
|
ce6731baf1 | ||
|
|
2c0b65d37b | ||
|
|
a76f4ab7dd | ||
|
|
d68f215f03 | ||
|
|
0a5ac52b49 | ||
|
|
8acb3803e4 | ||
|
|
ac62a94de3 | ||
|
|
0abcb37e3f | ||
|
|
7da5efd55c | ||
|
|
d4ff44d5f6 | ||
|
|
fff706d702 | ||
|
|
eac4310b2e | ||
|
|
e87ee29e32 | ||
|
|
61ebbc01ed | ||
|
|
15f425bdb8 | ||
|
|
861092637b | ||
|
|
3717b7a792 | ||
|
|
950a034895 | ||
|
|
982e655c07 | ||
|
|
308497ffc6 | ||
|
|
b205525d34 | ||
|
|
654b6b6c63 | ||
|
|
3b908ed143 | ||
|
|
265ed24ac0 | ||
|
|
57eeee2ec3 | ||
|
|
6a79b0e859 | ||
|
|
0d9f14f5c1 | ||
|
|
9fced16efb | ||
|
|
f16868d301 | ||
|
|
21af9bf1cd | ||
|
|
b2f4308980 | ||
|
|
6a37135f4d | ||
|
|
b8e1e63379 | ||
|
|
448d2b5f49 | ||
|
|
7867d44251 | ||
|
|
2380ca1714 | ||
|
|
a1cc78d5a1 | ||
|
|
7531ac89d6 | ||
|
|
72acffc66c | ||
|
|
525549f204 | ||
|
|
3f8d3e9c50 | ||
|
|
1951cd1eee | ||
|
|
55aee95f11 | ||
|
|
777134a07b | ||
|
|
4b8ce9423f | ||
|
|
051ab439a9 | ||
|
|
12e60c6d4e | ||
|
|
ff3223259f | ||
|
|
3da1ade4e5 | ||
|
|
ff40c83aa7 | ||
|
|
f49427d364 | ||
|
|
04e8ff84fe | ||
|
|
6f4a5a4612 | ||
|
|
6d4e6cc813 | ||
|
|
86cec97b22 | ||
|
|
e5ee822745 | ||
|
|
167a92810a | ||
|
|
b8b8c3d538 | ||
|
|
21105ab344 | ||
|
|
e49d928ce4 | ||
|
|
5e253785af | ||
|
|
3cbc8d1ba3 | ||
|
|
b4af26a188 | ||
|
|
6daede08cb | ||
|
|
3669ff3c1e | ||
|
|
9afdb05fe8 | ||
|
|
4d9279cb3b | ||
|
|
640e49976f | ||
|
|
f1aa936d2c | ||
|
|
a5ba25a5f6 | ||
|
|
b4e6418aef | ||
|
|
0077a6d51b | ||
|
|
4798f4e652 | ||
|
|
b38e28b6bc | ||
|
|
052dac0d3f | ||
|
|
2eeafcf9a6 | ||
|
|
45e093fc45 | ||
|
|
e593715d72 | ||
|
|
1209f2c014 | ||
|
|
7c821a85f8 | ||
|
|
cf367a62ce | ||
|
|
b233957885 | ||
|
|
492aed1450 | ||
|
|
cd91a1eeca | ||
|
|
5ed274d0b7 | ||
|
|
4271f44a9e | ||
|
|
78d07cb0f9 | ||
|
|
5b11e3883c | ||
|
|
7d22ce5573 | ||
|
|
b64dd3c63d | ||
|
|
0ea6abe7df | ||
|
|
8646cecb78 | ||
|
|
867a0de670 | ||
|
|
4f47fc4e14 | ||
|
|
8d39a31e89 | ||
|
|
66fcebdc9e | ||
|
|
af9ce990f0 | ||
|
|
e3d623f190 | ||
|
|
15be441ad8 | ||
|
|
c7c84e7420 | ||
|
|
37489a855f | ||
|
|
f03130a36e | ||
|
|
a1d18227e5 | ||
|
|
1549605c55 | ||
|
|
14a3f4cd54 | ||
|
|
9448659fc6 | ||
|
|
4002714825 | ||
|
|
61ea058d9f | ||
|
|
0fdb77d643 | ||
|
|
0c90cb7b83 | ||
|
|
ede2ac0ea2 | ||
|
|
d006efebc0 | ||
|
|
f2f45339dc | ||
|
|
be5c815f63 | ||
|
|
31e106ced2 | ||
|
|
250ba99498 | ||
|
|
c2c3a46e3e | ||
|
|
3eee678ab1 | ||
|
|
62ed553054 | ||
|
|
e3049e98d8 | ||
|
|
86f9168797 | ||
|
|
f7690db37d | ||
|
|
7e0b0763fc | ||
|
|
c67c4e7095 | ||
|
|
64a05e540e | ||
|
|
beb0a345ac | ||
|
|
f60cb60fc6 | ||
|
|
4002fbe1f5 | ||
|
|
7ff4b4f2b5 | ||
|
|
945feafe25 | ||
|
|
5389ac0ddf | ||
|
|
5d4a1e245b | ||
|
|
3c199daa95 | ||
|
|
4dd33ac575 | ||
|
|
bb3bbfe56d | ||
|
|
f09de577f5 | ||
|
|
c2ce4e55f0 | ||
|
|
5e3796349a | ||
|
|
56a161e09a | ||
|
|
2786ecaeef | ||
|
|
1486a11839 | ||
|
|
c4c15288d2 | ||
|
|
aaed838872 | ||
|
|
43fba2627a | ||
|
|
7df26a5415 | ||
|
|
f3611c2773 | ||
|
|
d5de849552 | ||
|
|
6569a23890 | ||
|
|
2cf0f80e9f | ||
|
|
223c0b980b | ||
|
|
7ab1139f07 | ||
|
|
d055226949 | ||
|
|
cf910f3097 | ||
|
|
183c9ce1cf | ||
|
|
777168cb77 | ||
|
|
0dd6c329e3 | ||
|
|
7a642c8bf1 | ||
|
|
e47c939822 | ||
|
|
a0bbe25eef | ||
|
|
b96f11f7ec | ||
|
|
7e07da977c | ||
|
|
ddb1fb7535 | ||
|
|
ea2754e028 | ||
|
|
ceda7e98f8 | ||
|
|
2d0aca3b92 | ||
|
|
4e9d3c26ed | ||
|
|
f3bd0c3fc3 | ||
|
|
eb438719f7 | ||
|
|
44e2832b2a | ||
|
|
9539d32298 | ||
|
|
60c0994677 | ||
|
|
e7f81d59b0 | ||
|
|
f1320d6733 | ||
|
|
68f7d5b8d3 | ||
|
|
e8baa332d7 | ||
|
|
39704bec3c | ||
|
|
fad14bca01 | ||
|
|
9e8eec4816 | ||
|
|
fa2ea23c96 | ||
|
|
1a255e0e28 | ||
|
|
1d92cf1dab | ||
|
|
8d1e46bdcc | ||
|
|
b0b2824b58 | ||
|
|
0cb6f3053f | ||
|
|
95c2b205a4 | ||
|
|
6ede4ce79d | ||
|
|
10f2fa9c72 | ||
|
|
8b5102ca83 | ||
|
|
1048043963 | ||
|
|
2c4fcf2ea8 | ||
|
|
681162510a | ||
|
|
5c59ee9488 | ||
|
|
9075195ec4 | ||
|
|
62960f8a42 | ||
|
|
6293fe98a0 | ||
|
|
5c716247aa | ||
|
|
daf688eba6 | ||
|
|
c6712a0c6c | ||
|
|
4d74b52656 | ||
|
|
be2fcbcbf1 | ||
|
|
6247b6d468 | ||
|
|
966cb698e6 | ||
|
|
4b44638f4d | ||
|
|
13afff5752 | ||
|
|
e73fe837a8 | ||
|
|
a9caeb1064 | ||
|
|
171eef68c3 | ||
|
|
33368ebd02 | ||
|
|
501f9f8309 | ||
|
|
9fe787fc1f | ||
|
|
0dec3e5e6a | ||
|
|
66f5baa16e | ||
|
|
1cb921b7f3 | ||
|
|
0cf6721898 | ||
|
|
97c8bc9757 | ||
|
|
2cad095425 | ||
|
|
37d509f04f | ||
|
|
35eb9fc6ad | ||
|
|
df09088a96 | ||
|
|
1a14966577 | ||
|
|
0606b792f0 | ||
|
|
a53525e930 | ||
|
|
3a9c03bef3 | ||
|
|
f0dbdcff9d | ||
|
|
9d03dd7fb8 | ||
|
|
781b82baf5 | ||
|
|
2838362a7b | ||
|
|
0b66efac9c | ||
|
|
47a9660ec1 | ||
|
|
aabf62e7d2 | ||
|
|
6d891d2a3b | ||
|
|
c0e8bed5bf | ||
|
|
0dce2ff8a0 | ||
|
|
2642638fca | ||
|
|
8b0fc9819f | ||
|
|
bf5f91244b | ||
|
|
e8e84cf1da | ||
|
|
0179dbe1c2 | ||
|
|
8978b87728 | ||
|
|
0684128209 | ||
|
|
9b5c00a664 | ||
|
|
b347a7a96e | ||
|
|
240bfaa69e | ||
|
|
7dc48e57a6 | ||
|
|
8570883412 | ||
|
|
1d5627b181 | ||
|
|
038fff6c9f | ||
|
|
21dd9a8021 | ||
|
|
59934c1176 | ||
|
|
2f6ff57d96 | ||
|
|
77eba8727d | ||
|
|
47c392e135 | ||
|
|
9cff716925 | ||
|
|
4c207a004c | ||
|
|
650543a042 | ||
|
|
5f0cae8037 | ||
|
|
95c2ab77e7 | ||
|
|
d7f33b7e4e | ||
|
|
56e6441ceb | ||
|
|
b74b5e0602 | ||
|
|
b4dcbbfabd | ||
|
|
6dd0277c22 | ||
|
|
fb08218a04 | ||
|
|
08d95bff5e | ||
|
|
b476530755 | ||
|
|
a8ea1e9ef4 | ||
|
|
6dade671ad | ||
|
|
38b88b5892 | ||
|
|
340e3b952f | ||
|
|
35c91f6ea9 | ||
|
|
f5f9354093 | ||
|
|
600460ffc6 | ||
|
|
18b3833f90 | ||
|
|
f671d0513c | ||
|
|
100f6b7703 | ||
|
|
4e75c70874 | ||
|
|
bdbfe1f8a9 | ||
|
|
bea9d2cafd | ||
|
|
d709cb2ae3 | ||
|
|
444bb03fab | ||
|
|
966cc10fcc | ||
|
|
0c7087c41f | ||
|
|
c42a06bc1f | ||
|
|
b4c00a8fb0 | ||
|
|
f3403d4c5b | ||
|
|
5cf78472e1 | ||
|
|
2aaff16a87 | ||
|
|
6236198d43 | ||
|
|
83fb285d40 | ||
|
|
3050f10676 | ||
|
|
175fc5096d | ||
|
|
18f238dd53 | ||
|
|
4f551259dd | ||
|
|
9cb68c6e32 | ||
|
|
a9a89c604a | ||
|
|
e96a9190a3 | ||
|
|
1ff4e9008b | ||
|
|
2d716517a8 | ||
|
|
22226a8aec | ||
|
|
9b8e56c97c | ||
|
|
ad1bfc5468 | ||
|
|
2c0c05e96d | ||
|
|
d6d63147b6 | ||
|
|
98f7771d74 | ||
|
|
37eba37019 | ||
|
|
40b2f2553b | ||
|
|
d3e35d49ae | ||
|
|
a0474685c1 | ||
|
|
0b317b72ae | ||
|
|
afe06d1563 | ||
|
|
c40365e9b6 | ||
|
|
4b6d3a2bfd | ||
|
|
7ae624e700 | ||
|
|
c32cf33a16 | ||
|
|
7eb59de7df | ||
|
|
5931cf77f4 | ||
|
|
989aace192 | ||
|
|
65cf30e441 | ||
|
|
d4480c979d | ||
|
|
169e94d68b | ||
|
|
0cc8184057 | ||
|
|
a7c75142fa | ||
|
|
02d3c452e4 | ||
|
|
1c148575ea | ||
|
|
d1a1865650 | ||
|
|
067544abc5 | ||
|
|
77da57057f | ||
|
|
aa1da57c37 | ||
|
|
c2ce2aa4de | ||
|
|
90c9fd55fc | ||
|
|
47e403640b | ||
|
|
4ea513cc38 | ||
|
|
3ca0b9bb47 | ||
|
|
e592da5a59 | ||
|
|
2c93f889fd | ||
|
|
6173ce6463 | ||
|
|
065a51d2e1 | ||
|
|
7edcc22136 | ||
|
|
352177090f | ||
|
|
9d18c0b156 | ||
|
|
ec65a9a364 | ||
|
|
5c4b6a8ef0 | ||
|
|
5d502eb90c | ||
|
|
d6662d8442 | ||
|
|
1d97f13462 | ||
|
|
2c16681225 | ||
|
|
065047dc62 | ||
|
|
eba8d6d5f5 | ||
|
|
744dceaffe | ||
|
|
8740d147c9 | ||
|
|
16ae283fb4 | ||
|
|
312600fe9c | ||
|
|
3e0c067e43 | ||
|
|
f90551ff41 | ||
|
|
9442fc0b52 | ||
|
|
dbb93a2718 | ||
|
|
242cf423f8 | ||
|
|
217faf778b | ||
|
|
01b74950b7 | ||
|
|
420bfbcf40 | ||
|
|
89f6567fda | ||
|
|
efec05d581 | ||
|
|
47198dce5d | ||
|
|
f45500c612 | ||
|
|
6f3e817372 | ||
|
|
cfda5df020 | ||
|
|
2b4f41603d | ||
|
|
448f448d14 | ||
|
|
ee6a618116 | ||
|
|
e08f81c891 | ||
|
|
9324f1c29f | ||
|
|
d71c1514f2 | ||
|
|
2df75e84e7 | ||
|
|
9ab89734de | ||
|
|
960c0319c4 | ||
|
|
439891cb9f | ||
|
|
bdfb3ef11c | ||
|
|
8d581f7fe4 | ||
|
|
262907d0a3 | ||
|
|
15be673054 | ||
|
|
16a5649670 | ||
|
|
6582895b51 | ||
|
|
e3d65389d7 | ||
|
|
027cb376f3 | ||
|
|
f1261bcdd7 | ||
|
|
2e7b36d04f | ||
|
|
ce1a58414a | ||
|
|
1012c5705a | ||
|
|
1c2947581b | ||
|
|
00883822be | ||
|
|
13fdb9d8a5 | ||
|
|
52b2bc4109 | ||
|
|
b59b3a5152 | ||
|
|
fe6c03370e | ||
|
|
e3f128875c | ||
|
|
7bf82a814b | ||
|
|
e1270928a3 | ||
|
|
6fce5b54a8 | ||
|
|
3c38eafd75 | ||
|
|
9dcc1b3370 | ||
|
|
e3c37aac28 | ||
|
|
61a967095d | ||
|
|
c0e004ec1c | ||
|
|
0a1b7296b9 | ||
|
|
cd5e6743f7 | ||
|
|
2091fe530f | ||
|
|
cda8d63d43 | ||
|
|
bef1b140e9 | ||
|
|
c9188e2260 | ||
|
|
15eaf27bc7 | ||
|
|
bf2277e263 | ||
|
|
348ffbc47e | ||
|
|
f13cbcf175 | ||
|
|
9418c56fd3 | ||
|
|
7dbd502931 | ||
|
|
0bf9c1e881 | ||
|
|
bf07d37737 | ||
|
|
eecb713616 | ||
|
|
bf085e2c4b | ||
|
|
ce1a97d6c8 | ||
|
|
34c9ec4e1a | ||
|
|
e73fb6808a | ||
|
|
1c93d9dcfe | ||
|
|
675d6ec5e6 | ||
|
|
1ad43c54c0 | ||
|
|
1cf6c15ab4 | ||
|
|
8fc17ed764 | ||
|
|
26028068e8 | ||
|
|
8519682564 | ||
|
|
5ca0c73e98 | ||
|
|
4c979aa44f | ||
|
|
274dc3ecac | ||
|
|
5e2b5edde5 | ||
|
|
b8b6521659 | ||
|
|
e37b1b0623 | ||
|
|
4a79462c3e | ||
|
|
c328cc9608 | ||
|
|
cf2d39220a | ||
|
|
7dbd649f60 | ||
|
|
4282199bb4 | ||
|
|
7071dd0162 | ||
|
|
e61a687eda | ||
|
|
7e85d2fbd4 | ||
|
|
969ab28261 | ||
|
|
90d36cc630 | ||
|
|
1bb68cbcfa | ||
|
|
de7a14003c | ||
|
|
e3ead9f585 | ||
|
|
a461b0ae44 | ||
|
|
1b28f9fa89 | ||
|
|
dff8076022 | ||
|
|
dd3c187484 | ||
|
|
4677778f85 | ||
|
|
f96204dbe0 | ||
|
|
0427b783e2 | ||
|
|
4650732f4a | ||
|
|
1e138c1401 | ||
|
|
89fb7c85bf | ||
|
|
0e51fc90e3 | ||
|
|
1b6c683ca6 | ||
|
|
501e72c3de | ||
|
|
a450efb483 | ||
|
|
0cf8d4f8e8 | ||
|
|
084447e414 | ||
|
|
4c9c9f0b89 | ||
|
|
13db2916de | ||
|
|
2d64cd55a1 | ||
|
|
60a6af7498 | ||
|
|
3cb06eb2b2 | ||
|
|
b8e73495a5 | ||
|
|
187cfc1594 | ||
|
|
90cd2a4753 | ||
|
|
f3e6a582d4 | ||
|
|
3ae470eedf | ||
|
|
6595592a71 | ||
|
|
199389c94a | ||
|
|
c31438b2f2 | ||
|
|
843f73ecaa | ||
|
|
86f043a66c | ||
|
|
80d2df7789 | ||
|
|
f882a63cba | ||
|
|
611b3584d6 | ||
|
|
a1f13dd31b | ||
|
|
966e7d0e36 | ||
|
|
44103abdb7 | ||
|
|
8f9d4b2b50 | ||
|
|
78c674a685 | ||
|
|
197830a57d | ||
|
|
3d024d5fce | ||
|
|
5763743614 | ||
|
|
54da964a99 | ||
|
|
e25cff9328 | ||
|
|
36b397be9f | ||
|
|
468019e947 | ||
|
|
7e941baa26 | ||
|
|
63270b0665 | ||
|
|
bcdbba05d3 | ||
|
|
51d1f309cd | ||
|
|
f04720afb8 | ||
|
|
e6e6c6e635 | ||
|
|
1f340a262f | ||
|
|
242a17b9e0 | ||
|
|
6e1632c606 | ||
|
|
56dab605f1 | ||
|
|
3aa3d7e629 | ||
|
|
75585f771a | ||
|
|
9a9f35039e | ||
|
|
e6f84b8cc8 | ||
|
|
72f15da2ed | ||
|
|
effbd99384 | ||
|
|
d1ba4324de | ||
|
|
c0b5d378dc | ||
|
|
b8c438f22d | ||
|
|
a85271ce0a | ||
|
|
fd5e69f769 | ||
|
|
ddb0b8d8b8 | ||
|
|
1345226bc9 | ||
|
|
fb202e9de7 | ||
|
|
5dcb5fa862 | ||
|
|
f77f2709a9 | ||
|
|
bc852bca48 | ||
|
|
9314e9e853 | ||
|
|
838ddf8f55 | ||
|
|
619869c639 | ||
|
|
31baaf72b4 | ||
|
|
c92b996942 | ||
|
|
e84c7db049 | ||
|
|
9ef7b6afe2 | ||
|
|
c5c03ac556 | ||
|
|
6ca321ca75 | ||
|
|
9c788a529b | ||
|
|
6159c356c9 | ||
|
|
ac9d92587e | ||
|
|
f32dc6b828 | ||
|
|
7a928b40f3 | ||
|
|
172501e10c | ||
|
|
317e030de0 | ||
|
|
cfda3e6a48 | ||
|
|
4d522b8f31 | ||
|
|
e93c81196f | ||
|
|
7bdd14a994 | ||
|
|
afe06b48d6 | ||
|
|
63c5ed3798 | ||
|
|
77bb536542 | ||
|
|
7c6e0d5981 | ||
|
|
a1708730c3 | ||
|
|
d33ca87e4c | ||
|
|
3c509c5f68 | ||
|
|
a840cc700a | ||
|
|
b40b989523 | ||
|
|
5eba93c4e7 | ||
|
|
915dfb494e | ||
|
|
a16cca7680 | ||
|
|
644482fc99 | ||
|
|
8c08ecfcbf | ||
|
|
b9920bdd0e | ||
|
|
bdf71e2685 | ||
|
|
bd4fd9c28c | ||
|
|
ff3e574187 | ||
|
|
4422f80ae7 | ||
|
|
cc8c2efff2 | ||
|
|
cdaca293d9 | ||
|
|
4dbc7850bd | ||
|
|
8119379d4f | ||
|
|
9b4253fe67 | ||
|
|
b5c599c80c | ||
|
|
9137e717b0 | ||
|
|
80186aa7f4 | ||
|
|
6ac739630f | ||
|
|
80a61616b1 | ||
|
|
589d2ee7b5 | ||
|
|
0a294db912 | ||
|
|
2788aa366c | ||
|
|
0f29fdaf17 | ||
|
|
2912d993c2 | ||
|
|
62ceb118ee | ||
|
|
0569c9c1be | ||
|
|
5a91746b80 | ||
|
|
fdc091a857 | ||
|
|
8469db016d | ||
|
|
f6312b16f1 | ||
|
|
c76e538231 | ||
|
|
96ea49870c | ||
|
|
6e8c73fd38 | ||
|
|
56981a2aaf | ||
|
|
ec16121fb3 | ||
|
|
7bd9988c8e | ||
|
|
068312ecb8 | ||
|
|
d36a86a12c | ||
|
|
c174b13f8b | ||
|
|
6b95c4e358 | ||
|
|
22e2ecb003 | ||
|
|
e08296f70c | ||
|
|
dd50e5bdf2 | ||
|
|
504ecd5f7a | ||
|
|
7d1bb21c19 | ||
|
|
63dc2a843f | ||
|
|
296baeb096 | ||
|
|
01dabb774a | ||
|
|
d0fe4071a9 | ||
|
|
3d491c470b | ||
|
|
06462e8a92 | ||
|
|
dbf371344b | ||
|
|
e2c6e00570 | ||
|
|
e4a0001fc6 | ||
|
|
49400b0c7f | ||
|
|
5957498c6f | ||
|
|
b6282b99cb | ||
|
|
a8483841b5 | ||
|
|
d068001102 | ||
|
|
d576be58dc | ||
|
|
1a2b88964f | ||
|
|
f7a188a642 | ||
|
|
befbf2a206 | ||
|
|
e01b7c1ede | ||
|
|
dd8d472318 | ||
|
|
256489639c | ||
|
|
e323abe5d9 | ||
|
|
afc00b08d7 | ||
|
|
af41fb79b5 | ||
|
|
535b7c5e0f | ||
|
|
217f7a7ea7 | ||
|
|
317d351423 | ||
|
|
d27519c0ca | ||
|
|
255dc45dc9 | ||
|
|
f4d8728df9 | ||
|
|
8611631f5e | ||
|
|
1e5ed4fa33 | ||
|
|
0daeab3b8d | ||
|
|
bd27401311 | ||
|
|
14df44dd3f | ||
|
|
1272621ebc | ||
|
|
0e83482e47 | ||
|
|
c0d929bed9 | ||
|
|
828a26286d | ||
|
|
082b0d822c | ||
|
|
651b4b9efa | ||
|
|
ab1e54375f | ||
|
|
70e2db51e1 | ||
|
|
0145919a9e | ||
|
|
2236a247d9 | ||
|
|
7291f50e8d | ||
|
|
bc5677a47b | ||
|
|
137ef36757 | ||
|
|
33a3753c3f | ||
|
|
9770899a4b | ||
|
|
fe8eeb5641 | ||
|
|
8cd1f1f7f9 | ||
|
|
b84876ba69 | ||
|
|
0f1ca2939a | ||
|
|
4882078469 | ||
|
|
991b120eee | ||
|
|
f278d177f9 | ||
|
|
53b2ff4b04 | ||
|
|
0c89d71aee | ||
|
|
b746bf7814 | ||
|
|
f11969015a | ||
|
|
f1b820e5fc | ||
|
|
7356ff0b18 | ||
|
|
30f7a2ff20 | ||
|
|
f6b55fae79 | ||
|
|
8aa88f4d36 | ||
|
|
ce7b565595 | ||
|
|
41fd08bb0d | ||
|
|
d0a930cd44 | ||
|
|
9bb1854398 | ||
|
|
f7400212fc | ||
|
|
6434b42481 | ||
|
|
dd0b38b32f | ||
|
|
7816db8e8a | ||
|
|
9cc6ab3922 | ||
|
|
2c27e24bb4 | ||
|
|
c382c550e7 | ||
|
|
c663494c69 | ||
|
|
97f27ea585 | ||
|
|
379bfa5a36 | ||
|
|
235c0077b8 | ||
|
|
c621546bd6 | ||
|
|
aa330b8240 | ||
|
|
e43606eb4d | ||
|
|
6a378a28b4 | ||
|
|
95368d9cb4 | ||
|
|
74f9c570ea | ||
|
|
eed4a13b3b | ||
|
|
7e9f7659b3 | ||
|
|
4d396169c8 | ||
|
|
4cd950900b | ||
|
|
2b96c3f5ce | ||
|
|
63fad159e8 | ||
|
|
e5f1480a38 | ||
|
|
020955ebc2 | ||
|
|
3733fa02ee | ||
|
|
7037e4a4b1 | ||
|
|
0e98f938c4 | ||
|
|
55d0c29f4a | ||
|
|
59997ecad5 | ||
|
|
6e2f0833ad | ||
|
|
25f626cc52 | ||
|
|
ece891d6db | ||
|
|
702355da47 | ||
|
|
c4fba310d2 | ||
|
|
e9dd099870 | ||
|
|
070d89a561 | ||
|
|
28cc9dd331 | ||
|
|
7c1fecc94a | ||
|
|
7a9fab52be | ||
|
|
8cb8371011 | ||
|
|
875c55d86b | ||
|
|
b85154f13f | ||
|
|
06047d9103 | ||
|
|
2362637e90 | ||
|
|
edd02607e2 | ||
|
|
0211e420ed | ||
|
|
9a184e0bb1 | ||
|
|
168fb3a8d8 | ||
|
|
4c5307b456 | ||
|
|
626f9bd8c2 | ||
|
|
a06b36dee0 | ||
|
|
18e1bee8d5 | ||
|
|
41f76801eb | ||
|
|
31a7bfc47f | ||
|
|
1b6d18fcb0 | ||
|
|
57c32b709d | ||
|
|
5f19822e37 | ||
|
|
9a0c9cd6e1 | ||
|
|
0ac8e1d80b | ||
|
|
744e55ec74 | ||
|
|
74ba4d7950 | ||
|
|
fa96436661 | ||
|
|
d15b8273d6 | ||
|
|
0a5cf3a928 | ||
|
|
6173e38fdc | ||
|
|
34cd99d1d9 | ||
|
|
0922a0fc3f | ||
|
|
dd53b356ff | ||
|
|
f1db505778 | ||
|
|
662727ca3e | ||
|
|
bdec6f2b20 | ||
|
|
c86c294f55 | ||
|
|
a9a03b9708 | ||
|
|
f4e8c406bb | ||
|
|
12bfcb501c | ||
|
|
0fc1782dd4 | ||
|
|
9274d31690 | ||
|
|
983a539503 | ||
|
|
94bb7fe5cb | ||
|
|
b98e0aa09b | ||
|
|
49c6d7e32d | ||
|
|
ee73fc361b | ||
|
|
e84dbd28db | ||
|
|
02449d9aa5 | ||
|
|
2876329f16 | ||
|
|
a1f455551f | ||
|
|
042cc1f69e | ||
|
|
90b804d3fa | ||
|
|
4bc603a0cc | ||
|
|
6c3f74b946 | ||
|
|
8d78a33e60 | ||
|
|
df07537ccf | ||
|
|
de25ed3f37 | ||
|
|
40edf25866 | ||
|
|
7b7db23633 | ||
|
|
794b4da840 | ||
|
|
e9ea3ba4a2 | ||
|
|
d207ea1652 | ||
|
|
625d06ac79 | ||
|
|
3460225590 | ||
|
|
ea6531cf32 | ||
|
|
2afb88e2ce | ||
|
|
6c9f37d263 | ||
|
|
735955282b | ||
|
|
dd056e54e2 | ||
|
|
f5548973ab | ||
|
|
07dc741e18 | ||
|
|
8b66981ce0 | ||
|
|
3a7e8c9f5f | ||
|
|
fb90b43432 | ||
|
|
0302c21253 | ||
|
|
9182a46233 | ||
|
|
51b46f451f | ||
|
|
11f3690201 | ||
|
|
5784a37f91 | ||
|
|
af91ff0e06 | ||
|
|
be3a78f583 | ||
|
|
7f22da5230 | ||
|
|
5af0629ba5 | ||
|
|
a776e5ad31 | ||
|
|
6e422c447a | ||
|
|
4608d0157e | ||
|
|
a24fe59ee4 | ||
|
|
4ad296c60b | ||
|
|
0517fa153c | ||
|
|
8f81fd6be5 | ||
|
|
1472be4d3e | ||
|
|
8925527fef | ||
|
|
8cdc220bc0 | ||
|
|
d315d41a12 | ||
|
|
4f7687895d | ||
|
|
07d46886df | ||
|
|
b79c8f527f | ||
|
|
0cf10ae4d7 | ||
|
|
debe0b561d | ||
|
|
9ddc7ad038 | ||
|
|
9a4c887c4a | ||
|
|
de41c6ef43 | ||
|
|
002cf105c6 | ||
|
|
fb8fdf9273 | ||
|
|
517b8ed057 | ||
|
|
d3d7ed1766 | ||
|
|
77fd094090 | ||
|
|
c65f9acdc7 | ||
|
|
5c4cdcb2d5 | ||
|
|
b1233c7e4d | ||
|
|
4ebe4b907b | ||
|
|
bf44d0f640 | ||
|
|
73cf99c052 | ||
|
|
44c02227e9 | ||
|
|
77da9a0087 | ||
|
|
42d2353e74 | ||
|
|
4b441ebac5 | ||
|
|
01140217f5 | ||
|
|
71f3877f3a | ||
|
|
83d135f990 | ||
|
|
d4ac3d53fc | ||
|
|
f0332c0b58 | ||
|
|
bdd4294e79 | ||
|
|
dcf92bffd2 | ||
|
|
a2256e899b | ||
|
|
8b6805572a | ||
|
|
607253c2d0 | ||
|
|
09f4a1c5e5 | ||
|
|
5c9fff9c6e | ||
|
|
99b4912688 | ||
|
|
0a6312d66f | ||
|
|
a97f52db20 | ||
|
|
5267be57f7 | ||
|
|
e813bf31d7 | ||
|
|
1bd0be0361 | ||
|
|
996c8ca7c2 | ||
|
|
fec65fbff6 | ||
|
|
de4610a55f | ||
|
|
6e34c2d59a | ||
|
|
34b09398d5 | ||
|
|
0516ce7786 | ||
|
|
bb86462ed7 | ||
|
|
8fa8df95fb | ||
|
|
82ca52713b | ||
|
|
f29e383575 | ||
|
|
5aeef9c1c8 | ||
|
|
ddd3fe5948 | ||
|
|
5591550167 | ||
|
|
6bb9ef8de4 | ||
|
|
14a6788535 | ||
|
|
6f86826516 | ||
|
|
0e6ed13454 | ||
|
|
b914f45e9e | ||
|
|
3ed66094e8 | ||
|
|
718004d9b5 | ||
|
|
1dc54324f4 | ||
|
|
89ecf4ac01 | ||
|
|
d42eac4287 | ||
|
|
3fa6c51bb1 | ||
|
|
37c5250e03 | ||
|
|
0d3bb93ce8 | ||
|
|
5e74c58b73 | ||
|
|
7ac16811cc | ||
|
|
29b6a732f3 | ||
|
|
3dcd6bc597 | ||
|
|
1342f5d592 | ||
|
|
8fbfd5916d | ||
|
|
1225d36188 | ||
|
|
a19e02be5e | ||
|
|
0761e60a4a | ||
|
|
af96c8304f | ||
|
|
0de0e95020 | ||
|
|
35d8fb0501 | ||
|
|
87c71953be | ||
|
|
79a91b8168 | ||
|
|
2f9038bf62 | ||
|
|
4d50ca4e21 | ||
|
|
a1077d0970 | ||
|
|
b9fdc0c251 | ||
|
|
f471b4836f | ||
|
|
32b75d1b69 | ||
|
|
f7e3bd28b4 | ||
|
|
452e52f958 | ||
|
|
0090099565 | ||
|
|
2ed23cb50d | ||
|
|
a97ab4f933 | ||
|
|
bc93011554 | ||
|
|
14b6cc4e22 | ||
|
|
80ffd3581f | ||
|
|
dd058b8de6 | ||
|
|
3c2ad4022c | ||
|
|
1f4b8da60a | ||
|
|
9af4cf219e | ||
|
|
cf4b88fcc4 | ||
|
|
2215a9a181 | ||
|
|
aa32f61ce7 | ||
|
|
8266727062 | ||
|
|
d839230402 | ||
|
|
1cc50d31f9 | ||
|
|
104377d718 | ||
|
|
83640b2ee5 | ||
|
|
9aea3e265d | ||
|
|
59227bf075 | ||
|
|
f61cfc5931 | ||
|
|
27b8a5fd84 | ||
|
|
60ff74140e | ||
|
|
4f0a7170af | ||
|
|
6d2ff9d2a7 | ||
|
|
122b0bfe82 | ||
|
|
3eae7695fc | ||
|
|
6efde61227 | ||
|
|
1c48124db4 | ||
|
|
e9895ea2e7 | ||
|
|
eab8c0d754 | ||
|
|
7ffe62d901 | ||
|
|
d5bfec70af | ||
|
|
2a86817349 | ||
|
|
5be7d88b34 | ||
|
|
8a335ee7fd | ||
|
|
216ad2680b | ||
|
|
e16509d5cf | ||
|
|
19c9b7c803 | ||
|
|
ffd08df863 | ||
|
|
460459e8db | ||
|
|
07416b61e3 | ||
|
|
000a13e21a | ||
|
|
03ca98b0df | ||
|
|
abb74a1203 | ||
|
|
77c1d556bb | ||
|
|
bd55ab05bd | ||
|
|
2025193b7a | ||
|
|
418683f537 | ||
|
|
008b848dcc | ||
|
|
79b7575fd8 | ||
|
|
792279581b | ||
|
|
3ca360391a | ||
|
|
5f0a3797c9 | ||
|
|
2d2c53d20e | ||
|
|
02ca14fd0e | ||
|
|
0f5895faee | ||
|
|
c0dfe6e51d | ||
|
|
1b4af1f8d8 | ||
|
|
8e255534a1 | ||
|
|
4607dfe257 | ||
|
|
6e376532b0 | ||
|
|
4ed64fd5ee | ||
|
|
21700ae515 | ||
|
|
b962ef3154 | ||
|
|
32f78136b2 | ||
|
|
01d6133bd7 | ||
|
|
4b62cd3616 | ||
|
|
df7b1d8e64 | ||
|
|
2449e1f5a5 | ||
|
|
66c0e4ad5f | ||
|
|
18371aaff9 | ||
|
|
f36eab2608 | ||
|
|
66d38261f7 | ||
|
|
553b4cfd0b | ||
|
|
edd63a7920 | ||
|
|
5ce03efc3e | ||
|
|
4645e8b6b1 | ||
|
|
42365aa7ef | ||
|
|
dff4ce92ad | ||
|
|
e5b0533dab | ||
|
|
a2a315a6e8 | ||
|
|
7abdc4b218 | ||
|
|
479ddb1fee | ||
|
|
4ee27b4594 | ||
|
|
58ebde9502 | ||
|
|
04ee89493e | ||
|
|
dd3594c6b3 | ||
|
|
f7ea431516 | ||
|
|
16a153468d | ||
|
|
b062212e55 | ||
|
|
39eb96e9ff | ||
|
|
4c84f6b423 | ||
|
|
0b2ae71f8b | ||
|
|
39d0b57ebf | ||
|
|
c036f6ae2d | ||
|
|
e35e2ea6ec | ||
|
|
f33f8eee26 | ||
|
|
31a3f064c0 | ||
|
|
232518a219 | ||
|
|
bc165078a2 | ||
|
|
e4dabef0c7 | ||
|
|
00142d8443 | ||
|
|
1b0b7fa0e1 | ||
|
|
67fb731ec4 | ||
|
|
a30a6f2f20 | ||
|
|
baeebb2b57 | ||
|
|
ecc6f550eb | ||
|
|
640974fb28 | ||
|
|
3b0c5ae467 | ||
|
|
0fa14c8662 | ||
|
|
d17be0df52 | ||
|
|
53a8a6e5a6 | ||
|
|
dd2fc45c27 | ||
|
|
ba9f8c674c | ||
|
|
c4f4fa4089 | ||
|
|
32634b0771 | ||
|
|
c97b66287c | ||
|
|
cd6fc8a8ef | ||
|
|
3308781376 | ||
|
|
40e8b4e527 | ||
|
|
4741e64c89 | ||
|
|
0b489c7e61 | ||
|
|
22d4db1cf2 | ||
|
|
7383225271 | ||
|
|
4b3ae5e157 | ||
|
|
797bc8504c | ||
|
|
305f4d92ef | ||
|
|
c36f0e71b6 | ||
|
|
a028c69f48 | ||
|
|
4e4b6de5ce | ||
|
|
9aac2328c6 | ||
|
|
e5084c1eca | ||
|
|
9b12f09600 | ||
|
|
a71762e405 | ||
|
|
b8f3e5675a | ||
|
|
820011dedc | ||
|
|
cdd6054e08 | ||
|
|
a15b6a6f86 | ||
|
|
20d3e2b967 | ||
|
|
608fdce0a0 | ||
|
|
ecd3251542 | ||
|
|
999c7126b3 | ||
|
|
3c50ea961f | ||
|
|
acc29ff1d9 | ||
|
|
886bba55ac | ||
|
|
cd440215a5 | ||
|
|
73060b4523 | ||
|
|
c76d939563 | ||
|
|
3c4b69f95d | ||
|
|
3f01d9a043 | ||
|
|
dbc6fe3e84 | ||
|
|
da6c15163b | ||
|
|
9818bf7026 | ||
|
|
73c7acb159 | ||
|
|
ea8fbb5233 | ||
|
|
9b033e1b8a | ||
|
|
a65ce7b107 | ||
|
|
2249c12a3c | ||
|
|
b4ac9cd02c | ||
|
|
3517eba632 | ||
|
|
2cd44abafc | ||
|
|
4b486ebbc1 | ||
|
|
f9f211d2c6 | ||
|
|
77b30f69e4 | ||
|
|
17d2a464ad | ||
|
|
ae6530ee82 | ||
|
|
a6ba9e5ccd | ||
|
|
c4cdab969b | ||
|
|
c331c73ec6 | ||
|
|
d1f063c62d | ||
|
|
b686dc4911 | ||
|
|
78936b2f2a | ||
|
|
b2ed1e2607 | ||
|
|
fb8870297d | ||
|
|
4cbc0f6c2e | ||
|
|
1b9eff64fa | ||
|
|
d07d1a6ef8 | ||
|
|
8bdd60fa71 | ||
|
|
b872086c74 | ||
|
|
e0af4a15d0 | ||
|
|
d31802ed98 | ||
|
|
87c4136bd4 | ||
|
|
09e027bc9d | ||
|
|
707828b71a | ||
|
|
8f44037133 | ||
|
|
9717ccb786 | ||
|
|
6354cbf9d6 | ||
|
|
95a849efc2 | ||
|
|
fe083a94b9 | ||
|
|
6fdcdfa5ea | ||
|
|
4a4885eead | ||
|
|
a0ef686c54 | ||
|
|
2903a5c050 | ||
|
|
4d50b9f1f1 | ||
|
|
5e3c2af236 | ||
|
|
5d791838d2 | ||
|
|
b80c5cff49 | ||
|
|
47b5740bdf | ||
|
|
b8092857d9 | ||
|
|
3cda1a23ce | ||
|
|
215677c10b | ||
|
|
3688cd3fea | ||
|
|
5ca2a8318d | ||
|
|
e27ec862c3 | ||
|
|
d0b8b5a199 | ||
|
|
efe2ce3647 | ||
|
|
71f00188fb | ||
|
|
a1c9cb8860 | ||
|
|
74e9718370 | ||
|
|
2d71c9cdfd | ||
|
|
484d549ece | ||
|
|
d098ab436d | ||
|
|
85ffd33f08 | ||
|
|
c1b8e93083 | ||
|
|
383d4656aa | ||
|
|
3e3d10824f | ||
|
|
128418b214 | ||
|
|
050a39a7a5 | ||
|
|
5f085789b9 | ||
|
|
6a8832d83b | ||
|
|
fcb498b0d5 | ||
|
|
0433252e50 | ||
|
|
5ce6f37e26 | ||
|
|
02fc7bb5f6 | ||
|
|
9e1294e866 | ||
|
|
c2c800d863 | ||
|
|
625c107c25 | ||
|
|
33319f5d2d | ||
|
|
ad3c1c37bb | ||
|
|
005bf19acf | ||
|
|
91c77808c4 | ||
|
|
0ce97f77e0 | ||
|
|
197ad60d21 | ||
|
|
dc31387c6f | ||
|
|
bd64da3785 | ||
|
|
4fef0d4f14 | ||
|
|
89d6f580dc | ||
|
|
23eb74e085 | ||
|
|
9c86097286 | ||
|
|
f0bb9c7d8d | ||
|
|
d4514f9c10 | ||
|
|
c324033ba4 | ||
|
|
74a16db975 | ||
|
|
a10044e110 | ||
|
|
6cdd067faf | ||
|
|
0989cd358a | ||
|
|
6e0739931d | ||
|
|
b17ca44f0b | ||
|
|
fd6e025d61 | ||
|
|
9230708e47 | ||
|
|
92f3b3895e | ||
|
|
fa8a78ff01 | ||
|
|
310d842b70 | ||
|
|
1498de83d6 | ||
|
|
e29f62f0a7 | ||
|
|
39e5fa6ae8 | ||
|
|
dc289aa4fa | ||
|
|
6db8f53445 | ||
|
|
417bac4055 | ||
|
|
e9c94cdd49 | ||
|
|
d104216bbe | ||
|
|
d086fdaf9f | ||
|
|
8693afdfea | ||
|
|
a876161ef9 | ||
|
|
10035c898b | ||
|
|
71edaf4d01 | ||
|
|
2b77d50776 | ||
|
|
6ea91af2f8 | ||
|
|
b767440399 | ||
|
|
4174ec7116 | ||
|
|
068ba17e21 | ||
|
|
4d10c96aa6 | ||
|
|
b701ea36a7 | ||
|
|
198fa5e3c7 | ||
|
|
507cd13793 | ||
|
|
6c14c96e71 | ||
|
|
976963cd21 | ||
|
|
9391d980c3 | ||
|
|
bab5183820 | ||
|
|
0abaf22467 | ||
|
|
463a8134a1 | ||
|
|
d22b2d181f | ||
|
|
5a9bbf639a | ||
|
|
81e48ada47 | ||
|
|
598bc44f67 | ||
|
|
b93f4f623c | ||
|
|
1054dc5ed1 | ||
|
|
7fc4e8af0a | ||
|
|
4198bb88b6 | ||
|
|
db325d1f43 | ||
|
|
7ff38c14a9 | ||
|
|
3f2de3d101 | ||
|
|
6bd91936ff | ||
|
|
035a2e5479 | ||
|
|
6983ba3225 | ||
|
|
77e028d620 | ||
|
|
0bb91218c5 | ||
|
|
231a51fe7a | ||
|
|
8d0cbaf8df | ||
|
|
b843c27322 | ||
|
|
2688cf343b | ||
|
|
b416b87518 | ||
|
|
3f1b9f095a | ||
|
|
8a6eeb82c5 | ||
|
|
5779283a52 | ||
|
|
80d0dcc9a3 | ||
|
|
d51ad518c4 | ||
|
|
29ba1730ca | ||
|
|
183210619d | ||
|
|
feff911fb7 | ||
|
|
8eee5f3253 | ||
|
|
3e55fef5e1 | ||
|
|
63397e380f | ||
|
|
07c3aaeea1 | ||
|
|
8254bbae56 | ||
|
|
e7886aa9b4 | ||
|
|
fb08868e54 | ||
|
|
c141d99059 | ||
|
|
f66e1c49b0 | ||
|
|
4acbe8f20c | ||
|
|
2ea70a5c73 | ||
|
|
eb612bfdfc | ||
|
|
5e826c78a7 | ||
|
|
a0d906739d | ||
|
|
98b13037e7 | ||
|
|
29f09f71b4 | ||
|
|
a00b6e258d | ||
|
|
7ded272b94 | ||
|
|
1d12b1fa1e | ||
|
|
54582bdce9 | ||
|
|
a9a4300a36 | ||
|
|
f720e0ac0f | ||
|
|
a8245df745 | ||
|
|
86c5d02a5e | ||
|
|
5af597c2fb | ||
|
|
dd9e0164d5 | ||
|
|
9d16b4081e | ||
|
|
545cafce9b | ||
|
|
fb66d51796 | ||
|
|
5175664174 | ||
|
|
a579d67064 | ||
|
|
be760bed7e | ||
|
|
357383159e | ||
|
|
0ea1c28135 | ||
|
|
36e56f36ad | ||
|
|
0a9984c27e | ||
|
|
0ecdcc253b | ||
|
|
1667890172 | ||
|
|
9b3f863cf5 | ||
|
|
2f2ed4e40e | ||
|
|
3d582304b6 | ||
|
|
996d45df0a | ||
|
|
6047635406 | ||
|
|
e16bccbb91 | ||
|
|
9786e7faeb | ||
|
|
fde4b823f1 | ||
|
|
b7e71a249e | ||
|
|
bf8d642607 | ||
|
|
1fab40bb69 | ||
|
|
ad61b58036 | ||
|
|
b7722e7037 | ||
|
|
6c2167b65f | ||
|
|
18be9882f7 | ||
|
|
a102c2c22b | ||
|
|
ae75462254 | ||
|
|
3ad956e73f | ||
|
|
d6114165d3 | ||
|
|
c3a959cc37 | ||
|
|
ca70beec47 | ||
|
|
758939215d | ||
|
|
ab861e56f1 | ||
|
|
8eb64ad600 | ||
|
|
d74d3fe851 | ||
|
|
fefc6a7e6b | ||
|
|
a119114ad7 | ||
|
|
430b1a22db | ||
|
|
a754ea1326 | ||
|
|
2ecf22e37e | ||
|
|
9dcd0756ba | ||
|
|
c455254fd1 | ||
|
|
bb1f6e6818 | ||
|
|
0722e91eb9 | ||
|
|
c859a6f365 | ||
|
|
ef49850789 | ||
|
|
4f6f334f41 | ||
|
|
8cd76d3921 | ||
|
|
885805b5df | ||
|
|
d61f260372 | ||
|
|
d0a48627b2 | ||
|
|
4b8f13e902 | ||
|
|
5b9a57f536 | ||
|
|
ba9963b8fa | ||
|
|
6887106ff7 | ||
|
|
98416a4fab | ||
|
|
fad3288d20 | ||
|
|
5ecff1e4c3 | ||
|
|
bfeae0b5f5 | ||
|
|
1c5336cd57 | ||
|
|
43c2cf4edb | ||
|
|
f6d80d66a2 | ||
|
|
b2ca0babeb | ||
|
|
ed4ae322f5 | ||
|
|
4f924ab07e | ||
|
|
ebadeff0ca | ||
|
|
830018aa38 | ||
|
|
8dfddd279b | ||
|
|
544f2f74df | ||
|
|
450348d6bd | ||
|
|
5928ea9c7a | ||
|
|
4754880099 | ||
|
|
1fea66e527 | ||
|
|
806a3163ba | ||
|
|
08cf6780ba | ||
|
|
6814907a2c | ||
|
|
11a8a25528 | ||
|
|
1b246eecfe | ||
|
|
95456b8e78 | ||
|
|
79fc481a2b | ||
|
|
b9ce871463 | ||
|
|
0bd78e1cd8 | ||
|
|
d27f2d8168 | ||
|
|
407f3f142a | ||
|
|
61cfbecc74 | ||
|
|
feeabd08ab | ||
|
|
31a3432a8e | ||
|
|
27db045095 | ||
|
|
db8c75f08d | ||
|
|
beaada77e6 | ||
|
|
aefab9293a | ||
|
|
a6d9310888 | ||
|
|
bfc09ac211 | ||
|
|
d930280af5 | ||
|
|
445e4a9792 | ||
|
|
aec761916e | ||
|
|
7d750d2b92 | ||
|
|
bdf1724412 | ||
|
|
9cea2dfb8f | ||
|
|
00dec36c72 | ||
|
|
26a651f7ae | ||
|
|
b64f0dace3 | ||
|
|
a7b95cacb6 | ||
|
|
ac0e0351a0 | ||
|
|
2245ac2f88 | ||
|
|
1bfaf76dd0 | ||
|
|
88513d2d1a | ||
|
|
91bc396178 | ||
|
|
d3fdbe48ae | ||
|
|
2c086105b1 | ||
|
|
aed98c5125 | ||
|
|
2d77f7cd48 | ||
|
|
d5affe1ada | ||
|
|
d61688923d | ||
|
|
4aee6822ca | ||
|
|
038542ea3e | ||
|
|
beb14ca6d6 | ||
|
|
4114129ac0 | ||
|
|
6d24719167 | ||
|
|
2393c94363 | ||
|
|
372203f1fa | ||
|
|
691468174b | ||
|
|
6f8d439717 | ||
|
|
f3ab5d5500 | ||
|
|
8f467b4288 | ||
|
|
4adcf7e9ed | ||
|
|
9f8c40ed78 | ||
|
|
cda9d7e579 | ||
|
|
c27d2d4b93 | ||
|
|
003afef541 | ||
|
|
09bbca2f61 | ||
|
|
0a305eb79f | ||
|
|
aff5408633 | ||
|
|
31626d4c6f | ||
|
|
426ec2d399 | ||
|
|
a632f6d5b1 | ||
|
|
83c199bb00 | ||
|
|
2ec6d08613 | ||
|
|
42271ad463 | ||
|
|
57ee847ce7 | ||
|
|
985bd18904 | ||
|
|
2d1f798d14 | ||
|
|
9e9f70a693 | ||
|
|
1b9d311b5c | ||
|
|
4d437416da | ||
|
|
267b942383 | ||
|
|
142cb601f8 | ||
|
|
21b523fcd3 | ||
|
|
006cab3e9e | ||
|
|
4e909ee8b1 | ||
|
|
95df5d042c | ||
|
|
22059858fe | ||
|
|
82107a02f5 | ||
|
|
515893595d | ||
|
|
3800be3898 | ||
|
|
c9ad952604 | ||
|
|
2a09ffc648 | ||
|
|
821d8fee3b | ||
|
|
42224594b6 | ||
|
|
d369a2b775 | ||
|
|
a5f4cfc612 | ||
|
|
23e5402bec | ||
|
|
391e8afd1f | ||
|
|
eff2c3a621 | ||
|
|
de48e4e4df | ||
|
|
c4a694862c | ||
|
|
1e076a4ae0 | ||
|
|
188311863a | ||
|
|
0eb083e979 | ||
|
|
abe61b9926 | ||
|
|
54e49d10d2 | ||
|
|
ef75829878 | ||
|
|
a19341b57a | ||
|
|
c9549391d1 | ||
|
|
2b767161da | ||
|
|
7c9631081d | ||
|
|
b6f29bef06 | ||
|
|
6abbbaad1b | ||
|
|
fe5f448015 | ||
|
|
7beb473a3d | ||
|
|
19bc92289d | ||
|
|
4e4f6c1ec8 | ||
|
|
459e67b2a7 | ||
|
|
51ba24991c | ||
|
|
dfa0fd5b33 | ||
|
|
f7ef60c13f | ||
|
|
8b2bfa4212 | ||
|
|
a6c915aab9 | ||
|
|
a8323cc3f5 | ||
|
|
aa29735868 | ||
|
|
a059e9241e | ||
|
|
acd637160f | ||
|
|
ddb2783f9a | ||
|
|
8fa895d65e | ||
|
|
33b658a341 | ||
|
|
df725aade2 | ||
|
|
d84440d53b | ||
|
|
0c1ae21c11 | ||
|
|
f30959c6bd | ||
|
|
d7e406e020 | ||
|
|
638e3c070c | ||
|
|
07aeac37fd | ||
|
|
6ec76e7f9a | ||
|
|
cb9951dcad | ||
|
|
0776701396 | ||
|
|
39de6c784c | ||
|
|
e5c4482088 | ||
|
|
975c171d5a | ||
|
|
7d7f63059a | ||
|
|
8c6c0a7bcc | ||
|
|
aa41743ebd | ||
|
|
ee5f13cb6b | ||
|
|
974145f61c | ||
|
|
849318138e | ||
|
|
6a04c0878b | ||
|
|
db80e18308 | ||
|
|
3081207a4c | ||
|
|
8085c7a450 | ||
|
|
842de91168 | ||
|
|
4c621bc697 | ||
|
|
938458b330 | ||
|
|
651dad0cc1 | ||
|
|
f591ab3ba0 | ||
|
|
09aa4cf2ca | ||
|
|
61c0bdb09c | ||
|
|
89367d47a8 | ||
|
|
7fdfd938e0 | ||
|
|
e526b5ffeb | ||
|
|
adb974960d | ||
|
|
2acc92828f | ||
|
|
a1d1f43e6a | ||
|
|
aac739ccd2 | ||
|
|
c3d1b07c45 | ||
|
|
77bafd823b | ||
|
|
624b5f228b | ||
|
|
6d233becf0 | ||
|
|
2bcd13aaee | ||
|
|
20723cb792 | ||
|
|
b93ad10fa5 | ||
|
|
28e2007767 | ||
|
|
802f1e4406 | ||
|
|
a37cc6cb08 | ||
|
|
6cea51585f | ||
|
|
fce9c3a9f1 | ||
|
|
969903ebf2 | ||
|
|
7b3f86152a | ||
|
|
ea1362a936 | ||
|
|
f62a5b83a9 | ||
|
|
a834b98232 | ||
|
|
152cf6325d | ||
|
|
c98ab69cc7 | ||
|
|
f7cce15156 | ||
|
|
3072c5b8a1 | ||
|
|
ac1ab03cb0 | ||
|
|
2ef72f7abb | ||
|
|
eae27d1788 | ||
|
|
a3787eff19 | ||
|
|
836d945ece | ||
|
|
2816902f0e | ||
|
|
f72a26d340 | ||
|
|
387521bb6d | ||
|
|
a4da82a43b | ||
|
|
bc90fefb5b | ||
|
|
c3d871aef4 | ||
|
|
59e378f48f | ||
|
|
a622fd90b4 | ||
|
|
861b647e7b | ||
|
|
70e57dad88 | ||
|
|
91ff938035 | ||
|
|
3acd1146f9 | ||
|
|
45d3bfff28 | ||
|
|
18110b519c | ||
|
|
4c9768565e | ||
|
|
873e734c39 | ||
|
|
747e0c657d | ||
|
|
780f13db30 | ||
|
|
62519bfe05 | ||
|
|
29f7f468ce | ||
|
|
9c36a5fd06 | ||
|
|
4558c8f37a | ||
|
|
bb67388bbe | ||
|
|
3dcd2b82c4 | ||
|
|
c0f3e32447 | ||
|
|
8733e087d7 | ||
|
|
9f9e577640 | ||
|
|
9813cea1d0 | ||
|
|
304537c24f | ||
|
|
cc0054a4d5 | ||
|
|
29ec219b82 | ||
|
|
0994d7811f | ||
|
|
934708d950 | ||
|
|
bbc002a505 | ||
|
|
c8d4e8b5d0 | ||
|
|
18a21d5802 | ||
|
|
fcb63f3039 | ||
|
|
91d7a6f8a9 | ||
|
|
238db14002 | ||
|
|
d0995204da | ||
|
|
6ebc2b2561 | ||
|
|
95b817e8d7 | ||
|
|
558f034007 | ||
|
|
72ea805298 | ||
|
|
79ffbf7fe1 | ||
|
|
4f0d286d2c | ||
|
|
6fb5888e55 | ||
|
|
b5810dfe9d | ||
|
|
85a79f9d67 | ||
|
|
d24465b79a | ||
|
|
c67a99ff27 | ||
|
|
bae4e12302 | ||
|
|
09df1cdb5c | ||
|
|
2946d87e48 | ||
|
|
6a2d7bff1a | ||
|
|
9b7b2b347f | ||
|
|
33638d5347 | ||
|
|
2ae7d2e6ea | ||
|
|
ffc490ef89 | ||
|
|
29b75ca46f | ||
|
|
004dde18a7 | ||
|
|
3440e8d208 | ||
|
|
e138ae5ec9 | ||
|
|
bf8ba229e0 | ||
|
|
19d0a7495e | ||
|
|
099b62f124 | ||
|
|
8ce78ca488 | ||
|
|
fc9610919c | ||
|
|
e082d2403c | ||
|
|
370c3afc71 | ||
|
|
93357ef017 | ||
|
|
753592cc70 | ||
|
|
b150e6866d | ||
|
|
2f475fa9ea | ||
|
|
ecff50c2b4 | ||
|
|
6f53cf9cc6 | ||
|
|
1056202b48 | ||
|
|
709de3d621 | ||
|
|
f9894f4ebc | ||
|
|
74d3b80d70 | ||
|
|
4b01dfe369 | ||
|
|
fc09d10560 | ||
|
|
59b2e3ea4a | ||
|
|
243cf29793 | ||
|
|
9ded8fbe58 | ||
|
|
9258928c2d | ||
|
|
132cd3aa2c | ||
|
|
fef60d9d41 | ||
|
|
2fdd24c724 | ||
|
|
852a02daff | ||
|
|
2a6148716c | ||
|
|
5ca692fc89 | ||
|
|
3e2487493e | ||
|
|
fdcb0cd2bc | ||
|
|
4962e1772d | ||
|
|
d7d5618498 | ||
|
|
3f3d6ebe66 | ||
|
|
ec28988bfa | ||
|
|
db23538898 | ||
|
|
423a18cecc | ||
|
|
f164260eee | ||
|
|
a091121293 | ||
|
|
d744c85310 | ||
|
|
c9f2c54c49 | ||
|
|
f29d223ed5 | ||
|
|
8dabd34432 | ||
|
|
a104a365e3 | ||
|
|
62d94ff342 | ||
|
|
cbc04a7d40 | ||
|
|
71d3c5bf41 | ||
|
|
bc69e46ad1 | ||
|
|
13f035b905 | ||
|
|
79cbe50894 | ||
|
|
1c04aa54a7 | ||
|
|
b718283327 | ||
|
|
b34390017b | ||
|
|
8980f89370 | ||
|
|
f46d47239f | ||
|
|
13dc82b9d4 | ||
|
|
a243dd4587 | ||
|
|
9d5d6c557b | ||
|
|
a604682805 | ||
|
|
70b1cd798f | ||
|
|
578f42d588 | ||
|
|
e3ad6d2bd1 | ||
|
|
4b64a8d20d | ||
|
|
fcc8700218 | ||
|
|
e5b713ee63 | ||
|
|
9849c6b847 | ||
|
|
9bb5da968c | ||
|
|
d5a71fd567 | ||
|
|
0f98ba4729 | ||
|
|
a6a2174bf7 | ||
|
|
f07c3171e3 | ||
|
|
6cb1e3f3fa | ||
|
|
81b64f69a5 | ||
|
|
17e1f58fd6 | ||
|
|
582833b338 | ||
|
|
48be4fa069 | ||
|
|
2af05bdd3c | ||
|
|
4dbfc91e2b | ||
|
|
95cef39def | ||
|
|
00fb5bcf35 | ||
|
|
42eeb93d99 | ||
|
|
afe7bb4b33 | ||
|
|
0f5f91df0b | ||
|
|
f209a4804b | ||
|
|
5794ffe4bd | ||
|
|
ceb49d3742 | ||
|
|
44142f8234 | ||
|
|
347213d124 | ||
|
|
8ca51bc68a | ||
|
|
56f852a64f | ||
|
|
1c68e79091 | ||
|
|
473a050f0b | ||
|
|
6768e81d5d | ||
|
|
3743f515cf | ||
|
|
3e0b6a7d1f | ||
|
|
ef72f7d513 | ||
|
|
2f71461b29 | ||
|
|
d8cab4c133 | ||
|
|
95a093e97b | ||
|
|
68bb51c55b | ||
|
|
fb8fe6f2b3 | ||
|
|
3e61c90dbe | ||
|
|
ac18b471d2 | ||
|
|
bbe2386bff | ||
|
|
2f47248e3c | ||
|
|
315bb970a5 | ||
|
|
65b0f6049d | ||
|
|
0033535e21 | ||
|
|
3e4a8cb800 | ||
|
|
ad638da2c2 | ||
|
|
a923d8541c | ||
|
|
66fb9ca5f6 | ||
|
|
11cb78c5f8 | ||
|
|
527a5f0980 | ||
|
|
6e878d2ca4 | ||
|
|
cf30b24706 | ||
|
|
709a2ed474 | ||
|
|
ecd30cc8bb | ||
|
|
0105ad5e39 | ||
|
|
cebaab8ee5 | ||
|
|
34281925d6 | ||
|
|
e90c4fa770 | ||
|
|
a06e077938 | ||
|
|
7bdae7be4f | ||
|
|
c125d83e9e | ||
|
|
2abf9221e3 | ||
|
|
6f1e89085c | ||
|
|
5303cdc4af | ||
|
|
feb03e4717 | ||
|
|
64e3a091c3 | ||
|
|
a2c50a980c | ||
|
|
23478b891f | ||
|
|
aab2d52b25 | ||
|
|
9a9041f1ce | ||
|
|
0aa704935b | ||
|
|
ede7f8f5de | ||
|
|
3c317d2fac | ||
|
|
b55b0258e0 | ||
|
|
55a8098d48 | ||
|
|
389e50ff1e | ||
|
|
1df4043ad7 | ||
|
|
b000b8a736 | ||
|
|
7eab7fa353 | ||
|
|
58f7c82d52 | ||
|
|
4d1cd0da93 | ||
|
|
9ee7a014c9 | ||
|
|
e1ab7db87d | ||
|
|
14a5596346 | ||
|
|
2eba5f33b9 | ||
|
|
60a3773c50 | ||
|
|
e8e8177e9d | ||
|
|
f1fe04245a | ||
|
|
8bb208e8f8 | ||
|
|
f8a3aa91cd | ||
|
|
019bde82ce | ||
|
|
ca5e38751c | ||
|
|
b5b25b39e9 | ||
|
|
1784523cc6 | ||
|
|
d71d10adbc | ||
|
|
40fb750589 | ||
|
|
62a6b8d4a6 | ||
|
|
24b1890710 | ||
|
|
3a1d28379a | ||
|
|
c57285d199 | ||
|
|
68cfe929c4 | ||
|
|
6237fd2c16 | ||
|
|
b023f9bd2a | ||
|
|
b7ac885d38 | ||
|
|
cbd9dcbe41 | ||
|
|
4594187732 | ||
|
|
63818f8488 | ||
|
|
8af61cdb66 | ||
|
|
ab83c0fd5b | ||
|
|
3cc40a2584 | ||
|
|
c11933b3fd | ||
|
|
4687699726 | ||
|
|
012dcb4893 | ||
|
|
f01d18e4b9 | ||
|
|
dabd3cd355 | ||
|
|
fa001f27a5 | ||
|
|
40b2e06a7f | ||
|
|
8008499028 | ||
|
|
3ac6929919 | ||
|
|
8d36acd29b | ||
|
|
e54209d643 | ||
|
|
f6a958dc3a | ||
|
|
2548e7b23f | ||
|
|
97046a3548 | ||
|
|
a7d52c414f | ||
|
|
479466a495 | ||
|
|
fa2a8f6fb8 | ||
|
|
ddfa33be79 | ||
|
|
25c76a760e | ||
|
|
14240e9e10 | ||
|
|
a3045b4e49 | ||
|
|
b0685b3576 | ||
|
|
138c57c76a | ||
|
|
182a415555 | ||
|
|
6e789fc516 | ||
|
|
09f278121e | ||
|
|
ed50e3f1b4 | ||
|
|
3a499099af | ||
|
|
931fc45f05 | ||
|
|
6076c74041 | ||
|
|
b4fdccf87a | ||
|
|
8d012181b0 | ||
|
|
d6344d9b5f | ||
|
|
cb9410ded2 | ||
|
|
6838fb32af | ||
|
|
74d77cb140 | ||
|
|
7ad3abfd05 | ||
|
|
7c6df7132e | ||
|
|
f27299dc3b | ||
|
|
47724ef238 | ||
|
|
357389a905 | ||
|
|
42cabc14d4 | ||
|
|
a948ca1669 | ||
|
|
9cef14dfb2 | ||
|
|
2d15d84a01 | ||
|
|
1035469662 | ||
|
|
296a6f7749 | ||
|
|
5cff8124b0 | ||
|
|
90e2510e2f | ||
|
|
9251dd7b24 | ||
|
|
3615063fbc | ||
|
|
09664f1ab8 | ||
|
|
bdf1157d55 | ||
|
|
b4a5ce89c2 | ||
|
|
660516914e | ||
|
|
4c1c479fcf | ||
|
|
309651dc82 | ||
|
|
b13b9f3331 | ||
|
|
108e584983 | ||
|
|
f3b4071209 | ||
|
|
fe1d024351 | ||
|
|
0de08d418f | ||
|
|
109edaae6d | ||
|
|
d69a630989 | ||
|
|
987b67bd2e | ||
|
|
f4d56802f9 | ||
|
|
9dfd6eacf4 | ||
|
|
5aed78e183 | ||
|
|
011e5dd864 | ||
|
|
ae654266df | ||
|
|
03986f1b8b | ||
|
|
bc649593e4 | ||
|
|
cc0285da7f | ||
|
|
f3bc16f4f5 | ||
|
|
15f94858f2 | ||
|
|
5febd06c25 | ||
|
|
9eb7fe8ac0 | ||
|
|
1f26ea4a85 | ||
|
|
912c29fd8c | ||
|
|
eea468918e | ||
|
|
537490e391 | ||
|
|
de8e362d4a | ||
|
|
7a588144b7 | ||
|
|
7f2999aa43 | ||
|
|
a3498f96ef | ||
|
|
637bfa0252 | ||
|
|
1c8f689ecb | ||
|
|
7a8b11d716 | ||
|
|
a67e207866 | ||
|
|
5817209158 | ||
|
|
b39d409aa2 | ||
|
|
a18fb9448b | ||
|
|
1f3007dbb4 | ||
|
|
5dafa4a270 | ||
|
|
e93bcbeee1 | ||
|
|
adc032e7d8 | ||
|
|
248c2b9bf5 | ||
|
|
a8baa05023 | ||
|
|
7066a79466 | ||
|
|
4a623f7ed2 | ||
|
|
f18700ef64 | ||
|
|
52d9a3c34f | ||
|
|
d785ed2588 | ||
|
|
4ff37a4ed1 | ||
|
|
fe167b6ba2 | ||
|
|
f042a7419d | ||
|
|
bc0ebfcdeb | ||
|
|
57d13c770a | ||
|
|
1692384636 | ||
|
|
7634091325 | ||
|
|
bdc8f59c17 | ||
|
|
817efbc29c | ||
|
|
d2661cb4b2 | ||
|
|
9b0110f50c | ||
|
|
5876381f86 | ||
|
|
c4edc25d01 | ||
|
|
36361d14cf | ||
|
|
c8fe5f485c | ||
|
|
1ac1212925 | ||
|
|
3d4fb5136d | ||
|
|
b6b03c8ab9 | ||
|
|
432945e422 | ||
|
|
052f9ddedb | ||
|
|
a96784b98e | ||
|
|
e06944438a | ||
|
|
fa1009b6fc | ||
|
|
b377e857bd | ||
|
|
9a806f667b | ||
|
|
979c9ce8e3 | ||
|
|
b217e6eed7 | ||
|
|
6b7e74a030 | ||
|
|
7fdeb14e6d | ||
|
|
8a323f8354 | ||
|
|
a7abd5bf70 | ||
|
|
932b589780 | ||
|
|
27c282a6ee | ||
|
|
5373289574 | ||
|
|
7d0eabaa80 | ||
|
|
e7f5d12cb6 | ||
|
|
f14e020370 | ||
|
|
e933b28aaf | ||
|
|
1bc490077a | ||
|
|
7d773abe50 | ||
|
|
f22114aeed | ||
|
|
0919de4511 | ||
|
|
3e5292a052 | ||
|
|
2066d60b16 | ||
|
|
51e84c77e7 | ||
|
|
775d9e0615 | ||
|
|
a20d55fb64 | ||
|
|
1b37baf656 | ||
|
|
bffe69a151 | ||
|
|
71525352f0 | ||
|
|
facc5f7ec5 | ||
|
|
184229b1e5 | ||
|
|
3e488c4f19 | ||
|
|
3f84e373ac | ||
|
|
ac6d6ec2f1 | ||
|
|
f11d5d9de8 | ||
|
|
ed2dbefa73 | ||
|
|
39f23aec6b | ||
|
|
362422641e | ||
|
|
a9dc900515 | ||
|
|
3a705696af | ||
|
|
2cfb8a2bf0 | ||
|
|
21ee1c2d01 | ||
|
|
a00febe1a0 | ||
|
|
1e7125ae7b | ||
|
|
aa4a7471dd | ||
|
|
69a03ce23c | ||
|
|
0f50cd7623 | ||
|
|
669c555874 | ||
|
|
1cfb73a129 | ||
|
|
2a585c2fba | ||
|
|
32a83128e6 | ||
|
|
fe7bb33af8 | ||
|
|
da6fa34f02 | ||
|
|
37a358ab93 | ||
|
|
3452c8d693 | ||
|
|
336992cc54 | ||
|
|
13afcbd1eb | ||
|
|
e58a3fd0aa | ||
|
|
57625b6c4c | ||
|
|
0d058d2174 | ||
|
|
8d49a8f278 | ||
|
|
b4b6cfdb1c | ||
|
|
6b7ccde156 | ||
|
|
9b0fd007fd | ||
|
|
6f3ef94836 | ||
|
|
08ac9866e0 | ||
|
|
a17fadea3a | ||
|
|
e30bbfd85d | ||
|
|
120f9d81b2 | ||
|
|
fa38839a80 | ||
|
|
d8f109176c | ||
|
|
bbb1b99ce1 | ||
|
|
0cd8840dba | ||
|
|
d4b253ba3e | ||
|
|
aee7fc118b | ||
|
|
60f0b4fffe | ||
|
|
a95e600eb0 | ||
|
|
a25959184e | ||
|
|
0e5da5b8bc | ||
|
|
ddfa4b8896 | ||
|
|
d816a11bca | ||
|
|
7820391cb9 | ||
|
|
148866bc73 | ||
|
|
0b57c47547 | ||
|
|
02db4450df | ||
|
|
ed7af82bdf | ||
|
|
e3b5673e98 | ||
|
|
82412f218f | ||
|
|
7c648782bc | ||
|
|
ee64d14733 | ||
|
|
bfaab6ed6b | ||
|
|
97333deb3f | ||
|
|
400d9d4205 | ||
|
|
ad1145a201 | ||
|
|
513c22df3b | ||
|
|
b5afd53138 | ||
|
|
72b4b3c7f8 | ||
|
|
eb60ba23f5 | ||
|
|
69aac49f79 | ||
|
|
67f139e016 | ||
|
|
654f047302 | ||
|
|
e6c23672b2 | ||
|
|
1058e5fdde | ||
|
|
6929d9355f | ||
|
|
8c377ad965 | ||
|
|
a81a16beac | ||
|
|
d92945bb8a | ||
|
|
90a6a59a2f | ||
|
|
8bae3d9007 | ||
|
|
98042b858d | ||
|
|
a837bd08b0 | ||
|
|
2c61e9c76a | ||
|
|
da97f78ae0 | ||
|
|
2e1a9da5e2 | ||
|
|
422fd933f5 | ||
|
|
2594124825 | ||
|
|
d09b6ecaa5 | ||
|
|
fb2e71b9bd | ||
|
|
68b67e24f2 | ||
|
|
c1e2341f0a | ||
|
|
70d834c512 | ||
|
|
65ee4e4555 | ||
|
|
5304b13365 | ||
|
|
e547bfa933 | ||
|
|
36ddb13d1f | ||
|
|
74e3def5b3 | ||
|
|
24d41452b0 | ||
|
|
2597020d22 | ||
|
|
2d0fea2650 | ||
|
|
c1a71ad14f | ||
|
|
024c7641a9 | ||
|
|
5c56bdf229 | ||
|
|
af779fa57c | ||
|
|
9918541795 | ||
|
|
04d5c8fb77 | ||
|
|
5980b3cbb0 | ||
|
|
10074bfcc6 | ||
|
|
3940e69c91 | ||
|
|
0ace5f6553 | ||
|
|
b8a9f19515 | ||
|
|
6cd007838d | ||
|
|
72870e2c57 | ||
|
|
9c8997cbe4 | ||
|
|
c6efb82526 | ||
|
|
5abfdc0140 | ||
|
|
d8bc4a0e9a | ||
|
|
8ad2fdd71e | ||
|
|
a2e45a2211 | ||
|
|
621c2b9015 | ||
|
|
b39d1e9b9d | ||
|
|
e1c456407e | ||
|
|
3fe8251dfb | ||
|
|
930a45e7a9 | ||
|
|
afc66554d7 | ||
|
|
998ab15570 | ||
|
|
c0d258ca17 | ||
|
|
230e4547e8 | ||
|
|
4cf33909ee | ||
|
|
323273382c | ||
|
|
6f0a2608b4 | ||
|
|
ea86edbd82 | ||
|
|
e7b5a8e6cb | ||
|
|
27eaf0cf02 | ||
|
|
c84904d8c8 | ||
|
|
01e1c85304 | ||
|
|
4774582dfb | ||
|
|
1ed09ff7a4 | ||
|
|
d89cf27d65 | ||
|
|
35d5ba2626 | ||
|
|
e5f0c38fa9 | ||
|
|
47925f3dd7 | ||
|
|
82c5950c7e | ||
|
|
1806879bb2 | ||
|
|
998b046d70 | ||
|
|
ec4f6e93c2 | ||
|
|
b49dcfb52b | ||
|
|
c62d55342d | ||
|
|
f7815fa93c | ||
|
|
6e305e11e3 | ||
|
|
b97606f0b0 | ||
|
|
f26154bfa9 | ||
|
|
d220ac8582 | ||
|
|
c57e748107 | ||
|
|
d6f8f16068 | ||
|
|
466429efb0 | ||
|
|
89977c73d1 | ||
|
|
a9a05a32bd | ||
|
|
2045c79e37 | ||
|
|
e60b5245d3 | ||
|
|
90bbabce56 | ||
|
|
ddfbe8b649 | ||
|
|
d001f6a396 | ||
|
|
d31da176eb | ||
|
|
e664cd5826 | ||
|
|
b8abeab6d3 | ||
|
|
4aa176c127 | ||
|
|
498e939f0e | ||
|
|
9a22b893b6 | ||
|
|
76d0d40946 | ||
|
|
791ad1210e | ||
|
|
100945694a | ||
|
|
abe2e6ecf7 | ||
|
|
d8efc99217 | ||
|
|
0163b5b8be | ||
|
|
baee3996ab | ||
|
|
8ad1928d93 | ||
|
|
24bf52bc69 | ||
|
|
862049c490 | ||
|
|
a8fc98aa30 | ||
|
|
d70f33748c | ||
|
|
b006c31b7b | ||
|
|
ae45a462e0 | ||
|
|
3cb0dd6685 | ||
|
|
c2a84aa6f0 | ||
|
|
9346e55d5a | ||
|
|
8fc2f8ef62 | ||
|
|
512b9ac194 | ||
|
|
560a82aeaf | ||
|
|
7358db5c27 | ||
|
|
e059efda1b | ||
|
|
164a985115 | ||
|
|
ade57a781c | ||
|
|
9f12ed83f2 | ||
|
|
8aabd9839b | ||
|
|
882fbb0433 | ||
|
|
15eee5dbbb | ||
|
|
cfc1d037ff | ||
|
|
c24ed07596 | ||
|
|
08aab6a620 | ||
|
|
2748c64d60 | ||
|
|
c4f1ab3cc5 | ||
|
|
5e06ec8409 | ||
|
|
04d0a84ae5 | ||
|
|
c1dfe2c529 | ||
|
|
7f88e8badb | ||
|
|
2f66ff2e4f | ||
|
|
76c251513e | ||
|
|
80afddacc8 | ||
|
|
7543c9df50 | ||
|
|
83fb13329d | ||
|
|
e06c923605 | ||
|
|
ab1169895f | ||
|
|
01e81c7e10 | ||
|
|
7bf1142ae0 | ||
|
|
af9f7a952b | ||
|
|
514592b892 | ||
|
|
d72efff878 | ||
|
|
e4c60e2030 | ||
|
|
ed80eb5b0f | ||
|
|
60dd765b3d | ||
|
|
b380dd030f | ||
|
|
19479ea021 | ||
|
|
d708ef6731 | ||
|
|
d1238baecb | ||
|
|
0510759bc4 | ||
|
|
6d5cca5ed0 | ||
|
|
e2b82b4325 | ||
|
|
cf4570a06f | ||
|
|
6df5dddd90 | ||
|
|
d4e9b141db | ||
|
|
ec0665a931 | ||
|
|
836fa69e2e | ||
|
|
9026dc2da4 | ||
|
|
98c9af4c59 | ||
|
|
e481d679b2 | ||
|
|
eb68aa38e3 | ||
|
|
082237e2b5 | ||
|
|
dd08a7a4f6 | ||
|
|
a60c9ef88e | ||
|
|
4e3d235e04 | ||
|
|
19da3606f9 | ||
|
|
fc9e0d2249 | ||
|
|
21a0f09081 | ||
|
|
b84b71f524 | ||
|
|
3d29bda9f8 | ||
|
|
459c664043 | ||
|
|
45edad84cb | ||
|
|
fd31f7e7e5 | ||
|
|
7b2531da24 | ||
|
|
848a13654d | ||
|
|
1cca8f5a30 | ||
|
|
12ffcf0b45 | ||
|
|
852989856d | ||
|
|
7dfdbf8fbe | ||
|
|
1eebb90030 | ||
|
|
ab71654078 | ||
|
|
7a6cff4b3a | ||
|
|
c3ba2198b1 | ||
|
|
ff748f1a41 | ||
|
|
b8193b6321 | ||
|
|
113d0937de | ||
|
|
d0a506661f | ||
|
|
4e71173928 | ||
|
|
e0f0a2ccee | ||
|
|
96edebf4d9 | ||
|
|
3783b455c0 | ||
|
|
7ee5238f5e | ||
|
|
b398169567 | ||
|
|
1960eebc2d | ||
|
|
ad1dd08693 | ||
|
|
95fd093c4a | ||
|
|
ed1ad28e29 | ||
|
|
7076505c24 | ||
|
|
5825cf9457 | ||
|
|
ff40415aee | ||
|
|
f48eb36f75 | ||
|
|
768e3e796e | ||
|
|
3869d4a3a7 | ||
|
|
a87c468c5c | ||
|
|
7abf50a5c0 | ||
|
|
d3f46eb61b | ||
|
|
72c58b0d1d | ||
|
|
6c89e1b311 | ||
|
|
09777a4fc2 | ||
|
|
0331071346 | ||
|
|
614ae7b2bc | ||
|
|
af41ada7aa | ||
|
|
6a33a4456e | ||
|
|
e0c2a39ad4 | ||
|
|
cda1f2be58 | ||
|
|
79e06c4147 | ||
|
|
ead2618c31 | ||
|
|
84eb9fee76 | ||
|
|
79300cdcd9 | ||
|
|
a9591ad1b7 | ||
|
|
098106b54c | ||
|
|
74bb59fa57 | ||
|
|
c97d112b30 | ||
|
|
2dc20b84c1 | ||
|
|
39b689f966 | ||
|
|
6fd3ff4032 | ||
|
|
ab8d1464a7 | ||
|
|
bf90d11a31 | ||
|
|
a08b6ae813 | ||
|
|
74c500b6ec | ||
|
|
26aeadbc3e | ||
|
|
d0a4b50e19 | ||
|
|
ebaf06a741 | ||
|
|
34d837c2dd | ||
|
|
7607d5145b | ||
|
|
12a90289ed | ||
|
|
592697583d | ||
|
|
b50a96982e | ||
|
|
aa2a54c10a | ||
|
|
532d4b5106 | ||
|
|
5788719988 | ||
|
|
ac0b911eda | ||
|
|
10232bfe9e | ||
|
|
a9c1ca9fc5 | ||
|
|
d051dd8087 | ||
|
|
bf52cef16f | ||
|
|
16a9c5e02b | ||
|
|
fef1a90938 | ||
|
|
27870d48ff | ||
|
|
2f66f3ce08 | ||
|
|
369df58a0d | ||
|
|
3d08b352a2 | ||
|
|
d13be06aaa | ||
|
|
f1c69192da | ||
|
|
a2314225e0 | ||
|
|
1e482fe6a8 | ||
|
|
80e7f9b9de | ||
|
|
d219269f1b | ||
|
|
0ff0512aff |
24
.cvsignore
24
.cvsignore
@@ -1,16 +1,22 @@
|
|||||||
compile
|
|
||||||
config.log
|
|
||||||
Makefile
|
Makefile
|
||||||
libtool
|
|
||||||
Makefile.in
|
Makefile.in
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
configure
|
aclocal.m4.bak
|
||||||
config.h
|
|
||||||
config.status
|
|
||||||
curl-config
|
|
||||||
autom4te.cache
|
autom4te.cache
|
||||||
depcomp
|
compile
|
||||||
config.guess
|
config.guess
|
||||||
|
curl_config.h
|
||||||
|
config.log
|
||||||
|
config.lt
|
||||||
|
config.status
|
||||||
config.sub
|
config.sub
|
||||||
ltmain.sh
|
configure
|
||||||
|
curl-config
|
||||||
|
depcomp
|
||||||
libcurl.pc
|
libcurl.pc
|
||||||
|
libtool
|
||||||
|
ltmain.sh
|
||||||
|
vc6curl.ncb
|
||||||
|
vc6curl.opt
|
||||||
|
vc6curl.sln
|
||||||
|
vc6curl.suo
|
||||||
|
|||||||
87
Android.mk
Normal file
87
Android.mk
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
# Google Android makefile for curl and libcurl
|
||||||
|
#
|
||||||
|
# Place the curl source (including this makefile) into external/curl/ in the
|
||||||
|
# Android source tree. Then build them with 'make curl' or just 'make libcurl'
|
||||||
|
# from the Android root. Tested with Android 1.5
|
||||||
|
#
|
||||||
|
# Note: you must first create a curl_config.h file by running configure in the
|
||||||
|
# Android environment. The only way I've found to do this is tricky. Perform a
|
||||||
|
# normal Android build with libcurl in the source tree, providing the target
|
||||||
|
# "showcommands" to make. The build will eventually fail (because curl_config.h
|
||||||
|
# doesn't exist yet), but the compiler commands used to build curl will be
|
||||||
|
# shown. Now, from the external/curl/ directory, run curl's normal configure
|
||||||
|
# command with flags that match what Android itself uses. This will mean
|
||||||
|
# putting the compiler directory into the PATH, putting the -I, -isystem and
|
||||||
|
# -D options into CPPFLAGS, putting the -m, -f, -O and -nostdlib options into
|
||||||
|
# CFLAGS, and putting the -Wl, -L and -l options into LIBS, along with the path
|
||||||
|
# to the files libgcc.a, crtbegin_dynamic.o, and ccrtend_android.o. Remember
|
||||||
|
# that the paths must be absolute since you will not be running configure from
|
||||||
|
# the same directory as the Android make. The normal cross-compiler options
|
||||||
|
# must also be set.
|
||||||
|
#
|
||||||
|
# The end result will be a configure command that looks something like this
|
||||||
|
# (the environment variable A is set to the Android root path):
|
||||||
|
#
|
||||||
|
# A=`realpath ../..` && \
|
||||||
|
# PATH="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/bin:$PATH" \
|
||||||
|
# ./configure --host=arm-linux CC=arm-eabi-gcc \
|
||||||
|
# CPPFLAGS="-I $A/system/core/include ..." \
|
||||||
|
# CFLAGS="-fno-exceptions -Wno-multichar ..." \
|
||||||
|
# LIB="$A/prebuilt/linux-x86/toolchain/arm-eabi-X/lib/gcc/arm-eabi/X\
|
||||||
|
# /interwork/libgcc.a ..." \
|
||||||
|
#
|
||||||
|
# Dan Fandrich
|
||||||
|
# September 2009
|
||||||
|
|
||||||
|
LOCAL_PATH:= $(call my-dir)
|
||||||
|
|
||||||
|
common_CFLAGS := -Wpointer-arith -Wwrite-strings -Wunused -Winline -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wno-long-long -Wfloat-equal -Wno-multichar -Wsign-compare -Wno-format-nonliteral -Wendif-labels -Wstrict-prototypes -Wdeclaration-after-statement -Wno-system-headers -DHAVE_CONFIG_H
|
||||||
|
|
||||||
|
#########################
|
||||||
|
# Build the libcurl library
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
include $(LOCAL_PATH)/lib/Makefile.inc
|
||||||
|
CURL_HEADERS := \
|
||||||
|
curlbuild.h \
|
||||||
|
curl.h \
|
||||||
|
curlrules.h \
|
||||||
|
curlver.h \
|
||||||
|
easy.h \
|
||||||
|
mprintf.h \
|
||||||
|
multi.h \
|
||||||
|
stdcheaders.h \
|
||||||
|
typecheck-gcc.h \
|
||||||
|
types.h
|
||||||
|
|
||||||
|
LOCAL_SRC_FILES := $(addprefix lib/,$(CSOURCES))
|
||||||
|
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include/
|
||||||
|
LOCAL_CFLAGS += $(common_CFLAGS)
|
||||||
|
|
||||||
|
LOCAL_COPY_HEADERS_TO := libcurl/curl
|
||||||
|
LOCAL_COPY_HEADERS := $(addprefix include/curl/,$(CURL_HEADERS))
|
||||||
|
|
||||||
|
LOCAL_MODULE:= libcurl
|
||||||
|
|
||||||
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
|
||||||
|
#########################
|
||||||
|
# Build the curl binary
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
include $(LOCAL_PATH)/src/Makefile.inc
|
||||||
|
LOCAL_SRC_FILES := $(addprefix src/,$(CURL_SOURCES))
|
||||||
|
|
||||||
|
LOCAL_MODULE := curl
|
||||||
|
LOCAL_STATIC_LIBRARIES := libcurl
|
||||||
|
LOCAL_SYSTEM_SHARED_LIBRARIES := libc
|
||||||
|
|
||||||
|
LOCAL_C_INCLUDES += $(LOCAL_PATH)/include $(LOCAL_PATH)/lib
|
||||||
|
|
||||||
|
# This will also need to include $(CURLX_ONES) in order to correctly build
|
||||||
|
# a dynamic library
|
||||||
|
LOCAL_CFLAGS += $(common_CFLAGS)
|
||||||
|
|
||||||
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
2
CMake/CMakeConfigurableFile.in
Normal file
2
CMake/CMakeConfigurableFile.in
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
@CMAKE_CONFIGURABLE_FILE_CONTENT@
|
||||||
|
|
||||||
41
CMake/CheckTypeSize.c.in
Normal file
41
CMake/CheckTypeSize.c.in
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#cmakedefine CHECK_TYPE_SIZE_TYPE @CHECK_TYPE_SIZE_TYPE@
|
||||||
|
#ifdef CHECK_TYPE_SIZE_TYPE
|
||||||
|
|
||||||
|
@CHECK_TYPE_SIZE_PREINCLUDE@
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
# include <sys/types.h>
|
||||||
|
#endif /* HAVE_SYS_TYPES_H */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
# include <winsock2.h>
|
||||||
|
# include <ws2tcpip.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HAVE_STDINT_H
|
||||||
|
# include <stdint.h>
|
||||||
|
#endif /* HAVE_STDINT_H */
|
||||||
|
|
||||||
|
#ifdef HAVE_STDDEF_H
|
||||||
|
# include <stddef.h>
|
||||||
|
#endif /* HAVE_STDDEF_H */
|
||||||
|
|
||||||
|
@CHECK_TYPE_SIZE_PREMAIN@
|
||||||
|
|
||||||
|
#ifdef __CLASSIC_C__
|
||||||
|
int main(){
|
||||||
|
int ac;
|
||||||
|
char*av[];
|
||||||
|
#else
|
||||||
|
int main(int ac, char*av[]){
|
||||||
|
#endif
|
||||||
|
if(ac > 1000){return *av[0];}
|
||||||
|
return sizeof(CHECK_TYPE_SIZE_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else /* CHECK_TYPE_SIZE_TYPE */
|
||||||
|
|
||||||
|
# error "CHECK_TYPE_SIZE_TYPE has to specify the type"
|
||||||
|
|
||||||
|
#endif /* CHECK_TYPE_SIZE_TYPE */
|
||||||
56
CMake/CheckTypeSize.cmake
Normal file
56
CMake/CheckTypeSize.cmake
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
# - Check sizeof a type
|
||||||
|
# CHECK_TYPE_SIZE(TYPE VARIABLE)
|
||||||
|
# Check if the type exists and determine size of type. if the type
|
||||||
|
# exists, the size will be stored to the variable.
|
||||||
|
#
|
||||||
|
# VARIABLE - variable to store size if the type exists.
|
||||||
|
# HAVE_${VARIABLE} - does the variable exists or not
|
||||||
|
|
||||||
|
macro(CHECK_TYPE_SIZE TYPE VARIABLE)
|
||||||
|
set(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
|
||||||
|
if(NOT DEFINED ${VARIABLE})
|
||||||
|
if("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||||
|
set(CHECK_TYPE_SIZE_TYPE "${TYPE}")
|
||||||
|
set(MACRO_CHECK_TYPE_SIZE_FLAGS
|
||||||
|
"${CMAKE_REQUIRED_FLAGS}")
|
||||||
|
foreach(def HAVE_SYS_TYPES_H HAVE_STDINT_H HAVE_STDDEF_H)
|
||||||
|
if("${def}")
|
||||||
|
set(MACRO_CHECK_TYPE_SIZE_FLAGS
|
||||||
|
"${MACRO_CHECK_TYPE_SIZE_FLAGS} -D${def}")
|
||||||
|
endif("${def}")
|
||||||
|
endforeach(def)
|
||||||
|
set(CHECK_TYPE_SIZE_PREMAIN)
|
||||||
|
foreach(def ${CMAKE_EXTRA_INCLUDE_FILES})
|
||||||
|
set(CHECK_TYPE_SIZE_PREMAIN "${CHECK_TYPE_SIZE_PREMAIN}#include \"${def}\"\n")
|
||||||
|
endforeach(def)
|
||||||
|
configure_file(
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/CMake/CheckTypeSize.c.in"
|
||||||
|
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
|
||||||
|
IMMEDIATE @ONLY)
|
||||||
|
file(READ
|
||||||
|
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
|
||||||
|
CHECK_TYPE_SIZE_FILE_CONTENT)
|
||||||
|
message(STATUS "Check size of ${TYPE}")
|
||||||
|
if(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
set(CHECK_TYPE_SIZE_ADD_LIBRARIES
|
||||||
|
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||||
|
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
try_run(${VARIABLE} HAVE_${VARIABLE}
|
||||||
|
${CMAKE_BINARY_DIR}
|
||||||
|
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckTypeSize.c"
|
||||||
|
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS}
|
||||||
|
"${CHECK_TYPE_SIZE_ADD_LIBRARIES}"
|
||||||
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
if(HAVE_${VARIABLE})
|
||||||
|
message(STATUS "Check size of ${TYPE} - done")
|
||||||
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
|
"Determining size of ${TYPE} passed with the following output:\n${OUTPUT}\n\n")
|
||||||
|
else(HAVE_${VARIABLE})
|
||||||
|
message(STATUS "Check size of ${TYPE} - failed")
|
||||||
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
|
"Determining size of ${TYPE} failed with the following output:\n${OUTPUT}\nCheckTypeSize.c:\n${CHECK_TYPE_SIZE_FILE_CONTENT}\n\n")
|
||||||
|
endif(HAVE_${VARIABLE})
|
||||||
|
endif("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
|
||||||
|
endif(NOT DEFINED ${VARIABLE})
|
||||||
|
set(CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS )
|
||||||
|
endmacro(CHECK_TYPE_SIZE)
|
||||||
75
CMake/CurlCheckCSourceCompiles.cmake
Normal file
75
CMake/CurlCheckCSourceCompiles.cmake
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
# - Check if the source code provided in the SOURCE argument compiles.
|
||||||
|
# CURL_CHECK_C_SOURCE_COMPILES(SOURCE VAR)
|
||||||
|
# - macro which checks if the source code compiles
|
||||||
|
# SOURCE - source code to try to compile
|
||||||
|
# VAR - variable to store whether the source code compiled
|
||||||
|
#
|
||||||
|
# The following variables may be set before calling this macro to
|
||||||
|
# modify the way the check is run:
|
||||||
|
#
|
||||||
|
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||||
|
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||||
|
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||||
|
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||||
|
|
||||||
|
macro(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR)
|
||||||
|
if("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
|
||||||
|
set(message "${VAR}")
|
||||||
|
# If the number of arguments is greater than 2 (SOURCE VAR)
|
||||||
|
if(${ARGC} GREATER 2)
|
||||||
|
# then add the third argument as a message
|
||||||
|
set(message "${ARGV2} (${VAR})")
|
||||||
|
endif(${ARGC} GREATER 2)
|
||||||
|
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||||
|
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
||||||
|
if(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
|
||||||
|
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||||
|
else(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
|
||||||
|
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
if(CMAKE_REQUIRED_INCLUDES)
|
||||||
|
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
|
||||||
|
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
||||||
|
else(CMAKE_REQUIRED_INCLUDES)
|
||||||
|
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
|
||||||
|
endif(CMAKE_REQUIRED_INCLUDES)
|
||||||
|
set(src "")
|
||||||
|
foreach(def ${EXTRA_DEFINES})
|
||||||
|
set(src "${src}#define ${def} 1\n")
|
||||||
|
endforeach(def)
|
||||||
|
foreach(inc ${HEADER_INCLUDES})
|
||||||
|
set(src "${src}#include <${inc}>\n")
|
||||||
|
endforeach(inc)
|
||||||
|
|
||||||
|
set(src "${src}\nint main() { ${SOURCE} ; return 0; }")
|
||||||
|
set(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}")
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in
|
||||||
|
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
|
||||||
|
IMMEDIATE)
|
||||||
|
message(STATUS "Performing Test ${message}")
|
||||||
|
try_compile(${VAR}
|
||||||
|
${CMAKE_BINARY_DIR}
|
||||||
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
|
||||||
|
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
||||||
|
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
|
||||||
|
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
|
||||||
|
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
|
||||||
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
if(${VAR})
|
||||||
|
set(${VAR} 1 CACHE INTERNAL "Test ${message}")
|
||||||
|
message(STATUS "Performing Test ${message} - Success")
|
||||||
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
|
"Performing C SOURCE FILE Test ${message} succeded with the following output:\n"
|
||||||
|
"${OUTPUT}\n"
|
||||||
|
"Source file was:\n${src}\n")
|
||||||
|
else(${VAR})
|
||||||
|
message(STATUS "Performing Test ${message} - Failed")
|
||||||
|
set(${VAR} "" CACHE INTERNAL "Test ${message}")
|
||||||
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
|
"Performing C SOURCE FILE Test ${message} failed with the following output:\n"
|
||||||
|
"${OUTPUT}\n"
|
||||||
|
"Source file was:\n${src}\n")
|
||||||
|
endif(${VAR})
|
||||||
|
endif("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
|
||||||
|
endmacro(CURL_CHECK_C_SOURCE_COMPILES)
|
||||||
83
CMake/CurlCheckCSourceRuns.cmake
Normal file
83
CMake/CurlCheckCSourceRuns.cmake
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
# - Check if the source code provided in the SOURCE argument compiles and runs.
|
||||||
|
# CURL_CHECK_C_SOURCE_RUNS(SOURCE VAR)
|
||||||
|
# - macro which checks if the source code runs
|
||||||
|
# SOURCE - source code to try to compile
|
||||||
|
# VAR - variable to store size if the type exists.
|
||||||
|
#
|
||||||
|
# The following variables may be set before calling this macro to
|
||||||
|
# modify the way the check is run:
|
||||||
|
#
|
||||||
|
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
|
||||||
|
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
|
||||||
|
# CMAKE_REQUIRED_INCLUDES = list of include directories
|
||||||
|
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||||
|
|
||||||
|
macro(CURL_CHECK_C_SOURCE_RUNS SOURCE VAR)
|
||||||
|
if("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
|
||||||
|
set(message "${VAR}")
|
||||||
|
# If the number of arguments is greater than 2 (SOURCE VAR)
|
||||||
|
if(${ARGC} GREATER 2)
|
||||||
|
# then add the third argument as a message
|
||||||
|
set(message "${ARGV2} (${VAR})")
|
||||||
|
endif(${ARGC} GREATER 2)
|
||||||
|
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||||
|
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
||||||
|
if(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
|
||||||
|
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||||
|
else(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
|
||||||
|
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
if(CMAKE_REQUIRED_INCLUDES)
|
||||||
|
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
|
||||||
|
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
||||||
|
else(CMAKE_REQUIRED_INCLUDES)
|
||||||
|
set(CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
|
||||||
|
endif(CMAKE_REQUIRED_INCLUDES)
|
||||||
|
set(src "")
|
||||||
|
foreach(def ${EXTRA_DEFINES})
|
||||||
|
set(src "${src}#define ${def} 1\n")
|
||||||
|
endforeach(def)
|
||||||
|
foreach(inc ${HEADER_INCLUDES})
|
||||||
|
set(src "${src}#include <${inc}>\n")
|
||||||
|
endforeach(inc)
|
||||||
|
|
||||||
|
set(src "${src}\nint main() { ${SOURCE} ; return 0; }")
|
||||||
|
set(CMAKE_CONFIGURABLE_FILE_CONTENT "${src}")
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CMakeConfigurableFile.in
|
||||||
|
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
|
||||||
|
IMMEDIATE)
|
||||||
|
message(STATUS "Performing Test ${message}")
|
||||||
|
try_run(${VAR} ${VAR}_COMPILED
|
||||||
|
${CMAKE_BINARY_DIR}
|
||||||
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
|
||||||
|
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
||||||
|
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
|
||||||
|
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
|
||||||
|
"${CURL_CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
|
||||||
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
# if it did not compile make the return value fail code of 1
|
||||||
|
if(NOT ${VAR}_COMPILED)
|
||||||
|
set(${VAR} 1)
|
||||||
|
endif(NOT ${VAR}_COMPILED)
|
||||||
|
# if the return value was 0 then it worked
|
||||||
|
set(result_var ${${VAR}})
|
||||||
|
if("${result_var}" EQUAL 0)
|
||||||
|
set(${VAR} 1 CACHE INTERNAL "Test ${message}")
|
||||||
|
message(STATUS "Performing Test ${message} - Success")
|
||||||
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
|
"Performing C SOURCE FILE Test ${message} succeded with the following output:\n"
|
||||||
|
"${OUTPUT}\n"
|
||||||
|
"Return value: ${${VAR}}\n"
|
||||||
|
"Source file was:\n${src}\n")
|
||||||
|
else("${result_var}" EQUAL 0)
|
||||||
|
message(STATUS "Performing Test ${message} - Failed")
|
||||||
|
set(${VAR} "" CACHE INTERNAL "Test ${message}")
|
||||||
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
|
"Performing C SOURCE FILE Test ${message} failed with the following output:\n"
|
||||||
|
"${OUTPUT}\n"
|
||||||
|
"Return value: ${result_var}\n"
|
||||||
|
"Source file was:\n${src}\n")
|
||||||
|
endif("${result_var}" EQUAL 0)
|
||||||
|
endif("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
|
||||||
|
endmacro(CURL_CHECK_C_SOURCE_RUNS)
|
||||||
690
CMake/CurlTests.c
Normal file
690
CMake/CurlTests.c
Normal file
@@ -0,0 +1,690 @@
|
|||||||
|
#ifdef TIME_WITH_SYS_TIME
|
||||||
|
/* Time with sys/time test */
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
if ((struct tm *) 0)
|
||||||
|
return 0;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_FCNTL_O_NONBLOCK
|
||||||
|
|
||||||
|
/* headers for FCNTL_O_NONBLOCK test */
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
/* */
|
||||||
|
#if defined(sun) || defined(__sun__) || \
|
||||||
|
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||||
|
# if defined(__SVR4) || defined(__srv4__)
|
||||||
|
# define PLATFORM_SOLARIS
|
||||||
|
# else
|
||||||
|
# define PLATFORM_SUNOS4
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
|
||||||
|
# define PLATFORM_AIX_V3
|
||||||
|
#endif
|
||||||
|
/* */
|
||||||
|
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) || defined(__BEOS__)
|
||||||
|
#error "O_NONBLOCK does not work on this platform"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
/* O_NONBLOCK source test */
|
||||||
|
int flags = 0;
|
||||||
|
if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_GETHOSTBYADDR_R_5
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
char * address;
|
||||||
|
int length;
|
||||||
|
int type;
|
||||||
|
struct hostent h;
|
||||||
|
struct hostent_data hdata;
|
||||||
|
int rc;
|
||||||
|
#ifndef gethostbyaddr_r
|
||||||
|
(void)gethostbyaddr_r;
|
||||||
|
#endif
|
||||||
|
rc = gethostbyaddr_r(address, length, type, &h, &hdata);
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GETHOSTBYADDR_R_5_REENTRANT
|
||||||
|
#define _REENTRANT
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
char * address;
|
||||||
|
int length;q
|
||||||
|
int type;
|
||||||
|
struct hostent h;
|
||||||
|
struct hostent_data hdata;
|
||||||
|
int rc;
|
||||||
|
#ifndef gethostbyaddr_r
|
||||||
|
(void)gethostbyaddr_r;
|
||||||
|
#endif
|
||||||
|
rc = gethostbyaddr_r(address, length, type, &h, &hdata);
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GETHOSTBYADDR_R_7
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
char * address;
|
||||||
|
int length;
|
||||||
|
int type;
|
||||||
|
struct hostent h;
|
||||||
|
char buffer[8192];
|
||||||
|
int h_errnop;
|
||||||
|
struct hostent * hp;
|
||||||
|
|
||||||
|
#ifndef gethostbyaddr_r
|
||||||
|
(void)gethostbyaddr_r;
|
||||||
|
#endif
|
||||||
|
hp = gethostbyaddr_r(address, length, type, &h,
|
||||||
|
buffer, 8192, &h_errnop);
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GETHOSTBYADDR_R_7_REENTRANT
|
||||||
|
#define _REENTRANT
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
char * address;
|
||||||
|
int length;
|
||||||
|
int type;
|
||||||
|
struct hostent h;
|
||||||
|
char buffer[8192];
|
||||||
|
int h_errnop;
|
||||||
|
struct hostent * hp;
|
||||||
|
|
||||||
|
#ifndef gethostbyaddr_r
|
||||||
|
(void)gethostbyaddr_r;
|
||||||
|
#endif
|
||||||
|
hp = gethostbyaddr_r(address, length, type, &h,
|
||||||
|
buffer, 8192, &h_errnop);
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GETHOSTBYADDR_R_8
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
char * address;
|
||||||
|
int length;
|
||||||
|
int type;
|
||||||
|
struct hostent h;
|
||||||
|
char buffer[8192];
|
||||||
|
int h_errnop;
|
||||||
|
struct hostent * hp;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
#ifndef gethostbyaddr_r
|
||||||
|
(void)gethostbyaddr_r;
|
||||||
|
#endif
|
||||||
|
rc = gethostbyaddr_r(address, length, type, &h,
|
||||||
|
buffer, 8192, &hp, &h_errnop);
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GETHOSTBYADDR_R_8_REENTRANT
|
||||||
|
#define _REENTRANT
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
char * address;
|
||||||
|
int length;
|
||||||
|
int type;
|
||||||
|
struct hostent h;
|
||||||
|
char buffer[8192];
|
||||||
|
int h_errnop;
|
||||||
|
struct hostent * hp;
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
#ifndef gethostbyaddr_r
|
||||||
|
(void)gethostbyaddr_r;
|
||||||
|
#endif
|
||||||
|
rc = gethostbyaddr_r(address, length, type, &h,
|
||||||
|
buffer, 8192, &hp, &h_errnop);
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GETHOSTBYNAME_R_3
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#undef NULL
|
||||||
|
#define NULL (void *)0
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
struct hostent_data data;
|
||||||
|
#ifndef gethostbyname_r
|
||||||
|
(void)gethostbyname_r;
|
||||||
|
#endif
|
||||||
|
gethostbyname_r(NULL, NULL, NULL);
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GETHOSTBYNAME_R_3_REENTRANT
|
||||||
|
#define _REENTRANT
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#undef NULL
|
||||||
|
#define NULL (void *)0
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
struct hostent_data data;
|
||||||
|
#ifndef gethostbyname_r
|
||||||
|
(void)gethostbyname_r;
|
||||||
|
#endif
|
||||||
|
gethostbyname_r(NULL, NULL, NULL);
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GETHOSTBYNAME_R_5
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#undef NULL
|
||||||
|
#define NULL (void *)0
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
#ifndef gethostbyname_r
|
||||||
|
(void)gethostbyname_r;
|
||||||
|
#endif
|
||||||
|
gethostbyname_r(NULL, NULL, NULL, 0, NULL);
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GETHOSTBYNAME_R_5_REENTRANT
|
||||||
|
#define _REENTRANT
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#undef NULL
|
||||||
|
#define NULL (void *)0
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
#ifndef gethostbyname_r
|
||||||
|
(void)gethostbyname_r;
|
||||||
|
#endif
|
||||||
|
gethostbyname_r(NULL, NULL, NULL, 0, NULL);
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GETHOSTBYNAME_R_6
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#undef NULL
|
||||||
|
#define NULL (void *)0
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
#ifndef gethostbyname_r
|
||||||
|
(void)gethostbyname_r;
|
||||||
|
#endif
|
||||||
|
gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GETHOSTBYNAME_R_6_REENTRANT
|
||||||
|
#define _REENTRANT
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#undef NULL
|
||||||
|
#define NULL (void *)0
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
#ifndef gethostbyname_r
|
||||||
|
(void)gethostbyname_r;
|
||||||
|
#endif
|
||||||
|
gethostbyname_r(NULL, NULL, NULL, 0, NULL, NULL);
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SOCKLEN_T
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <ws2tcpip.h>
|
||||||
|
#else
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
if ((socklen_t *) 0)
|
||||||
|
return 0;
|
||||||
|
if (sizeof (socklen_t))
|
||||||
|
return 0;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IN_ADDR_T
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
if ((in_addr_t *) 0)
|
||||||
|
return 0;
|
||||||
|
if (sizeof (in_addr_t))
|
||||||
|
return 0;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_BOOL_T
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_STDBOOL_H
|
||||||
|
#include <stdbool.h>
|
||||||
|
#endif
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
if (sizeof (bool *) )
|
||||||
|
return 0;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef STDC_HEADERS
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <float.h>
|
||||||
|
int main() { return 0; }
|
||||||
|
#endif
|
||||||
|
#ifdef RETSIGTYPE_TEST
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#ifdef signal
|
||||||
|
# undef signal
|
||||||
|
#endif
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" void (*signal (int, void (*)(int)))(int);
|
||||||
|
#else
|
||||||
|
void (*signal ()) ();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_INET_NTOA_R_DECL
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
typedef void (*func_type)();
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
#ifndef inet_ntoa_r
|
||||||
|
func_type func;
|
||||||
|
func = (func_type)inet_ntoa_r;
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_INET_NTOA_R_DECL_REENTRANT
|
||||||
|
#define _REENTRANT
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
typedef void (*func_type)();
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
#ifndef inet_ntoa_r
|
||||||
|
func_type func;
|
||||||
|
func = (func_type)&inet_ntoa_r;
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GETADDRINFO
|
||||||
|
#include <netdb.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
struct addrinfo hints, *ai;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
memset(&hints, 0, sizeof(hints));
|
||||||
|
hints.ai_family = AF_UNSPEC;
|
||||||
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
#ifndef getaddrinfo
|
||||||
|
(void)getaddrinfo;
|
||||||
|
#endif
|
||||||
|
error = getaddrinfo("127.0.0.1", "8080", &hints, &ai);
|
||||||
|
if (error) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_FILE_OFFSET_BITS
|
||||||
|
#ifdef _FILE_OFFSET_BITS
|
||||||
|
#undef _FILE_OFFSET_BITS
|
||||||
|
#endif
|
||||||
|
#define _FILE_OFFSET_BITS 64
|
||||||
|
#include <sys/types.h>
|
||||||
|
/* Check that off_t can represent 2**63 - 1 correctly.
|
||||||
|
We can't simply define LARGE_OFF_T to be 9223372036854775807,
|
||||||
|
since some C++ compilers masquerading as C compilers
|
||||||
|
incorrectly reject 9223372036854775807. */
|
||||||
|
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
|
||||||
|
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
|
||||||
|
&& LARGE_OFF_T % 2147483647 == 1)
|
||||||
|
? 1 : -1];
|
||||||
|
int main () { ; return 0; }
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IOCTLSOCKET
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
# ifdef HAVE_WINSOCK2_H
|
||||||
|
# include <winsock2.h>
|
||||||
|
# else
|
||||||
|
# ifdef HAVE_WINSOCK_H
|
||||||
|
# include <winsock.h>
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
/* ioctlsocket source code */
|
||||||
|
int socket;
|
||||||
|
unsigned long flags = ioctlsocket(socket, FIONBIO, &flags);
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IOCTLSOCKET_CAMEL
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
# ifdef HAVE_WINSOCK2_H
|
||||||
|
# include <winsock2.h>
|
||||||
|
# else
|
||||||
|
# ifdef HAVE_WINSOCK_H
|
||||||
|
# include <winsock.h>
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
/* IoctlSocket source code */
|
||||||
|
if(0 != IoctlSocket(0, 0, 0))
|
||||||
|
return 1;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IOCTLSOCKET_CAMEL_FIONBIO
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
# ifdef HAVE_WINSOCK2_H
|
||||||
|
# include <winsock2.h>
|
||||||
|
# else
|
||||||
|
# ifdef HAVE_WINSOCK_H
|
||||||
|
# include <winsock.h>
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
/* IoctlSocket source code */
|
||||||
|
long flags = 0;
|
||||||
|
if(0 != ioctlsocket(0, FIONBIO, &flags))
|
||||||
|
return 1;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IOCTLSOCKET_FIONBIO
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
# ifdef HAVE_WINSOCK2_H
|
||||||
|
# include <winsock2.h>
|
||||||
|
# else
|
||||||
|
# ifdef HAVE_WINSOCK_H
|
||||||
|
# include <winsock.h>
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
int flags = 0;
|
||||||
|
if(0 != ioctlsocket(0, FIONBIO, &flags))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IOCTL_FIONBIO
|
||||||
|
/* headers for FIONBIO test */
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
# include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_IOCTL_H
|
||||||
|
# include <sys/ioctl.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_STROPTS_H
|
||||||
|
# include <stropts.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
int flags = 0;
|
||||||
|
if(0 != ioctl(0, FIONBIO, &flags))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IOCTL_SIOCGIFADDR
|
||||||
|
/* headers for FIONBIO test */
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
# include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_IOCTL_H
|
||||||
|
# include <sys/ioctl.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_STROPTS_H
|
||||||
|
# include <stropts.h>
|
||||||
|
#endif
|
||||||
|
#include <net/if.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
struct ifreq ifr;
|
||||||
|
if(0 != ioctl(0, SIOCGIFADDR, &ifr))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SETSOCKOPT_SO_NONBLOCK
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_WINDOWS_H
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
# ifdef HAVE_WINSOCK2_H
|
||||||
|
# include <winsock2.h>
|
||||||
|
# else
|
||||||
|
# ifdef HAVE_WINSOCK_H
|
||||||
|
# include <winsock.h>
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
/* includes start */
|
||||||
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
|
# include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
/* includes end */
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
|
||||||
|
return 1;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_GLIBC_STRERROR_R
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
int
|
||||||
|
main () {
|
||||||
|
char buffer[1024]; /* big enough to play with */
|
||||||
|
char *string =
|
||||||
|
strerror_r(EACCES, buffer, sizeof(buffer));
|
||||||
|
/* this should've returned a string */
|
||||||
|
if(!string || !string[0])
|
||||||
|
return 99;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_POSIX_STRERROR_R
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
int
|
||||||
|
main () {
|
||||||
|
char buffer[1024]; /* big enough to play with */
|
||||||
|
int error =
|
||||||
|
strerror_r(EACCES, buffer, sizeof(buffer));
|
||||||
|
/* This should've returned zero, and written an error string in the
|
||||||
|
buffer.*/
|
||||||
|
if(!buffer[0] || error)
|
||||||
|
return 99;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
42
CMake/FindCARES.cmake
Executable file
42
CMake/FindCARES.cmake
Executable file
@@ -0,0 +1,42 @@
|
|||||||
|
# - Find c-ares
|
||||||
|
# Find the c-ares includes and library
|
||||||
|
# This module defines
|
||||||
|
# CARES_INCLUDE_DIR, where to find ares.h, etc.
|
||||||
|
# CARES_LIBRARIES, the libraries needed to use c-ares.
|
||||||
|
# CARES_FOUND, If false, do not try to use c-ares.
|
||||||
|
# also defined, but not for general use are
|
||||||
|
# CARES_LIBRARY, where to find the c-ares library.
|
||||||
|
|
||||||
|
FIND_PATH(CARES_INCLUDE_DIR ares.h
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(CARES_NAMES ${CARES_NAMES} cares)
|
||||||
|
FIND_LIBRARY(CARES_LIBRARY
|
||||||
|
NAMES ${CARES_NAMES}
|
||||||
|
PATHS /usr/lib /usr/local/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
IF (CARES_LIBRARY AND CARES_INCLUDE_DIR)
|
||||||
|
SET(CARES_LIBRARIES ${CARES_LIBRARY})
|
||||||
|
SET(CARES_FOUND "YES")
|
||||||
|
ELSE (CARES_LIBRARY AND CARES_INCLUDE_DIR)
|
||||||
|
SET(CARES_FOUND "NO")
|
||||||
|
ENDIF (CARES_LIBRARY AND CARES_INCLUDE_DIR)
|
||||||
|
|
||||||
|
|
||||||
|
IF (CARES_FOUND)
|
||||||
|
IF (NOT CARES_FIND_QUIETLY)
|
||||||
|
MESSAGE(STATUS "Found c-ares: ${CARES_LIBRARIES}")
|
||||||
|
ENDIF (NOT CARES_FIND_QUIETLY)
|
||||||
|
ELSE (CARES_FOUND)
|
||||||
|
IF (CARES_FIND_REQUIRED)
|
||||||
|
MESSAGE(FATAL_ERROR "Could not find c-ares library")
|
||||||
|
ENDIF (CARES_FIND_REQUIRED)
|
||||||
|
ENDIF (CARES_FOUND)
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(
|
||||||
|
CARES_LIBRARY
|
||||||
|
CARES_INCLUDE_DIR
|
||||||
|
)
|
||||||
19
CMake/FindOpenSSL.cmake
Normal file
19
CMake/FindOpenSSL.cmake
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Extension of the standard FindOpenSSL.cmake
|
||||||
|
# Adds OPENSSL_INCLUDE_DIRS and libeay32
|
||||||
|
include("${CMAKE_ROOT}/Modules/FindOpenSSL.cmake")
|
||||||
|
|
||||||
|
# Bill Hoffman told that libeay32 is necessary for him:
|
||||||
|
find_library(SSL_LIBEAY NAMES libeay32)
|
||||||
|
|
||||||
|
if(OPENSSL_FOUND)
|
||||||
|
if(SSL_LIBEAY)
|
||||||
|
list(APPEND OPENSSL_LIBRARIES ${SSL_LIBEAY})
|
||||||
|
else()
|
||||||
|
set(OPENSSL_FOUND FALSE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if(OPENSSL_FOUND)
|
||||||
|
set(OPENSSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
8
CMake/FindZLIB.cmake
Normal file
8
CMake/FindZLIB.cmake
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Locate zlib
|
||||||
|
include("${CMAKE_ROOT}/Modules/FindZLIB.cmake")
|
||||||
|
|
||||||
|
find_library(ZLIB_LIBRARY_DEBUG NAMES zd zlibd zdlld zlib1d )
|
||||||
|
|
||||||
|
if(ZLIB_FOUND AND ZLIB_LIBRARY_DEBUG)
|
||||||
|
set( ZLIB_LIBRARIES optimized "${ZLIB_LIBRARY}" debug ${ZLIB_LIBRARY_DEBUG})
|
||||||
|
endif()
|
||||||
250
CMake/OtherTests.cmake
Normal file
250
CMake/OtherTests.cmake
Normal file
@@ -0,0 +1,250 @@
|
|||||||
|
include(CurlCheckCSourceCompiles)
|
||||||
|
set(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
|
||||||
|
set(HEADER_INCLUDES)
|
||||||
|
set(headers_hack)
|
||||||
|
|
||||||
|
macro(add_header_include check header)
|
||||||
|
if(${check})
|
||||||
|
set(headers_hack
|
||||||
|
"${headers_hack}\n#include <${header}>")
|
||||||
|
#SET(HEADER_INCLUDES
|
||||||
|
# ${HEADER_INCLUDES}
|
||||||
|
# "${header}")
|
||||||
|
endif(${check})
|
||||||
|
endmacro(add_header_include)
|
||||||
|
|
||||||
|
set(signature_call_conv)
|
||||||
|
if(HAVE_WINDOWS_H)
|
||||||
|
add_header_include(HAVE_WINDOWS_H "windows.h")
|
||||||
|
add_header_include(HAVE_WINSOCK2_H "winsock2.h")
|
||||||
|
add_header_include(HAVE_WINSOCK_H "winsock.h")
|
||||||
|
set(EXTRA_DEFINES ${EXTRA_DEFINES}
|
||||||
|
"__unused7\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#define __unused3")
|
||||||
|
set(signature_call_conv "PASCAL")
|
||||||
|
else(HAVE_WINDOWS_H)
|
||||||
|
add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
|
||||||
|
add_header_include(HAVE_SYS_SOCKET_H "sys/socket.h")
|
||||||
|
endif(HAVE_WINDOWS_H)
|
||||||
|
|
||||||
|
set(EXTRA_DEFINES_BACKUP "${EXTRA_DEFINES}")
|
||||||
|
set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
|
||||||
|
curl_check_c_source_compiles("recv(0, 0, 0, 0)" curl_cv_recv)
|
||||||
|
if(curl_cv_recv)
|
||||||
|
# AC_CACHE_CHECK([types of arguments and return type for recv],
|
||||||
|
#[curl_cv_func_recv_args], [
|
||||||
|
#SET(curl_cv_func_recv_args "unknown")
|
||||||
|
#for recv_retv in 'int' 'ssize_t'; do
|
||||||
|
if(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||||
|
foreach(recv_retv "int" "ssize_t" )
|
||||||
|
foreach(recv_arg1 "int" "ssize_t" "SOCKET")
|
||||||
|
foreach(recv_arg2 "void *" "char *")
|
||||||
|
foreach(recv_arg3 "size_t" "int" "socklen_t" "unsigned int")
|
||||||
|
foreach(recv_arg4 "int" "unsigned int")
|
||||||
|
if(NOT curl_cv_func_recv_done)
|
||||||
|
set(curl_cv_func_recv_test "UNKNOWN")
|
||||||
|
set(extern_line "extern ${recv_retv} ${signature_call_conv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})\;")
|
||||||
|
set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
|
||||||
|
curl_check_c_source_compiles("
|
||||||
|
${recv_arg1} s=0;
|
||||||
|
${recv_arg2} buf=0;
|
||||||
|
${recv_arg3} len=0;
|
||||||
|
${recv_arg4} flags=0;
|
||||||
|
${recv_retv} res = recv(s, buf, len, flags)"
|
||||||
|
curl_cv_func_recv_test
|
||||||
|
"${recv_retv} recv(${recv_arg1}, ${recv_arg2}, ${recv_arg3}, ${recv_arg4})")
|
||||||
|
if(curl_cv_func_recv_test)
|
||||||
|
set(curl_cv_func_recv_args
|
||||||
|
"${recv_arg1},${recv_arg2},${recv_arg3},${recv_arg4},${recv_retv}")
|
||||||
|
set(RECV_TYPE_ARG1 "${recv_arg1}")
|
||||||
|
set(RECV_TYPE_ARG2 "${recv_arg2}")
|
||||||
|
set(RECV_TYPE_ARG3 "${recv_arg3}")
|
||||||
|
set(RECV_TYPE_ARG4 "${recv_arg4}")
|
||||||
|
set(RECV_TYPE_RETV "${recv_retv}")
|
||||||
|
set(HAVE_RECV 1)
|
||||||
|
set(curl_cv_func_recv_done 1)
|
||||||
|
endif(curl_cv_func_recv_test)
|
||||||
|
endif(NOT curl_cv_func_recv_done)
|
||||||
|
endforeach(recv_arg4)
|
||||||
|
endforeach(recv_arg3)
|
||||||
|
endforeach(recv_arg2)
|
||||||
|
endforeach(recv_arg1)
|
||||||
|
endforeach(recv_retv)
|
||||||
|
else(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||||
|
string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG1 "${curl_cv_func_recv_args}")
|
||||||
|
string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG2 "${curl_cv_func_recv_args}")
|
||||||
|
string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" RECV_TYPE_ARG3 "${curl_cv_func_recv_args}")
|
||||||
|
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" RECV_TYPE_ARG4 "${curl_cv_func_recv_args}")
|
||||||
|
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" RECV_TYPE_RETV "${curl_cv_func_recv_args}")
|
||||||
|
#MESSAGE("RECV_TYPE_ARG1 ${RECV_TYPE_ARG1}")
|
||||||
|
#MESSAGE("RECV_TYPE_ARG2 ${RECV_TYPE_ARG2}")
|
||||||
|
#MESSAGE("RECV_TYPE_ARG3 ${RECV_TYPE_ARG3}")
|
||||||
|
#MESSAGE("RECV_TYPE_ARG4 ${RECV_TYPE_ARG4}")
|
||||||
|
#MESSAGE("RECV_TYPE_RETV ${RECV_TYPE_RETV}")
|
||||||
|
endif(NOT DEFINED curl_cv_func_recv_args OR "${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||||
|
|
||||||
|
if("${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||||
|
message(FATAL_ERROR "Cannot find proper types to use for recv args")
|
||||||
|
endif("${curl_cv_func_recv_args}" STREQUAL "unknown")
|
||||||
|
else(curl_cv_recv)
|
||||||
|
message(FATAL_ERROR "Unable to link function recv")
|
||||||
|
endif(curl_cv_recv)
|
||||||
|
set(curl_cv_func_recv_args "${curl_cv_func_recv_args}" CACHE INTERNAL "Arguments for recv")
|
||||||
|
set(HAVE_RECV 1)
|
||||||
|
|
||||||
|
curl_check_c_source_compiles("send(0, 0, 0, 0)" curl_cv_send)
|
||||||
|
if(curl_cv_send)
|
||||||
|
# AC_CACHE_CHECK([types of arguments and return type for send],
|
||||||
|
#[curl_cv_func_send_args], [
|
||||||
|
#SET(curl_cv_func_send_args "unknown")
|
||||||
|
#for send_retv in 'int' 'ssize_t'; do
|
||||||
|
if(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||||
|
foreach(send_retv "int" "ssize_t" )
|
||||||
|
foreach(send_arg1 "int" "ssize_t" "SOCKET")
|
||||||
|
foreach(send_arg2 "const void *" "void *" "char *" "const char *")
|
||||||
|
foreach(send_arg3 "size_t" "int" "socklen_t" "unsigned int")
|
||||||
|
foreach(send_arg4 "int" "unsigned int")
|
||||||
|
if(NOT curl_cv_func_send_done)
|
||||||
|
set(curl_cv_func_send_test "UNKNOWN")
|
||||||
|
set(extern_line "extern ${send_retv} ${signature_call_conv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})\;")
|
||||||
|
set(EXTRA_DEFINES "${EXTRA_DEFINES_BACKUP}\n${headers_hack}\n${extern_line}\n#define __unused5")
|
||||||
|
curl_check_c_source_compiles("
|
||||||
|
${send_arg1} s=0;
|
||||||
|
${send_arg2} buf=0;
|
||||||
|
${send_arg3} len=0;
|
||||||
|
${send_arg4} flags=0;
|
||||||
|
${send_retv} res = send(s, buf, len, flags)"
|
||||||
|
curl_cv_func_send_test
|
||||||
|
"${send_retv} send(${send_arg1}, ${send_arg2}, ${send_arg3}, ${send_arg4})")
|
||||||
|
if(curl_cv_func_send_test)
|
||||||
|
#MESSAGE("Found arguments: ${curl_cv_func_send_test}")
|
||||||
|
string(REGEX REPLACE "(const) .*" "\\1" send_qual_arg2 "${send_arg2}")
|
||||||
|
string(REGEX REPLACE "const (.*)" "\\1" send_arg2 "${send_arg2}")
|
||||||
|
set(curl_cv_func_send_args
|
||||||
|
"${send_arg1},${send_arg2},${send_arg3},${send_arg4},${send_retv},${send_qual_arg2}")
|
||||||
|
set(SEND_TYPE_ARG1 "${send_arg1}")
|
||||||
|
set(SEND_TYPE_ARG2 "${send_arg2}")
|
||||||
|
set(SEND_TYPE_ARG3 "${send_arg3}")
|
||||||
|
set(SEND_TYPE_ARG4 "${send_arg4}")
|
||||||
|
set(SEND_TYPE_RETV "${send_retv}")
|
||||||
|
set(HAVE_SEND 1)
|
||||||
|
set(curl_cv_func_send_done 1)
|
||||||
|
endif(curl_cv_func_send_test)
|
||||||
|
endif(NOT curl_cv_func_send_done)
|
||||||
|
endforeach(send_arg4)
|
||||||
|
endforeach(send_arg3)
|
||||||
|
endforeach(send_arg2)
|
||||||
|
endforeach(send_arg1)
|
||||||
|
endforeach(send_retv)
|
||||||
|
else(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||||
|
string(REGEX REPLACE "^([^,]*),[^,]*,[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG1 "${curl_cv_func_send_args}")
|
||||||
|
string(REGEX REPLACE "^[^,]*,([^,]*),[^,]*,[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG2 "${curl_cv_func_send_args}")
|
||||||
|
string(REGEX REPLACE "^[^,]*,[^,]*,([^,]*),[^,]*,[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG3 "${curl_cv_func_send_args}")
|
||||||
|
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,([^,]*),[^,]*,[^,]*$" "\\1" SEND_TYPE_ARG4 "${curl_cv_func_send_args}")
|
||||||
|
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,([^,]*),[^,]*$" "\\1" SEND_TYPE_RETV "${curl_cv_func_send_args}")
|
||||||
|
string(REGEX REPLACE "^[^,]*,[^,]*,[^,]*,[^,]*,[^,]*,([^,]*)$" "\\1" SEND_QUAL_ARG2 "${curl_cv_func_send_args}")
|
||||||
|
#MESSAGE("SEND_TYPE_ARG1 ${SEND_TYPE_ARG1}")
|
||||||
|
#MESSAGE("SEND_TYPE_ARG2 ${SEND_TYPE_ARG2}")
|
||||||
|
#MESSAGE("SEND_TYPE_ARG3 ${SEND_TYPE_ARG3}")
|
||||||
|
#MESSAGE("SEND_TYPE_ARG4 ${SEND_TYPE_ARG4}")
|
||||||
|
#MESSAGE("SEND_TYPE_RETV ${SEND_TYPE_RETV}")
|
||||||
|
#MESSAGE("SEND_QUAL_ARG2 ${SEND_QUAL_ARG2}")
|
||||||
|
endif(NOT DEFINED curl_cv_func_send_args OR "${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||||
|
|
||||||
|
if("${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||||
|
message(FATAL_ERROR "Cannot find proper types to use for send args")
|
||||||
|
endif("${curl_cv_func_send_args}" STREQUAL "unknown")
|
||||||
|
set(SEND_QUAL_ARG2 "const")
|
||||||
|
else(curl_cv_send)
|
||||||
|
message(FATAL_ERROR "Unable to link function send")
|
||||||
|
endif(curl_cv_send)
|
||||||
|
set(curl_cv_func_send_args "${curl_cv_func_send_args}" CACHE INTERNAL "Arguments for send")
|
||||||
|
set(HAVE_SEND 1)
|
||||||
|
|
||||||
|
set(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
|
||||||
|
curl_check_c_source_compiles("int flag = MSG_NOSIGNAL" HAVE_MSG_NOSIGNAL)
|
||||||
|
|
||||||
|
set(EXTRA_DEFINES "__unused1\n#undef inline\n#define __unused2")
|
||||||
|
set(HEADER_INCLUDES)
|
||||||
|
set(headers_hack)
|
||||||
|
|
||||||
|
macro(add_header_include check header)
|
||||||
|
if(${check})
|
||||||
|
set(headers_hack
|
||||||
|
"${headers_hack}\n#include <${header}>")
|
||||||
|
#SET(HEADER_INCLUDES
|
||||||
|
# ${HEADER_INCLUDES}
|
||||||
|
# "${header}")
|
||||||
|
endif(${check})
|
||||||
|
endmacro(add_header_include header)
|
||||||
|
|
||||||
|
if(HAVE_WINDOWS_H)
|
||||||
|
set(EXTRA_DEFINES ${EXTRA_DEFINES}
|
||||||
|
"__unused7\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif\n#define __unused3")
|
||||||
|
add_header_include(HAVE_WINDOWS_H "windows.h")
|
||||||
|
add_header_include(HAVE_WINSOCK2_H "winsock2.h")
|
||||||
|
add_header_include(HAVE_WINSOCK_H "winsock.h")
|
||||||
|
else(HAVE_WINDOWS_H)
|
||||||
|
add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
|
||||||
|
add_header_include(HAVE_SYS_TIME_H "sys/time.h")
|
||||||
|
add_header_include(TIME_WITH_SYS_TIME "time.h")
|
||||||
|
add_header_include(HAVE_TIME_H "time.h")
|
||||||
|
endif(HAVE_WINDOWS_H)
|
||||||
|
set(EXTRA_DEFINES "${EXTRA_DEFINES}\n${headers_hack}\n#define __unused5")
|
||||||
|
curl_check_c_source_compiles("struct timeval ts;\nts.tv_sec = 0;\nts.tv_usec = 0" HAVE_STRUCT_TIMEVAL)
|
||||||
|
|
||||||
|
|
||||||
|
include(CurlCheckCSourceRuns)
|
||||||
|
set(EXTRA_DEFINES)
|
||||||
|
set(HEADER_INCLUDES)
|
||||||
|
if(HAVE_SYS_POLL_H)
|
||||||
|
set(HEADER_INCLUDES "sys/poll.h")
|
||||||
|
endif(HAVE_SYS_POLL_H)
|
||||||
|
curl_check_c_source_runs("return poll((void *)0, 0, 10 /*ms*/)" HAVE_POLL_FINE)
|
||||||
|
|
||||||
|
set(HAVE_SIG_ATOMIC_T 1)
|
||||||
|
set(EXTRA_DEFINES)
|
||||||
|
set(HEADER_INCLUDES)
|
||||||
|
if(HAVE_SIGNAL_H)
|
||||||
|
set(HEADER_INCLUDES "signal.h")
|
||||||
|
set(CMAKE_EXTRA_INCLUDE_FILES "signal.h")
|
||||||
|
endif(HAVE_SIGNAL_H)
|
||||||
|
check_type_size("sig_atomic_t" SIZEOF_SIG_ATOMIC_T)
|
||||||
|
if(HAVE_SIZEOF_SIG_ATOMIC_T)
|
||||||
|
curl_check_c_source_compiles("static volatile sig_atomic_t dummy = 0" HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
|
||||||
|
if(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
|
||||||
|
set(HAVE_SIG_ATOMIC_T_VOLATILE 1)
|
||||||
|
endif(NOT HAVE_SIG_ATOMIC_T_NOT_VOLATILE)
|
||||||
|
endif(HAVE_SIZEOF_SIG_ATOMIC_T)
|
||||||
|
|
||||||
|
set(CHECK_TYPE_SIZE_PREINCLUDE
|
||||||
|
"#undef inline")
|
||||||
|
|
||||||
|
if(HAVE_WINDOWS_H)
|
||||||
|
set(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE}
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
|
#include <windows.h>")
|
||||||
|
if(HAVE_WINSOCK2_H)
|
||||||
|
set(CHECK_TYPE_SIZE_PREINCLUDE "${CHECK_TYPE_SIZE_PREINCLUDE}\n#include <winsock2.h>")
|
||||||
|
endif(HAVE_WINSOCK2_H)
|
||||||
|
else(HAVE_WINDOWS_H)
|
||||||
|
if(HAVE_SYS_SOCKET_H)
|
||||||
|
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
|
||||||
|
"sys/socket.h")
|
||||||
|
endif(HAVE_SYS_SOCKET_H)
|
||||||
|
if(HAVE_NETINET_IN_H)
|
||||||
|
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
|
||||||
|
"netinet/in.h")
|
||||||
|
endif(HAVE_NETINET_IN_H)
|
||||||
|
if(HAVE_ARPA_INET_H)
|
||||||
|
set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES}
|
||||||
|
"arpa/inet.h")
|
||||||
|
endif(HAVE_ARPA_INET_H)
|
||||||
|
endif(HAVE_WINDOWS_H)
|
||||||
|
|
||||||
|
check_type_size("struct sockaddr_storage" SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||||
|
if(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||||
|
set(HAVE_STRUCT_SOCKADDR_STORAGE 1)
|
||||||
|
endif(HAVE_SIZEOF_STRUCT_SOCKADDR_STORAGE)
|
||||||
|
|
||||||
121
CMake/Platforms/WindowsCache.cmake
Normal file
121
CMake/Platforms/WindowsCache.cmake
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
if(NOT UNIX)
|
||||||
|
if(WIN32)
|
||||||
|
set(HAVE_LIBDL 0)
|
||||||
|
set(HAVE_LIBUCB 0)
|
||||||
|
set(HAVE_LIBSOCKET 0)
|
||||||
|
set(NOT_NEED_LIBNSL 0)
|
||||||
|
set(HAVE_LIBNSL 0)
|
||||||
|
set(HAVE_LIBZ 0)
|
||||||
|
set(HAVE_LIBCRYPTO 0)
|
||||||
|
|
||||||
|
set(HAVE_DLOPEN 0)
|
||||||
|
|
||||||
|
set(HAVE_ALLOCA_H 0)
|
||||||
|
set(HAVE_ARPA_INET_H 0)
|
||||||
|
set(HAVE_DLFCN_H 0)
|
||||||
|
set(HAVE_FCNTL_H 1)
|
||||||
|
set(HAVE_FEATURES_H 0)
|
||||||
|
set(HAVE_INTTYPES_H 0)
|
||||||
|
set(HAVE_IO_H 1)
|
||||||
|
set(HAVE_MALLOC_H 1)
|
||||||
|
set(HAVE_MEMORY_H 1)
|
||||||
|
set(HAVE_NETDB_H 0)
|
||||||
|
set(HAVE_NETINET_IF_ETHER_H 0)
|
||||||
|
set(HAVE_NETINET_IN_H 0)
|
||||||
|
set(HAVE_NET_IF_H 0)
|
||||||
|
set(HAVE_PROCESS_H 1)
|
||||||
|
set(HAVE_PWD_H 0)
|
||||||
|
set(HAVE_SETJMP_H 1)
|
||||||
|
set(HAVE_SGTTY_H 0)
|
||||||
|
set(HAVE_SIGNAL_H 1)
|
||||||
|
set(HAVE_SOCKIO_H 0)
|
||||||
|
set(HAVE_STDINT_H 0)
|
||||||
|
set(HAVE_STDLIB_H 1)
|
||||||
|
set(HAVE_STRINGS_H 0)
|
||||||
|
set(HAVE_STRING_H 1)
|
||||||
|
set(HAVE_SYS_PARAM_H 0)
|
||||||
|
set(HAVE_SYS_POLL_H 0)
|
||||||
|
set(HAVE_SYS_SELECT_H 0)
|
||||||
|
set(HAVE_SYS_SOCKET_H 0)
|
||||||
|
set(HAVE_SYS_SOCKIO_H 0)
|
||||||
|
set(HAVE_SYS_STAT_H 1)
|
||||||
|
set(HAVE_SYS_TIME_H 0)
|
||||||
|
set(HAVE_SYS_TYPES_H 1)
|
||||||
|
set(HAVE_SYS_UTIME_H 1)
|
||||||
|
set(HAVE_TERMIOS_H 0)
|
||||||
|
set(HAVE_TERMIO_H 0)
|
||||||
|
set(HAVE_TIME_H 1)
|
||||||
|
set(HAVE_UNISTD_H 0)
|
||||||
|
set(HAVE_UTIME_H 0)
|
||||||
|
set(HAVE_X509_H 0)
|
||||||
|
set(HAVE_ZLIB_H 0)
|
||||||
|
|
||||||
|
set(HAVE_SIZEOF_LONG_DOUBLE 1)
|
||||||
|
set(SIZEOF_LONG_DOUBLE 8)
|
||||||
|
|
||||||
|
set(HAVE_SOCKET 1)
|
||||||
|
set(HAVE_POLL 0)
|
||||||
|
set(HAVE_SELECT 1)
|
||||||
|
set(HAVE_STRDUP 1)
|
||||||
|
set(HAVE_STRSTR 1)
|
||||||
|
set(HAVE_STRTOK_R 0)
|
||||||
|
set(HAVE_STRFTIME 1)
|
||||||
|
set(HAVE_UNAME 0)
|
||||||
|
set(HAVE_STRCASECMP 0)
|
||||||
|
set(HAVE_STRICMP 1)
|
||||||
|
set(HAVE_STRCMPI 1)
|
||||||
|
set(HAVE_GETHOSTBYADDR 1)
|
||||||
|
set(HAVE_GETTIMEOFDAY 0)
|
||||||
|
set(HAVE_INET_ADDR 1)
|
||||||
|
set(HAVE_INET_NTOA 1)
|
||||||
|
set(HAVE_INET_NTOA_R 0)
|
||||||
|
set(HAVE_TCGETATTR 0)
|
||||||
|
set(HAVE_TCSETATTR 0)
|
||||||
|
set(HAVE_PERROR 1)
|
||||||
|
set(HAVE_CLOSESOCKET 1)
|
||||||
|
set(HAVE_SETVBUF 0)
|
||||||
|
set(HAVE_SIGSETJMP 0)
|
||||||
|
set(HAVE_GETPASS_R 0)
|
||||||
|
set(HAVE_STRLCAT 0)
|
||||||
|
set(HAVE_GETPWUID 0)
|
||||||
|
set(HAVE_GETEUID 0)
|
||||||
|
set(HAVE_UTIME 1)
|
||||||
|
set(HAVE_RAND_EGD 0)
|
||||||
|
set(HAVE_RAND_SCREEN 0)
|
||||||
|
set(HAVE_RAND_STATUS 0)
|
||||||
|
set(HAVE_GMTIME_R 0)
|
||||||
|
set(HAVE_LOCALTIME_R 0)
|
||||||
|
set(HAVE_GETHOSTBYADDR_R 0)
|
||||||
|
set(HAVE_GETHOSTBYNAME_R 0)
|
||||||
|
set(HAVE_SIGNAL_FUNC 1)
|
||||||
|
set(HAVE_SIGNAL_MACRO 0)
|
||||||
|
|
||||||
|
set(HAVE_GETHOSTBYADDR_R_5 0)
|
||||||
|
set(HAVE_GETHOSTBYADDR_R_5_REENTRANT 0)
|
||||||
|
set(HAVE_GETHOSTBYADDR_R_7 0)
|
||||||
|
set(HAVE_GETHOSTBYADDR_R_7_REENTRANT 0)
|
||||||
|
set(HAVE_GETHOSTBYADDR_R_8 0)
|
||||||
|
set(HAVE_GETHOSTBYADDR_R_8_REENTRANT 0)
|
||||||
|
set(HAVE_GETHOSTBYNAME_R_3 0)
|
||||||
|
set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
|
||||||
|
set(HAVE_GETHOSTBYNAME_R_5 0)
|
||||||
|
set(HAVE_GETHOSTBYNAME_R_5_REENTRANT 0)
|
||||||
|
set(HAVE_GETHOSTBYNAME_R_6 0)
|
||||||
|
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)
|
||||||
|
|
||||||
|
set(TIME_WITH_SYS_TIME 0)
|
||||||
|
set(HAVE_O_NONBLOCK 0)
|
||||||
|
set(HAVE_IN_ADDR_T 0)
|
||||||
|
set(HAVE_INET_NTOA_R_DECL 0)
|
||||||
|
set(HAVE_INET_NTOA_R_DECL_REENTRANT 0)
|
||||||
|
set(HAVE_GETADDRINFO 0)
|
||||||
|
set(STDC_HEADERS 1)
|
||||||
|
set(RETSIGTYPE_TEST 1)
|
||||||
|
|
||||||
|
set(HAVE_SIGACTION 0)
|
||||||
|
set(HAVE_MACRO_SIGSETJMP 0)
|
||||||
|
else(WIN32)
|
||||||
|
message("This file should be included on Windows platform only")
|
||||||
|
endif(WIN32)
|
||||||
|
endif(NOT UNIX)
|
||||||
|
|
||||||
31
CMake/Utilities.cmake
Normal file
31
CMake/Utilities.cmake
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# File containing various utilities
|
||||||
|
|
||||||
|
# Converts a CMake list to a string containing elements separated by spaces
|
||||||
|
function(TO_LIST_SPACES _LIST_NAME OUTPUT_VAR)
|
||||||
|
set(NEW_LIST_SPACE)
|
||||||
|
foreach(ITEM ${${_LIST_NAME}})
|
||||||
|
set(NEW_LIST_SPACE "${NEW_LIST_SPACE} ${ITEM}")
|
||||||
|
endforeach()
|
||||||
|
string(STRIP ${NEW_LIST_SPACE} NEW_LIST_SPACE)
|
||||||
|
set(${OUTPUT_VAR} "${NEW_LIST_SPACE}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Appends a lis of item to a string which is a space-separated list, if they don't already exist.
|
||||||
|
function(LIST_SPACES_APPEND_ONCE LIST_NAME)
|
||||||
|
string(REPLACE " " ";" _LIST ${${LIST_NAME}})
|
||||||
|
list(APPEND _LIST ${ARGN})
|
||||||
|
list(REMOVE_DUPLICATES _LIST)
|
||||||
|
to_list_spaces(_LIST NEW_LIST_SPACE)
|
||||||
|
set(${LIST_NAME} "${NEW_LIST_SPACE}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Convinience function that does the same as LIST(FIND ...) but with a TRUE/FALSE return value.
|
||||||
|
# Ex: IN_STR_LIST(MY_LIST "Searched item" WAS_FOUND)
|
||||||
|
function(IN_STR_LIST LIST_NAME ITEM_SEARCHED RETVAL)
|
||||||
|
list(FIND ${LIST_NAME} ${ITEM_SEARCHED} FIND_POS)
|
||||||
|
if(${FIND_POS} EQUAL -1)
|
||||||
|
set(${RETVAL} FALSE PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
set(${RETVAL} TRUE PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
884
CMakeLists.txt
Normal file
884
CMakeLists.txt
Normal file
@@ -0,0 +1,884 @@
|
|||||||
|
# cURL/libcurl CMake script
|
||||||
|
# by Tetetest and Sukender (Benoit Neil)
|
||||||
|
|
||||||
|
# TODO:
|
||||||
|
# The output .so file lacks the soname number which we currently have within the lib/Makefile.am file
|
||||||
|
# Add full (4 or 5 libs) SSL support
|
||||||
|
# Add INSTALL target (EXTRA_DIST variables in Makefile.am may be moved to Makefile.inc so that CMake/CPack is aware of what's to include).
|
||||||
|
# Add CTests(?)
|
||||||
|
# Check on all possible platforms
|
||||||
|
# Test with as many configurations possible (With or without any option)
|
||||||
|
# Create scripts that help keeping the CMake build system up to date (to reduce maintenance). According to Tetetest:
|
||||||
|
# - lists of headers that 'configure' checks for;
|
||||||
|
# - curl-specific tests (the ones that are in m4/curl-*.m4 files);
|
||||||
|
# - (most obvious thing:) curl version numbers.
|
||||||
|
# Add documentation subproject
|
||||||
|
#
|
||||||
|
# To check:
|
||||||
|
# (From Daniel Stenberg) The cmake build selected to run gcc with -fPIC on my box while the plain configure script did not.
|
||||||
|
# (From Daniel Stenberg) The gcc command line use neither -g nor any -O options. As a developer, I also treasure our configure scripts's --enable-debug option that sets a long range of "picky" compiler options.
|
||||||
|
cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR)
|
||||||
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
|
||||||
|
include(Utilities)
|
||||||
|
|
||||||
|
project( CURL C )
|
||||||
|
|
||||||
|
|
||||||
|
file (READ ${CURL_SOURCE_DIR}/include/curl/curlver.h CURL_VERSION_H_CONTENTS)
|
||||||
|
string (REGEX MATCH "LIBCURL_VERSION_MAJOR[ \t]+([0-9]+)"
|
||||||
|
LIBCURL_VERSION_MJ ${CURL_VERSION_H_CONTENTS})
|
||||||
|
string (REGEX MATCH "([0-9]+)"
|
||||||
|
LIBCURL_VERSION_MJ ${LIBCURL_VERSION_MJ})
|
||||||
|
string (REGEX MATCH
|
||||||
|
"LIBCURL_VERSION_MINOR[ \t]+([0-9]+)"
|
||||||
|
LIBCURL_VERSION_MI ${CURL_VERSION_H_CONTENTS})
|
||||||
|
string (REGEX MATCH "([0-9]+)" LIBCURL_VERSION_MI ${LIBCURL_VERSION_MI})
|
||||||
|
string (REGEX MATCH
|
||||||
|
"LIBCURL_VERSION_PATCH[ \t]+([0-9]+)"
|
||||||
|
LIBCURL_VERSION_PT ${CURL_VERSION_H_CONTENTS})
|
||||||
|
string (REGEX MATCH "([0-9]+)" LIBCURL_VERSION_PT ${LIBCURL_VERSION_PT})
|
||||||
|
set (CURL_MAJOR_VERSION ${LIBCURL_VERSION_MJ})
|
||||||
|
set (CURL_MINOR_VERSION ${LIBCURL_VERSION_MI})
|
||||||
|
set (CURL_PATCH_VERSION ${LIBCURL_VERSION_PT})
|
||||||
|
|
||||||
|
include_regular_expression("^.*$") # Sukender: Is it necessary?
|
||||||
|
|
||||||
|
# Setup package meta-data
|
||||||
|
# SET(PACKAGE "curl")
|
||||||
|
set(CURL_VERSION ${CURL_MAJOR_VERSION}.${CURL_MINOR_VERSION}.${CURL_PATCH_VERSION})
|
||||||
|
message(STATUS "curl version=[${CURL_VERSION}]")
|
||||||
|
# SET(PACKAGE_TARNAME "curl")
|
||||||
|
# SET(PACKAGE_NAME "curl")
|
||||||
|
# SET(PACKAGE_VERSION "-")
|
||||||
|
# SET(PACKAGE_STRING "curl-")
|
||||||
|
# SET(PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/")
|
||||||
|
set(OPERATING_SYSTEM "${CMAKE_SYSTEM_NAME}")
|
||||||
|
set(OS "\"${CMAKE_SYSTEM_NAME}\"")
|
||||||
|
|
||||||
|
# Make the base headers visible to everything
|
||||||
|
# IF(NOT ${PROJECT_BINARY_DIR} EQUAL ${PROJECT_SOURCE_DIR})
|
||||||
|
# INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)
|
||||||
|
# ENDIF()
|
||||||
|
include_directories( ${CURL_SOURCE_DIR}/include )
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(NATIVE_WINDOWS ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(BUILD_CURL_EXE "Set to ON to build cURL executable." ON)
|
||||||
|
option(BUILD_CURL_TESTS "Set to ON to build cURL tests." ON)
|
||||||
|
option(CURL_STATICLIB "Set to ON to build libcurl with static linking." OFF)
|
||||||
|
option(CURL_USE_ARES "Set to ON to enable c-ares support" OFF)
|
||||||
|
# initialize CURL_LIBS
|
||||||
|
set(CURL_LIBS "")
|
||||||
|
|
||||||
|
if(CURL_USE_ARES)
|
||||||
|
set(USE_ARES ${CURL_USE_ARES})
|
||||||
|
find_package(CARES REQUIRED)
|
||||||
|
list(APPEND CURL_LIBS ${CARES_LIBRARY} )
|
||||||
|
set(CURL_LIBS ${CURL_LIBS} ${CARES_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(BUILD_DASHBOARD_REPORTS "Set to ON to activate reporting of cURL builds here http://www.cdash.org/CDashPublic/index.php?project=CURL" OFF)
|
||||||
|
if(BUILD_DASHBOARD_REPORTS)
|
||||||
|
#INCLUDE(Dart)
|
||||||
|
include(CTest)
|
||||||
|
endif(BUILD_DASHBOARD_REPORTS)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
option(BUILD_RELEASE_DEBUG_DIRS "Set OFF to build each configuration to a separate directory" OFF)
|
||||||
|
mark_as_advanced(BUILD_RELEASE_DEBUG_DIRS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON)
|
||||||
|
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
|
||||||
|
|
||||||
|
# IF(WIN32)
|
||||||
|
# OPTION(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without openssl" ON)
|
||||||
|
# MARK_AS_ADVANCED(CURL_WINDOWS_SSPI)
|
||||||
|
# ENDIF()
|
||||||
|
|
||||||
|
option(HTTP_ONLY "disables all protocols except HTTP (This overrides all CURL_DISABLE_* options)" OFF)
|
||||||
|
mark_as_advanced(HTTP_ONLY)
|
||||||
|
option(CURL_DISABLE_FTP "disables FTP" OFF)
|
||||||
|
mark_as_advanced(CURL_DISABLE_FTP)
|
||||||
|
option(CURL_DISABLE_LDAP "disables LDAP" OFF)
|
||||||
|
mark_as_advanced(CURL_DISABLE_LDAP)
|
||||||
|
option(CURL_DISABLE_TELNET "disables Telnet" OFF)
|
||||||
|
mark_as_advanced(CURL_DISABLE_TELNET)
|
||||||
|
option(CURL_DISABLE_DICT "disables DICT" OFF)
|
||||||
|
mark_as_advanced(CURL_DISABLE_DICT)
|
||||||
|
option(CURL_DISABLE_FILE "disables FILE" OFF)
|
||||||
|
mark_as_advanced(CURL_DISABLE_FILE)
|
||||||
|
option(CURL_DISABLE_TFTP "disables TFTP" OFF)
|
||||||
|
mark_as_advanced(CURL_DISABLE_TFTP)
|
||||||
|
option(CURL_DISABLE_HTTP "disables HTTP" OFF)
|
||||||
|
mark_as_advanced(CURL_DISABLE_HTTP)
|
||||||
|
|
||||||
|
option(CURL_DISABLE_LDAPS "to disable LDAPS" OFF)
|
||||||
|
mark_as_advanced(CURL_DISABLE_LDAPS)
|
||||||
|
if(WIN32)
|
||||||
|
set(CURL_DEFAULT_DISABLE_LDAP OFF)
|
||||||
|
# some windows compilers do not have wldap32
|
||||||
|
if( NOT HAVE_WLDAP32)
|
||||||
|
set(CURL_DISABLE_LDAP ON CACHE BOOL "" FORCE)
|
||||||
|
message(STATUS "wldap32 not found CURL_DISABLE_LDAP set ON")
|
||||||
|
option(CURL_LDAP_WIN "Use W$ LDAP implementation" OFF)
|
||||||
|
else()
|
||||||
|
option(CURL_LDAP_WIN "Use W$ LDAP implementation" ON)
|
||||||
|
endif()
|
||||||
|
mark_as_advanced(CURL_LDAP_WIN)
|
||||||
|
set(CURL_LDAP_HYBRID OFF)
|
||||||
|
else()
|
||||||
|
option(CURL_LDAP_HYBRID "W$ LDAP with non-W$ compiler" OFF)
|
||||||
|
mark_as_advanced(CURL_LDAP_HYBRID)
|
||||||
|
set(CURL_LDAP_WIN OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(HTTP_ONLY)
|
||||||
|
set(CURL_DISABLE_FTP ON)
|
||||||
|
set(CURL_DISABLE_LDAP ON)
|
||||||
|
set(CURL_DISABLE_TELNET ON)
|
||||||
|
set(CURL_DISABLE_DICT ON)
|
||||||
|
set(CURL_DISABLE_FILE ON)
|
||||||
|
set(CURL_DISABLE_TFTP ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(CURL_DISABLE_COOKIES "to disable cookies support" OFF)
|
||||||
|
mark_as_advanced(CURL_DISABLE_COOKIES)
|
||||||
|
|
||||||
|
option(CURL_DISABLE_CRYPTO_AUTH "to disable cryptographic authentication" OFF)
|
||||||
|
mark_as_advanced(CURL_DISABLE_CRYPTO_AUTH)
|
||||||
|
option(CURL_DISABLE_VERBOSE_STRINGS "to disable verbose strings" OFF)
|
||||||
|
mark_as_advanced(CURL_DISABLE_VERBOSE_STRINGS)
|
||||||
|
option(DISABLED_THREADSAFE "Set to explicitly specify we don't want to use thread-safe functions" OFF)
|
||||||
|
mark_as_advanced(DISABLED_THREADSAFE)
|
||||||
|
option(ENABLE_IPV6 "Define if you want to enable IPv6 support" OFF)
|
||||||
|
mark_as_advanced(ENABLE_IPV6)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
list_spaces_append_once(CMAKE_C_STANDARD_LIBRARIES wsock32.lib ws2_32.lib) # bufferoverflowu.lib
|
||||||
|
if(CURL_DISABLE_LDAP)
|
||||||
|
# Remove wldap32.lib from space-separated list
|
||||||
|
string(REPLACE " " ";" _LIST ${CMAKE_C_STANDARD_LIBRARIES})
|
||||||
|
list(REMOVE_ITEM _LIST "wldap32.lib")
|
||||||
|
to_list_spaces(_LIST CMAKE_C_STANDARD_LIBRARIES)
|
||||||
|
else()
|
||||||
|
# Append wldap32.lib
|
||||||
|
list_spaces_append_once(CMAKE_C_STANDARD_LIBRARIES wldap32.lib)
|
||||||
|
endif()
|
||||||
|
set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}" CACHE STRING "" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
# We need ansi c-flags, especially on HP
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
|
||||||
|
set(CMAKE_REQUIRED_FLAGS ${CMAKE_ANSI_CFLAGS})
|
||||||
|
|
||||||
|
# Disable warnings on Borland to avoid changing 3rd party code.
|
||||||
|
if(BORLAND)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-")
|
||||||
|
endif(BORLAND)
|
||||||
|
|
||||||
|
# If we are on AIX, do the _ALL_SOURCE magic
|
||||||
|
if(${CMAKE_SYSTEM_NAME} MATCHES AIX)
|
||||||
|
set(_ALL_SOURCE 1)
|
||||||
|
endif(${CMAKE_SYSTEM_NAME} MATCHES AIX)
|
||||||
|
|
||||||
|
# Include all the necessary files for macros
|
||||||
|
include (CheckFunctionExists)
|
||||||
|
include (CheckIncludeFile)
|
||||||
|
include (CheckIncludeFiles)
|
||||||
|
include (CheckLibraryExists)
|
||||||
|
include (CheckSymbolExists)
|
||||||
|
# if crosscompiling is on, the CHECK_TYPE_SIZE macro coming with cmake uses
|
||||||
|
# TRY_COMPILE instead of TRY_RUN which makes crosscompiling easier, Alex
|
||||||
|
if(CMAKE_CROSSCOMPILING)
|
||||||
|
include ("${CMAKE_MODULE_PATH}/CheckTypeSize.cmake")
|
||||||
|
else(CMAKE_CROSSCOMPILING)
|
||||||
|
include (CheckTypeSize)
|
||||||
|
endif(CMAKE_CROSSCOMPILING)
|
||||||
|
|
||||||
|
# On windows preload settings
|
||||||
|
if(WIN32)
|
||||||
|
include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/Platforms/WindowsCache.cmake)
|
||||||
|
endif(WIN32)
|
||||||
|
|
||||||
|
# This macro checks if the symbol exists in the library and if it
|
||||||
|
# does, it appends library to the list.
|
||||||
|
macro(CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
|
||||||
|
check_library_exists("${LIBRARY};${CURL_LIBS}" ${SYMBOL} ""
|
||||||
|
${VARIABLE})
|
||||||
|
if(${VARIABLE})
|
||||||
|
set(CURL_LIBS ${CURL_LIBS} ${LIBRARY})
|
||||||
|
endif(${VARIABLE})
|
||||||
|
endmacro(CHECK_LIBRARY_EXISTS_CONCAT)
|
||||||
|
|
||||||
|
# Check for all needed libraries
|
||||||
|
check_library_exists_concat("dl" dlopen HAVE_LIBDL)
|
||||||
|
#CHECK_LIBRARY_EXISTS_CONCAT("ucb" gethostname HAVE_LIBUCB)
|
||||||
|
check_library_exists_concat("socket" connect HAVE_LIBSOCKET)
|
||||||
|
check_library_exists("c" gethostbyname "" NOT_NEED_LIBNSL)
|
||||||
|
|
||||||
|
# Yellowtab Zeta needs different libraries than BeOS 5.
|
||||||
|
if(BEOS)
|
||||||
|
set(NOT_NEED_LIBNSL 1)
|
||||||
|
check_library_exists_concat("bind" gethostbyname HAVE_LIBBIND)
|
||||||
|
check_library_exists_concat("bnetapi" closesocket HAVE_LIBBNETAPI)
|
||||||
|
endif(BEOS)
|
||||||
|
|
||||||
|
if(NOT NOT_NEED_LIBNSL)
|
||||||
|
check_library_exists_concat("nsl" gethostbyname HAVE_LIBNSL)
|
||||||
|
endif(NOT NOT_NEED_LIBNSL)
|
||||||
|
|
||||||
|
check_library_exists_concat("ws2_32" getch HAVE_LIBWS2_32)
|
||||||
|
check_library_exists_concat("winmm" getch HAVE_LIBWINMM)
|
||||||
|
check_library_exists("wldap32" cldap_open "" HAVE_WLDAP32)
|
||||||
|
|
||||||
|
# IF(NOT CURL_SPECIAL_LIBZ)
|
||||||
|
# CHECK_LIBRARY_EXISTS_CONCAT("z" inflateEnd HAVE_LIBZ)
|
||||||
|
# ENDIF(NOT CURL_SPECIAL_LIBZ)
|
||||||
|
|
||||||
|
option(CMAKE_USE_OPENSSL "Use OpenSSL code. Experimental" ON)
|
||||||
|
mark_as_advanced(CMAKE_USE_OPENSSL)
|
||||||
|
if(CMAKE_USE_OPENSSL)
|
||||||
|
if(WIN32)
|
||||||
|
find_package(OpenSSL)
|
||||||
|
if(OPENSSL_FOUND)
|
||||||
|
set(USE_SSLEAY TRUE)
|
||||||
|
set(USE_OPENSSL TRUE)
|
||||||
|
list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES} )
|
||||||
|
endif()
|
||||||
|
#FIND_LIBRARY(LIBEAY NAMES libeay32)
|
||||||
|
#LIST(APPEND CURL_LIBS ${LIBEAY} )
|
||||||
|
else(WIN32)
|
||||||
|
check_library_exists_concat("crypto" CRYPTO_lock HAVE_LIBCRYPTO)
|
||||||
|
check_library_exists_concat("ssl" SSL_connect HAVE_LIBSSL)
|
||||||
|
endif(WIN32)
|
||||||
|
endif(CMAKE_USE_OPENSSL)
|
||||||
|
|
||||||
|
# Check for idn
|
||||||
|
check_library_exists_concat("idn" idna_to_ascii_lz HAVE_LIBIDN)
|
||||||
|
|
||||||
|
# Check for LDAP
|
||||||
|
check_library_exists_concat("ldap" ldap_init HAVE_LIBLDAP)
|
||||||
|
# if(NOT HAVE_LIBLDAP)
|
||||||
|
# SET(CURL_DISABLE_LDAP ON)
|
||||||
|
# endif(NOT HAVE_LIBLDAP)
|
||||||
|
|
||||||
|
# Check for symbol dlopen (same as HAVE_LIBDL)
|
||||||
|
check_library_exists("${CURL_LIBS}" dlopen "" HAVE_DLOPEN)
|
||||||
|
|
||||||
|
# For other tests to use the same libraries
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBS})
|
||||||
|
|
||||||
|
option(CURL_ZLIB "Set to ON to enable building cURL with zlib support." ON)
|
||||||
|
set(HAVE_LIBZ OFF)
|
||||||
|
set(HAVE_ZLIB_H OFF)
|
||||||
|
set(HAVE_ZLIB OFF)
|
||||||
|
if(CURL_ZLIB) # AND CURL_CONFIG_HAS_BEEN_RUN_BEFORE
|
||||||
|
find_package(ZLIB QUIET)
|
||||||
|
if(ZLIB_FOUND)
|
||||||
|
set(HAVE_ZLIB_H ON)
|
||||||
|
set(HAVE_ZLIB ON)
|
||||||
|
set(HAVE_LIBZ ON)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# If we have features.h, then do the _BSD_SOURCE magic
|
||||||
|
check_include_file("features.h" HAVE_FEATURES_H)
|
||||||
|
|
||||||
|
# Check if header file exists and add it to the list.
|
||||||
|
macro(CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
|
||||||
|
check_include_files("${CURL_INCLUDES};${FILE}" ${VARIABLE})
|
||||||
|
if(${VARIABLE})
|
||||||
|
set(CURL_INCLUDES ${CURL_INCLUDES} ${FILE})
|
||||||
|
set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -D${VARIABLE}")
|
||||||
|
endif(${VARIABLE})
|
||||||
|
endmacro(CHECK_INCLUDE_FILE_CONCAT)
|
||||||
|
|
||||||
|
|
||||||
|
# Check for header files
|
||||||
|
if(NOT UNIX)
|
||||||
|
check_include_file_concat("ws2tcpip.h" HAVE_WS2TCPIP_H)
|
||||||
|
check_include_file_concat("winsock2.h" HAVE_WINSOCK2_H)
|
||||||
|
endif(NOT UNIX)
|
||||||
|
check_include_file_concat("stdio.h" HAVE_STDIO_H)
|
||||||
|
if(NOT UNIX)
|
||||||
|
check_include_file_concat("windows.h" HAVE_WINDOWS_H)
|
||||||
|
check_include_file_concat("winsock.h" HAVE_WINSOCK_H)
|
||||||
|
endif(NOT UNIX)
|
||||||
|
|
||||||
|
check_include_file_concat("inttypes.h" HAVE_INTTYPES_H)
|
||||||
|
check_include_file_concat("sys/filio.h" HAVE_SYS_FILIO_H)
|
||||||
|
check_include_file_concat("sys/ioctl.h" HAVE_SYS_IOCTL_H)
|
||||||
|
check_include_file_concat("sys/param.h" HAVE_SYS_PARAM_H)
|
||||||
|
check_include_file_concat("sys/poll.h" HAVE_SYS_POLL_H)
|
||||||
|
check_include_file_concat("sys/resource.h" HAVE_SYS_RESOURCE_H)
|
||||||
|
check_include_file_concat("sys/select.h" HAVE_SYS_SELECT_H)
|
||||||
|
check_include_file_concat("sys/socket.h" HAVE_SYS_SOCKET_H)
|
||||||
|
check_include_file_concat("sys/sockio.h" HAVE_SYS_SOCKIO_H)
|
||||||
|
check_include_file_concat("sys/stat.h" HAVE_SYS_STAT_H)
|
||||||
|
check_include_file_concat("sys/time.h" HAVE_SYS_TIME_H)
|
||||||
|
check_include_file_concat("sys/types.h" HAVE_SYS_TYPES_H)
|
||||||
|
check_include_file_concat("sys/uio.h" HAVE_SYS_UIO_H)
|
||||||
|
check_include_file_concat("sys/un.h" HAVE_SYS_UN_H)
|
||||||
|
check_include_file_concat("sys/utime.h" HAVE_SYS_UTIME_H)
|
||||||
|
check_include_file_concat("alloca.h" HAVE_ALLOCA_H)
|
||||||
|
check_include_file_concat("arpa/inet.h" HAVE_ARPA_INET_H)
|
||||||
|
check_include_file_concat("arpa/tftp.h" HAVE_ARPA_TFTP_H)
|
||||||
|
check_include_file_concat("assert.h" HAVE_ASSERT_H)
|
||||||
|
check_include_file_concat("crypto.h" HAVE_CRYPTO_H)
|
||||||
|
check_include_file_concat("des.h" HAVE_DES_H)
|
||||||
|
check_include_file_concat("err.h" HAVE_ERR_H)
|
||||||
|
check_include_file_concat("errno.h" HAVE_ERRNO_H)
|
||||||
|
check_include_file_concat("fcntl.h" HAVE_FCNTL_H)
|
||||||
|
check_include_file_concat("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H)
|
||||||
|
check_include_file_concat("gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H)
|
||||||
|
check_include_file_concat("gssapi/gssapi_krb5.h" HAVE_GSSAPI_GSSAPI_KRB5_H)
|
||||||
|
check_include_file_concat("idn-free.h" HAVE_IDN_FREE_H)
|
||||||
|
check_include_file_concat("ifaddrs.h" HAVE_IFADDRS_H)
|
||||||
|
check_include_file_concat("io.h" HAVE_IO_H)
|
||||||
|
check_include_file_concat("krb.h" HAVE_KRB_H)
|
||||||
|
check_include_file_concat("libgen.h" HAVE_LIBGEN_H)
|
||||||
|
check_include_file_concat("libssh2.h" HAVE_LIBSSH2_H)
|
||||||
|
check_include_file_concat("limits.h" HAVE_LIMITS_H)
|
||||||
|
check_include_file_concat("locale.h" HAVE_LOCALE_H)
|
||||||
|
check_include_file_concat("net/if.h" HAVE_NET_IF_H)
|
||||||
|
check_include_file_concat("netdb.h" HAVE_NETDB_H)
|
||||||
|
check_include_file_concat("netinet/in.h" HAVE_NETINET_IN_H)
|
||||||
|
check_include_file_concat("netinet/tcp.h" HAVE_NETINET_TCP_H)
|
||||||
|
check_include_file_concat("openssl/crypto.h" HAVE_OPENSSL_CRYPTO_H)
|
||||||
|
check_include_file_concat("openssl/engine.h" HAVE_OPENSSL_ENGINE_H)
|
||||||
|
check_include_file_concat("openssl/err.h" HAVE_OPENSSL_ERR_H)
|
||||||
|
check_include_file_concat("openssl/pem.h" HAVE_OPENSSL_PEM_H)
|
||||||
|
check_include_file_concat("openssl/pkcs12.h" HAVE_OPENSSL_PKCS12_H)
|
||||||
|
check_include_file_concat("openssl/rsa.h" HAVE_OPENSSL_RSA_H)
|
||||||
|
check_include_file_concat("openssl/ssl.h" HAVE_OPENSSL_SSL_H)
|
||||||
|
check_include_file_concat("openssl/x509.h" HAVE_OPENSSL_X509_H)
|
||||||
|
check_include_file_concat("pem.h" HAVE_PEM_H)
|
||||||
|
check_include_file_concat("poll.h" HAVE_POLL_H)
|
||||||
|
check_include_file_concat("pwd.h" HAVE_PWD_H)
|
||||||
|
check_include_file_concat("rsa.h" HAVE_RSA_H)
|
||||||
|
check_include_file_concat("setjmp.h" HAVE_SETJMP_H)
|
||||||
|
check_include_file_concat("sgtty.h" HAVE_SGTTY_H)
|
||||||
|
check_include_file_concat("signal.h" HAVE_SIGNAL_H)
|
||||||
|
check_include_file_concat("ssl.h" HAVE_SSL_H)
|
||||||
|
check_include_file_concat("stdbool.h" HAVE_STDBOOL_H)
|
||||||
|
check_include_file_concat("stdint.h" HAVE_STDINT_H)
|
||||||
|
check_include_file_concat("stdio.h" HAVE_STDIO_H)
|
||||||
|
check_include_file_concat("stdlib.h" HAVE_STDLIB_H)
|
||||||
|
check_include_file_concat("string.h" HAVE_STRING_H)
|
||||||
|
check_include_file_concat("strings.h" HAVE_STRINGS_H)
|
||||||
|
check_include_file_concat("stropts.h" HAVE_STROPTS_H)
|
||||||
|
check_include_file_concat("termio.h" HAVE_TERMIO_H)
|
||||||
|
check_include_file_concat("termios.h" HAVE_TERMIOS_H)
|
||||||
|
check_include_file_concat("time.h" HAVE_TIME_H)
|
||||||
|
check_include_file_concat("tld.h" HAVE_TLD_H)
|
||||||
|
check_include_file_concat("unistd.h" HAVE_UNISTD_H)
|
||||||
|
check_include_file_concat("utime.h" HAVE_UTIME_H)
|
||||||
|
check_include_file_concat("x509.h" HAVE_X509_H)
|
||||||
|
|
||||||
|
check_include_file_concat("process.h" HAVE_PROCESS_H)
|
||||||
|
check_include_file_concat("stddef.h" HAVE_STDDEF_H)
|
||||||
|
check_include_file_concat("dlfcn.h" HAVE_DLFCN_H)
|
||||||
|
check_include_file_concat("malloc.h" HAVE_MALLOC_H)
|
||||||
|
check_include_file_concat("memory.h" HAVE_MEMORY_H)
|
||||||
|
check_include_file_concat("ldap.h" HAVE_LDAP_H)
|
||||||
|
check_include_file_concat("netinet/if_ether.h" HAVE_NETINET_IF_ETHER_H)
|
||||||
|
check_include_file_concat("stdint.h" HAVE_STDINT_H)
|
||||||
|
check_include_file_concat("sockio.h" HAVE_SOCKIO_H)
|
||||||
|
check_include_file_concat("sys/utsname.h" HAVE_SYS_UTSNAME_H)
|
||||||
|
check_include_file_concat("idna.h" HAVE_IDNA_H)
|
||||||
|
|
||||||
|
if(CMAKE_USE_OPENSSL)
|
||||||
|
check_include_file_concat("openssl/rand.h" HAVE_OPENSSL_RAND_H)
|
||||||
|
endif(CMAKE_USE_OPENSSL)
|
||||||
|
|
||||||
|
|
||||||
|
check_type_size(size_t SIZEOF_SIZE_T)
|
||||||
|
check_type_size(ssize_t SIZEOF_SSIZE_T)
|
||||||
|
check_type_size("long long" SIZEOF_LONG_LONG)
|
||||||
|
check_type_size("long" SIZEOF_LONG)
|
||||||
|
check_type_size("int" SIZEOF_INT)
|
||||||
|
check_type_size("__int64" SIZEOF___INT64)
|
||||||
|
check_type_size("long double" SIZEOF_LONG_DOUBLE)
|
||||||
|
check_type_size("time_t" SIZEOF_TIME_T)
|
||||||
|
if(NOT HAVE_SIZEOF_SSIZE_T)
|
||||||
|
if(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
|
||||||
|
set(ssize_t long)
|
||||||
|
endif(SIZEOF_LONG EQUAL SIZEOF_SIZE_T)
|
||||||
|
if(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
|
||||||
|
set(ssize_t __int64)
|
||||||
|
endif(NOT ssize_t AND SIZEOF___INT64 EQUAL SIZEOF_SIZE_T)
|
||||||
|
endif(NOT HAVE_SIZEOF_SSIZE_T)
|
||||||
|
|
||||||
|
# Different sizeofs, etc.
|
||||||
|
|
||||||
|
# define CURL_SIZEOF_LONG 4
|
||||||
|
# define CURL_TYPEOF_CURL_OFF_T long long
|
||||||
|
# define CURL_FORMAT_CURL_OFF_T "lld"
|
||||||
|
# define CURL_FORMAT_CURL_OFF_TU "llu"
|
||||||
|
# define CURL_FORMAT_OFF_T "%lld"
|
||||||
|
# define CURL_SIZEOF_CURL_OFF_T 8
|
||||||
|
# define CURL_SUFFIX_CURL_OFF_T LL
|
||||||
|
# define CURL_SUFFIX_CURL_OFF_TU ULL
|
||||||
|
|
||||||
|
set(CURL_SIZEOF_LONG ${SIZEOF_LONG})
|
||||||
|
|
||||||
|
if(SIZEOF_LONG EQUAL 8)
|
||||||
|
set(CURL_TYPEOF_CURL_OFF_T long)
|
||||||
|
set(CURL_SIZEOF_CURL_OFF_T 8)
|
||||||
|
set(CURL_FORMAT_CURL_OFF_T "ld")
|
||||||
|
set(CURL_FORMAT_CURL_OFF_TU "lu")
|
||||||
|
set(CURL_FORMAT_OFF_T "%ld")
|
||||||
|
set(CURL_SUFFIX_CURL_OFF_T L)
|
||||||
|
set(CURL_SUFFIX_CURL_OFF_TU LU)
|
||||||
|
endif(SIZEOF_LONG EQUAL 8)
|
||||||
|
|
||||||
|
if(SIZEOF_LONG_LONG EQUAL 8)
|
||||||
|
set(CURL_TYPEOF_CURL_OFF_T "long long")
|
||||||
|
set(CURL_SIZEOF_CURL_OFF_T 8)
|
||||||
|
set(CURL_FORMAT_CURL_OFF_T "lld")
|
||||||
|
set(CURL_FORMAT_CURL_OFF_TU "llu")
|
||||||
|
set(CURL_FORMAT_OFF_T "%lld")
|
||||||
|
set(CURL_SUFFIX_CURL_OFF_T LL)
|
||||||
|
set(CURL_SUFFIX_CURL_OFF_TU LLU)
|
||||||
|
endif(SIZEOF_LONG_LONG EQUAL 8)
|
||||||
|
|
||||||
|
if(NOT CURL_TYPEOF_CURL_OFF_T)
|
||||||
|
set(CURL_TYPEOF_CURL_OFF_T ${ssize_t})
|
||||||
|
set(CURL_SIZEOF_CURL_OFF_T ${SIZEOF_SSIZE_T})
|
||||||
|
# TODO: need adjustment here.
|
||||||
|
set(CURL_FORMAT_CURL_OFF_T "ld")
|
||||||
|
set(CURL_FORMAT_CURL_OFF_TU "lu")
|
||||||
|
set(CURL_FORMAT_OFF_T "%ld")
|
||||||
|
set(CURL_SUFFIX_CURL_OFF_T L)
|
||||||
|
set(CURL_SUFFIX_CURL_OFF_TU LU)
|
||||||
|
endif(NOT CURL_TYPEOF_CURL_OFF_T)
|
||||||
|
|
||||||
|
if(HAVE_SIZEOF_LONG_LONG)
|
||||||
|
set(HAVE_LONGLONG 1)
|
||||||
|
set(HAVE_LL 1)
|
||||||
|
endif(HAVE_SIZEOF_LONG_LONG)
|
||||||
|
|
||||||
|
find_file(RANDOM_FILE urandom /dev)
|
||||||
|
mark_as_advanced(RANDOM_FILE)
|
||||||
|
|
||||||
|
# Check for some functions that are used
|
||||||
|
check_symbol_exists(basename "${CURL_INCLUDES}" HAVE_BASENAME)
|
||||||
|
check_symbol_exists(socket "${CURL_INCLUDES}" HAVE_SOCKET)
|
||||||
|
check_symbol_exists(poll "${CURL_INCLUDES}" HAVE_POLL)
|
||||||
|
check_symbol_exists(select "${CURL_INCLUDES}" HAVE_SELECT)
|
||||||
|
check_symbol_exists(strdup "${CURL_INCLUDES}" HAVE_STRDUP)
|
||||||
|
check_symbol_exists(strstr "${CURL_INCLUDES}" HAVE_STRSTR)
|
||||||
|
check_symbol_exists(strtok_r "${CURL_INCLUDES}" HAVE_STRTOK_R)
|
||||||
|
check_symbol_exists(strftime "${CURL_INCLUDES}" HAVE_STRFTIME)
|
||||||
|
check_symbol_exists(uname "${CURL_INCLUDES}" HAVE_UNAME)
|
||||||
|
check_symbol_exists(strcasecmp "${CURL_INCLUDES}" HAVE_STRCASECMP)
|
||||||
|
check_symbol_exists(stricmp "${CURL_INCLUDES}" HAVE_STRICMP)
|
||||||
|
check_symbol_exists(strcmpi "${CURL_INCLUDES}" HAVE_STRCMPI)
|
||||||
|
check_symbol_exists(strncmpi "${CURL_INCLUDES}" HAVE_STRNCMPI)
|
||||||
|
check_symbol_exists(alarm "${CURL_INCLUDES}" HAVE_ALARM)
|
||||||
|
if(NOT HAVE_STRNCMPI)
|
||||||
|
set(HAVE_STRCMPI)
|
||||||
|
endif(NOT HAVE_STRNCMPI)
|
||||||
|
check_symbol_exists(gethostbyaddr "${CURL_INCLUDES}" HAVE_GETHOSTBYADDR)
|
||||||
|
check_symbol_exists(gethostbyaddr_r "${CURL_INCLUDES}" HAVE_GETHOSTBYADDR_R)
|
||||||
|
check_symbol_exists(gettimeofday "${CURL_INCLUDES}" HAVE_GETTIMEOFDAY)
|
||||||
|
check_symbol_exists(inet_addr "${CURL_INCLUDES}" HAVE_INET_ADDR)
|
||||||
|
check_symbol_exists(inet_ntoa "${CURL_INCLUDES}" HAVE_INET_NTOA)
|
||||||
|
check_symbol_exists(inet_ntoa_r "${CURL_INCLUDES}" HAVE_INET_NTOA_R)
|
||||||
|
check_symbol_exists(tcsetattr "${CURL_INCLUDES}" HAVE_TCSETATTR)
|
||||||
|
check_symbol_exists(tcgetattr "${CURL_INCLUDES}" HAVE_TCGETATTR)
|
||||||
|
check_symbol_exists(perror "${CURL_INCLUDES}" HAVE_PERROR)
|
||||||
|
check_symbol_exists(closesocket "${CURL_INCLUDES}" HAVE_CLOSESOCKET)
|
||||||
|
check_symbol_exists(setvbuf "${CURL_INCLUDES}" HAVE_SETVBUF)
|
||||||
|
check_symbol_exists(sigsetjmp "${CURL_INCLUDES}" HAVE_SIGSETJMP)
|
||||||
|
check_symbol_exists(getpass_r "${CURL_INCLUDES}" HAVE_GETPASS_R)
|
||||||
|
check_symbol_exists(strlcat "${CURL_INCLUDES}" HAVE_STRLCAT)
|
||||||
|
check_symbol_exists(getpwuid "${CURL_INCLUDES}" HAVE_GETPWUID)
|
||||||
|
check_symbol_exists(geteuid "${CURL_INCLUDES}" HAVE_GETEUID)
|
||||||
|
check_symbol_exists(utime "${CURL_INCLUDES}" HAVE_UTIME)
|
||||||
|
if(CMAKE_USE_OPENSSL)
|
||||||
|
check_symbol_exists(RAND_status "${CURL_INCLUDES}" HAVE_RAND_STATUS)
|
||||||
|
check_symbol_exists(RAND_screen "${CURL_INCLUDES}" HAVE_RAND_SCREEN)
|
||||||
|
check_symbol_exists(RAND_egd "${CURL_INCLUDES}" HAVE_RAND_EGD)
|
||||||
|
check_symbol_exists(CRYPTO_cleanup_all_ex_data "${CURL_INCLUDES}"
|
||||||
|
HAVE_CRYPTO_CLEANUP_ALL_EX_DATA)
|
||||||
|
if(HAVE_LIBCRYPTO AND HAVE_LIBSSL)
|
||||||
|
set(USE_OPENSSL 1)
|
||||||
|
set(USE_SSLEAY 1)
|
||||||
|
endif(HAVE_LIBCRYPTO AND HAVE_LIBSSL)
|
||||||
|
endif(CMAKE_USE_OPENSSL)
|
||||||
|
check_symbol_exists(gmtime_r "${CURL_INCLUDES}" HAVE_GMTIME_R)
|
||||||
|
check_symbol_exists(localtime_r "${CURL_INCLUDES}" HAVE_LOCALTIME_R)
|
||||||
|
|
||||||
|
check_symbol_exists(gethostbyname "${CURL_INCLUDES}" HAVE_GETHOSTBYNAME)
|
||||||
|
check_symbol_exists(gethostbyname_r "${CURL_INCLUDES}" HAVE_GETHOSTBYNAME_R)
|
||||||
|
|
||||||
|
check_symbol_exists(signal "${CURL_INCLUDES}" HAVE_SIGNAL_FUNC)
|
||||||
|
check_symbol_exists(SIGALRM "${CURL_INCLUDES}" HAVE_SIGNAL_MACRO)
|
||||||
|
if(HAVE_SIGNAL_FUNC AND HAVE_SIGNAL_MACRO)
|
||||||
|
set(HAVE_SIGNAL 1)
|
||||||
|
endif(HAVE_SIGNAL_FUNC AND HAVE_SIGNAL_MACRO)
|
||||||
|
check_symbol_exists(uname "${CURL_INCLUDES}" HAVE_UNAME)
|
||||||
|
check_symbol_exists(strtoll "${CURL_INCLUDES}" HAVE_STRTOLL)
|
||||||
|
check_symbol_exists(_strtoi64 "${CURL_INCLUDES}" HAVE__STRTOI64)
|
||||||
|
check_symbol_exists(strerror_r "${CURL_INCLUDES}" HAVE_STRERROR_R)
|
||||||
|
check_symbol_exists(siginterrupt "${CURL_INCLUDES}" HAVE_SIGINTERRUPT)
|
||||||
|
check_symbol_exists(perror "${CURL_INCLUDES}" HAVE_PERROR)
|
||||||
|
check_symbol_exists(fork "${CURL_INCLUDES}" HAVE_FORK)
|
||||||
|
check_symbol_exists(freeaddrinfo "${CURL_INCLUDES}" HAVE_FREEADDRINFO)
|
||||||
|
check_symbol_exists(freeifaddrs "${CURL_INCLUDES}" HAVE_FREEIFADDRS)
|
||||||
|
check_symbol_exists(pipe "${CURL_INCLUDES}" HAVE_PIPE)
|
||||||
|
check_symbol_exists(ftruncate "${CURL_INCLUDES}" HAVE_FTRUNCATE)
|
||||||
|
check_symbol_exists(getprotobyname "${CURL_INCLUDES}" HAVE_GETPROTOBYNAME)
|
||||||
|
check_symbol_exists(getrlimit "${CURL_INCLUDES}" HAVE_GETRLIMIT)
|
||||||
|
check_symbol_exists(idn_free "${CURL_INCLUDES}" HAVE_IDN_FREE)
|
||||||
|
check_symbol_exists(idna_strerror "${CURL_INCLUDES}" HAVE_IDNA_STRERROR)
|
||||||
|
check_symbol_exists(tld_strerror "${CURL_INCLUDES}" HAVE_TLD_STRERROR)
|
||||||
|
check_symbol_exists(setlocale "${CURL_INCLUDES}" HAVE_SETLOCALE)
|
||||||
|
check_symbol_exists(setrlimit "${CURL_INCLUDES}" HAVE_SETRLIMIT)
|
||||||
|
check_symbol_exists(fcntl "${CURL_INCLUDES}" HAVE_FCNTL)
|
||||||
|
check_symbol_exists(ioctl "${CURL_INCLUDES}" HAVE_IOCTL)
|
||||||
|
check_symbol_exists(setsockopt "${CURL_INCLUDES}" HAVE_SETSOCKOPT)
|
||||||
|
|
||||||
|
# symbol exists in win32, but function does not.
|
||||||
|
check_function_exists(inet_pton HAVE_INET_PTON)
|
||||||
|
|
||||||
|
# sigaction and sigsetjmp are special. Use special mechanism for
|
||||||
|
# detecting those, but only if previous attempt failed.
|
||||||
|
if(HAVE_SIGNAL_H)
|
||||||
|
check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
|
||||||
|
endif(HAVE_SIGNAL_H)
|
||||||
|
|
||||||
|
if(NOT HAVE_SIGSETJMP)
|
||||||
|
if(HAVE_SETJMP_H)
|
||||||
|
check_symbol_exists(sigsetjmp "setjmp.h" HAVE_MACRO_SIGSETJMP)
|
||||||
|
if(HAVE_MACRO_SIGSETJMP)
|
||||||
|
set(HAVE_SIGSETJMP 1)
|
||||||
|
endif(HAVE_MACRO_SIGSETJMP)
|
||||||
|
endif(HAVE_SETJMP_H)
|
||||||
|
endif(NOT HAVE_SIGSETJMP)
|
||||||
|
|
||||||
|
# If there is no stricmp(), do not allow LDAP to parse URLs
|
||||||
|
if(NOT HAVE_STRICMP)
|
||||||
|
set(HAVE_LDAP_URL_PARSE 1)
|
||||||
|
endif(NOT HAVE_STRICMP)
|
||||||
|
|
||||||
|
# For other curl specific tests, use this macro.
|
||||||
|
macro(CURL_INTERNAL_TEST CURL_TEST)
|
||||||
|
if("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
|
||||||
|
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||||
|
"-D${CURL_TEST} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS}")
|
||||||
|
if(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
set(CURL_TEST_ADD_LIBRARIES
|
||||||
|
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||||
|
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
|
||||||
|
message(STATUS "Performing Curl Test ${CURL_TEST}")
|
||||||
|
try_compile(${CURL_TEST}
|
||||||
|
${CMAKE_BINARY_DIR}
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c
|
||||||
|
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
|
||||||
|
"${CURL_TEST_ADD_LIBRARIES}"
|
||||||
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
if(${CURL_TEST})
|
||||||
|
set(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||||
|
message(STATUS "Performing Curl Test ${CURL_TEST} - Success")
|
||||||
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
|
"Performing Curl Test ${CURL_TEST} passed with the following output:\n"
|
||||||
|
"${OUTPUT}\n")
|
||||||
|
else(${CURL_TEST})
|
||||||
|
message(STATUS "Performing Curl Test ${CURL_TEST} - Failed")
|
||||||
|
set(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||||
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
|
"Performing Curl Test ${CURL_TEST} failed with the following output:\n"
|
||||||
|
"${OUTPUT}\n")
|
||||||
|
endif(${CURL_TEST})
|
||||||
|
endif("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
|
||||||
|
endmacro(CURL_INTERNAL_TEST)
|
||||||
|
|
||||||
|
macro(CURL_INTERNAL_TEST_RUN CURL_TEST)
|
||||||
|
if("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$")
|
||||||
|
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||||
|
"-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}")
|
||||||
|
if(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
set(CURL_TEST_ADD_LIBRARIES
|
||||||
|
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
|
||||||
|
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||||
|
|
||||||
|
message(STATUS "Performing Curl Test ${CURL_TEST}")
|
||||||
|
try_run(${CURL_TEST} ${CURL_TEST}_COMPILE
|
||||||
|
${CMAKE_BINARY_DIR}
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/CMake/CurlTests.c
|
||||||
|
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
|
||||||
|
"${CURL_TEST_ADD_LIBRARIES}"
|
||||||
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
if(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
|
||||||
|
set(${CURL_TEST} 1 CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||||
|
message(STATUS "Performing Curl Test ${CURL_TEST} - Success")
|
||||||
|
else(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
|
||||||
|
message(STATUS "Performing Curl Test ${CURL_TEST} - Failed")
|
||||||
|
set(${CURL_TEST} "" CACHE INTERNAL "Curl test ${FUNCTION}")
|
||||||
|
file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
|
||||||
|
"Performing Curl Test ${CURL_TEST} failed with the following output:\n"
|
||||||
|
"${OUTPUT}")
|
||||||
|
if(${CURL_TEST}_COMPILE)
|
||||||
|
file(APPEND
|
||||||
|
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
|
||||||
|
"There was a problem running this test\n")
|
||||||
|
endif(${CURL_TEST}_COMPILE)
|
||||||
|
file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log"
|
||||||
|
"\n\n")
|
||||||
|
endif(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST})
|
||||||
|
endif("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$")
|
||||||
|
endmacro(CURL_INTERNAL_TEST_RUN)
|
||||||
|
|
||||||
|
# Do curl specific tests
|
||||||
|
foreach(CURL_TEST
|
||||||
|
HAVE_FCNTL_O_NONBLOCK
|
||||||
|
HAVE_IOCTLSOCKET
|
||||||
|
HAVE_IOCTLSOCKET_CAMEL
|
||||||
|
HAVE_IOCTLSOCKET_CAMEL_FIONBIO
|
||||||
|
HAVE_IOCTLSOCKET_FIONBIO
|
||||||
|
HAVE_IOCTL_FIONBIO
|
||||||
|
HAVE_IOCTL_SIOCGIFADDR
|
||||||
|
HAVE_SETSOCKOPT_SO_NONBLOCK
|
||||||
|
HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
||||||
|
TIME_WITH_SYS_TIME
|
||||||
|
HAVE_O_NONBLOCK
|
||||||
|
HAVE_GETHOSTBYADDR_R_5
|
||||||
|
HAVE_GETHOSTBYADDR_R_7
|
||||||
|
HAVE_GETHOSTBYADDR_R_8
|
||||||
|
HAVE_GETHOSTBYADDR_R_5_REENTRANT
|
||||||
|
HAVE_GETHOSTBYADDR_R_7_REENTRANT
|
||||||
|
HAVE_GETHOSTBYADDR_R_8_REENTRANT
|
||||||
|
HAVE_GETHOSTBYNAME_R_3
|
||||||
|
HAVE_GETHOSTBYNAME_R_5
|
||||||
|
HAVE_GETHOSTBYNAME_R_6
|
||||||
|
HAVE_GETHOSTBYNAME_R_3_REENTRANT
|
||||||
|
HAVE_GETHOSTBYNAME_R_5_REENTRANT
|
||||||
|
HAVE_GETHOSTBYNAME_R_6_REENTRANT
|
||||||
|
HAVE_SOCKLEN_T
|
||||||
|
HAVE_IN_ADDR_T
|
||||||
|
HAVE_BOOL_T
|
||||||
|
STDC_HEADERS
|
||||||
|
RETSIGTYPE_TEST
|
||||||
|
HAVE_INET_NTOA_R_DECL
|
||||||
|
HAVE_INET_NTOA_R_DECL_REENTRANT
|
||||||
|
HAVE_GETADDRINFO
|
||||||
|
HAVE_FILE_OFFSET_BITS
|
||||||
|
)
|
||||||
|
curl_internal_test(${CURL_TEST})
|
||||||
|
endforeach(CURL_TEST)
|
||||||
|
if(HAVE_FILE_OFFSET_BITS)
|
||||||
|
set(_FILE_OFFSET_BITS 64)
|
||||||
|
endif(HAVE_FILE_OFFSET_BITS)
|
||||||
|
foreach(CURL_TEST
|
||||||
|
HAVE_GLIBC_STRERROR_R
|
||||||
|
HAVE_POSIX_STRERROR_R
|
||||||
|
)
|
||||||
|
curl_internal_test_run(${CURL_TEST})
|
||||||
|
endforeach(CURL_TEST)
|
||||||
|
|
||||||
|
# Check for reentrant
|
||||||
|
foreach(CURL_TEST
|
||||||
|
HAVE_GETHOSTBYADDR_R_5
|
||||||
|
HAVE_GETHOSTBYADDR_R_7
|
||||||
|
HAVE_GETHOSTBYADDR_R_8
|
||||||
|
HAVE_GETHOSTBYNAME_R_3
|
||||||
|
HAVE_GETHOSTBYNAME_R_5
|
||||||
|
HAVE_GETHOSTBYNAME_R_6
|
||||||
|
HAVE_INET_NTOA_R_DECL_REENTRANT)
|
||||||
|
if(NOT ${CURL_TEST})
|
||||||
|
if(${CURL_TEST}_REENTRANT)
|
||||||
|
set(NEED_REENTRANT 1)
|
||||||
|
endif(${CURL_TEST}_REENTRANT)
|
||||||
|
endif(NOT ${CURL_TEST})
|
||||||
|
endforeach(CURL_TEST)
|
||||||
|
|
||||||
|
if(NEED_REENTRANT)
|
||||||
|
foreach(CURL_TEST
|
||||||
|
HAVE_GETHOSTBYADDR_R_5
|
||||||
|
HAVE_GETHOSTBYADDR_R_7
|
||||||
|
HAVE_GETHOSTBYADDR_R_8
|
||||||
|
HAVE_GETHOSTBYNAME_R_3
|
||||||
|
HAVE_GETHOSTBYNAME_R_5
|
||||||
|
HAVE_GETHOSTBYNAME_R_6)
|
||||||
|
set(${CURL_TEST} 0)
|
||||||
|
if(${CURL_TEST}_REENTRANT)
|
||||||
|
set(${CURL_TEST} 1)
|
||||||
|
endif(${CURL_TEST}_REENTRANT)
|
||||||
|
endforeach(CURL_TEST)
|
||||||
|
endif(NEED_REENTRANT)
|
||||||
|
|
||||||
|
if(HAVE_INET_NTOA_R_DECL_REENTRANT)
|
||||||
|
set(HAVE_INET_NTOA_R_DECL 1)
|
||||||
|
set(NEED_REENTRANT 1)
|
||||||
|
endif(HAVE_INET_NTOA_R_DECL_REENTRANT)
|
||||||
|
|
||||||
|
# Some other minor tests
|
||||||
|
|
||||||
|
if(NOT HAVE_IN_ADDR_T)
|
||||||
|
set(in_addr_t "unsigned long")
|
||||||
|
endif(NOT HAVE_IN_ADDR_T)
|
||||||
|
|
||||||
|
# Fix libz / zlib.h
|
||||||
|
|
||||||
|
if(NOT CURL_SPECIAL_LIBZ)
|
||||||
|
if(NOT HAVE_LIBZ)
|
||||||
|
set(HAVE_ZLIB_H 0)
|
||||||
|
endif(NOT HAVE_LIBZ)
|
||||||
|
|
||||||
|
if(NOT HAVE_ZLIB_H)
|
||||||
|
set(HAVE_LIBZ 0)
|
||||||
|
endif(NOT HAVE_ZLIB_H)
|
||||||
|
endif(NOT CURL_SPECIAL_LIBZ)
|
||||||
|
|
||||||
|
if(_FILE_OFFSET_BITS)
|
||||||
|
set(_FILE_OFFSET_BITS 64)
|
||||||
|
endif(_FILE_OFFSET_BITS)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS "-D_FILE_OFFSET_BITS=64")
|
||||||
|
set(CMAKE_EXTRA_INCLUDE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/curl/curl.h")
|
||||||
|
check_type_size("curl_off_t" SIZEOF_CURL_OFF_T)
|
||||||
|
set(CMAKE_EXTRA_INCLUDE_FILES)
|
||||||
|
set(CMAKE_REQUIRED_FLAGS)
|
||||||
|
|
||||||
|
|
||||||
|
# Check for nonblocking
|
||||||
|
set(HAVE_DISABLED_NONBLOCKING 1)
|
||||||
|
if(HAVE_FIONBIO OR
|
||||||
|
HAVE_IOCTLSOCKET OR
|
||||||
|
HAVE_IOCTLSOCKET_CASE OR
|
||||||
|
HAVE_O_NONBLOCK)
|
||||||
|
set(HAVE_DISABLED_NONBLOCKING)
|
||||||
|
endif(HAVE_FIONBIO OR
|
||||||
|
HAVE_IOCTLSOCKET OR
|
||||||
|
HAVE_IOCTLSOCKET_CASE OR
|
||||||
|
HAVE_O_NONBLOCK)
|
||||||
|
|
||||||
|
if(RETSIGTYPE_TEST)
|
||||||
|
set(RETSIGTYPE void)
|
||||||
|
else(RETSIGTYPE_TEST)
|
||||||
|
set(RETSIGTYPE int)
|
||||||
|
endif(RETSIGTYPE_TEST)
|
||||||
|
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCC AND APPLE)
|
||||||
|
include(CheckCCompilerFlag)
|
||||||
|
check_c_compiler_flag(-Wno-long-double HAVE_C_FLAG_Wno_long_double)
|
||||||
|
if(HAVE_C_FLAG_Wno_long_double)
|
||||||
|
# The Mac version of GCC warns about use of long double. Disable it.
|
||||||
|
get_source_file_property(MPRINTF_COMPILE_FLAGS mprintf.c COMPILE_FLAGS)
|
||||||
|
if(MPRINTF_COMPILE_FLAGS)
|
||||||
|
set(MPRINTF_COMPILE_FLAGS "${MPRINTF_COMPILE_FLAGS} -Wno-long-double")
|
||||||
|
else(MPRINTF_COMPILE_FLAGS)
|
||||||
|
set(MPRINTF_COMPILE_FLAGS "-Wno-long-double")
|
||||||
|
endif(MPRINTF_COMPILE_FLAGS)
|
||||||
|
set_source_files_properties(mprintf.c PROPERTIES
|
||||||
|
COMPILE_FLAGS ${MPRINTF_COMPILE_FLAGS})
|
||||||
|
endif(HAVE_C_FLAG_Wno_long_double)
|
||||||
|
endif(CMAKE_COMPILER_IS_GNUCC AND APPLE)
|
||||||
|
|
||||||
|
if(HAVE_SOCKLEN_T)
|
||||||
|
set(CURL_TYPEOF_CURL_SOCKLEN_T "socklen_t")
|
||||||
|
check_type_size("socklen_t" CURL_SIZEOF_CURL_SOCKLEN_T)
|
||||||
|
else()
|
||||||
|
set(CURL_TYPEOF_CURL_SOCKLEN_T int)
|
||||||
|
set(CURL_SIZEOF_CURL_SOCKLEN_T ${SIZEOF_INT})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(CMake/OtherTests.cmake)
|
||||||
|
|
||||||
|
add_definitions(-DHAVE_CONFIG_H)
|
||||||
|
|
||||||
|
# For windows, do not allow the compiler to use default target (Vista).
|
||||||
|
if(WIN32)
|
||||||
|
add_definitions(-D_WIN32_WINNT=0x0501)
|
||||||
|
endif(WIN32)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
|
endif(MSVC)
|
||||||
|
|
||||||
|
# Sets up the dependencies (zlib, OpenSSL, etc.) of a cURL subproject according to options.
|
||||||
|
# TODO This is far to be complete!
|
||||||
|
function(SETUP_CURL_DEPENDENCIES TARGET_NAME)
|
||||||
|
if(CURL_ZLIB AND ZLIB_FOUND)
|
||||||
|
include_directories(${ZLIB_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
if(CURL_ZLIB AND ZLIB_FOUND)
|
||||||
|
target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES})
|
||||||
|
#ADD_DEFINITIONS( -DHAVE_ZLIB_H -DHAVE_ZLIB -DHAVE_LIBZ )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_USE_OPENSSL AND OPENSSL_FOUND)
|
||||||
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
if(CMAKE_USE_OPENSSL AND CURL_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||||
|
target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES})
|
||||||
|
#ADD_DEFINITIONS( -DUSE_SSLEAY )
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Ugly (but functional) way to include "Makefile.inc" by transforming it (= regenerate it).
|
||||||
|
function(TRANSFORM_MAKEFILE_INC INPUT_FILE OUTPUT_FILE)
|
||||||
|
file(READ ${INPUT_FILE} MAKEFILE_INC_TEXT)
|
||||||
|
string(REPLACE "$(top_srcdir)" "\${CURL_SOURCE_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
string(REPLACE "$(top_builddir)" "\${CURL_BINARY_DIR}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
|
||||||
|
string(REGEX REPLACE "\\\\\n" "<22>!<21>" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*\n)" "SET(\\1 \\2)\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
string(REPLACE "<22>!<21>" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
|
||||||
|
string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace $() with ${}
|
||||||
|
string(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace @@ with ${}, even if that may not be read by CMake scripts.
|
||||||
|
file(WRITE ${OUTPUT_FILE} ${MAKEFILE_INC_TEXT})
|
||||||
|
|
||||||
|
### BUGGY METHOD 1
|
||||||
|
# FILE(STRINGS Makefile.inc MAKEFILE_INC_TEXT)
|
||||||
|
# STRING(REPLACE "# ./lib/Makefile.inc" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
# STRING(REPLACE " " " " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace tabs with spaces
|
||||||
|
|
||||||
|
# #STRING(REGEX MATCH "CSOURCES *=" AAA ${MAKEFILE_INC_TEXT})
|
||||||
|
# #MESSAGE(STATUS ${AAA})
|
||||||
|
|
||||||
|
# STRING(REPLACE "CSOURCES =" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
# STRING(REPLACE "HHEADERS =" "" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
|
||||||
|
# STRING(REGEX REPLACE "[^ ]+\\.c" "" ${HEADERS_VAR} ${MAKEFILE_INC_TEXT}) # Remove source files and store into headers var
|
||||||
|
# STRING(REGEX REPLACE " +" " " ${HEADERS_VAR} ${${HEADERS_VAR}})
|
||||||
|
# STRING(REGEX REPLACE " " ";" ${HEADERS_VAR} ${${HEADERS_VAR}})
|
||||||
|
|
||||||
|
# STRING(REGEX REPLACE "[^ ]+\\.h" "" ${SOURCES_VAR} ${MAKEFILE_INC_TEXT}) # Remove headers and store into source files var
|
||||||
|
# STRING(REGEX REPLACE " +" " " ${SOURCES_VAR} ${${SOURCES_VAR}})
|
||||||
|
# STRING(REGEX REPLACE " " ";" ${SOURCES_VAR} ${${SOURCES_VAR}})
|
||||||
|
|
||||||
|
# SET(${HEADERS_VAR} ${${HEADERS_VAR}} PARENT_SCOPE)
|
||||||
|
# SET(${SOURCES_VAR} ${${SOURCES_VAR}} PARENT_SCOPE)
|
||||||
|
|
||||||
|
### BUGGY METHOD 2
|
||||||
|
# FILE(READ Makefile.inc MAKEFILE_INC_TEXT)
|
||||||
|
# #STRING(REPLACE "\t" " " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Replace tabs with spaces
|
||||||
|
# #STRING(REGEX REPLACE "\n+" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT}) # Remove empty lines (allow a simplification in the script)
|
||||||
|
# STRING(REGEX REPLACE "([A-Z]+)[\t ]*=[\t ]*" "SET(\\1 " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
# #STRING(REGEX REPLACE "^(.*)[\t ]*[^\\]$" ")" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
# STRING(REGEX REPLACE "([^\\])\n" "\\1)\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
# # STRING(REGEX REPLACE "CSOURCES *=" "SET(libCurl_SRCS " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
# # STRING(REGEX REPLACE "HHEADERS *=" "SET(libCurl_HEADERS " MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
|
||||||
|
# FILE(WRITE Makefile.inc.cmake ${MAKEFILE_INC_TEXT})
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
add_subdirectory(lib)
|
||||||
|
if(BUILD_CURL_EXE)
|
||||||
|
add_subdirectory(src)
|
||||||
|
endif()
|
||||||
|
if(BUILD_CURL_TESTS)
|
||||||
|
add_subdirectory(tests)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# This needs to be run very last so other parts of the scripts can take advantage of this.
|
||||||
|
if(NOT CURL_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||||
|
set(CURL_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
|
||||||
|
endif()
|
||||||
2
COPYING
2
COPYING
@@ -1,6 +1,6 @@
|
|||||||
COPYRIGHT AND PERMISSION NOTICE
|
COPYRIGHT AND PERMISSION NOTICE
|
||||||
|
|
||||||
Copyright (c) 1996 - 2008, Daniel Stenberg, <daniel@haxx.se>.
|
Copyright (c) 1996 - 2009, Daniel Stenberg, <daniel@haxx.se>.
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
|
|||||||
13
CTestConfig.cmake
Normal file
13
CTestConfig.cmake
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
## This file should be placed in the root directory of your project.
|
||||||
|
## Then modify the CMakeLists.txt file in the root directory of your
|
||||||
|
## project to incorporate the testing dashboard.
|
||||||
|
## # The following are required to uses Dart and the Cdash dashboard
|
||||||
|
## ENABLE_TESTING()
|
||||||
|
## INCLUDE(Dart)
|
||||||
|
set(CTEST_PROJECT_NAME "CURL")
|
||||||
|
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
|
||||||
|
|
||||||
|
set(CTEST_DROP_METHOD "http")
|
||||||
|
set(CTEST_DROP_SITE "my.cdash.org")
|
||||||
|
set(CTEST_DROP_LOCATION "/submit.php?project=CURL")
|
||||||
|
set(CTEST_DROP_SITE_CDASH TRUE)
|
||||||
78
MacOSX-Framework
Executable file
78
MacOSX-Framework
Executable file
@@ -0,0 +1,78 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# This script performs all of the steps needed to build a
|
||||||
|
# universal binary libcurl.framework for Mac OS X 10.4 or greater.
|
||||||
|
|
||||||
|
VERSION=`/usr/bin/sed -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' include/curl/curlver.h`
|
||||||
|
|
||||||
|
SDK32='/Developer/SDKs/MacOSX10.4u.sdk'
|
||||||
|
|
||||||
|
MINVER32='-mmacosx-version-min=10.4'
|
||||||
|
|
||||||
|
ARCHES32='-arch ppc -arch i386'
|
||||||
|
|
||||||
|
SDK64='/Developer/SDKs/MacOSX10.5.sdk'
|
||||||
|
|
||||||
|
MINVER64='-mmacosx-version-min=10.5'
|
||||||
|
|
||||||
|
ARCHES64='-arch ppc64 -arch x86_64'
|
||||||
|
|
||||||
|
if test -d $SDK32; then
|
||||||
|
echo "----Configuring libcurl for 32 bit universal framework..."
|
||||||
|
./configure --disable-dependency-tracking --disable-static --with-gssapi \
|
||||||
|
CFLAGS="-Os -isysroot $SDK32 $ARCHES32 $MINVER32" \
|
||||||
|
LDFLAGS="-Wl,-syslibroot,$SDK32 $ARCHES32 $MINVER32 -Wl,-headerpad_max_install_names" \
|
||||||
|
CC=$CC
|
||||||
|
|
||||||
|
echo "----Building 32 bit libcurl..."
|
||||||
|
make
|
||||||
|
|
||||||
|
echo "----Creating 32 bit framework..."
|
||||||
|
rm -r libcurl.framework
|
||||||
|
mkdir -p libcurl.framework/Versions/A/Resources
|
||||||
|
cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl
|
||||||
|
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl
|
||||||
|
/usr/bin/sed -e "s/7\.12\.3/$VERSION/" lib/libcurl.plist >libcurl.framework/Versions/A/Resources/Info.plist
|
||||||
|
mkdir -p libcurl.framework/Versions/A/Headers/curl
|
||||||
|
cp include/curl/*.h libcurl.framework/Versions/A/Headers/curl
|
||||||
|
pushd libcurl.framework
|
||||||
|
ln -fs Versions/A/libcurl libcurl
|
||||||
|
ln -fs Versions/A/Resources Resources
|
||||||
|
ln -fs Versions/A/Headers Headers
|
||||||
|
cd Versions
|
||||||
|
ln -fs A Current
|
||||||
|
|
||||||
|
if test -d $SDK64; then
|
||||||
|
popd
|
||||||
|
make clean
|
||||||
|
echo "----Configuring libcurl for 64 bit universal framework..."
|
||||||
|
./configure --disable-dependency-tracking --disable-static --with-gssapi \
|
||||||
|
CFLAGS="-Os -isysroot $SDK64 $ARCHES64 $MINVER64" \
|
||||||
|
LDFLAGS="-Wl,-syslibroot,$SDK64 $ARCHES64 $MINVER64 -Wl,-headerpad_max_install_names" \
|
||||||
|
CC=$CC
|
||||||
|
|
||||||
|
echo "----Building 64 bit libcurl..."
|
||||||
|
make
|
||||||
|
|
||||||
|
echo "----Appending 64 bit framework to 32 bit framework..."
|
||||||
|
cp lib/.libs/libcurl.dylib libcurl.framework/Versions/A/libcurl64
|
||||||
|
install_name_tool -id @executable_path/../Frameworks/libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl64
|
||||||
|
cp libcurl.framework/Versions/A/libcurl libcurl.framework/Versions/A/libcurl32
|
||||||
|
lipo libcurl.framework/Versions/A/libcurl32 libcurl.framework/Versions/A/libcurl64 -create -output libcurl.framework/Versions/A/libcurl
|
||||||
|
rm libcurl.framework/Versions/A/libcurl32 libcurl.framework/Versions/A/libcurl64
|
||||||
|
cp libcurl.framework/Versions/A/Headers/curl/curlbuild.h libcurl.framework/Versions/A/Headers/curl/curlbuild32.h
|
||||||
|
cp include/curl/curlbuild.h libcurl.framework/Versions/A/Headers/curl/curlbuild64.h
|
||||||
|
cat >libcurl.framework/Versions/A/Headers/curl/curlbuild.h <<EOF
|
||||||
|
#ifdef __LP64__
|
||||||
|
#include "curl/curlbuild64.h"
|
||||||
|
#else
|
||||||
|
#include "curl/curlbuild32.h"
|
||||||
|
#endif
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
lipo -info libcurl.framework/Versions/A/libcurl
|
||||||
|
echo "libcurl.framework is built and can now be included in other projects."
|
||||||
|
echo "Copy libcurl.framework to your bundle's Contents/Frameworks folder, ~/Library/Frameworks or /Library/Frameworks."
|
||||||
|
else
|
||||||
|
echo "Building libcurl.framework requires Mac OS X 10.4 or later with the MacOSX10.4u SDK installed."
|
||||||
|
fi
|
||||||
29
Makefile.am
29
Makefile.am
@@ -5,7 +5,7 @@
|
|||||||
# | (__| |_| | _ <| |___
|
# | (__| |_| | _ <| |___
|
||||||
# \___|\___/|_| \_\_____|
|
# \___|\___/|_| \_\_____|
|
||||||
#
|
#
|
||||||
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
#
|
#
|
||||||
# This software is licensed as described in the file COPYING, which
|
# This software is licensed as described in the file COPYING, which
|
||||||
# you should have received as part of this distribution. The terms
|
# you should have received as part of this distribution. The terms
|
||||||
@@ -23,8 +23,17 @@
|
|||||||
|
|
||||||
AUTOMAKE_OPTIONS = foreign
|
AUTOMAKE_OPTIONS = foreign
|
||||||
|
|
||||||
EXTRA_DIST = CHANGES COPYING maketgz reconf Makefile.dist curl-config.in \
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
curl-style.el sample.emacs RELEASE-NOTES buildconf buildconf.bat libcurl.pc.in
|
|
||||||
|
CMAKE_DIST = CMakeLists.txt CMake/CheckTypeSize.c.in CMake/CheckTypeSize.cmake \
|
||||||
|
CMake/CMakeConfigurableFile.in CMake/CurlCheckCSourceCompiles.cmake \
|
||||||
|
CMake/CurlCheckCSourceRuns.cmake CMake/CurlTests.c CMake/FindOpenSSL.cmake \
|
||||||
|
CMake/FindZLIB.cmake CMake/OtherTests.cmake CMake/Platforms/WindowsCache.cmake \
|
||||||
|
CMake/Utilities.cmake include/curl/curlbuild.h.cmake
|
||||||
|
|
||||||
|
EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \
|
||||||
|
curl-style.el sample.emacs RELEASE-NOTES buildconf \
|
||||||
|
libcurl.pc.in vc6curl.dsw MacOSX-Framework Android.mk $(CMAKE_DIST)
|
||||||
|
|
||||||
bin_SCRIPTS = curl-config
|
bin_SCRIPTS = curl-config
|
||||||
|
|
||||||
@@ -37,7 +46,7 @@ pkgconfig_DATA = libcurl.pc
|
|||||||
dist-hook:
|
dist-hook:
|
||||||
rm -rf $(top_builddir)/tests/log
|
rm -rf $(top_builddir)/tests/log
|
||||||
find $(distdir) -name "*.dist" -exec rm {} \;
|
find $(distdir) -name "*.dist" -exec rm {} \;
|
||||||
(distit=`find $(srcdir) -name "*.dist"`; \
|
(distit=`find $(srcdir) -name "*.dist" | grep -v ./ares/`; \
|
||||||
for file in $$distit; do \
|
for file in $$distit; do \
|
||||||
strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
|
strip=`echo $$file | sed -e s/^$(srcdir)// -e s/\.dist//`; \
|
||||||
cp $$file $(distdir)$$strip; \
|
cp $$file $(distdir)$$strip; \
|
||||||
@@ -72,7 +81,11 @@ test-torture:
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
@(cd docs/examples; $(MAKE) all)
|
@(cd docs/examples; $(MAKE) check)
|
||||||
|
|
||||||
|
clean-local:
|
||||||
|
@(cd tests; $(MAKE) clean)
|
||||||
|
@(cd docs; $(MAKE) clean)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
|
# Build source and binary rpms. For rpm-3.0 and above, the ~/.rpmmacros
|
||||||
@@ -102,7 +115,7 @@ rpm:
|
|||||||
mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
|
mv $$RPM_TOPDIR/SRPMS/$(RPMDIST)-*.src.rpm .
|
||||||
|
|
||||||
#
|
#
|
||||||
# Build a Solaris pkkgadd format file
|
# Build a Solaris pkgadd format file
|
||||||
# run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format
|
# run 'make pkgadd' once you've done './configure' and 'make' to make a Solaris pkgadd format
|
||||||
# file (which ends up back in this directory).
|
# file (which ends up back in this directory).
|
||||||
# The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do
|
# The pkgadd file is in 'pkgtrans' format, so to install on Solaris, do
|
||||||
@@ -135,3 +148,7 @@ uninstall-hook:
|
|||||||
ca-bundle: lib/mk-ca-bundle.pl
|
ca-bundle: lib/mk-ca-bundle.pl
|
||||||
@echo "generate a fresh ca-bundle.crt"
|
@echo "generate a fresh ca-bundle.crt"
|
||||||
@perl $< -b -l -u lib/ca-bundle.crt
|
@perl $< -b -l -u lib/ca-bundle.crt
|
||||||
|
|
||||||
|
ca-firefox: lib/firefox-db2pem.sh
|
||||||
|
@echo "generate a fresh ca-bundle.crt"
|
||||||
|
./lib/firefox-db2pem.sh lib/ca-bundle.crt
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# | (__| |_| | _ <| |___
|
# | (__| |_| | _ <| |___
|
||||||
# \___|\___/|_| \_\_____|
|
# \___|\___/|_| \_\_____|
|
||||||
#
|
#
|
||||||
# Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
|
# Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
#
|
#
|
||||||
# This software is licensed as described in the file COPYING, which
|
# This software is licensed as described in the file COPYING, which
|
||||||
# you should have received as part of this distribution. The terms
|
# you should have received as part of this distribution. The terms
|
||||||
@@ -130,9 +130,9 @@ vc:
|
|||||||
|
|
||||||
vc-x64:
|
vc-x64:
|
||||||
cd lib
|
cd lib
|
||||||
MACHINE=x64 nmake /f Makefile.$(VC) cfg=release
|
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release
|
||||||
cd ..\src
|
cd ..\src
|
||||||
MACHINE=x64 nmake /f Makefile.$(VC)
|
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release
|
||||||
|
|
||||||
vc-zlib:
|
vc-zlib:
|
||||||
cd lib
|
cd lib
|
||||||
@@ -152,6 +152,12 @@ vc-ssl-zlib:
|
|||||||
cd ..\src
|
cd ..\src
|
||||||
nmake /f Makefile.$(VC) cfg=release-ssl-zlib
|
nmake /f Makefile.$(VC) cfg=release-ssl-zlib
|
||||||
|
|
||||||
|
vc-x64-ssl-zlib:
|
||||||
|
cd lib
|
||||||
|
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
|
||||||
|
cd ..\src
|
||||||
|
nmake /f Makefile.$(VC) MACHINE=x64 cfg=release-ssl-zlib
|
||||||
|
|
||||||
vc-ssl-dll:
|
vc-ssl-dll:
|
||||||
cd lib
|
cd lib
|
||||||
nmake /f Makefile.$(VC) cfg=release-ssl-dll
|
nmake /f Makefile.$(VC) cfg=release-ssl-dll
|
||||||
@@ -256,13 +262,22 @@ linux: all
|
|||||||
|
|
||||||
linux-ssl: ssl
|
linux-ssl: ssl
|
||||||
|
|
||||||
|
|
||||||
vc8:
|
vc8:
|
||||||
@echo "generate VC8 makefiles"
|
@echo "generate VC8 makefiles"
|
||||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" lib/Makefile.vc6 > lib/Makefile.vc8
|
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" lib/Makefile.vc6 > lib/Makefile.vc8
|
||||||
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" src/Makefile.vc6 > src/Makefile.vc8
|
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/wsock32.lib bufferoverflowu.lib/g" -e "s/VC6/VC8/g" src/Makefile.vc6 > src/Makefile.vc8
|
||||||
|
|
||||||
|
# VC9 makefiles are for use with VS2008
|
||||||
|
vc9:
|
||||||
|
@echo "generate VC9 makefiles"
|
||||||
|
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" lib/Makefile.vc6 > lib/Makefile.vc9
|
||||||
|
@sed -e "s#/GX /DWIN32 /YX#/EHsc /DWIN32#" -e "s#/GZ#/RTC1#" -e "s/wsock32.lib/ws2_32.lib/g" -e "s/vc6/vc9/g" -e "s/VC6/VC9/g" src/Makefile.vc6 > src/Makefile.vc9
|
||||||
|
|
||||||
ca-bundle: lib/mk-ca-bundle.pl
|
ca-bundle: lib/mk-ca-bundle.pl
|
||||||
@echo "generate a fresh ca-bundle.crt"
|
@echo "generate a fresh ca-bundle.crt"
|
||||||
@perl $< -b -l -u lib/ca-bundle.crt
|
@perl $< -b -l -u lib/ca-bundle.crt
|
||||||
|
|
||||||
|
ca-firefox: lib/firefox-db2pem.sh
|
||||||
|
@echo "generate a fresh ca-bundle.crt"
|
||||||
|
./lib/firefox-db2pem.sh lib/ca-bundle.crt
|
||||||
|
|||||||
5
README
5
README
@@ -30,10 +30,9 @@ CONTACT
|
|||||||
|
|
||||||
WEB SITE
|
WEB SITE
|
||||||
|
|
||||||
Visit the curl web site or mirrors for the latest news and downloads:
|
Visit the curl web site for the latest news and downloads:
|
||||||
|
|
||||||
Sweden http://curl.haxx.se/
|
http://curl.haxx.se/
|
||||||
Mirrors http://curlm.haxx.se/
|
|
||||||
|
|
||||||
CVS
|
CVS
|
||||||
|
|
||||||
|
|||||||
109
RELEASE-NOTES
109
RELEASE-NOTES
@@ -1,79 +1,64 @@
|
|||||||
Curl and libcurl 7.18.1
|
Curl and libcurl 7.19.7
|
||||||
|
|
||||||
Public curl releases: 104
|
Public curl releases: 113
|
||||||
Command line options: 126
|
Command line options: 132
|
||||||
curl_easy_setopt() options: 150
|
curl_easy_setopt() options: 163
|
||||||
Public functions in libcurl: 56
|
Public functions in libcurl: 58
|
||||||
Public web site mirrors: 39
|
Known libcurl bindings: 38
|
||||||
Known libcurl bindings: 36
|
Contributors: 732
|
||||||
Contributors: 621
|
|
||||||
|
|
||||||
This release includes the following changes:
|
This release includes the following changes:
|
||||||
|
|
||||||
o added support for HttpOnly cookies
|
o -T. is now for non-blocking uploading from stdin
|
||||||
o 'make ca-bundle' downloads and generates an updated ca bundle file
|
o SYST handling on FTP for OS/400 FTP server cases
|
||||||
o we no longer distribute or install a ca cert bundle
|
o libcurl refuses to read a single HTTP header longer than 100K
|
||||||
o SSLv2 is now disabled by default for SSL operations
|
o added the --crlfile option to curl
|
||||||
o the test509-style setting URL in callback is officially no longer supported
|
|
||||||
o support a full chain of certificates in a given PKCS12 certificate
|
|
||||||
o resumed transfers work with SFTP
|
|
||||||
o added type checking macros for curl_easy_setopt() and curl_easy_getinfo(),
|
|
||||||
watch out for new warnings in code using libcurl (needs gcc-4.3 and
|
|
||||||
currently only works in C mode)
|
|
||||||
o curl_easy_setopt(), curl_easy_getinfo(), curl_share_setopt() and
|
|
||||||
curl_multi_setopt() uses are now checked to use exactly three arguments
|
|
||||||
o --with-ca-path=DIR configure option allows to set an openSSL CApath instead
|
|
||||||
of a default ca bundle.
|
|
||||||
|
|
||||||
This release includes the following bugfixes:
|
This release includes the following bugfixes:
|
||||||
|
|
||||||
o improved pipelining
|
o The windows makefiles work again
|
||||||
o improved strdup replacement
|
o libcurl-NSS acknowledges verifyhost
|
||||||
o GnuTLS-built libcurl failed when doing global cleanup and reinit
|
o SIGSEGV when pipelined pipe unexpectedly breaks
|
||||||
o error message problem when unable to resolve a host on Windows
|
o data corruption issue with re-connected transfers
|
||||||
o Accept: header replacing
|
o use after free if we're completed but easy_conn not NULL (pipelined)
|
||||||
o not verifying server certs with GnuTLS still failed if gnutls had
|
o missing strdup() return code check
|
||||||
problems with the cert
|
o CURLOPT_PROXY_TRANSFER_MODE could pass along wrong syntax
|
||||||
o when using the multi interface and a handle is removed while still having
|
o configure --with-gnutls=PATH fixed
|
||||||
a transfer going on, the connection is now closed by force
|
o ftp response reader bug on failed control connections
|
||||||
o bad re-use of SSL connections in non-complete state
|
o improved NSS error message on failed host name verifications
|
||||||
o test case 405 failures with GnuTLS builds
|
o ftp NOBODY on re-used connection hang
|
||||||
o crash when connection cache size is 1 and Curl_do() failed
|
o configure uses pkg-config for cross-compiles as well
|
||||||
o GnuTLS-built libcurl can now be forced to prefer SSLv3
|
o improved NSS detection in configure
|
||||||
o crash when doing Negotiate again on a re-used connection
|
o cookie expiry date at 1970-jan-1 00:00:00
|
||||||
o select/poll regression
|
o libcurl-OpenSSL failed to verify some certs with Subject Alternative Name
|
||||||
o better MIT kerberos configure check
|
o libcurl-OpenSSL can load CRL files with more than one certificate inside
|
||||||
o curl_easy_reset() + SFTP re-used connection download crash
|
o received cookies without explicit path got saved wrong if the URL had a
|
||||||
o SFTP non-existing file + SFTP existing file error
|
query part
|
||||||
o sharing DNS cache between easy handles running in multiple threads could
|
o don't shrink SO_SNDBUF on windows for those who have it set large already
|
||||||
lead to crash
|
o connect next bug
|
||||||
o SFTP upload with CURLOPT_FTP_CREATE_MISSING_DIRS on re-used connection
|
o invalid file name characters handling on Windows
|
||||||
o SFTP infinite loop when given an invalid quote command
|
o double close() on the primary socket with libcurl-NSS
|
||||||
o curl-config erroneously reported LDAPS support with missing LDAP libraries
|
o GSS negotiate infinite loop on bad credentials
|
||||||
o SCP infinite loop when downloading a zero byte file
|
o memory leak in SCP/SFTP connections
|
||||||
o setting the CURLOPT_SSL_CTX_FUNCTION with libcurl built without OpenSSL
|
o use pkg-config to find out libssh2 installation details in configure
|
||||||
now makes curl_easy_setopt() properly return failure
|
o unparsable cookie expire dates make cookies get treated as session coookies
|
||||||
o configure --with-libssh2 (with no given path)
|
o POST with Digest authentication and "Transfer-Encoding: chunked"
|
||||||
|
o SCP connection re-use with wrong auth
|
||||||
|
o CURLINFO_CONTENT_LENGTH_DOWNLOAD for 0 bytes transfers
|
||||||
|
o CURLINFO_SIZE_DOWNLOAD for ldap transfers (-w size_download)
|
||||||
|
|
||||||
This release includes the following known bugs:
|
This release includes the following known bugs:
|
||||||
|
|
||||||
o see docs/KNOWN_BUGS (http://curl.haxx.se/docs/knownbugs.html)
|
o see docs/KNOWN_BUGS (http://curl.haxx.se/docs/knownbugs.html)
|
||||||
|
|
||||||
Other curl-related news:
|
|
||||||
|
|
||||||
o
|
|
||||||
|
|
||||||
New curl mirrors:
|
|
||||||
|
|
||||||
o http://curl.cuendet.com/ is a new mirror in Atlanta, USA
|
|
||||||
|
|
||||||
This release would not have looked like this without help, code, reports and
|
This release would not have looked like this without help, code, reports and
|
||||||
advice from friends like these:
|
advice from friends like these:
|
||||||
|
|
||||||
Michal Marek, Dmitry Kurochkin, Niklas Angebrand, G<>nter Knauf, Yang Tse,
|
Karl Moerder, Kamil Dudka, Krister Johansen, Andre Guibert de Bruet,
|
||||||
Dan Fandrich, Mike Hommey, Pooyan McSporran, Jerome Muffat-Meridol,
|
Michal Marek, Eric Wong, Guenter Knauf, Peter Sylvester, Daniel Johnson,
|
||||||
Kaspar Brand, Gautam Kachroo, Zmey Petroff, Georg Lippitsch, Sam Listopad,
|
Claes Jakobsson, Sven Anders, Chris Mumford, John P. McCaskey,
|
||||||
Anatoli Tubman, Mike Protts, Michael Calmer, Brian Ulm, Dmitry Popov,
|
Constantine Sapuntzakis, Michael Stillwell, Tom Mueller, Dan Fandrich,
|
||||||
Jes Badwal, Dan Petitt, Stephen Collyer
|
Kevin Baughman, John Dennis, Ray Dassen, Johan van Selst, Dima Barsky,
|
||||||
|
Liza Alenchery, Gabriel Kuri, Stan van de Burgt, Didier Brisebourg
|
||||||
|
|
||||||
Thanks! (and sorry if I forgot to mention someone)
|
Thanks! (and sorry if I forgot to mention someone)
|
||||||
|
|||||||
25
TODO-RELEASE
25
TODO-RELEASE
@@ -1,17 +1,22 @@
|
|||||||
To be addressed before 7.18.2 (planned release: June 2008)
|
To be addressed in 7.19.8 (planned release: January 2010)
|
||||||
=============================
|
=========================
|
||||||
|
|
||||||
128 - Phil Blundell's ares and ipv6 fix (feedback lacking)
|
244 - patch for [out] parameters
|
||||||
|
http://curl.haxx.se/mail/lib-2009-06/0342.html
|
||||||
|
|
||||||
129 - Pierre Reiss' libcurl + https + multi = lost information (awaiting
|
245 - HTTP version getinfo
|
||||||
better example/clarification on how to figure out when the claimed
|
http://curl.haxx.se/mail/lib-2009-06/0312.html
|
||||||
problem occurs)
|
|
||||||
|
|
||||||
130 - Vincent Le Normand's SFTP patch for touch
|
247 - Using CURLINFO_ERROR in Curl_failf
|
||||||
|
http://curl.haxx.se/mail/lib-2009-06/0065.html
|
||||||
|
|
||||||
131 - Scott Barrett's Support for CURLOPT_NOBODY with SFTP
|
253 - add option to disable SNI for TLS handshakes
|
||||||
|
|
||||||
132 - Xponaut's CURLFORM_STREAM option to curl_formadd()
|
257 - bug #2891595 DNS cache
|
||||||
|
|
||||||
133 -
|
258 - bug #2891591 Curl_dns_entry
|
||||||
|
|
||||||
|
259 - Avoding connection re-use when using CURLOPT_HTTPPROXYTUNNEL
|
||||||
|
|
||||||
|
260 -
|
||||||
|
|
||||||
|
|||||||
2415
acinclude.m4
2415
acinclude.m4
File diff suppressed because it is too large
Load Diff
@@ -1,23 +1,33 @@
|
|||||||
configure
|
*.html
|
||||||
autom4te.cache
|
*.lo
|
||||||
|
*.pdf
|
||||||
|
.deps
|
||||||
|
.libs
|
||||||
Makefile
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
aclocal.m4
|
||||||
|
acountry
|
||||||
adig
|
adig
|
||||||
ahost
|
ahost
|
||||||
config.log
|
ares_build.h
|
||||||
config.status
|
ares_config.h
|
||||||
aclocal.m4
|
ares_config.h.in
|
||||||
.deps
|
ares_version.h.dist
|
||||||
Makefile.in
|
autom4te.cache
|
||||||
|
compile
|
||||||
config.guess
|
config.guess
|
||||||
config.h
|
config.h
|
||||||
config.h.in
|
config.h.in
|
||||||
|
config.log
|
||||||
|
config.lt
|
||||||
|
config.status
|
||||||
config.sub
|
config.sub
|
||||||
libtool
|
configure
|
||||||
ltmain.sh
|
|
||||||
stamp-h1
|
|
||||||
*.lo
|
|
||||||
.libs
|
|
||||||
depcomp
|
depcomp
|
||||||
libcares.la
|
libcares.la
|
||||||
|
libcares.pc
|
||||||
|
libtool
|
||||||
|
ltmain.sh
|
||||||
|
man3
|
||||||
missing
|
missing
|
||||||
ares_version.h.dist
|
stamp-h*
|
||||||
|
|||||||
47
ares/AUTHORS
47
ares/AUTHORS
@@ -1,28 +1,37 @@
|
|||||||
c-ares is based on ares, and these are the people that have worked on it since
|
c-ares is based on ares, and these are the people that have worked on it since
|
||||||
the fork was made:
|
the fork was made:
|
||||||
|
|
||||||
Daniel Stenberg
|
Alexander Lazic
|
||||||
Dominick Meglio
|
Alexey Simak
|
||||||
liren at vivisimo.com
|
Andreas Rieke
|
||||||
James Bursa
|
Ashish Sharma
|
||||||
Duncan Wilcox
|
Brad House
|
||||||
Dirk Manske
|
Brad Spencer
|
||||||
|
Bram Matthys
|
||||||
Dan Fandrich
|
Dan Fandrich
|
||||||
|
Daniel Stenberg
|
||||||
|
Dirk Manske
|
||||||
|
Dominick Meglio
|
||||||
|
Doug Goldstein
|
||||||
|
Duncan Wilcox
|
||||||
|
Eino Tuominen
|
||||||
|
Erik Kline
|
||||||
|
George Neill
|
||||||
Gisle Vanem
|
Gisle Vanem
|
||||||
|
Guilherme Balena Versiani
|
||||||
Gunter Knauf
|
Gunter Knauf
|
||||||
Henrik Stoerner
|
Henrik Stoerner
|
||||||
Yang Tse
|
James Bursa
|
||||||
Nick Mathewson
|
|
||||||
Alexander Lazic
|
|
||||||
Andreas Rieke
|
|
||||||
Guilherme Balena Versiani
|
|
||||||
Brad Spencer
|
|
||||||
Ravi Pratap
|
|
||||||
William Ahern
|
|
||||||
Bram Matthys
|
|
||||||
Michael Wallner
|
Michael Wallner
|
||||||
Vlad Dinulescu
|
Nick Mathewson
|
||||||
Brad House
|
Phil Blundell
|
||||||
|
Ravi Pratap
|
||||||
|
Robin Cornelius
|
||||||
|
Sebastian at basti79.de
|
||||||
Shmulik Regev
|
Shmulik Regev
|
||||||
Ashish Sharma
|
Steinar H. Gunderson
|
||||||
Brad Spencer
|
Tofu Linden
|
||||||
|
Vlad Dinulescu
|
||||||
|
William Ahern
|
||||||
|
Yang Tse
|
||||||
|
liren at vivisimo.com
|
||||||
|
|||||||
433
ares/CHANGES
433
ares/CHANGES
@@ -1,5 +1,438 @@
|
|||||||
Changelog for the c-ares project
|
Changelog for the c-ares project
|
||||||
|
|
||||||
|
* November 2, 2009 (Yang Tse)
|
||||||
|
- Renamed c-ares setup.h to ares_setup.h
|
||||||
|
|
||||||
|
* October 31, 2009 (Yang Tse)
|
||||||
|
- Symbol hiding configure options are named now --enable-symbol-hiding
|
||||||
|
and --disable-symbol-hiding in an attempt to make them less ambiguous.
|
||||||
|
|
||||||
|
* October 30, 2009 (Yang Tse)
|
||||||
|
- Many fixes for ares_parse_txt_reply()
|
||||||
|
|
||||||
|
* October 29, 2009 (Daniel Stenberg)
|
||||||
|
- Jakub Hrozek added ares_parse_txt_reply() for TXT parsing
|
||||||
|
|
||||||
|
* October 29, 2009 (Yang Tse)
|
||||||
|
- Updated MSVC 6.0 workspace and project files that allows building
|
||||||
|
dynamic and static c-ares libraries in debug and release flavours.
|
||||||
|
Additionally each of the three sample programs is built against
|
||||||
|
each of the four possible c-ares libraries, generating all this
|
||||||
|
a total number of 12 executables and 4 libraries.
|
||||||
|
|
||||||
|
* October 28, 2009 (Yang Tse)
|
||||||
|
- Initial step towards the ability to reduce c-ares exported symbols
|
||||||
|
when built as a shared library based on the 'visibility' attribute
|
||||||
|
for GNUC and Intel compilers and based on __global for Sun compilers,
|
||||||
|
taking also in account __declspec function decoration for Win32 and
|
||||||
|
Symbian DLL's.
|
||||||
|
|
||||||
|
* October 27, 2009 (Yang Tse)
|
||||||
|
- Fixed Pelles C Win32 target compilation issues.
|
||||||
|
|
||||||
|
* October 23, 2009 (Yang Tse)
|
||||||
|
- John Engelhart noticed an unreleased problem relative to a duplicate
|
||||||
|
ARES_ECANCELLED error code value and missing error code description.
|
||||||
|
|
||||||
|
* October 7, 2009 (Yang Tse)
|
||||||
|
- Overhauled ares__get_hostent() Fixing out of bounds memory overwrite
|
||||||
|
triggered with malformed /etc/hosts file. Improving parsing of /etc/hosts
|
||||||
|
file. Validating requested address family. Ensuring that failures always
|
||||||
|
return a NULL pointer. Adjusting header inclusions.
|
||||||
|
|
||||||
|
* October 6, 2009 (Yang Tse)
|
||||||
|
- Fix ssize_t redefinition errors on WIN64 reported by Alexey Simak.
|
||||||
|
|
||||||
|
* September 29, 2009 (Yang Tse)
|
||||||
|
- Make configure script also check if _REENTRANT definition is required to
|
||||||
|
make errno available as a preprocessor macro.
|
||||||
|
|
||||||
|
* September 7, 2009 (Yang Tse)
|
||||||
|
- Add T_SRV portability check to ares_parse_srv_reply.c
|
||||||
|
|
||||||
|
* 4 Sep 2009 (Daniel Stenberg)
|
||||||
|
- Jakub Hrozek added ares_parse_srv_reply() for SRV parsing
|
||||||
|
|
||||||
|
* 3 Aug 2009 (Daniel Stenberg)
|
||||||
|
- Joshua Kwan fixed the init routine to fill in the defaults for stuff that
|
||||||
|
fails to get inited by other means. This fixes a case of when the c-ares
|
||||||
|
init fails when internet access is fone.
|
||||||
|
|
||||||
|
- Timo Teras changed the reason code used in the resolve callback done when
|
||||||
|
ares_cancel() is used, to be ARES_ECANCELLED instead of ARES_ETIMEOUT to
|
||||||
|
better allow the callback to know what's happening.
|
||||||
|
|
||||||
|
* 14 Jul 2009 (Guenter Knauf)
|
||||||
|
- renamed generated config.h to ares_config.h to avoid any future clashes
|
||||||
|
with config.h from other projects.
|
||||||
|
|
||||||
|
* June 20 2009 (Yang Tse)
|
||||||
|
- Refactor how libraries are checked for connect() function in configure
|
||||||
|
script and check for connect() as it is done for other functions.
|
||||||
|
|
||||||
|
* June 19 2009 (Yang Tse)
|
||||||
|
- Make sclose() function-like macro definition used to close a socket,
|
||||||
|
now solely based on HAVE_CLOSESOCKET and HAVE_CLOSESOCKET_CAMEL
|
||||||
|
config file preprocessor definitions
|
||||||
|
|
||||||
|
* June 18 2009 (Yang Tse)
|
||||||
|
- Add CloseSocket camel case function check for configure script.
|
||||||
|
|
||||||
|
* June 17 2009 (Yang Tse)
|
||||||
|
- Check for socket() and closesocket() as it is done for other functions
|
||||||
|
in configure script.
|
||||||
|
|
||||||
|
* June 11 2009 (Yang Tse)
|
||||||
|
- Modified buildconf so that when automake runs it copies missing files
|
||||||
|
instead of symlinking them.
|
||||||
|
|
||||||
|
* June 8 2009 (Yang Tse)
|
||||||
|
- Removed buildconf.bat from release and daily snapshot archives. This
|
||||||
|
file is only for CVS tree checkout builds.
|
||||||
|
|
||||||
|
* May 26 2009 (Yang Tse)
|
||||||
|
- Added --enable-curldebug configure option to enable and disable building
|
||||||
|
with the low-level curl debug memory tracking 'feature' to allow decoupled
|
||||||
|
setting from --enable-debug, allowing again to build c-ares independently
|
||||||
|
out of the CVS tree.
|
||||||
|
|
||||||
|
For the c-ares library option --enable-debug enables debug build features
|
||||||
|
which are _not_ related with memory tracking. For the c-ares library when
|
||||||
|
--enable-debug is given it does not enable the memory tracking feature. If
|
||||||
|
you wish to enable the curl debug memory tracking you must use configure
|
||||||
|
option --enable-curldebug explicitily to do so.
|
||||||
|
|
||||||
|
Internally, definition of preprocessor symbol DEBUGBUILD restricts code
|
||||||
|
which is only compiled for debug enabled builds. And symbol CURLDEBUG is
|
||||||
|
used to differentiate code which is _only_ used for memory tracking.
|
||||||
|
|
||||||
|
Make ares_init(), ares_dup() and ares_init_options() fail returning
|
||||||
|
ARES_ENOTINITIALIZED if library initialization has not been performed
|
||||||
|
calling ares_library_init().
|
||||||
|
|
||||||
|
* May 20 2009 (Yang Tse)
|
||||||
|
- Added ares_library_init() and ares_library_cleanup() man pages.
|
||||||
|
|
||||||
|
* May 19 2009 (Yang Tse)
|
||||||
|
- Introduced ares_library_init() and ares_library_cleanup() functions.
|
||||||
|
|
||||||
|
This is an API and ABI break for Win32/64 systems. Non-Win32/64 build targets
|
||||||
|
using c-ares 1.6.1 can still survive without calling these functions. Read all
|
||||||
|
the details on ares_library_init(3) and ares_library_cleanup(3) man pages that
|
||||||
|
are included.
|
||||||
|
|
||||||
|
curl/libcurl 7.19.5 is fully compatible with c-ares 1.6.1 on all systems.
|
||||||
|
|
||||||
|
In order to use c-ares 1.6.1 with curl/libcurl on Win32/64 systems it is
|
||||||
|
required that curl/libcurl is 7.19.5 or newer. In other words, it is not
|
||||||
|
possible on Win32/64 to use c-ares 1.6.1 with a curl/libcurl version less
|
||||||
|
than 7.19.5
|
||||||
|
|
||||||
|
* May 11 2009 (Daniel Stenberg)
|
||||||
|
- Gregor Jasny made c-ares link with libtool 's -export-symbols-regex option to
|
||||||
|
only expose functions starting with ares_.
|
||||||
|
|
||||||
|
* May 7 2009 (Yang Tse)
|
||||||
|
- Fix an m4 overquoting triggering a spurious 'AS_TR_CPP' symbol definition
|
||||||
|
attempt in generated config.h
|
||||||
|
|
||||||
|
* May 2 2009 (Yang Tse)
|
||||||
|
- Use a build-time configured ares_socklen_t data type instead of socklen_t.
|
||||||
|
|
||||||
|
* April 21 2009 (Yang Tse)
|
||||||
|
- Moved potential inclusion of system's malloc.h and memory.h header files to
|
||||||
|
setup_once.h. Inclusion of each header file is based on the definition of
|
||||||
|
NEED_MALLOC_H and NEED_MEMORY_H respectively.
|
||||||
|
|
||||||
|
* March 11 2009 (Yang Tse)
|
||||||
|
- Japheth Cleaver fixed acountry.c replacing u_long with unsigned long.
|
||||||
|
|
||||||
|
* February 20 2009 (Yang Tse)
|
||||||
|
- Do not halt compilation when using VS2008 to build a Windows 2000 target.
|
||||||
|
|
||||||
|
* February 3 2009 (Phil Blundell)
|
||||||
|
- If the server returns garbage or nothing at all in response to an AAAA query,
|
||||||
|
go on and ask for A records anyway.
|
||||||
|
|
||||||
|
* January 31 2009 (Daniel Stenberg)
|
||||||
|
- ares_gethostbyname() now accepts 'AF_UNSPEC' as a family for resolving
|
||||||
|
either AF_INET6 or AF_INET. It works by accepting any of the looksups in the
|
||||||
|
hosts file, and it resolves the AAAA field with a fallback to A.
|
||||||
|
|
||||||
|
* January 14 2009 (Daniel Stenberg)
|
||||||
|
- ares.h no longer uses the HAVE_STRUCT_IN6_ADDR define check, but instead it
|
||||||
|
now declares the private struct ares_in6_addr for all systems instead of
|
||||||
|
relying on one possibly not present in the system.
|
||||||
|
|
||||||
|
* January 13 2009 (Phil Blundell)
|
||||||
|
- ares__send_query() now varies the retry timeout pseudo-randomly to avoid
|
||||||
|
packet storms when several queries were started at the same time.
|
||||||
|
|
||||||
|
* January 11 2009 (Daniel Stenberg)
|
||||||
|
- Phil Blundell added the internal function ares__expand_name_for_response()
|
||||||
|
that is now used by the ares_parse_*_reply() functions instead of the
|
||||||
|
ares_expand_name() simply to easier return ARES_EBADRESP for the cases where
|
||||||
|
the name expansion fails as in responses that really isn't expected.
|
||||||
|
|
||||||
|
Version 1.6.0 (Dec 9, 2008)
|
||||||
|
|
||||||
|
* December 9 2008 (Gisle Vanem)
|
||||||
|
|
||||||
|
Fixes for Win32 targets using the Watt-32 tcp/ip stack.
|
||||||
|
|
||||||
|
* Dec 4 2008 (Daniel Stenberg)
|
||||||
|
|
||||||
|
Gregor Jasny provided the patch that introduces ares_set_socket_callback(),
|
||||||
|
and I edited it to also get duped by ares_dup().
|
||||||
|
|
||||||
|
* Dec 3 2008 (Daniel Stenberg)
|
||||||
|
|
||||||
|
API changes:
|
||||||
|
|
||||||
|
I made sure the public ares_config struct looks like before and yet it
|
||||||
|
supports the ROTATE option thanks to c-ares now storing the "optmask"
|
||||||
|
internally. Thus we should be ABI compatible with the past release(s)
|
||||||
|
now. My efforts mentioned below should not break backwards ABI compliance.
|
||||||
|
|
||||||
|
Here's how I suggest we proceed with the API:
|
||||||
|
|
||||||
|
ares_init() will be primary "channel creator" function.
|
||||||
|
|
||||||
|
ares_init_options() will continue to work exactly like now and before. For
|
||||||
|
starters, it will be the (only) way to set the existing options.
|
||||||
|
|
||||||
|
ares_save_options() will continue to work like today, but will ONLY save
|
||||||
|
options that you can set today (including ARES_OPT_ROTATE actually) but new
|
||||||
|
options that we add may not be saved with this.
|
||||||
|
|
||||||
|
Instead we introduce:
|
||||||
|
|
||||||
|
ares_dup() that instead can make a new channel and clone the config used
|
||||||
|
from an existing channel. It will then clone all config options, including
|
||||||
|
future new things we add.
|
||||||
|
|
||||||
|
ares_set_*() style functions that set (new) config options. As a start we
|
||||||
|
simply add these for new functionality, but over time we can also introduce
|
||||||
|
them for existing "struct ares_options" so that we can eventually deprecate
|
||||||
|
the two ares_*_options() functions.
|
||||||
|
|
||||||
|
ares_get_*() style functions for extracting info from a channel handle that
|
||||||
|
should be used instead of ares_save_options().
|
||||||
|
|
||||||
|
* Nov 26 2008 (Yang Tse)
|
||||||
|
- Brad Spencer provided changes to allow buildconf to work on OS X.
|
||||||
|
|
||||||
|
- Gerald Combs fixed a bug in ares_parse_ptr_reply() which would cause a
|
||||||
|
buffer to shrink instead of expand if a reply contained 8 or more records.
|
||||||
|
|
||||||
|
* Nov 25 2008 (Yang Tse)
|
||||||
|
- In preparation for the upcomming IPv6 nameservers patch, the internal
|
||||||
|
ares_addr union is now changed into an internal struct which also holds
|
||||||
|
the address family.
|
||||||
|
|
||||||
|
* Nov 19 2008 (Daniel Stenberg)
|
||||||
|
- Brad Spencer brought the new function ares_gethostbyname_file() which simply
|
||||||
|
resolves a host name from the given file, using the regular hosts syntax.
|
||||||
|
|
||||||
|
* Nov 1 2008 (Daniel Stenberg)
|
||||||
|
- Carlo Contavalli added support for the glibc "rotate" option, as documented
|
||||||
|
in man resolv.conf:
|
||||||
|
|
||||||
|
causes round robin selection of nameservers from among those listed. This
|
||||||
|
has the effect of spreading the query load among all listed servers, rather
|
||||||
|
than having all clients try the first listed server first every time.
|
||||||
|
|
||||||
|
You can enable it with ARES_OPT_ROTATE
|
||||||
|
|
||||||
|
* Oct 21 2008 (Yang Tse)
|
||||||
|
Charles Hardin added handling of EINPROGRESS for UDP connects.
|
||||||
|
|
||||||
|
* Oct 18 2008 (Daniel Stenberg)
|
||||||
|
Charles Hardin made adig support a regular numerical dotted IP address for the
|
||||||
|
-s option as well.
|
||||||
|
|
||||||
|
* Oct 7 2008 (Yang Tse)
|
||||||
|
- Added --enable-optimize configure option to enable and disable compiler
|
||||||
|
optimizations to allow decoupled setting from --enable-debug.
|
||||||
|
|
||||||
|
* Oct 2 2008 (Yang Tse)
|
||||||
|
- Added --enable-warnings configure option to enable and disable strict
|
||||||
|
compiler warnings to allow decoupled setting from --enable-debug.
|
||||||
|
|
||||||
|
* Sep 17 2008 (Yang Tse)
|
||||||
|
- Code reorganization to allow internal/private use of "nameser.h" to any
|
||||||
|
system that lacks arpa/nameser.h or arpa/nameser_compat.h header files.
|
||||||
|
|
||||||
|
* Sep 16 2008 (Yang Tse)
|
||||||
|
- Code reorganization to allow internal/private use of ares_writev to any
|
||||||
|
system that lacks the writev function.
|
||||||
|
|
||||||
|
* Sep 15 2008 (Yang Tse)
|
||||||
|
- Code reorganization to allow internal/private use of ares_strcasecmp to any
|
||||||
|
system that lacks the strcasecmp function.
|
||||||
|
|
||||||
|
- Improve configure detection of some string functions.
|
||||||
|
|
||||||
|
* Sep 11 2008 (Yang Tse)
|
||||||
|
- Code reorganization to allow internal/private use of ares_strdup to any
|
||||||
|
system that lacks the strdup function.
|
||||||
|
|
||||||
|
Version 1.5.3 (Aug 29, 2008)
|
||||||
|
|
||||||
|
* Aug 25 2008 (Yang Tse)
|
||||||
|
- Improvement by Brad House:
|
||||||
|
|
||||||
|
This patch addresses an issue in which a response could be sent back to the
|
||||||
|
source port of a client from a different address than the request was made to.
|
||||||
|
This is one form of a DNS cache poisoning attack.
|
||||||
|
|
||||||
|
The patch simply uses recvfrom() rather than recv() and validates that the
|
||||||
|
address returned from recvfrom() matches the address of the server we have
|
||||||
|
connected to. Only necessary on UDP sockets as they are connection-less, TCP
|
||||||
|
is unaffected.
|
||||||
|
|
||||||
|
- Fix by George Neill:
|
||||||
|
Fixed compilation of acountry sample application failure on some systems.
|
||||||
|
|
||||||
|
* Aug 4 2008 (Daniel Stenberg)
|
||||||
|
- Fix by Tofu Linden:
|
||||||
|
|
||||||
|
The symptom:
|
||||||
|
* Users (usually, but not always) on 2-Wire routers and the Comcast service
|
||||||
|
and a wired connection to their router would find that the second and
|
||||||
|
subsequent DNS lookups from fresh processes using c-ares to resolve the same
|
||||||
|
address would cause the process to never see a reply (it keeps polling for
|
||||||
|
around 1m15s before giving up).
|
||||||
|
|
||||||
|
The repro:
|
||||||
|
* On such a machine (and yeah, it took us a lot of QA to find the systems
|
||||||
|
that reproduce such a specific problem!), do 'ahost www.secondlife.com',
|
||||||
|
then do it again. The first process's lookup will work, subsequent lookups
|
||||||
|
will time-out and fail.
|
||||||
|
|
||||||
|
The cause:
|
||||||
|
* init_id_key() was calling randomize_key() *before* it initialized
|
||||||
|
key->state, meaning that the randomness generated by randomize_key() is
|
||||||
|
immediately overwritten with deterministic values. (/dev/urandom was also
|
||||||
|
being read incorrectly in the c-ares version we were using, but this was
|
||||||
|
fixed in a later version.)
|
||||||
|
* This makes the stream of generated query-IDs from any new c-ares process
|
||||||
|
be an identical and predictable sequence of IDs.
|
||||||
|
* This makes the 2-Wire's default built-in DNS server detect these queries
|
||||||
|
as probable-duplicates and (erroneously) not respond at all.
|
||||||
|
|
||||||
|
|
||||||
|
* Aug 4 2008 (Yang Tse)
|
||||||
|
- Autoconf 2.62 has changed the behaviour of the AC_AIX macro which we use.
|
||||||
|
Prior versions of autoconf defined _ALL_SOURCE if _AIX was defined. 2.62
|
||||||
|
version of AC_AIX defines _ALL_SOURCE and other four preprocessor symbols
|
||||||
|
no matter if the system is AIX or not. To keep the traditional behaviour,
|
||||||
|
and an uniform one across autoconf versions AC_AIX is replaced with our
|
||||||
|
own internal macro CARES_CHECK_AIX_ALL_SOURCE.
|
||||||
|
|
||||||
|
* Aug 1 2008 (Yang Tse)
|
||||||
|
- Configure process now checks if the preprocessor _REENTRANT symbol is already
|
||||||
|
defined. If it isn't currently defined a set of checks are performed to test
|
||||||
|
if its definition is required to make visible to the compiler a set of *_r
|
||||||
|
functions. Finally, if _REENTRANT is already defined or needed it takes care
|
||||||
|
of making adjustments necessary to ensure that it is defined equally for the
|
||||||
|
configure process tests and generated config file.
|
||||||
|
|
||||||
|
* Jul 20 2008 (Yang Tse)
|
||||||
|
- When recvfrom prototype uses a void pointer for arguments 2, 5 or 6 this will
|
||||||
|
now cause the definition, as appropriate, of RECVFROM_TYPE_ARG2_IS_VOID,
|
||||||
|
RECVFROM_TYPE_ARG5_IS_VOID or RECVFROM_TYPE_ARG6_IS_VOID.
|
||||||
|
|
||||||
|
* Jul 17 2008 (Yang Tse)
|
||||||
|
- RECVFROM_TYPE_ARG2, RECVFROM_TYPE_ARG5 and RECVFROM_TYPE_ARG6 are now defined
|
||||||
|
to the data type pointed by its respective argument and not the pointer type.
|
||||||
|
|
||||||
|
* Jul 16 2008 (Yang Tse)
|
||||||
|
- Improved configure detection of number of arguments for getservbyport_r.
|
||||||
|
Detection is now based on compilation checks instead of linker ones.
|
||||||
|
|
||||||
|
- Configure process now checks availability of recvfrom() socket function and
|
||||||
|
finds out its return type and the types of its arguments. Added definitions
|
||||||
|
for non-configure systems config files, and introduced macro sreadfrom which
|
||||||
|
will be used on udp sockets as a recvfrom() wrapper in the future.
|
||||||
|
|
||||||
|
* Jul 15 2008 (Yang Tse)
|
||||||
|
- Introduce definition of _REENTRANT symbol in setup.h to improve library
|
||||||
|
usability. Previously the configure process only used the AC_SYS_LARGEFILE
|
||||||
|
macro for debug builds, now it is also used for non-debug ones enabling the
|
||||||
|
use of configure options --enable-largefile and --disable-largefile which
|
||||||
|
might be needed for library compatibility. Remove checking the size of
|
||||||
|
curl_off_t, it is no longer needed.
|
||||||
|
|
||||||
|
* Jul 3 2008 (Daniel Stenberg)
|
||||||
|
- Phil Blundell: If you ask ares_gethostbyname() to do an AF_INET6 lookup and
|
||||||
|
the target host has only A records, it automatically falls back to an
|
||||||
|
AF_INET lookup and gives you the A results. However, if the target host has
|
||||||
|
a CNAME record, this behaviour is defeated since the original query does
|
||||||
|
return some data even though ares_parse_aaa_reply() doesn't consider it
|
||||||
|
relevant. Here's a small patch to make it behave the same with and without
|
||||||
|
the CNAME.
|
||||||
|
|
||||||
|
* Jul 2 2008 (Yang Tse)
|
||||||
|
- Fallback to gettimeofday when monotonic clock is unavailable at run-time.
|
||||||
|
|
||||||
|
* Jun 30 2008 (Daniel Stenberg)
|
||||||
|
|
||||||
|
- As was pointed out to me by Andreas Schuldei, the MAXHOSTNAMELEN define is
|
||||||
|
not posix or anything and thus c-ares failed to build on hurd (and possibly
|
||||||
|
elsewhere). The define was also somewhat artificially used in the windows
|
||||||
|
port. Now, I instead rewrote the use of gethostbyname to enlarge the host
|
||||||
|
name buffer in case of need and totally avoid the use of the MAXHOSTNAMELEN
|
||||||
|
define. I thus also removed the defien from the namser.h file where it was
|
||||||
|
once added for the windows build.
|
||||||
|
|
||||||
|
I also fixed init_by_defaults() function to not leak memory in case if
|
||||||
|
error.
|
||||||
|
|
||||||
|
* Jun 9 2008 (Yang Tse)
|
||||||
|
|
||||||
|
- Make libcares.pc generated file for pkg-config include information relative
|
||||||
|
to the libraries needed for the static linking of c-ares.
|
||||||
|
|
||||||
|
* May 30 2008 (Yang Tse)
|
||||||
|
|
||||||
|
- Brad House fixed a missing header file inclusion in adig sample program.
|
||||||
|
|
||||||
|
Version 1.5.2 (May 29, 2008)
|
||||||
|
|
||||||
|
* May 13 2008 (Daniel Stenberg)
|
||||||
|
|
||||||
|
- Introducing millisecond resolution support for the timeout option. See
|
||||||
|
ares_init_options()'s ARES_OPT_TIMEOUTMS.
|
||||||
|
|
||||||
|
* May 9 2008 (Yang Tse)
|
||||||
|
|
||||||
|
- Use monotonic time source if available, for private function ares__tvnow()
|
||||||
|
|
||||||
|
* May 7 2008 (Daniel Stenberg)
|
||||||
|
|
||||||
|
- Sebastian made c-ares able to return all PTR-records when doing reverse
|
||||||
|
lookups. It is not common practice to have multiple PTR-Records for a single
|
||||||
|
IP, but its perfectly legal and some sites have those.
|
||||||
|
|
||||||
|
- Doug Goldstein provided a configure patch: updates autoconf 2.13 usage to
|
||||||
|
autoconf 2.57 usage (which is the version you have specified as the minimum
|
||||||
|
version). It's a minor change but it does clean up some warnings with newer
|
||||||
|
autoconf (specifically 2.62).
|
||||||
|
|
||||||
|
* May 5 2008 (Yang Tse)
|
||||||
|
|
||||||
|
- Improved parsing of resolver configuration files.
|
||||||
|
|
||||||
|
* April 4 2008 (Daniel Stenberg)
|
||||||
|
|
||||||
|
- Eino Tuominen improved the code when a file is used to seed the randomizer.
|
||||||
|
|
||||||
|
- Alexey Simak made adig support NAPTR records
|
||||||
|
|
||||||
|
- Alexey Simak fixed the VC dsp file by adding the missing source file
|
||||||
|
ares_expand_string.c
|
||||||
|
|
||||||
* December 11 2007 (Gisle Vanem)
|
* December 11 2007 (Gisle Vanem)
|
||||||
|
|
||||||
- Added another sample application; acountry.c which converts an
|
- Added another sample application; acountry.c which converts an
|
||||||
|
|||||||
7
ares/CVS-INFO
Normal file
7
ares/CVS-INFO
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
CVS-INFO
|
||||||
|
|
||||||
|
This file is only present in the CVS - never in release archives. It is used
|
||||||
|
as a sentinel file in buildconf.bat in order to differentiate a CVS checkout
|
||||||
|
from release and daily snapshot archives.
|
||||||
|
|
||||||
35
ares/FILES
35
ares/FILES
@@ -1,35 +0,0 @@
|
|||||||
*.c
|
|
||||||
*.h
|
|
||||||
*.3
|
|
||||||
NEWS
|
|
||||||
README
|
|
||||||
README.cares
|
|
||||||
CHANGES
|
|
||||||
FILES
|
|
||||||
maketgz
|
|
||||||
aclocal.m4
|
|
||||||
acinclude.m4
|
|
||||||
Makefile.in
|
|
||||||
Makefile.dj
|
|
||||||
Makefile.m32
|
|
||||||
Makefile.netware
|
|
||||||
Makefile.vc6
|
|
||||||
install-sh
|
|
||||||
mkinstalldirs
|
|
||||||
configure
|
|
||||||
configure.ac
|
|
||||||
config.guess
|
|
||||||
config.sub
|
|
||||||
vc/adig/adig.dep
|
|
||||||
vc/adig/adig.dsp
|
|
||||||
vc/adig/adig.mak
|
|
||||||
vc/adig/adig.plg
|
|
||||||
vc/vc.dsw
|
|
||||||
vc/ahost/ahost.dep
|
|
||||||
vc/ahost/ahost.dsp
|
|
||||||
vc/ahost/ahost.mak
|
|
||||||
vc/ahost/ahost.plg
|
|
||||||
vc/areslib/areslib.dep
|
|
||||||
vc/areslib/areslib.dsp
|
|
||||||
vc/areslib/areslib.mak
|
|
||||||
vc/areslib/areslib.plg
|
|
||||||
105
ares/Makefile.am
105
ares/Makefile.am
@@ -1,14 +1,45 @@
|
|||||||
AUTOMAKE_OPTIONS = foreign
|
AUTOMAKE_OPTIONS = foreign nostdinc
|
||||||
|
|
||||||
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
|
# Specify our include paths here, and do it relative to $(top_srcdir) and
|
||||||
|
# $(top_builddir), to ensure that these paths which belong to the library
|
||||||
|
# being currently built and tested are searched before the library which
|
||||||
|
# might possibly already be installed in the system.
|
||||||
|
#
|
||||||
|
# When using the low-level hard-hacking memory leak tracking code from
|
||||||
|
# libcurl the generated curl/curlbuild.h file must also be reachable.
|
||||||
|
# Using the libcurl lowlevel code from within c-ares library is ugly and
|
||||||
|
# only works when c-ares is built and linked with a similarly debug-build
|
||||||
|
# libcurl, but we do this anyway for convenience.
|
||||||
|
#
|
||||||
|
# $(top_builddir)/../include is for libcurl's generated curl/curlbuild.h file
|
||||||
|
# $(top_srcdir)/../include is for libcurl's external include files
|
||||||
|
# $(top_builddir)/../lib is for libcurl's generated lib/curl_config.h file
|
||||||
|
# $(top_srcdir)/../lib is for libcurl's lib/setup.h and other "private" files
|
||||||
|
# $(top_builddir) is for c-ares's generated ares_config.h file
|
||||||
|
# $(top_srcdir) is for c-ares's ares_setup.h and other "c-ares-private" files
|
||||||
|
|
||||||
|
if CURLDEBUG
|
||||||
|
INCLUDES = -I$(top_builddir)/../include \
|
||||||
|
-I$(top_srcdir)/../include \
|
||||||
|
-I$(top_builddir)/../lib \
|
||||||
|
-I$(top_srcdir)/../lib \
|
||||||
|
-I$(top_builddir) \
|
||||||
|
-I$(top_srcdir)
|
||||||
|
else
|
||||||
|
INCLUDES = -I$(top_builddir) \
|
||||||
|
-I$(top_srcdir)
|
||||||
|
endif
|
||||||
|
|
||||||
lib_LTLIBRARIES = libcares.la
|
lib_LTLIBRARIES = libcares.la
|
||||||
|
|
||||||
man_MANS = $(MANPAGES)
|
man_MANS = $(MANPAGES)
|
||||||
|
|
||||||
MSVCFILES = vc/adig/adig.dep vc/adig/adig.dsp vc/vc.dsw vc/ahost/ahost.dep \
|
MSVCFILES = vc/vc6aws.dsw vc/acountry/vc6acountry.dsp vc/adig/vc6adig.dsp \
|
||||||
vc/ahost/ahost.dsp vc/areslib/areslib.dep vc/areslib/areslib.dsp \
|
vc/ahost/vc6ahost.dsp vc/cares/vc6cares.dsp vc/cares/vc6cares.dsw
|
||||||
vc/areslib/areslib.dsw
|
|
||||||
|
|
||||||
if DEBUGBUILD
|
if CURLDEBUG
|
||||||
PROGS =
|
PROGS =
|
||||||
else
|
else
|
||||||
PROGS = ahost adig acountry
|
PROGS = ahost adig acountry
|
||||||
@@ -19,8 +50,13 @@ noinst_PROGRAMS =$(PROGS)
|
|||||||
# adig and ahost are just sample programs and thus not mentioned with the
|
# adig and ahost are just sample programs and thus not mentioned with the
|
||||||
# regular sources and headers
|
# regular sources and headers
|
||||||
EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj \
|
EXTRA_DIST = AUTHORS CHANGES README.cares Makefile.inc Makefile.dj \
|
||||||
Makefile.m32 Makefile.netware Makefile.vc6 adig.c ahost.c $(man_MANS) \
|
Makefile.m32 Makefile.netware Makefile.vc6 $(man_MANS) $(MSVCFILES) \
|
||||||
$(MSVCFILES) config-win32.h RELEASE-NOTES libcares.pc.in
|
config-win32.h RELEASE-NOTES libcares.pc.in buildconf get_ver.awk maketgz \
|
||||||
|
TODO ares_build.h.in $(PDFPAGES) cares.rc
|
||||||
|
|
||||||
|
CLEANFILES = $(PDFPAGES) $(HTMLPAGES)
|
||||||
|
|
||||||
|
DISTCLEANFILES = ares_build.h
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = libcares.pc
|
pkgconfig_DATA = libcares.pc
|
||||||
@@ -59,7 +95,6 @@ if NO_UNDEFINED
|
|||||||
UNDEF = -no-undefined
|
UNDEF = -no-undefined
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
libcares_la_LDFLAGS = $(UNDEF) $(VER)
|
libcares_la_LDFLAGS = $(UNDEF) $(VER)
|
||||||
|
|
||||||
# Makefile.inc provides the CSOURCES and HHEADERS defines
|
# Makefile.inc provides the CSOURCES and HHEADERS defines
|
||||||
@@ -70,16 +105,56 @@ libcares_la_SOURCES = $(CSOURCES) $(HHEADERS)
|
|||||||
# where to install the c-ares headers
|
# where to install the c-ares headers
|
||||||
libcares_ladir = $(includedir)
|
libcares_ladir = $(includedir)
|
||||||
# what headers to install on 'make install':
|
# what headers to install on 'make install':
|
||||||
libcares_la_HEADERS = ares.h ares_version.h ares_dns.h
|
libcares_la_HEADERS = ares.h ares_version.h ares_dns.h \
|
||||||
|
ares_build.h ares_rules.h
|
||||||
|
|
||||||
ahost_SOURCES = ahost.c ares_getopt.c
|
ahost_SOURCES = ahost.c ares_getopt.c ares_getopt.h
|
||||||
ahost_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
ahost_LDADD = $(top_builddir)/libcares.la
|
||||||
|
|
||||||
adig_SOURCES = adig.c ares_getopt.c
|
adig_SOURCES = adig.c ares_getopt.c ares_getopt.h
|
||||||
adig_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
adig_LDADD = $(top_builddir)/libcares.la
|
||||||
|
|
||||||
acountry_SOURCES = acountry.c ares_getopt.c
|
acountry_SOURCES = acountry.c ares_getopt.c ares_getopt.h
|
||||||
acountry_LDADD = $(top_builddir)/$(lib_LTLIBRARIES)
|
acountry_LDADD = $(top_builddir)/libcares.la
|
||||||
|
|
||||||
|
SOURCEDMANDIR = man3
|
||||||
|
SOURCEDMANPAGES = ares_init.3
|
||||||
|
|
||||||
|
clean-local: clean-sourced-manpages
|
||||||
|
|
||||||
|
clean-sourced-manpages:
|
||||||
|
@srcdmandir='$(SOURCEDMANDIR)'; \
|
||||||
|
echo "rm -rf $(top_builddir)/$$srcdmandir"; \
|
||||||
|
rm -rf $(top_builddir)/$$srcdmandir
|
||||||
|
|
||||||
|
sourced-manpages: clean-sourced-manpages
|
||||||
|
@srcdmandir='$(SOURCEDMANDIR)'; \
|
||||||
|
srcdmanfiles='$(SOURCEDMANPAGES)'; \
|
||||||
|
mkdir $(top_builddir)/$$srcdmandir; \
|
||||||
|
for file in $$srcdmanfiles; do \
|
||||||
|
if test -f $(top_srcdir)/$$file; then \
|
||||||
|
echo "cp $(top_srcdir)/$$file $(top_builddir)/$$srcdmandir/$$file"; \
|
||||||
|
cp $(top_srcdir)/$$file $(top_builddir)/$$srcdmandir/$$file; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
|
||||||
|
MAN2HTML = roffit --mandir=. < $< >$@
|
||||||
|
|
||||||
|
SUFFIXES = .3 .html
|
||||||
|
|
||||||
|
html: sourced-manpages $(HTMLPAGES)
|
||||||
|
|
||||||
|
.3.html:
|
||||||
|
$(MAN2HTML)
|
||||||
|
|
||||||
|
pdf: sourced-manpages $(PDFPAGES)
|
||||||
|
|
||||||
|
.3.pdf:
|
||||||
|
@(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \
|
||||||
|
groff -Tps -man $< >$$foo.ps; \
|
||||||
|
ps2pdf $$foo.ps $@; \
|
||||||
|
rm $$foo.ps; \
|
||||||
|
echo "converted $< to $@")
|
||||||
|
|
||||||
# Make files named *.dist replace the file without .dist extension
|
# Make files named *.dist replace the file without .dist extension
|
||||||
dist-hook:
|
dist-hook:
|
||||||
|
|||||||
@@ -1,32 +1,22 @@
|
|||||||
#
|
#
|
||||||
# c-ares Makefile for djgpp/gcc/Watt-32.
|
# c-ares Makefile for djgpp/gcc/Watt-32.
|
||||||
# By Gisle Vanem <giva@bgnett.no> 2004.
|
# By Gisle Vanem <gvanem@broadpark.no> 2004.
|
||||||
#
|
#
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
|
|
||||||
TOPDIR = ..
|
TOPDIR = ..
|
||||||
|
|
||||||
include ../packages/DOS/common.dj
|
DEPEND_PREREQ = ares_config.h
|
||||||
|
|
||||||
|
include ../packages/DOS/common.dj
|
||||||
include Makefile.inc
|
include Makefile.inc
|
||||||
|
|
||||||
CFLAGS += -DWATT32 -DHAVE_AF_INET6 -DHAVE_PF_INET6 -DHAVE_FIONBIO \
|
CFLAGS += -DWATT32 -Dselect=select_s
|
||||||
-DHAVE_STRUCT_IN6_ADDR -DHAVE_SOCKADDR_IN6_SIN6_SCOPE_ID \
|
|
||||||
-DHAVE_SYS_TIME_H -DHAVE_STRUCT_SOCKADDR_IN6 -DHAVE_STRUCT_ADDRINFO \
|
|
||||||
-DHAVE_SIGNAL_H -DHAVE_SIG_ATOMIC_T -DRETSIGTYPE='void' -DHAVE_PROCESS_H \
|
|
||||||
-DHAVE_ARPA_NAMESER_H -DHAVE_SYS_SOCKET_H -DHAVE_SYS_UIO_H -DHAVE_NETINET_IN_H \
|
|
||||||
-DHAVE_NETINET_TCP_H -DNS_INADDRSZ=4 -DHAVE_RECV -DHAVE_SEND \
|
|
||||||
-DSEND_TYPE_ARG1='int' -DSEND_QUAL_ARG2='const' \
|
|
||||||
-DSEND_TYPE_ARG2='void*' -DSEND_TYPE_ARG3='int' \
|
|
||||||
-DSEND_TYPE_ARG4='int' -DSEND_TYPE_RETV='int' \
|
|
||||||
-DRECV_TYPE_ARG1='int' -DRECV_TYPE_ARG2='void*' \
|
|
||||||
-DRECV_TYPE_ARG3='int' -DRECV_TYPE_ARG4='int' \
|
|
||||||
-DRECV_TYPE_RETV='int' -DHAVE_STRUCT_TIMEVAL \
|
|
||||||
-Dselect=select_s -Dsocklen_t=int -UHAVE_CONFIG_H
|
|
||||||
|
|
||||||
LDFLAGS = -s
|
LDFLAGS = -s
|
||||||
|
|
||||||
ifeq ($(USE_DEBUG),1)
|
ifeq ($(USE_CURLDEBUG),1)
|
||||||
EX_LIBS = ../lib/libcurl.a
|
EX_LIBS = ../lib/libcurl.a
|
||||||
OBJ_HACK = $(OBJECTS)
|
OBJ_HACK = $(OBJECTS)
|
||||||
else
|
else
|
||||||
@@ -49,12 +39,15 @@ EX_LIBS += $(WATT32_ROOT)/lib/libwatt.a
|
|||||||
|
|
||||||
OBJECTS = $(addprefix $(OBJ_DIR)/, $(CSOURCES:.c=.o))
|
OBJECTS = $(addprefix $(OBJ_DIR)/, $(CSOURCES:.c=.o))
|
||||||
|
|
||||||
all: $(OBJ_DIR) libcares.a ahost.exe adig.exe acountry.exe
|
all: $(OBJ_DIR) ares_config.h libcares.a ahost.exe adig.exe acountry.exe
|
||||||
@echo Welcome to c-ares.
|
@echo Welcome to c-ares.
|
||||||
|
|
||||||
libcares.a: $(OBJECTS)
|
libcares.a: $(OBJECTS)
|
||||||
ar rs $@ $?
|
ar rs $@ $?
|
||||||
|
|
||||||
|
ares_config.h: config.dos
|
||||||
|
$(COPY) $^ $@
|
||||||
|
|
||||||
ahost.exe: ahost.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
|
ahost.exe: ahost.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
|
||||||
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
|
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
|
||||||
|
|
||||||
@@ -64,12 +57,30 @@ adig.exe: adig.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
|
|||||||
acountry.exe: acountry.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
|
acountry.exe: acountry.c $(OBJ_DIR)/ares_getopt.o $(OBJ_HACK)
|
||||||
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
|
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(EX_LIBS)
|
||||||
|
|
||||||
clean:
|
# clean generated files
|
||||||
rm -f $(OBJECTS) libcares.a
|
#
|
||||||
|
genclean:
|
||||||
|
- $(DELETE) ares_config.h
|
||||||
|
|
||||||
vclean realclean: clean
|
# clean object files and subdir
|
||||||
rm -f ahost.exe adig.exe acountry.exe depend.dj
|
#
|
||||||
- rmdir $(OBJ_DIR)
|
objclean: genclean
|
||||||
|
- $(DELETE) $(OBJ_DIR)$(DS)*.o
|
||||||
|
- $(RMDIR) $(OBJ_DIR)
|
||||||
|
|
||||||
|
# clean without removing built library and programs
|
||||||
|
#
|
||||||
|
clean: objclean
|
||||||
|
- $(DELETE) depend.dj
|
||||||
|
|
||||||
|
# clean everything
|
||||||
|
#
|
||||||
|
realclean vclean: clean
|
||||||
|
- $(DELETE) libcares.a
|
||||||
|
- $(DELETE) acountry.exe
|
||||||
|
- $(DELETE) adig.exe
|
||||||
|
- $(DELETE) ahost.exe
|
||||||
|
- $(DELETE) libcares.a
|
||||||
|
|
||||||
-include depend.dj
|
-include depend.dj
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,165 @@
|
|||||||
CSOURCES = ares_fds.c ares_getsock.c ares_process.c ares_free_hostent.c \
|
|
||||||
ares_query.c ares__close_sockets.c ares_free_string.c ares_search.c \
|
|
||||||
ares__get_hostent.c ares_gethostbyaddr.c ares_send.c ares__read_line.c \
|
|
||||||
ares_gethostbyname.c ares_strerror.c ares_cancel.c ares_init.c \
|
|
||||||
ares_timeout.c ares_destroy.c ares_mkquery.c ares_version.c \
|
|
||||||
ares_expand_name.c ares_parse_a_reply.c windows_port.c \
|
|
||||||
ares_expand_string.c ares_parse_ptr_reply.c ares_parse_aaaa_reply.c \
|
|
||||||
ares_getnameinfo.c inet_net_pton.c bitncmp.c inet_ntop.c \
|
|
||||||
ares_parse_ns_reply.c ares_llist.c
|
|
||||||
|
|
||||||
HHEADERS = ares.h ares_private.h setup.h ares_dns.h ares_version.h \
|
CSOURCES = ares__close_sockets.c \
|
||||||
nameser.h inet_net_pton.h inet_ntop.h ares_ipv6.h bitncmp.h \
|
ares__get_hostent.c \
|
||||||
setup_once.h ares_llist.h
|
ares__read_line.c \
|
||||||
|
ares__timeval.c \
|
||||||
|
ares_cancel.c \
|
||||||
|
ares_destroy.c \
|
||||||
|
ares_expand_name.c \
|
||||||
|
ares_expand_string.c \
|
||||||
|
ares_fds.c \
|
||||||
|
ares_free_hostent.c \
|
||||||
|
ares_free_string.c \
|
||||||
|
ares_gethostbyaddr.c \
|
||||||
|
ares_gethostbyname.c \
|
||||||
|
ares_getnameinfo.c \
|
||||||
|
ares_getsock.c \
|
||||||
|
ares_init.c \
|
||||||
|
ares_library_init.c \
|
||||||
|
ares_llist.c \
|
||||||
|
ares_mkquery.c \
|
||||||
|
ares_parse_a_reply.c \
|
||||||
|
ares_parse_aaaa_reply.c \
|
||||||
|
ares_parse_ns_reply.c \
|
||||||
|
ares_parse_ptr_reply.c \
|
||||||
|
ares_parse_srv_reply.c \
|
||||||
|
ares_parse_txt_reply.c \
|
||||||
|
ares_process.c \
|
||||||
|
ares_query.c \
|
||||||
|
ares_search.c \
|
||||||
|
ares_send.c \
|
||||||
|
ares_strcasecmp.c \
|
||||||
|
ares_strdup.c \
|
||||||
|
ares_strerror.c \
|
||||||
|
ares_timeout.c \
|
||||||
|
ares_version.c \
|
||||||
|
ares_writev.c \
|
||||||
|
bitncmp.c \
|
||||||
|
inet_net_pton.c \
|
||||||
|
inet_ntop.c \
|
||||||
|
windows_port.c
|
||||||
|
|
||||||
|
HHEADERS = ares.h \
|
||||||
|
ares_build.h \
|
||||||
|
ares_dns.h \
|
||||||
|
ares_ipv6.h \
|
||||||
|
ares_library_init.h \
|
||||||
|
ares_llist.h \
|
||||||
|
ares_private.h \
|
||||||
|
ares_rules.h \
|
||||||
|
ares_strcasecmp.h \
|
||||||
|
ares_strdup.h \
|
||||||
|
ares_version.h \
|
||||||
|
ares_writev.h \
|
||||||
|
bitncmp.h \
|
||||||
|
inet_net_pton.h \
|
||||||
|
inet_ntop.h \
|
||||||
|
nameser.h \
|
||||||
|
ares_setup.h \
|
||||||
|
setup_once.h
|
||||||
|
|
||||||
|
MANPAGES = ares_cancel.3 \
|
||||||
|
ares_destroy.3 \
|
||||||
|
ares_destroy_options.3 \
|
||||||
|
ares_dup.3 \
|
||||||
|
ares_expand_name.3 \
|
||||||
|
ares_expand_string.3 \
|
||||||
|
ares_fds.3 \
|
||||||
|
ares_free_hostent.3 \
|
||||||
|
ares_free_string.3 \
|
||||||
|
ares_gethostbyaddr.3 \
|
||||||
|
ares_gethostbyname.3 \
|
||||||
|
ares_gethostbyname_file.3 \
|
||||||
|
ares_getnameinfo.3 \
|
||||||
|
ares_getsock.3 \
|
||||||
|
ares_init.3 \
|
||||||
|
ares_init_options.3 \
|
||||||
|
ares_library_cleanup.3 \
|
||||||
|
ares_library_init.3 \
|
||||||
|
ares_mkquery.3 \
|
||||||
|
ares_parse_a_reply.3 \
|
||||||
|
ares_parse_aaaa_reply.3 \
|
||||||
|
ares_parse_ns_reply.3 \
|
||||||
|
ares_parse_ptr_reply.3 \
|
||||||
|
ares_parse_srv_reply.3 \
|
||||||
|
ares_parse_txt_reply.3 \
|
||||||
|
ares_process.3 \
|
||||||
|
ares_query.3 \
|
||||||
|
ares_save_options.3 \
|
||||||
|
ares_search.3 \
|
||||||
|
ares_send.3 \
|
||||||
|
ares_set_socket_callback.3 \
|
||||||
|
ares_strerror.3 \
|
||||||
|
ares_timeout.3 \
|
||||||
|
ares_version.3
|
||||||
|
|
||||||
|
HTMLPAGES = ares_cancel.html \
|
||||||
|
ares_destroy.html \
|
||||||
|
ares_destroy_options.html \
|
||||||
|
ares_dup.html \
|
||||||
|
ares_expand_name.html \
|
||||||
|
ares_expand_string.html \
|
||||||
|
ares_fds.html \
|
||||||
|
ares_free_hostent.html \
|
||||||
|
ares_free_string.html \
|
||||||
|
ares_gethostbyaddr.html \
|
||||||
|
ares_gethostbyname.html \
|
||||||
|
ares_gethostbyname_file.html \
|
||||||
|
ares_getnameinfo.html \
|
||||||
|
ares_getsock.html \
|
||||||
|
ares_init.html \
|
||||||
|
ares_init_options.html \
|
||||||
|
ares_library_cleanup.html \
|
||||||
|
ares_library_init.html \
|
||||||
|
ares_mkquery.html \
|
||||||
|
ares_parse_a_reply.html \
|
||||||
|
ares_parse_aaaa_reply.html \
|
||||||
|
ares_parse_ns_reply.html \
|
||||||
|
ares_parse_ptr_reply.html \
|
||||||
|
ares_parse_srv_reply.html \
|
||||||
|
ares_parse_txt_reply.html \
|
||||||
|
ares_process.html \
|
||||||
|
ares_query.html \
|
||||||
|
ares_save_options.html \
|
||||||
|
ares_search.html \
|
||||||
|
ares_send.html \
|
||||||
|
ares_set_socket_callback.html \
|
||||||
|
ares_strerror.html \
|
||||||
|
ares_timeout.html \
|
||||||
|
ares_version.html
|
||||||
|
|
||||||
|
PDFPAGES = ares_cancel.pdf \
|
||||||
|
ares_destroy.pdf \
|
||||||
|
ares_destroy_options.pdf \
|
||||||
|
ares_dup.pdf \
|
||||||
|
ares_expand_name.pdf \
|
||||||
|
ares_expand_string.pdf \
|
||||||
|
ares_fds.pdf \
|
||||||
|
ares_free_hostent.pdf \
|
||||||
|
ares_free_string.pdf \
|
||||||
|
ares_gethostbyaddr.pdf \
|
||||||
|
ares_gethostbyname.pdf \
|
||||||
|
ares_gethostbyname_file.pdf \
|
||||||
|
ares_getnameinfo.pdf \
|
||||||
|
ares_getsock.pdf \
|
||||||
|
ares_init.pdf \
|
||||||
|
ares_init_options.pdf \
|
||||||
|
ares_library_cleanup.pdf \
|
||||||
|
ares_library_init.pdf \
|
||||||
|
ares_mkquery.pdf \
|
||||||
|
ares_parse_a_reply.pdf \
|
||||||
|
ares_parse_aaaa_reply.pdf \
|
||||||
|
ares_parse_ns_reply.pdf \
|
||||||
|
ares_parse_ptr_reply.pdf \
|
||||||
|
ares_parse_srv_reply.pdf \
|
||||||
|
ares_parse_txt_reply.pdf \
|
||||||
|
ares_process.pdf \
|
||||||
|
ares_query.pdf \
|
||||||
|
ares_save_options.pdf \
|
||||||
|
ares_search.pdf \
|
||||||
|
ares_send.pdf \
|
||||||
|
ares_set_socket_callback.pdf \
|
||||||
|
ares_strerror.pdf \
|
||||||
|
ares_timeout.pdf \
|
||||||
|
ares_version.pdf
|
||||||
|
|
||||||
MANPAGES= ares_destroy.3 ares_expand_name.3 ares_expand_string.3 ares_fds.3 \
|
|
||||||
ares_free_hostent.3 ares_free_string.3 ares_gethostbyaddr.3 \
|
|
||||||
ares_gethostbyname.3 ares_init.3 ares_init_options.3 ares_mkquery.3 \
|
|
||||||
ares_parse_a_reply.3 ares_parse_ptr_reply.3 ares_process.3 \
|
|
||||||
ares_query.3 ares_search.3 ares_send.3 ares_strerror.3 ares_timeout.3 \
|
|
||||||
ares_version.3 ares_cancel.3 ares_parse_aaaa_reply.3 ares_getnameinfo.3 \
|
|
||||||
ares_getsock.3 ares_parse_ns_reply.3 \
|
|
||||||
ares_destroy_options.3 ares_save_options.3
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ tags:
|
|||||||
%.exe: %.o ares_getopt.o $(LIB)
|
%.exe: %.o ares_getopt.o $(LIB)
|
||||||
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
|
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||||
|
|
||||||
$(OBJLIB): ares.h ares_dns.h ares_private.h
|
$(OBJLIB): ares.h ares_dns.h ares_private.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
$(CC) $(CFLAGS) -c $<
|
$(CC) $(CFLAGS) -c $<
|
||||||
@@ -55,7 +55,8 @@ install:
|
|||||||
${RANLIB} ${DESTDIR}${libdir}/$(LIB)
|
${RANLIB} ${DESTDIR}${libdir}/$(LIB)
|
||||||
chmod u-w ${DESTDIR}${libdir}/$(LIB)
|
chmod u-w ${DESTDIR}${libdir}/$(LIB)
|
||||||
${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir}
|
${INSTALL} -m 444 ${srcdir}/ares.h ${DESTDIR}${includedir}
|
||||||
${INSTALL} -m 444 ${srcdir}/ares_version.h ${DESTDIR}${includedir}
|
${INSTALL} -m 444 ${srcdir}/ares_build.h ${DESTDIR}${includedir}
|
||||||
|
${INSTALL} -m 444 ${srcdir}/ares_rules.h ${DESTDIR}${includedir}
|
||||||
(for man in $(MANPAGES); do \
|
(for man in $(MANPAGES); do \
|
||||||
${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \
|
${INSTALL} -m 444 ${srcdir}/$${man} ${DESTDIR}${mandir}/man3; \
|
||||||
done)
|
done)
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ MKDIR = mkdir
|
|||||||
MPKXDC = mkxdc
|
MPKXDC = mkxdc
|
||||||
|
|
||||||
# Global flags for all compilers
|
# Global flags for all compilers
|
||||||
CFLAGS = $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
|
CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
|
||||||
|
|
||||||
ifeq ($(CC),mwccnlm)
|
ifeq ($(CC),mwccnlm)
|
||||||
LD = mwldnlm
|
LD = mwldnlm
|
||||||
@@ -160,7 +160,7 @@ lib: prebuild $(LTARGET)
|
|||||||
|
|
||||||
nlm: prebuild $(TARGETS)
|
nlm: prebuild $(TARGETS)
|
||||||
|
|
||||||
prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h arpa/nameser.h
|
prebuild: $(OBJDIR) ares_build.h $(OBJDIR)/version.inc ares_config.h
|
||||||
|
|
||||||
install: $(INSTDIR) all
|
install: $(INSTDIR) all
|
||||||
@$(CP) *.nlm $(INSTDIR)
|
@$(CP) *.nlm $(INSTDIR)
|
||||||
@@ -170,7 +170,7 @@ install: $(INSTDIR) all
|
|||||||
@$(CP) ../RELEASE-NOTES $(INSTDIR)
|
@$(CP) ../RELEASE-NOTES $(INSTDIR)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-$(RM) $(LTARGET) $(TARGETS) config.h
|
-$(RM) $(LTARGET) $(TARGETS) ares_config.h
|
||||||
-$(RM) -r $(OBJDIR)
|
-$(RM) -r $(OBJDIR)
|
||||||
-$(RM) -r arpa
|
-$(RM) -r arpa
|
||||||
|
|
||||||
@@ -269,7 +269,7 @@ ifeq ($(LD),nlmconv)
|
|||||||
@echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
|
@echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
config.h: Makefile.netware
|
ares_config.h: Makefile.netware
|
||||||
@echo Creating $@
|
@echo Creating $@
|
||||||
@echo $(DL)/* $@ for NetWare target.$(DL) > $@
|
@echo $(DL)/* $@ for NetWare target.$(DL) > $@
|
||||||
@echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
|
@echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
|
||||||
@@ -282,31 +282,34 @@ config.h: Makefile.netware
|
|||||||
@echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
|
@echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
|
||||||
ifeq ($(LIBARCH),CLIB)
|
ifeq ($(LIBARCH),CLIB)
|
||||||
@echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@
|
@echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@
|
||||||
@echo $(DL)#define MAXHOSTNAMELEN 256$(DL) >> $@
|
@echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_STRNICMP 1$(DL) >> $@
|
||||||
@echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@
|
@echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_ARG2 char$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_ARG3 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_ARG6 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_RETV int$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
|
||||||
@echo $(DL)#define socklen_t int$(DL) >> $@
|
|
||||||
@echo $(DL)#define strncasecmp strnicmp$(DL) >> $@
|
|
||||||
@echo $(DL)#define strcasecmp stricmp$(DL) >> $@
|
|
||||||
else
|
else
|
||||||
@echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
|
@echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
|
@echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@
|
@echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
|
@echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
@echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
|
||||||
@@ -318,6 +321,9 @@ else
|
|||||||
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
|
@echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
|
@echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_FREEADDRINFO 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_GETADDRINFO 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
|
@echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
|
||||||
@@ -325,6 +331,14 @@ else
|
|||||||
@echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG3 size_t$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
|
||||||
@echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@
|
@echo $(DL)#define RECV_TYPE_RETV ssize_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_ARG1 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_ARG2 void$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_ARG3 size_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_ARG4 int$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_ARG5 struct sockaddr$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_ARG6 size_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_RETV ssize_t$(DL) >> $@
|
||||||
|
@echo $(DL)#define RECVFROM_TYPE_ARG2_IS_VOID 1$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
@echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
|
||||||
@echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@
|
@echo $(DL)#define SEND_TYPE_ARG2 void *$(DL) >> $@
|
||||||
@@ -334,22 +348,24 @@ else
|
|||||||
@echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
|
@echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_ARPA_NAMESER_H 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
|
|
||||||
@echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
|
@echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_GETHOSTBYNAME 1$(DL) >> $@
|
@echo $(DL)#define HAVE_GETHOSTBYNAME 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_GETHOSTNAME 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@
|
@echo $(DL)#define HAVE_GETPROTOBYNAME 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@
|
@echo $(DL)#define HAVE_GMTIME_R 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
@echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
|
@echo $(DL)#define HAVE_IOCTL 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_IOCTL_FIONBIO 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_LL 1$(DL) >> $@
|
@echo $(DL)#define HAVE_LL 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@
|
@echo $(DL)#define HAVE_LOCALTIME_R 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
|
@echo $(DL)#define HAVE_RECV 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_RECVFROM 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SEND 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SEND 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
|
||||||
@@ -372,8 +388,8 @@ endif
|
|||||||
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_UTIME 1$(DL) >> $@
|
@echo $(DL)#define HAVE_UTIME 1$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@
|
@echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@
|
||||||
|
@echo $(DL)#define HAVE_WRITEV 1$(DL) >> $@
|
||||||
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
@echo $(DL)#define RETSIGTYPE void$(DL) >> $@
|
||||||
@echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
|
|
||||||
@echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
|
@echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
|
||||||
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
@echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
|
||||||
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
|
@echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
|
||||||
@@ -390,13 +406,24 @@ endif
|
|||||||
@echo $(DL)#else$(DL) >> $@
|
@echo $(DL)#else$(DL) >> $@
|
||||||
@echo $(DL)#define HAVE_VARIADIC_MACROS_C99 1$(DL) >> $@
|
@echo $(DL)#define HAVE_VARIADIC_MACROS_C99 1$(DL) >> $@
|
||||||
@echo $(DL)#endif$(DL) >> $@
|
@echo $(DL)#endif$(DL) >> $@
|
||||||
ifdef OLD_NOVELLSDK
|
|
||||||
@echo $(DL)#define socklen_t int$(DL) >> $@
|
FORCE: ;
|
||||||
|
|
||||||
|
ares_build.h: Makefile.netware FORCE
|
||||||
|
@echo Creating $@
|
||||||
|
@echo $(DL)/* $@ intended for NetWare target.$(DL) > $@
|
||||||
|
@echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
|
||||||
|
@echo $(DL)** All your changes will be lost!!$(DL) >> $@
|
||||||
|
@echo $(DL)*/$(DL) >> $@
|
||||||
|
@echo $(DL)#ifndef __CARES_BUILD_H$(DL) >> $@
|
||||||
|
@echo $(DL)#define __CARES_BUILD_H$(DL) >> $@
|
||||||
|
ifeq ($(LIBARCH),CLIB)
|
||||||
|
@echo $(DL)#define CARES_TYPEOF_ARES_SOCKLEN_T int$(DL) >> $@
|
||||||
|
@echo $(DL)#define CARES_SIZEOF_ARES_SOCKLEN_T 4$(DL) >> $@
|
||||||
|
else
|
||||||
|
@echo $(DL)#define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int$(DL) >> $@
|
||||||
|
@echo $(DL)#define CARES_SIZEOF_ARES_SOCKLEN_T 4$(DL) >> $@
|
||||||
endif
|
endif
|
||||||
|
@echo $(DL)#define CARES_SIZEOF_LONG 4$(DL) >> $@
|
||||||
arpa/nameser.h: nameser.h
|
@echo $(DL)typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;$(DL) >> $@
|
||||||
@echo Fix missing header $@
|
@echo $(DL)#endif /* __CARES_BUILD_H */$(DL) >> $@
|
||||||
@-mkdir arpa
|
|
||||||
@$(CP) $< arpa
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# $Id$
|
# $Id$
|
||||||
#
|
#
|
||||||
# C-ares makefile for MSVC6+
|
# C-ares makefile for MSVC6+
|
||||||
# G. Vanem <giva@bgnett.no>.
|
# G. Vanem <gvanem@broadpark.no>.
|
||||||
#
|
#
|
||||||
|
|
||||||
CFG_MODEL = MD
|
CFG_MODEL = MD
|
||||||
@@ -12,8 +12,8 @@ USE_WATT32 = 0
|
|||||||
# Configurations:
|
# Configurations:
|
||||||
# -MD - msvcrt.dll, threads, release (normal)
|
# -MD - msvcrt.dll, threads, release (normal)
|
||||||
# -MDd - msvcrtd.dll, threads, debug
|
# -MDd - msvcrtd.dll, threads, debug
|
||||||
# -ML - libc, no threads, release
|
# -ML - libc, no threads, release (not available on VC-2008+)
|
||||||
# -MLd - libc, no threads, debug
|
# -MLd - libc, no threads, debug (not available on VC-2008+)
|
||||||
# -MT - libc, threads, release
|
# -MT - libc, threads, release
|
||||||
# -MTd - libc, threads, debug
|
# -MTd - libc, threads, debug
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ EX_LIBS = advapi32.lib ws2_32.lib
|
|||||||
!endif
|
!endif
|
||||||
|
|
||||||
!if "$(DEBUG_MODEL)" == "d"
|
!if "$(DEBUG_MODEL)" == "d"
|
||||||
CFLAGS = $(CFLAGS) -D_DEBUG -GZ
|
CFLAGS = $(CFLAGS) -DDEBUGBUILD -D_DEBUG -GZ
|
||||||
LDFLAGS = $(LDFLAGS) -debug -fixed:no
|
LDFLAGS = $(LDFLAGS) -debug -fixed:no
|
||||||
|
|
||||||
!else
|
!else
|
||||||
@@ -43,6 +43,8 @@ CFLAGS = $(CFLAGS) -O2 -Og
|
|||||||
LDFLAGS = $(LDFLAGS) -release
|
LDFLAGS = $(LDFLAGS) -release
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
|
CFLAGS = $(CFLAGS) -I.\.
|
||||||
|
|
||||||
OBJECTS = $(OBJ_DIR)\ares_fds.obj \
|
OBJECTS = $(OBJ_DIR)\ares_fds.obj \
|
||||||
$(OBJ_DIR)\ares_process.obj \
|
$(OBJ_DIR)\ares_process.obj \
|
||||||
$(OBJ_DIR)\ares_free_hostent.obj \
|
$(OBJ_DIR)\ares_free_hostent.obj \
|
||||||
@@ -57,11 +59,14 @@ OBJECTS = $(OBJ_DIR)\ares_fds.obj \
|
|||||||
$(OBJ_DIR)\ares__read_line.obj \
|
$(OBJ_DIR)\ares__read_line.obj \
|
||||||
$(OBJ_DIR)\ares_gethostbyname.obj \
|
$(OBJ_DIR)\ares_gethostbyname.obj \
|
||||||
$(OBJ_DIR)\ares_getnameinfo.obj \
|
$(OBJ_DIR)\ares_getnameinfo.obj \
|
||||||
|
$(OBJ_DIR)\ares_strcasecmp.obj \
|
||||||
$(OBJ_DIR)\ares_strerror.obj \
|
$(OBJ_DIR)\ares_strerror.obj \
|
||||||
$(OBJ_DIR)\ares_cancel.obj \
|
$(OBJ_DIR)\ares_cancel.obj \
|
||||||
$(OBJ_DIR)\ares_init.obj \
|
$(OBJ_DIR)\ares_init.obj \
|
||||||
|
$(OBJ_DIR)\ares_library_init.obj \
|
||||||
$(OBJ_DIR)\ares_llist.obj \
|
$(OBJ_DIR)\ares_llist.obj \
|
||||||
$(OBJ_DIR)\ares_timeout.obj \
|
$(OBJ_DIR)\ares_timeout.obj \
|
||||||
|
$(OBJ_DIR)\ares__timeval.obj \
|
||||||
$(OBJ_DIR)\ares_destroy.obj \
|
$(OBJ_DIR)\ares_destroy.obj \
|
||||||
$(OBJ_DIR)\ares_mkquery.obj \
|
$(OBJ_DIR)\ares_mkquery.obj \
|
||||||
$(OBJ_DIR)\ares_version.obj \
|
$(OBJ_DIR)\ares_version.obj \
|
||||||
@@ -69,9 +74,11 @@ OBJECTS = $(OBJ_DIR)\ares_fds.obj \
|
|||||||
$(OBJ_DIR)\ares_parse_a_reply.obj \
|
$(OBJ_DIR)\ares_parse_a_reply.obj \
|
||||||
$(OBJ_DIR)\ares_parse_aaaa_reply.obj \
|
$(OBJ_DIR)\ares_parse_aaaa_reply.obj \
|
||||||
$(OBJ_DIR)\ares_parse_ns_reply.obj \
|
$(OBJ_DIR)\ares_parse_ns_reply.obj \
|
||||||
|
$(OBJ_DIR)\ares_parse_srv_reply.obj \
|
||||||
$(OBJ_DIR)\windows_port.obj \
|
$(OBJ_DIR)\windows_port.obj \
|
||||||
$(OBJ_DIR)\ares_expand_string.obj \
|
$(OBJ_DIR)\ares_expand_string.obj \
|
||||||
$(OBJ_DIR)\ares_parse_ptr_reply.obj \
|
$(OBJ_DIR)\ares_parse_ptr_reply.obj \
|
||||||
|
$(OBJ_DIR)\ares_writev.obj \
|
||||||
$(OBJ_DIR)\bitncmp.obj \
|
$(OBJ_DIR)\bitncmp.obj \
|
||||||
$(OBJ_DIR)\inet_net_pton.obj \
|
$(OBJ_DIR)\inet_net_pton.obj \
|
||||||
$(OBJ_DIR)\inet_ntop.obj
|
$(OBJ_DIR)\inet_ntop.obj
|
||||||
@@ -105,11 +112,14 @@ $(DEF_FILE): $(OBJECTS) Makefile.VC6
|
|||||||
@echo ares_getsock >> $@
|
@echo ares_getsock >> $@
|
||||||
@echo ares_init >> $@
|
@echo ares_init >> $@
|
||||||
@echo ares_init_options >> $@
|
@echo ares_init_options >> $@
|
||||||
|
@echo ares_library_init >> $@
|
||||||
|
@echo ares_library_cleanup >> $@
|
||||||
@echo ares_mkquery >> $@
|
@echo ares_mkquery >> $@
|
||||||
@echo ares_parse_a_reply >> $@
|
@echo ares_parse_a_reply >> $@
|
||||||
@echo ares_parse_ptr_reply >> $@
|
@echo ares_parse_ptr_reply >> $@
|
||||||
@echo ares_parse_ns_reply >> $@
|
@echo ares_parse_ns_reply >> $@
|
||||||
@echo ares_process >> $@
|
@echo ares_process >> $@
|
||||||
|
@echo ares_process_fd >> $@
|
||||||
@echo ares_query >> $@
|
@echo ares_query >> $@
|
||||||
@echo ares_search >> $@
|
@echo ares_search >> $@
|
||||||
@echo ares_strerror >> $@
|
@echo ares_strerror >> $@
|
||||||
@@ -120,10 +130,11 @@ $(DEF_FILE): $(OBJECTS) Makefile.VC6
|
|||||||
@echo ares_inet_net_pton >> $@
|
@echo ares_inet_net_pton >> $@
|
||||||
@echo ares_inet_ntop >> $@
|
@echo ares_inet_ntop >> $@
|
||||||
@echo ares_inet_pton >> $@
|
@echo ares_inet_pton >> $@
|
||||||
@echo ares_writev >> $@
|
|
||||||
@echo ares_getnameinfo >> $@
|
@echo ares_getnameinfo >> $@
|
||||||
@echo ares_gettimeofday >> $@
|
|
||||||
@echo ares_parse_aaaa_reply >> $@
|
@echo ares_parse_aaaa_reply >> $@
|
||||||
|
!if "$(USE_WATT32)" == "0"
|
||||||
|
@echo ares_writev >> $@
|
||||||
|
!endif
|
||||||
|
|
||||||
ahost.exe: $(OBJ_DIR) $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
|
ahost.exe: $(OBJ_DIR) $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib
|
||||||
link $(LDFLAGS) -out:$@ $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib $(EX_LIBS)
|
link $(LDFLAGS) -out:$@ $(OBJ_DIR)\ahost.obj $(OBJ_DIR)\ares_getopt.obj cares_imp.lib $(EX_LIBS)
|
||||||
@@ -138,7 +149,8 @@ clean:
|
|||||||
- del $(OBJ_DIR)\*.obj *.ilk *.pdb *.pbt *.pbi *.pbo *._xe *.map
|
- del $(OBJ_DIR)\*.obj *.ilk *.pdb *.pbt *.pbi *.pbo *._xe *.map
|
||||||
|
|
||||||
vclean realclean: clean
|
vclean realclean: clean
|
||||||
- del $(DEF_FILE) cares.lib cares_imp.* cares.dll ahost.exe adig.exe
|
- del $(DEF_FILE) cares.lib cares_imp.* cares.dll
|
||||||
|
- del ahost.exe adig.exe acountry.exe
|
||||||
- rd $(OBJ_DIR)
|
- rd $(OBJ_DIR)
|
||||||
|
|
||||||
.c{$(OBJ_DIR)}.obj:
|
.c{$(OBJ_DIR)}.obj:
|
||||||
@@ -147,94 +159,117 @@ vclean realclean: clean
|
|||||||
#
|
#
|
||||||
# Copyright "gcc -MM .."
|
# Copyright "gcc -MM .."
|
||||||
#
|
#
|
||||||
$(OBJ_DIR)\ares_fds.obj: ares_fds.c setup.h setup_once.h ares.h ares_private.h \
|
$(OBJ_DIR)\ares_fds.obj: ares_fds.c ares_setup.h setup_once.h ares.h ares_private.h \
|
||||||
ares_ipv6.h
|
ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_process.obj: ares_process.c setup.h setup_once.h nameser.h \
|
$(OBJ_DIR)\ares_process.obj: ares_process.c ares_setup.h setup_once.h nameser.h \
|
||||||
ares.h ares_dns.h ares_private.h ares_ipv6.h
|
ares.h ares_dns.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_free_hostent.obj: ares_free_hostent.c setup.h setup_once.h \
|
$(OBJ_DIR)\ares_free_hostent.obj: ares_free_hostent.c ares_setup.h setup_once.h \
|
||||||
ares.h ares_private.h ares_ipv6.h
|
ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_query.obj: ares_query.c setup.h setup_once.h nameser.h \
|
$(OBJ_DIR)\ares_query.obj: ares_query.c ares_setup.h setup_once.h nameser.h \
|
||||||
ares.h ares_dns.h ares_private.h ares_ipv6.h
|
ares.h ares_dns.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares__close_sockets.obj: ares__close_sockets.c setup.h setup_once.h \
|
$(OBJ_DIR)\ares__close_sockets.obj: ares__close_sockets.c ares_setup.h setup_once.h \
|
||||||
ares.h ares_private.h ares_ipv6.h
|
ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_free_string.obj: ares_free_string.c setup.h setup_once.h ares.h
|
$(OBJ_DIR)\ares_free_string.obj: ares_free_string.c ares_setup.h setup_once.h \
|
||||||
|
ares.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_search.obj: ares_search.c setup.h setup_once.h nameser.h \
|
$(OBJ_DIR)\ares_search.obj: ares_search.c ares_setup.h setup_once.h nameser.h \
|
||||||
ares.h ares_private.h ares_ipv6.h
|
ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares__get_hostent.obj: ares__get_hostent.c setup.h setup_once.h \
|
$(OBJ_DIR)\ares__get_hostent.obj: ares__get_hostent.c ares_setup.h setup_once.h \
|
||||||
ares.h ares_private.h ares_ipv6.h inet_net_pton.h
|
ares.h ares_private.h ares_ipv6.h inet_net_pton.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_gethostbyaddr.obj: ares_gethostbyaddr.c setup.h setup_once.h \
|
$(OBJ_DIR)\ares_gethostbyaddr.obj: ares_gethostbyaddr.c ares_setup.h setup_once.h \
|
||||||
nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h
|
nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h ares_build.h \
|
||||||
|
ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_send.obj: ares_send.c setup.h setup_once.h nameser.h ares.h \
|
$(OBJ_DIR)\ares_send.obj: ares_send.c ares_setup.h setup_once.h nameser.h ares.h \
|
||||||
ares_dns.h ares_private.h ares_ipv6.h
|
ares_dns.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares__read_line.obj: ares__read_line.c setup.h setup_once.h ares.h \
|
$(OBJ_DIR)\ares__read_line.obj: ares__read_line.c ares_setup.h setup_once.h ares.h \
|
||||||
ares_private.h ares_ipv6.h
|
ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_gethostbyname.obj: ares_gethostbyname.c setup.h setup_once.h \
|
$(OBJ_DIR)\ares_gethostbyname.obj: ares_gethostbyname.c ares_setup.h setup_once.h \
|
||||||
nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h bitncmp.h
|
nameser.h ares.h ares_private.h ares_ipv6.h inet_net_pton.h bitncmp.h \
|
||||||
|
ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_strerror.obj: ares_strerror.c setup.h setup_once.h ares.h
|
$(OBJ_DIR)\ares_strcasecmp.obj: ares_strcasecmp.c ares_setup.h setup_once.h ares.h \
|
||||||
|
ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_cancel.obj: ares_cancel.c setup.h setup_once.h ares.h \
|
$(OBJ_DIR)\ares_strerror.obj: ares_strerror.c ares_setup.h setup_once.h ares.h \
|
||||||
ares_private.h ares_ipv6.h
|
ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_init.obj: ares_init.c setup.h setup_once.h nameser.h ares.h \
|
$(OBJ_DIR)\ares_cancel.obj: ares_cancel.c ares_setup.h setup_once.h ares.h \
|
||||||
ares_private.h ares_ipv6.h inet_net_pton.h
|
ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_timeout.obj: ares_timeout.c setup.h setup_once.h ares.h \
|
$(OBJ_DIR)\ares_init.obj: ares_init.c ares_setup.h setup_once.h nameser.h ares.h \
|
||||||
ares_private.h ares_ipv6.h
|
ares_private.h ares_ipv6.h inet_net_pton.h ares_build.h ares_rules.h \
|
||||||
|
ares_library_init.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_destroy.obj: ares_destroy.c setup.h setup_once.h ares.h \
|
$(OBJ_DIR)\ares_timeout.obj: ares_timeout.c ares_setup.h setup_once.h ares.h \
|
||||||
ares_private.h ares_ipv6.h
|
ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_mkquery.obj: ares_mkquery.c setup.h setup_once.h nameser.h \
|
$(OBJ_DIR)\ares__timeval.obj: ares__timeval.c ares_setup.h setup_once.h ares.h \
|
||||||
ares.h ares_dns.h
|
ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_version.obj: ares_version.c setup.h setup_once.h ares_version.h
|
$(OBJ_DIR)\ares_destroy.obj: ares_destroy.c ares_setup.h setup_once.h ares.h \
|
||||||
|
ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_expand_name.obj: ares_expand_name.c setup.h setup_once.h \
|
$(OBJ_DIR)\ares_mkquery.obj: ares_mkquery.c ares_setup.h setup_once.h nameser.h \
|
||||||
nameser.h ares.h ares_private.h ares_ipv6.h
|
ares.h ares_dns.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_parse_a_reply.obj: ares_parse_a_reply.c setup.h setup_once.h \
|
$(OBJ_DIR)\ares_version.obj: ares_version.c ares_setup.h setup_once.h ares.h \
|
||||||
nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h
|
ares_version.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\windows_port.obj: windows_port.c setup.h setup_once.h nameser.h \
|
$(OBJ_DIR)\ares_expand_name.obj: ares_expand_name.c ares_setup.h setup_once.h \
|
||||||
ares.h ares_private.h ares_ipv6.h
|
nameser.h ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_expand_string.obj: ares_expand_string.c setup.h setup_once.h \
|
$(OBJ_DIR)\ares_parse_a_reply.obj: ares_parse_a_reply.c ares_setup.h setup_once.h \
|
||||||
nameser.h ares.h ares_private.h ares_ipv6.h
|
nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h ares_build.h \
|
||||||
|
ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_parse_ptr_reply.obj: ares_parse_ptr_reply.c setup.h \
|
$(OBJ_DIR)\windows_port.obj: windows_port.c ares_setup.h setup_once.h nameser.h \
|
||||||
setup_once.h nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h
|
ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_parse_aaaa_reply.obj: ares_parse_aaaa_reply.c setup.h \
|
$(OBJ_DIR)\ares_expand_string.obj: ares_expand_string.c ares_setup.h setup_once.h \
|
||||||
|
nameser.h ares.h ares_private.h ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
|
$(OBJ_DIR)\ares_parse_ptr_reply.obj: ares_parse_ptr_reply.c ares_setup.h \
|
||||||
|
setup_once.h nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h \
|
||||||
|
ares_build.h ares_rules.h
|
||||||
|
|
||||||
|
$(OBJ_DIR)\ares_parse_aaaa_reply.obj: ares_parse_aaaa_reply.c ares_setup.h \
|
||||||
setup_once.h nameser.h ares.h ares_dns.h inet_net_pton.h ares_private.h \
|
setup_once.h nameser.h ares.h ares_dns.h inet_net_pton.h ares_private.h \
|
||||||
ares_ipv6.h
|
ares_ipv6.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_parse_ns_reply.obj: ares_parse_ns_reply.c setup.h \
|
$(OBJ_DIR)\ares_parse_ns_reply.obj: ares_parse_ns_reply.c ares_setup.h \
|
||||||
setup_once.h nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h
|
setup_once.h nameser.h ares.h ares_dns.h ares_private.h ares_ipv6.h \
|
||||||
|
ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_getnameinfo.obj: ares_getnameinfo.c setup.h setup_once.h \
|
$(OBJ_DIR)\ares_getnameinfo.obj: ares_getnameinfo.c ares_setup.h setup_once.h \
|
||||||
nameser.h ares.h ares_private.h ares_ipv6.h inet_ntop.h
|
nameser.h ares.h ares_private.h ares_ipv6.h inet_ntop.h ares_build.h \
|
||||||
|
ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\inet_net_pton.obj: inet_net_pton.c setup.h setup_once.h nameser.h \
|
$(OBJ_DIR)\inet_net_pton.obj: inet_net_pton.c ares_setup.h setup_once.h nameser.h \
|
||||||
ares_ipv6.h inet_net_pton.h
|
ares_ipv6.h inet_net_pton.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\bitncmp.obj: bitncmp.c bitncmp.h
|
$(OBJ_DIR)\bitncmp.obj: bitncmp.c bitncmp.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c setup.h setup_once.h nameser.h \
|
$(OBJ_DIR)\inet_ntop.obj: inet_ntop.c ares_setup.h setup_once.h nameser.h \
|
||||||
ares_ipv6.h inet_ntop.h
|
ares_ipv6.h inet_ntop.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_getopt.obj: ares_getopt.c ares_getopt.h
|
$(OBJ_DIR)\ares_getopt.obj: ares_getopt.c ares_getopt.h ares_build.h \
|
||||||
|
ares_rules.h
|
||||||
|
|
||||||
$(OBJ_DIR)\ares_llist.obj: ares_llist.c setup.h setup_once.h ares.h \
|
$(OBJ_DIR)\ares_library_init.obj: ares_library_init.c ares_setup.h setup_once.h \
|
||||||
ares_private.h ares_llist.h
|
ares.h ares_private.h ares_library_init.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
|
$(OBJ_DIR)\ares_llist.obj: ares_llist.c ares_setup.h setup_once.h ares.h \
|
||||||
|
ares_private.h ares_llist.h ares_build.h ares_rules.h
|
||||||
|
|
||||||
|
$(OBJ_DIR)\ares_writev.obj: ares_writev.c ares_setup.h setup_once.h ares.h \
|
||||||
|
ares_writev.h ares_build.h ares_rules.h
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ call ares_process() when select() returns.
|
|||||||
Some features are missing from the current version of ares, relative
|
Some features are missing from the current version of ares, relative
|
||||||
to the BIND resolver:
|
to the BIND resolver:
|
||||||
|
|
||||||
* There is no IPV6 support.
|
* There is no IPV6 support. [not true for c-ares]
|
||||||
* There is no hostname verification.
|
* There is no hostname verification.
|
||||||
* There is no logging of unexpected events.
|
* There is no logging of unexpected events.
|
||||||
* There is no debugging-oriented logging.
|
* There is no debugging-oriented logging.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ c-ares is not API compatible with ares: a new name makes that more obvious to
|
|||||||
the public.
|
the public.
|
||||||
|
|
||||||
The full source code is available in the 'c-ares' release archives, and in the
|
The full source code is available in the 'c-ares' release archives, and in the
|
||||||
'ares' subdir of the curl CVS source repostitory.
|
'ares' subdir of the curl CVS source repository.
|
||||||
|
|
||||||
If you find bugs, correct flaws, have questions or have comments in general in
|
If you find bugs, correct flaws, have questions or have comments in general in
|
||||||
regard to c-ares (or by all means the original ares too), get in touch with us
|
regard to c-ares (or by all means the original ares too), get in touch with us
|
||||||
@@ -22,4 +22,42 @@ original ares.
|
|||||||
|
|
||||||
You'll find all c-ares details and news here:
|
You'll find all c-ares details and news here:
|
||||||
|
|
||||||
http://daniel.haxx.se/projects/c-ares
|
http://c-ares.haxx.se/
|
||||||
|
|
||||||
|
|
||||||
|
NOTES FOR C-ARES HACKERS
|
||||||
|
|
||||||
|
The following notes apply to c-ares version 1.6.1 and later.
|
||||||
|
|
||||||
|
* The distributed ares_build.h file is only intended to be used on systems
|
||||||
|
which can not run the also distributed configure script.
|
||||||
|
|
||||||
|
* The distributed ares_build.h file is generated as a copy of ares_build.h.dist
|
||||||
|
when the c-ares source code distribution archive file is originally created.
|
||||||
|
|
||||||
|
* If you check out from CVS on a non-configure platform, you must run the
|
||||||
|
appropriate buildconf* script to set up ares_build.h and other local files
|
||||||
|
before being able of compiling the library.
|
||||||
|
|
||||||
|
* On systems capable of running the configure script, the configure process
|
||||||
|
will overwrite the distributed ares_build.h file with one that is suitable
|
||||||
|
and specific to the library being configured and built, this new file is
|
||||||
|
generated from the ares_build.h.in template file.
|
||||||
|
|
||||||
|
* If you intend to distribute an already compiled c-ares library you _MUST_
|
||||||
|
also distribute along with it the generated ares_build.h which has been
|
||||||
|
used to compile it. Otherwise the library will be of no use for the users of
|
||||||
|
the library that you have built. It is _your_ responsability to provide this
|
||||||
|
file. No one at the c-ares project can know how you have built the library.
|
||||||
|
|
||||||
|
* File ares_build.h includes platform and configuration dependent info,
|
||||||
|
and must not be modified by anyone. Configure script generates it for you.
|
||||||
|
|
||||||
|
* We cannot assume anything else but very basic compiler features being
|
||||||
|
present. While c-ares requires an ANSI C compiler to build, some of the
|
||||||
|
earlier ANSI compilers clearly can't deal with some preprocessor operators.
|
||||||
|
|
||||||
|
* Newlines must remain unix-style for older compilers' sake.
|
||||||
|
|
||||||
|
* Comments must be written in the old-style /* unnested C-fashion */
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,31 @@
|
|||||||
This is what's new and changed in the c-ares 1.5.2 release:
|
This is what's new and changed in the c-ares 1.7.0 release:
|
||||||
|
|
||||||
o
|
Changed:
|
||||||
|
|
||||||
|
o in6_addr is not used in ares.h anymore, but a private ares_in6_addr is
|
||||||
|
instead declared and used
|
||||||
|
o ares_gethostbyname() now supports 'AF_UNSPEC' as a family for resolving
|
||||||
|
either AF_INET6 or AF_INET
|
||||||
|
o a build-time configured ares_socklen_t is now used instead of socklen_t
|
||||||
|
o new ares_library_init() and ares_library_cleanup() functions
|
||||||
|
o new --enable-curldebug configure option
|
||||||
|
o ARES_ECANCELLED is now sent as reason for ares_cancel()
|
||||||
|
o added ares_parse_srv_reply()
|
||||||
|
o added ares_parse_txt_reply()
|
||||||
|
o new --enable-symbol-hiding configure option
|
||||||
|
|
||||||
|
Fixed:
|
||||||
|
|
||||||
|
o ares_parse_*_reply() functions now return ARES_EBADRESP instead of
|
||||||
|
ARES_EBADNAME if the name in the response failed to decode
|
||||||
|
o only expose/export symbols starting with 'ares_'
|
||||||
|
o fix \Device\TCP handle leaks triggered by buggy iphlpapi.dll
|
||||||
|
o init without internet gone no longer fails
|
||||||
|
o out of bounds memory overwrite triggered with malformed /etc/hosts file
|
||||||
|
|
||||||
Thanks go to these friendly people for their efforts and contributions:
|
Thanks go to these friendly people for their efforts and contributions:
|
||||||
|
|
||||||
|
Phil Blundell, Japheth Cleaver, Yang Tse, Gregor Jasny, Joshua Kwan,
|
||||||
|
Timo Teras, Jakub Hrozek, John Engelhart
|
||||||
|
|
||||||
Have fun!
|
Have fun!
|
||||||
|
|||||||
18
ares/TODO
Normal file
18
ares/TODO
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
TODO
|
||||||
|
====
|
||||||
|
|
||||||
|
ares_gethostbyname
|
||||||
|
|
||||||
|
- When built to support IPv6, it needs to also support PF_UNSPEC or similar,
|
||||||
|
so that an application can ask for any protocol and then c-ares would return
|
||||||
|
all known resolves and not just explicitly IPv4 _or_ IPv6 resolves.
|
||||||
|
|
||||||
|
ares_process
|
||||||
|
|
||||||
|
- Upon next ABI breakage ares_process() should be changed to return 'int'
|
||||||
|
and return ARES_ENOTINITIALIZED if ares_library_init() has not been called.
|
||||||
|
|
||||||
|
ares_process_fd
|
||||||
|
|
||||||
|
- Upon next ABI breakage ares_process_fd() should be changed to return
|
||||||
|
'int' and return ARES_ENOTINITIALIZED if library has not been initialized.
|
||||||
1384
ares/acinclude.m4
1384
ares/acinclude.m4
File diff suppressed because it is too large
Load Diff
@@ -10,8 +10,8 @@
|
|||||||
* CNAME = zz<CC>.countries.nerd.dk with address 127.0.x.y (ver 1) or
|
* CNAME = zz<CC>.countries.nerd.dk with address 127.0.x.y (ver 1) or
|
||||||
* CNAME = <a.b.c.d>.zz.countries.nerd.dk with address 127.0.x.y (ver 2)
|
* CNAME = <a.b.c.d>.zz.countries.nerd.dk with address 127.0.x.y (ver 2)
|
||||||
*
|
*
|
||||||
* The 2 letter country code in <CC> and the ISO-3166 country
|
* The 2 letter country code is in <CC> and the ISO-3166 country
|
||||||
* number in x.y (number = x*256 + y). Version 2 of the protocol is missing
|
* number is in x.y (number = x*256 + y). Version 2 of the protocol is missing
|
||||||
* the <CC> number.
|
* the <CC> number.
|
||||||
*
|
*
|
||||||
* Ref: http://countries.nerd.dk/more.html
|
* Ref: http://countries.nerd.dk/more.html
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -43,10 +43,14 @@
|
|||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#else
|
#else
|
||||||
|
#include <sys/socket.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
@@ -57,6 +61,25 @@
|
|||||||
#include "inet_net_pton.h"
|
#include "inet_net_pton.h"
|
||||||
#include "inet_ntop.h"
|
#include "inet_ntop.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_STRDUP
|
||||||
|
# include "ares_strdup.h"
|
||||||
|
# define strdup(ptr) ares_strdup(ptr)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRCASECMP
|
||||||
|
# include "ares_strcasecmp.h"
|
||||||
|
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRNCASECMP
|
||||||
|
# include "ares_strcasecmp.h"
|
||||||
|
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef INADDR_NONE
|
||||||
|
#define INADDR_NONE 0xffffffff
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char *usage = "acountry [-vh?] {host|addr} ...\n";
|
static const char *usage = "acountry [-vh?] {host|addr} ...\n";
|
||||||
static const char nerd_fmt[] = "%u.%u.%u.%u.zz.countries.nerd.dk";
|
static const char nerd_fmt[] = "%u.%u.%u.%u.zz.countries.nerd.dk";
|
||||||
static const char *nerd_ver1 = nerd_fmt + 14;
|
static const char *nerd_ver1 = nerd_fmt + 14;
|
||||||
@@ -87,12 +110,19 @@ int main(int argc, char **argv)
|
|||||||
ares_channel channel;
|
ares_channel channel;
|
||||||
int ch, status;
|
int ch, status;
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK);
|
WORD wVersionRequested = MAKEWORD(USE_WINSOCK,USE_WINSOCK);
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
WSAStartup(wVersionRequested, &wsaData);
|
WSAStartup(wVersionRequested, &wsaData);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
status = ares_library_init(ARES_LIB_INIT_ALL);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
while ((ch = ares_getopt(argc, argv, "dvh?")) != -1)
|
while ((ch = ares_getopt(argc, argv, "dvh?")) != -1)
|
||||||
switch (ch)
|
switch (ch)
|
||||||
{
|
{
|
||||||
@@ -155,7 +185,9 @@ int main(int argc, char **argv)
|
|||||||
wait_ares(channel);
|
wait_ares(channel);
|
||||||
ares_destroy(channel);
|
ares_destroy(channel);
|
||||||
|
|
||||||
#ifdef WIN32
|
ares_library_cleanup();
|
||||||
|
|
||||||
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -233,7 +265,7 @@ struct search_list {
|
|||||||
const char *long_name; /* normal country name */
|
const char *long_name; /* normal country name */
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct search_list *list_lookup(int number, const struct search_list *list, int num)
|
static const struct search_list *list_lookup(int number, const struct search_list *list, int num)
|
||||||
{
|
{
|
||||||
while (num > 0 && list->long_name)
|
while (num > 0 && list->long_name)
|
||||||
{
|
{
|
||||||
@@ -501,7 +533,8 @@ static int is_addr(char *str, char **end)
|
|||||||
{
|
{
|
||||||
int a0, a1, a2, a3, num, rc = 0, length = 0;
|
int a0, a1, a2, a3, num, rc = 0, length = 0;
|
||||||
|
|
||||||
if ((num = sscanf(str,"%3d.%3d.%3d.%3d%n",&a0,&a1,&a2,&a3,&length)) == 4 &&
|
num = sscanf(str,"%3d.%3d.%3d.%3d%n",&a0,&a1,&a2,&a3,&length);
|
||||||
|
if( (num == 4) &&
|
||||||
BYTE_OK(a0) && BYTE_OK(a1) && BYTE_OK(a2) && BYTE_OK(a3) &&
|
BYTE_OK(a0) && BYTE_OK(a1) && BYTE_OK(a2) && BYTE_OK(a3) &&
|
||||||
length >= (3+4))
|
length >= (3+4))
|
||||||
{
|
{
|
||||||
@@ -523,12 +556,13 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
|
|||||||
const struct search_list *country;
|
const struct search_list *country;
|
||||||
char ccode_A2[3], *ccopy, *dot_4;
|
char ccode_A2[3], *ccopy, *dot_4;
|
||||||
int cnumber, z0, z1, ver_1, ver_2;
|
int cnumber, z0, z1, ver_1, ver_2;
|
||||||
u_long ip;
|
unsigned long ip;
|
||||||
|
|
||||||
ip = ntohl(addr.s_addr);
|
ip = ntohl(addr.s_addr);
|
||||||
z0 = tolower(cname[0]);
|
z0 = tolower(cname[0]);
|
||||||
z1 = tolower(cname[1]);
|
z1 = tolower(cname[1]);
|
||||||
ccopy = strdup(cname);
|
ccopy = strdup(cname);
|
||||||
|
dot_4 = NULL;
|
||||||
|
|
||||||
ver_1 = (z0 == 'z' && z1 == 'z' && !strcasecmp(cname+4,nerd_ver1));
|
ver_1 = (z0 == 'z' && z1 == 'z' && !strcasecmp(cname+4,nerd_ver1));
|
||||||
ver_2 = (is_addr(ccopy,&dot_4) && !strcasecmp(dot_4,nerd_ver2));
|
ver_2 = (is_addr(ccopy,&dot_4) && !strcasecmp(dot_4,nerd_ver2));
|
||||||
@@ -560,8 +594,8 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
|
|||||||
|
|
||||||
if (ver_1)
|
if (ver_1)
|
||||||
{
|
{
|
||||||
ccode_A2[0] = tolower(cname[2]);
|
ccode_A2[0] = (char)tolower(cname[2]);
|
||||||
ccode_A2[1] = tolower(cname[3]);
|
ccode_A2[1] = (char)tolower(cname[3]);
|
||||||
ccode_A2[2] = '\0';
|
ccode_A2[2] = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -578,9 +612,14 @@ static void find_country_from_cname(const char *cname, struct in_addr addr)
|
|||||||
printf("Name for country-number %d not found.\n", cnumber);
|
printf("Name for country-number %d not found.\n", cnumber);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ver_1 && *(unsigned short*)&country->short_name != *(unsigned*)&ccode_A2)
|
if (ver_1)
|
||||||
printf("short-name mismatch; %s vs %s\n", country->short_name, ccode_A2);
|
{
|
||||||
|
if ((country->short_name[0] != ccode_A2[0]) ||
|
||||||
|
(country->short_name[1] != ccode_A2[1]) ||
|
||||||
|
(country->short_name[2] != ccode_A2[2]))
|
||||||
|
printf("short-name mismatch; %s vs %s\n",
|
||||||
|
country->short_name, ccode_A2);
|
||||||
|
}
|
||||||
printf("%s (%s), number %d.\n",
|
printf("%s (%s), number %d.\n",
|
||||||
country->long_name, country->short_name, cnumber);
|
country->long_name, country->short_name, cnumber);
|
||||||
}
|
}
|
||||||
|
|||||||
204
ares/adig.c
204
ares/adig.c
@@ -15,22 +15,37 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include "nameser.h"
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
# include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
#else
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
# include <arpa/nameser_compat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
# include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <arpa/nameser.h>
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <netdb.h>
|
#ifdef HAVE_STRINGS_H
|
||||||
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -42,8 +57,24 @@
|
|||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_dns.h"
|
#include "ares_dns.h"
|
||||||
#include "inet_ntop.h"
|
#include "inet_ntop.h"
|
||||||
|
#include "inet_net_pton.h"
|
||||||
#include "ares_getopt.h"
|
#include "ares_getopt.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_STRDUP
|
||||||
|
# include "ares_strdup.h"
|
||||||
|
# define strdup(ptr) ares_strdup(ptr)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRCASECMP
|
||||||
|
# include "ares_strcasecmp.h"
|
||||||
|
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRNCASECMP
|
||||||
|
# include "ares_strcasecmp.h"
|
||||||
|
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WATT32
|
#ifdef WATT32
|
||||||
#undef WIN32 /* Redefined in MingW headers */
|
#undef WIN32 /* Redefined in MingW headers */
|
||||||
#endif
|
#endif
|
||||||
@@ -53,6 +84,11 @@
|
|||||||
#define T_SRV 33 /* server selection */
|
#define T_SRV 33 /* server selection */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* AIX portability check */
|
||||||
|
#ifndef T_NAPTR
|
||||||
|
#define T_NAPTR 35 /* naming authority pointer */
|
||||||
|
#endif
|
||||||
|
|
||||||
struct nv {
|
struct nv {
|
||||||
const char *name;
|
const char *name;
|
||||||
int value;
|
int value;
|
||||||
@@ -110,6 +146,7 @@ static const struct nv types[] = {
|
|||||||
{ "AXFR", T_AXFR },
|
{ "AXFR", T_AXFR },
|
||||||
{ "MAILB", T_MAILB },
|
{ "MAILB", T_MAILB },
|
||||||
{ "MAILA", T_MAILA },
|
{ "MAILA", T_MAILA },
|
||||||
|
{ "NAPTR", T_NAPTR },
|
||||||
{ "ANY", T_ANY }
|
{ "ANY", T_ANY }
|
||||||
};
|
};
|
||||||
static const int ntypes = sizeof(types) / sizeof(types[0]);
|
static const int ntypes = sizeof(types) / sizeof(types[0]);
|
||||||
@@ -120,6 +157,7 @@ static const char *opcodes[] = {
|
|||||||
"UPDATEA", "UPDATED", "UPDATEDA", "UPDATEM", "UPDATEMA",
|
"UPDATEA", "UPDATED", "UPDATEDA", "UPDATEM", "UPDATEMA",
|
||||||
"ZONEINIT", "ZONEREF"
|
"ZONEINIT", "ZONEREF"
|
||||||
};
|
};
|
||||||
|
struct in_addr inaddr;
|
||||||
|
|
||||||
static const char *rcodes[] = {
|
static const char *rcodes[] = {
|
||||||
"NOERROR", "FORMERR", "SERVFAIL", "NXDOMAIN", "NOTIMP", "REFUSED",
|
"NOERROR", "FORMERR", "SERVFAIL", "NXDOMAIN", "NOTIMP", "REFUSED",
|
||||||
@@ -154,6 +192,13 @@ int main(int argc, char **argv)
|
|||||||
WSAStartup(wVersionRequested, &wsaData);
|
WSAStartup(wVersionRequested, &wsaData);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
status = ares_library_init(ARES_LIB_INIT_ALL);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
options.flags = ARES_FLAG_NOCHECKRESP;
|
options.flags = ARES_FLAG_NOCHECKRESP;
|
||||||
options.servers = NULL;
|
options.servers = NULL;
|
||||||
options.nservers = 0;
|
options.nservers = 0;
|
||||||
@@ -174,19 +219,24 @@ int main(int argc, char **argv)
|
|||||||
if (strcmp(flags[i].name, optarg) == 0)
|
if (strcmp(flags[i].name, optarg) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == nflags)
|
if (i < nflags)
|
||||||
usage();
|
|
||||||
options.flags |= flags[i].value;
|
options.flags |= flags[i].value;
|
||||||
|
else
|
||||||
|
usage();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
/* Add a server, and specify servers in the option mask. */
|
/* Add a server, and specify servers in the option mask. */
|
||||||
|
if (ares_inet_pton(AF_INET, optarg, &inaddr) <= 0)
|
||||||
|
{
|
||||||
hostent = gethostbyname(optarg);
|
hostent = gethostbyname(optarg);
|
||||||
if (!hostent || hostent->h_addrtype != AF_INET)
|
if (!hostent || hostent->h_addrtype != AF_INET)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "adig: server %s not found.\n", optarg);
|
fprintf(stderr, "adig: server %s not found.\n", optarg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
memcpy(&inaddr, hostent->h_addr, sizeof(struct in_addr));
|
||||||
|
}
|
||||||
options.servers = realloc(options.servers, (options.nservers + 1)
|
options.servers = realloc(options.servers, (options.nservers + 1)
|
||||||
* sizeof(struct in_addr));
|
* sizeof(struct in_addr));
|
||||||
if (!options.servers)
|
if (!options.servers)
|
||||||
@@ -194,7 +244,7 @@ int main(int argc, char **argv)
|
|||||||
fprintf(stderr, "Out of memory!\n");
|
fprintf(stderr, "Out of memory!\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
memcpy(&options.servers[options.nservers], hostent->h_addr,
|
memcpy(&options.servers[options.nservers], &inaddr,
|
||||||
sizeof(struct in_addr));
|
sizeof(struct in_addr));
|
||||||
options.nservers++;
|
options.nservers++;
|
||||||
optmask |= ARES_OPT_SERVERS;
|
optmask |= ARES_OPT_SERVERS;
|
||||||
@@ -207,9 +257,10 @@ int main(int argc, char **argv)
|
|||||||
if (strcasecmp(classes[i].name, optarg) == 0)
|
if (strcasecmp(classes[i].name, optarg) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == nclasses)
|
if (i < nclasses)
|
||||||
usage();
|
|
||||||
dnsclass = classes[i].value;
|
dnsclass = classes[i].value;
|
||||||
|
else
|
||||||
|
usage();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
@@ -219,9 +270,10 @@ int main(int argc, char **argv)
|
|||||||
if (strcasecmp(types[i].name, optarg) == 0)
|
if (strcasecmp(types[i].name, optarg) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == ntypes)
|
if (i < ntypes)
|
||||||
usage();
|
|
||||||
type = types[i].value;
|
type = types[i].value;
|
||||||
|
else
|
||||||
|
usage();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'T':
|
case 'T':
|
||||||
@@ -288,6 +340,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
ares_destroy(channel);
|
ares_destroy(channel);
|
||||||
|
|
||||||
|
ares_library_cleanup();
|
||||||
|
|
||||||
#ifdef USE_WINSOCK
|
#ifdef USE_WINSOCK
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
#endif
|
#endif
|
||||||
@@ -303,6 +357,8 @@ static void callback(void *arg, int status, int timeouts,
|
|||||||
unsigned int qdcount, ancount, nscount, arcount, i;
|
unsigned int qdcount, ancount, nscount, arcount, i;
|
||||||
const unsigned char *aptr;
|
const unsigned char *aptr;
|
||||||
|
|
||||||
|
(void) timeouts;
|
||||||
|
|
||||||
/* Display the query name if given. */
|
/* Display the query name if given. */
|
||||||
if (name)
|
if (name)
|
||||||
printf("Answer for query %s:\n", name);
|
printf("Answer for query %s:\n", name);
|
||||||
@@ -427,13 +483,16 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
const unsigned char *abuf, int alen)
|
const unsigned char *abuf, int alen)
|
||||||
{
|
{
|
||||||
const unsigned char *p;
|
const unsigned char *p;
|
||||||
char *name;
|
|
||||||
int type, dnsclass, ttl, dlen, status;
|
int type, dnsclass, ttl, dlen, status;
|
||||||
long len;
|
long len;
|
||||||
char addr[46];
|
char addr[46];
|
||||||
|
union {
|
||||||
|
unsigned char * as_uchar;
|
||||||
|
char * as_char;
|
||||||
|
} name;
|
||||||
|
|
||||||
/* Parse the RR name. */
|
/* Parse the RR name. */
|
||||||
status = ares_expand_name(aptr, abuf, alen, &name, &len);
|
status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
return NULL;
|
return NULL;
|
||||||
aptr += len;
|
aptr += len;
|
||||||
@@ -443,7 +502,7 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
*/
|
*/
|
||||||
if (aptr + RRFIXEDSZ > abuf + alen)
|
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||||
{
|
{
|
||||||
ares_free_string(name);
|
ares_free_string(name.as_char);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -456,16 +515,16 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
aptr += RRFIXEDSZ;
|
aptr += RRFIXEDSZ;
|
||||||
if (aptr + dlen > abuf + alen)
|
if (aptr + dlen > abuf + alen)
|
||||||
{
|
{
|
||||||
ares_free_string(name);
|
ares_free_string(name.as_char);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display the RR name, class, and type. */
|
/* Display the RR name, class, and type. */
|
||||||
printf("\t%-15s.\t%d", name, ttl);
|
printf("\t%-15s.\t%d", name.as_char, ttl);
|
||||||
if (dnsclass != C_IN)
|
if (dnsclass != C_IN)
|
||||||
printf("\t%s", class_name(dnsclass));
|
printf("\t%s", class_name(dnsclass));
|
||||||
printf("\t%s", type_name(type));
|
printf("\t%s", type_name(type));
|
||||||
ares_free_string(name);
|
ares_free_string(name.as_char);
|
||||||
|
|
||||||
/* Display the RR data. Don't touch aptr. */
|
/* Display the RR data. Don't touch aptr. */
|
||||||
switch (type)
|
switch (type)
|
||||||
@@ -479,11 +538,11 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
case T_NS:
|
case T_NS:
|
||||||
case T_PTR:
|
case T_PTR:
|
||||||
/* For these types, the RR data is just a domain name. */
|
/* For these types, the RR data is just a domain name. */
|
||||||
status = ares_expand_name(aptr, abuf, alen, &name, &len);
|
status = ares_expand_name(aptr, abuf, alen, &name.as_char, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t%s.", name);
|
printf("\t%s.", name.as_char);
|
||||||
ares_free_string(name);
|
ares_free_string(name.as_char);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_HINFO:
|
case T_HINFO:
|
||||||
@@ -492,28 +551,36 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
len = *p;
|
len = *p;
|
||||||
if (p + len + 1 > aptr + dlen)
|
if (p + len + 1 > aptr + dlen)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t%.*s", (int)len, p + 1);
|
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||||
p += len + 1;
|
if (status != ARES_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
printf("\t%s", name.as_char);
|
||||||
|
ares_free_string(name.as_char);
|
||||||
|
p += len;
|
||||||
len = *p;
|
len = *p;
|
||||||
if (p + len + 1 > aptr + dlen)
|
if (p + len + 1 > aptr + dlen)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t%.*s", (int)len, p + 1);
|
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
printf("\t%s", name.as_char);
|
||||||
|
ares_free_string(name.as_char);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_MINFO:
|
case T_MINFO:
|
||||||
/* The RR data is two domain names. */
|
/* The RR data is two domain names. */
|
||||||
p = aptr;
|
p = aptr;
|
||||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t%s.", name);
|
printf("\t%s.", name.as_char);
|
||||||
ares_free_string(name);
|
ares_free_string(name.as_char);
|
||||||
p += len;
|
p += len;
|
||||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t%s.", name);
|
printf("\t%s.", name.as_char);
|
||||||
ares_free_string(name);
|
ares_free_string(name.as_char);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_MX:
|
case T_MX:
|
||||||
@@ -523,11 +590,11 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
if (dlen < 2)
|
if (dlen < 2)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t%d", DNS__16BIT(aptr));
|
printf("\t%d", DNS__16BIT(aptr));
|
||||||
status = ares_expand_name(aptr + 2, abuf, alen, &name, &len);
|
status = ares_expand_name(aptr + 2, abuf, alen, &name.as_char, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t%s.", name);
|
printf("\t%s.", name.as_char);
|
||||||
ares_free_string(name);
|
ares_free_string(name.as_char);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_SOA:
|
case T_SOA:
|
||||||
@@ -535,17 +602,17 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
* numbers giving the serial number and some timeouts.
|
* numbers giving the serial number and some timeouts.
|
||||||
*/
|
*/
|
||||||
p = aptr;
|
p = aptr;
|
||||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t%s.\n", name);
|
printf("\t%s.\n", name.as_char);
|
||||||
ares_free_string(name);
|
ares_free_string(name.as_char);
|
||||||
p += len;
|
p += len;
|
||||||
status = ares_expand_name(p, abuf, alen, &name, &len);
|
status = ares_expand_name(p, abuf, alen, &name.as_char, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t\t\t\t\t\t%s.\n", name);
|
printf("\t\t\t\t\t\t%s.\n", name.as_char);
|
||||||
ares_free_string(name);
|
ares_free_string(name.as_char);
|
||||||
p += len;
|
p += len;
|
||||||
if (p + 20 > aptr + dlen)
|
if (p + 20 > aptr + dlen)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -564,8 +631,12 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
len = *p;
|
len = *p;
|
||||||
if (p + len + 1 > aptr + dlen)
|
if (p + len + 1 > aptr + dlen)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t%.*s", (int)len, p + 1);
|
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||||
p += len + 1;
|
if (status != ARES_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
printf("\t%s", name.as_char);
|
||||||
|
ares_free_string(name.as_char);
|
||||||
|
p += len;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -596,13 +667,48 @@ static const unsigned char *display_rr(const unsigned char *aptr,
|
|||||||
printf(" %d", DNS__16BIT(aptr + 2));
|
printf(" %d", DNS__16BIT(aptr + 2));
|
||||||
printf(" %d", DNS__16BIT(aptr + 4));
|
printf(" %d", DNS__16BIT(aptr + 4));
|
||||||
|
|
||||||
status = ares_expand_name(aptr + 6, abuf, alen, &name, &len);
|
status = ares_expand_name(aptr + 6, abuf, alen, &name.as_char, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
return NULL;
|
return NULL;
|
||||||
printf("\t%s.", name);
|
printf("\t%s.", name.as_char);
|
||||||
ares_free_string(name);
|
ares_free_string(name.as_char);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case T_NAPTR:
|
||||||
|
|
||||||
|
printf("\t%d", DNS__16BIT(aptr)); /* order */
|
||||||
|
printf(" %d\n", DNS__16BIT(aptr + 2)); /* preference */
|
||||||
|
|
||||||
|
p = aptr + 4;
|
||||||
|
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
printf("\t\t\t\t\t\t%s\n", name.as_char);
|
||||||
|
ares_free_string(name.as_char);
|
||||||
|
p += len;
|
||||||
|
|
||||||
|
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
printf("\t\t\t\t\t\t%s\n", name.as_char);
|
||||||
|
ares_free_string(name.as_char);
|
||||||
|
p += len;
|
||||||
|
|
||||||
|
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
printf("\t\t\t\t\t\t%s\n", name.as_char);
|
||||||
|
ares_free_string(name.as_char);
|
||||||
|
p += len;
|
||||||
|
|
||||||
|
status = ares_expand_string(p, abuf, alen, &name.as_uchar, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
printf("\t\t\t\t\t\t%s", name.as_char);
|
||||||
|
ares_free_string(name.as_char);
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printf("\t[Unknown RR; cannot parse]");
|
printf("\t[Unknown RR; cannot parse]");
|
||||||
break;
|
break;
|
||||||
|
|||||||
32
ares/ahost.c
32
ares/ahost.c
@@ -15,7 +15,7 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if !defined(WIN32) || defined(WATT32)
|
#if !defined(WIN32) || defined(WATT32)
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef HAVE_SYS_TIME_H
|
||||||
@@ -29,6 +29,9 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -39,6 +42,22 @@
|
|||||||
#include "inet_ntop.h"
|
#include "inet_ntop.h"
|
||||||
#include "inet_net_pton.h"
|
#include "inet_net_pton.h"
|
||||||
#include "ares_getopt.h"
|
#include "ares_getopt.h"
|
||||||
|
#include "ares_ipv6.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_STRDUP
|
||||||
|
# include "ares_strdup.h"
|
||||||
|
# define strdup(ptr) ares_strdup(ptr)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRCASECMP
|
||||||
|
# include "ares_strcasecmp.h"
|
||||||
|
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRNCASECMP
|
||||||
|
# include "ares_strcasecmp.h"
|
||||||
|
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
||||||
|
#endif
|
||||||
|
|
||||||
static void callback(void *arg, int status, int timeouts, struct hostent *host);
|
static void callback(void *arg, int status, int timeouts, struct hostent *host);
|
||||||
static void usage(void);
|
static void usage(void);
|
||||||
@@ -58,6 +77,13 @@ int main(int argc, char **argv)
|
|||||||
WSAStartup(wVersionRequested, &wsaData);
|
WSAStartup(wVersionRequested, &wsaData);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
status = ares_library_init(ARES_LIB_INIT_ALL);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
while ((c = ares_getopt(argc,argv,"dt:h")) != -1)
|
while ((c = ares_getopt(argc,argv,"dt:h")) != -1)
|
||||||
{
|
{
|
||||||
switch (c)
|
switch (c)
|
||||||
@@ -128,6 +154,8 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
ares_destroy(channel);
|
ares_destroy(channel);
|
||||||
|
|
||||||
|
ares_library_cleanup();
|
||||||
|
|
||||||
#ifdef USE_WINSOCK
|
#ifdef USE_WINSOCK
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
#endif
|
#endif
|
||||||
@@ -139,6 +167,8 @@ static void callback(void *arg, int status, int timeouts, struct hostent *host)
|
|||||||
{
|
{
|
||||||
char **p;
|
char **p;
|
||||||
|
|
||||||
|
(void)timeouts;
|
||||||
|
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s: %s\n", (char *) arg, ares_strerror(status));
|
fprintf(stderr, "%s: %s\n", (char *) arg, ares_strerror(status));
|
||||||
|
|||||||
326
ares/ares.h
326
ares/ares.h
@@ -1,6 +1,7 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
/* Copyright 1998, 2009 by the Massachusetts Institute of Technology.
|
||||||
|
* Copyright (C) 2007-2009 by Daniel Stenberg
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
* software and its documentation for any purpose and without
|
* software and its documentation for any purpose and without
|
||||||
@@ -18,20 +19,26 @@
|
|||||||
#ifndef ARES__H
|
#ifndef ARES__H
|
||||||
#define ARES__H
|
#define ARES__H
|
||||||
|
|
||||||
|
#include "ares_version.h" /* c-ares version defines */
|
||||||
|
#include "ares_build.h" /* c-ares build definitions */
|
||||||
|
#include "ares_rules.h" /* c-ares rules enforcement */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define WIN32 when build target is Win32 API
|
* Define WIN32 when build target is Win32 API
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
|
#if (defined(_WIN32) || defined(__WIN32__)) && \
|
||||||
#define WIN32
|
!defined(WIN32) && !defined(__SYMBIAN32__)
|
||||||
|
# define WIN32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#if defined(_AIX) || (defined(NETWARE) && defined(__NOVELL_LIBC__))
|
|
||||||
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
|
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
|
||||||
libc5-based Linux systems. Only include it on system that are known to
|
libc5-based Linux systems. Only include it on system that are known to
|
||||||
require it! */
|
require it! */
|
||||||
|
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
|
||||||
|
defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY)
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
#if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
|
||||||
@@ -39,9 +46,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WATT32)
|
#if defined(WATT32)
|
||||||
#include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
#include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#include <tcp.h>
|
# include <tcp.h>
|
||||||
#elif defined(WIN32)
|
#elif defined(WIN32)
|
||||||
# ifndef WIN32_LEAN_AND_MEAN
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
# define WIN32_LEAN_AND_MEAN
|
# define WIN32_LEAN_AND_MEAN
|
||||||
@@ -50,14 +57,37 @@
|
|||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
# include <ws2tcpip.h>
|
# include <ws2tcpip.h>
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
# include <sys/socket.h>
|
||||||
#include <sys/socket.h>
|
# include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
** c-ares external API function linkage decorations.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined(CARES_STATICLIB) && \
|
||||||
|
(defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__))
|
||||||
|
/* __declspec function decoration for Win32 and Symbian DLL's */
|
||||||
|
# if defined(CARES_BUILDING_LIBRARY)
|
||||||
|
# define CARES_EXTERN __declspec(dllexport)
|
||||||
|
# else
|
||||||
|
# define CARES_EXTERN __declspec(dllimport)
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
/* visibility function decoration for other cases */
|
||||||
|
# if !defined(CARES_SYMBOL_HIDING) || \
|
||||||
|
defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)
|
||||||
|
# define CARES_EXTERN
|
||||||
|
# else
|
||||||
|
# define CARES_EXTERN CARES_SYMBOL_SCOPE_EXTERN
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define ARES_SUCCESS 0
|
#define ARES_SUCCESS 0
|
||||||
|
|
||||||
/* Server error codes (ARES_ENODATA indicates no relevant answer) */
|
/* Server error codes (ARES_ENODATA indicates no relevant answer) */
|
||||||
@@ -88,6 +118,16 @@ extern "C" {
|
|||||||
#define ARES_ENONAME 19
|
#define ARES_ENONAME 19
|
||||||
#define ARES_EBADHINTS 20
|
#define ARES_EBADHINTS 20
|
||||||
|
|
||||||
|
/* Uninitialized library error code */
|
||||||
|
#define ARES_ENOTINITIALIZED 21 /* introduced in 1.6.1 */
|
||||||
|
|
||||||
|
/* ares_library_init error codes */
|
||||||
|
#define ARES_ELOADIPHLPAPI 22 /* introduced in 1.6.1 */
|
||||||
|
#define ARES_EADDRGETNETWORKPARAMS 23 /* introduced in 1.6.1 */
|
||||||
|
|
||||||
|
/* More error codes */
|
||||||
|
#define ARES_ECANCELLED 24 /* introduced in 1.6.1 */
|
||||||
|
|
||||||
/* Flag values */
|
/* Flag values */
|
||||||
#define ARES_FLAG_USEVC (1 << 0)
|
#define ARES_FLAG_USEVC (1 << 0)
|
||||||
#define ARES_FLAG_PRIMARY (1 << 1)
|
#define ARES_FLAG_PRIMARY (1 << 1)
|
||||||
@@ -112,6 +152,8 @@ extern "C" {
|
|||||||
#define ARES_OPT_SORTLIST (1 << 10)
|
#define ARES_OPT_SORTLIST (1 << 10)
|
||||||
#define ARES_OPT_SOCK_SNDBUF (1 << 11)
|
#define ARES_OPT_SOCK_SNDBUF (1 << 11)
|
||||||
#define ARES_OPT_SOCK_RCVBUF (1 << 12)
|
#define ARES_OPT_SOCK_RCVBUF (1 << 12)
|
||||||
|
#define ARES_OPT_TIMEOUTMS (1 << 13)
|
||||||
|
#define ARES_OPT_ROTATE (1 << 14)
|
||||||
|
|
||||||
/* Nameinfo flag values */
|
/* Nameinfo flag values */
|
||||||
#define ARES_NI_NOFQDN (1 << 0)
|
#define ARES_NI_NOFQDN (1 << 0)
|
||||||
@@ -154,6 +196,11 @@ extern "C" {
|
|||||||
#define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \
|
#define ARES_GETSOCK_WRITABLE(bits,num) (bits & (1 << ((num) + \
|
||||||
ARES_GETSOCK_MAXNUM)))
|
ARES_GETSOCK_MAXNUM)))
|
||||||
|
|
||||||
|
/* c-ares library initialization flag values */
|
||||||
|
#define ARES_LIB_INIT_NONE (0)
|
||||||
|
#define ARES_LIB_INIT_WIN32 (1 << 0)
|
||||||
|
#define ARES_LIB_INIT_ALL (ARES_LIB_INIT_WIN32)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Typedef our socket type
|
* Typedef our socket type
|
||||||
@@ -177,9 +224,26 @@ typedef void (*ares_sock_state_cb)(void *data,
|
|||||||
|
|
||||||
struct apattern;
|
struct apattern;
|
||||||
|
|
||||||
|
/* NOTE about the ares_options struct to users and developers.
|
||||||
|
|
||||||
|
This struct will remain looking like this. It will not be extended nor
|
||||||
|
shrunk in future releases, but all new options will be set by ares_set_*()
|
||||||
|
options instead of with the ares_init_options() function.
|
||||||
|
|
||||||
|
Eventually (in a galaxy far far away), all options will be settable by
|
||||||
|
ares_set_*() options and the ares_init_options() function will become
|
||||||
|
deprecated.
|
||||||
|
|
||||||
|
When new options are added to c-ares, they are not added to this
|
||||||
|
struct. And they are not "saved" with the ares_save_options() function but
|
||||||
|
instead we encourage the use of the ares_dup() function. Needless to say,
|
||||||
|
if you add config options to c-ares you need to make sure ares_dup()
|
||||||
|
duplicates this new option.
|
||||||
|
|
||||||
|
*/
|
||||||
struct ares_options {
|
struct ares_options {
|
||||||
int flags;
|
int flags;
|
||||||
int timeout;
|
int timeout; /* in seconds or milliseconds, depending on options */
|
||||||
int tries;
|
int tries;
|
||||||
int ndots;
|
int ndots;
|
||||||
unsigned short udp_port;
|
unsigned short udp_port;
|
||||||
@@ -201,68 +265,182 @@ struct hostent;
|
|||||||
struct timeval;
|
struct timeval;
|
||||||
struct sockaddr;
|
struct sockaddr;
|
||||||
struct ares_channeldata;
|
struct ares_channeldata;
|
||||||
typedef struct ares_channeldata *ares_channel;
|
|
||||||
typedef void (*ares_callback)(void *arg, int status, int timeouts,
|
|
||||||
unsigned char *abuf, int alen);
|
|
||||||
typedef void (*ares_host_callback)(void *arg, int status, int timeouts,
|
|
||||||
struct hostent *hostent);
|
|
||||||
typedef void (*ares_nameinfo_callback)(void *arg, int status, int timeouts,
|
|
||||||
char *node, char *service);
|
|
||||||
|
|
||||||
int ares_init(ares_channel *channelptr);
|
typedef struct ares_channeldata *ares_channel;
|
||||||
int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
|
||||||
|
typedef void (*ares_callback)(void *arg,
|
||||||
|
int status,
|
||||||
|
int timeouts,
|
||||||
|
unsigned char *abuf,
|
||||||
|
int alen);
|
||||||
|
|
||||||
|
typedef void (*ares_host_callback)(void *arg,
|
||||||
|
int status,
|
||||||
|
int timeouts,
|
||||||
|
struct hostent *hostent);
|
||||||
|
|
||||||
|
typedef void (*ares_nameinfo_callback)(void *arg,
|
||||||
|
int status,
|
||||||
|
int timeouts,
|
||||||
|
char *node,
|
||||||
|
char *service);
|
||||||
|
|
||||||
|
typedef int (*ares_sock_create_callback)(ares_socket_t socket_fd,
|
||||||
|
int type,
|
||||||
|
void *data);
|
||||||
|
|
||||||
|
CARES_EXTERN int ares_library_init(int flags);
|
||||||
|
|
||||||
|
CARES_EXTERN void ares_library_cleanup(void);
|
||||||
|
|
||||||
|
CARES_EXTERN const char *ares_version(int *version);
|
||||||
|
|
||||||
|
CARES_EXTERN int ares_init(ares_channel *channelptr);
|
||||||
|
|
||||||
|
CARES_EXTERN int ares_init_options(ares_channel *channelptr,
|
||||||
|
struct ares_options *options,
|
||||||
int optmask);
|
int optmask);
|
||||||
int ares_save_options(ares_channel channel, struct ares_options *options, int *optmask);
|
|
||||||
void ares_destroy_options(struct ares_options *options);
|
CARES_EXTERN int ares_save_options(ares_channel channel,
|
||||||
void ares_destroy(ares_channel channel);
|
struct ares_options *options,
|
||||||
void ares_cancel(ares_channel channel);
|
int *optmask);
|
||||||
void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
|
||||||
ares_callback callback, void *arg);
|
CARES_EXTERN void ares_destroy_options(struct ares_options *options);
|
||||||
void ares_query(ares_channel channel, const char *name, int dnsclass,
|
|
||||||
int type, ares_callback callback, void *arg);
|
CARES_EXTERN int ares_dup(ares_channel *dest,
|
||||||
void ares_search(ares_channel channel, const char *name, int dnsclass,
|
ares_channel src);
|
||||||
int type, ares_callback callback, void *arg);
|
|
||||||
void ares_gethostbyname(ares_channel channel, const char *name, int family,
|
CARES_EXTERN void ares_destroy(ares_channel channel);
|
||||||
ares_host_callback callback, void *arg);
|
|
||||||
void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
|
CARES_EXTERN void ares_cancel(ares_channel channel);
|
||||||
int family, ares_host_callback callback, void *arg);
|
|
||||||
void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
|
void ares_set_socket_callback(ares_channel channel,
|
||||||
socklen_t salen, int flags,
|
ares_sock_create_callback callback,
|
||||||
|
void *user_data);
|
||||||
|
|
||||||
|
CARES_EXTERN void ares_send(ares_channel channel,
|
||||||
|
const unsigned char *qbuf,
|
||||||
|
int qlen,
|
||||||
|
ares_callback callback,
|
||||||
|
void *arg);
|
||||||
|
|
||||||
|
CARES_EXTERN void ares_query(ares_channel channel,
|
||||||
|
const char *name,
|
||||||
|
int dnsclass,
|
||||||
|
int type,
|
||||||
|
ares_callback callback,
|
||||||
|
void *arg);
|
||||||
|
|
||||||
|
CARES_EXTERN void ares_search(ares_channel channel,
|
||||||
|
const char *name,
|
||||||
|
int dnsclass,
|
||||||
|
int type,
|
||||||
|
ares_callback callback,
|
||||||
|
void *arg);
|
||||||
|
|
||||||
|
CARES_EXTERN void ares_gethostbyname(ares_channel channel,
|
||||||
|
const char *name,
|
||||||
|
int family,
|
||||||
|
ares_host_callback callback,
|
||||||
|
void *arg);
|
||||||
|
|
||||||
|
CARES_EXTERN int ares_gethostbyname_file(ares_channel channel,
|
||||||
|
const char *name,
|
||||||
|
int family,
|
||||||
|
struct hostent **host);
|
||||||
|
|
||||||
|
CARES_EXTERN void ares_gethostbyaddr(ares_channel channel,
|
||||||
|
const void *addr,
|
||||||
|
int addrlen,
|
||||||
|
int family,
|
||||||
|
ares_host_callback callback,
|
||||||
|
void *arg);
|
||||||
|
|
||||||
|
CARES_EXTERN void ares_getnameinfo(ares_channel channel,
|
||||||
|
const struct sockaddr *sa,
|
||||||
|
ares_socklen_t salen,
|
||||||
|
int flags,
|
||||||
ares_nameinfo_callback callback,
|
ares_nameinfo_callback callback,
|
||||||
void *arg);
|
void *arg);
|
||||||
int ares_fds(ares_channel channel, fd_set *read_fds, fd_set *write_fds);
|
|
||||||
int ares_getsock(ares_channel channel, int *socks, int numsocks);
|
CARES_EXTERN int ares_fds(ares_channel channel,
|
||||||
struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
|
fd_set *read_fds,
|
||||||
|
fd_set *write_fds);
|
||||||
|
|
||||||
|
CARES_EXTERN int ares_getsock(ares_channel channel,
|
||||||
|
int *socks,
|
||||||
|
int numsocks);
|
||||||
|
|
||||||
|
CARES_EXTERN struct timeval *ares_timeout(ares_channel channel,
|
||||||
|
struct timeval *maxtv,
|
||||||
struct timeval *tv);
|
struct timeval *tv);
|
||||||
void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds);
|
|
||||||
void ares_process_fd(ares_channel channel, ares_socket_t read_fd,
|
CARES_EXTERN void ares_process(ares_channel channel,
|
||||||
|
fd_set *read_fds,
|
||||||
|
fd_set *write_fds);
|
||||||
|
|
||||||
|
CARES_EXTERN void ares_process_fd(ares_channel channel,
|
||||||
|
ares_socket_t read_fd,
|
||||||
ares_socket_t write_fd);
|
ares_socket_t write_fd);
|
||||||
|
|
||||||
int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id,
|
CARES_EXTERN int ares_mkquery(const char *name,
|
||||||
int rd, unsigned char **buf, int *buflen);
|
int dnsclass,
|
||||||
int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
|
int type,
|
||||||
int alen, char **s, long *enclen);
|
unsigned short id,
|
||||||
int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf,
|
int rd,
|
||||||
int alen, unsigned char **s, long *enclen);
|
unsigned char **buf,
|
||||||
|
int *buflen);
|
||||||
|
|
||||||
#if !defined(HAVE_STRUCT_IN6_ADDR) && !defined(s6_addr)
|
CARES_EXTERN int ares_expand_name(const unsigned char *encoded,
|
||||||
struct in6_addr {
|
const unsigned char *abuf,
|
||||||
|
int alen,
|
||||||
|
char **s,
|
||||||
|
long *enclen);
|
||||||
|
|
||||||
|
CARES_EXTERN int ares_expand_string(const unsigned char *encoded,
|
||||||
|
const unsigned char *abuf,
|
||||||
|
int alen,
|
||||||
|
unsigned char **s,
|
||||||
|
long *enclen);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: before c-ares 1.6.1 we would most often use the system in6_addr
|
||||||
|
* struct below when ares itself was built, but many apps would use this
|
||||||
|
* private version since the header checked a HAVE_* define for it. Starting
|
||||||
|
* with 1.6.1 we always declare and use our own to stop relying on the
|
||||||
|
* system's one.
|
||||||
|
*/
|
||||||
|
struct ares_in6_addr {
|
||||||
union {
|
union {
|
||||||
unsigned char _S6_u8[16];
|
unsigned char _S6_u8[16];
|
||||||
} _S6_un;
|
} _S6_un;
|
||||||
};
|
};
|
||||||
#define s6_addr _S6_un._S6_u8
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO: the structs 'addrttl' and 'addr6ttl' really should get their names
|
||||||
|
* prefixed with ares_ to keep them in our own "name space".
|
||||||
|
*/
|
||||||
struct addrttl {
|
struct addrttl {
|
||||||
struct in_addr ipaddr;
|
struct in_addr ipaddr;
|
||||||
int ttl;
|
int ttl;
|
||||||
};
|
};
|
||||||
struct addr6ttl {
|
struct addr6ttl {
|
||||||
struct in6_addr ip6addr;
|
struct ares_in6_addr ip6addr;
|
||||||
int ttl;
|
int ttl;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ares_srv_reply {
|
||||||
|
unsigned short weight;
|
||||||
|
unsigned short priority;
|
||||||
|
unsigned short port;
|
||||||
|
char *host;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ares_txt_reply {
|
||||||
|
size_t length; /* length excludes null termination */
|
||||||
|
unsigned char *txt;
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Parse the buffer, starting at *abuf and of length alen bytes, previously
|
** Parse the buffer, starting at *abuf and of length alen bytes, previously
|
||||||
** obtained from an ares_search call. Put the results in *host, if nonnull.
|
** obtained from an ares_search call. Put the results in *host, if nonnull.
|
||||||
@@ -270,19 +448,45 @@ struct addr6ttl {
|
|||||||
** their TTLs in that array, and set *naddrttls to the number of addresses
|
** their TTLs in that array, and set *naddrttls to the number of addresses
|
||||||
** so written.
|
** so written.
|
||||||
*/
|
*/
|
||||||
int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
|
||||||
|
CARES_EXTERN int ares_parse_a_reply(const unsigned char *abuf,
|
||||||
|
int alen,
|
||||||
struct hostent **host,
|
struct hostent **host,
|
||||||
struct addrttl *addrttls, int *naddrttls);
|
struct addrttl *addrttls,
|
||||||
int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
int *naddrttls);
|
||||||
|
|
||||||
|
CARES_EXTERN int ares_parse_aaaa_reply(const unsigned char *abuf,
|
||||||
|
int alen,
|
||||||
struct hostent **host,
|
struct hostent **host,
|
||||||
struct addr6ttl *addrttls, int *naddrttls);
|
struct addr6ttl *addrttls,
|
||||||
int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
int *naddrttls);
|
||||||
int addrlen, int family, struct hostent **host);
|
|
||||||
int ares_parse_ns_reply(const unsigned char *abuf, int alen,
|
CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf,
|
||||||
|
int alen,
|
||||||
|
const void *addr,
|
||||||
|
int addrlen,
|
||||||
|
int family,
|
||||||
struct hostent **host);
|
struct hostent **host);
|
||||||
void ares_free_string(void *str);
|
|
||||||
void ares_free_hostent(struct hostent *host);
|
CARES_EXTERN int ares_parse_ns_reply(const unsigned char *abuf,
|
||||||
const char *ares_strerror(int code);
|
int alen,
|
||||||
|
struct hostent **host);
|
||||||
|
|
||||||
|
CARES_EXTERN int ares_parse_srv_reply(const unsigned char* abuf,
|
||||||
|
int alen,
|
||||||
|
struct ares_srv_reply** srv_out,
|
||||||
|
int *nsrvreply);
|
||||||
|
|
||||||
|
CARES_EXTERN int ares_parse_txt_reply(const unsigned char* abuf,
|
||||||
|
int alen,
|
||||||
|
struct ares_txt_reply** txt_out,
|
||||||
|
int *nsrvreply);
|
||||||
|
|
||||||
|
CARES_EXTERN void ares_free_string(void *str);
|
||||||
|
|
||||||
|
CARES_EXTERN void ares_free_hostent(struct hostent *host);
|
||||||
|
|
||||||
|
CARES_EXTERN const char *ares_strerror(int code);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
@@ -54,14 +54,14 @@ void ares__close_sockets(ares_channel channel, struct server_state *server)
|
|||||||
if (server->tcp_socket != ARES_SOCKET_BAD)
|
if (server->tcp_socket != ARES_SOCKET_BAD)
|
||||||
{
|
{
|
||||||
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 0, 0);
|
SOCK_STATE_CALLBACK(channel, server->tcp_socket, 0, 0);
|
||||||
closesocket(server->tcp_socket);
|
sclose(server->tcp_socket);
|
||||||
server->tcp_socket = ARES_SOCKET_BAD;
|
server->tcp_socket = ARES_SOCKET_BAD;
|
||||||
server->tcp_connection_generation = ++channel->tcp_connection_generation;
|
server->tcp_connection_generation = ++channel->tcp_connection_generation;
|
||||||
}
|
}
|
||||||
if (server->udp_socket != ARES_SOCKET_BAD)
|
if (server->udp_socket != ARES_SOCKET_BAD)
|
||||||
{
|
{
|
||||||
SOCK_STATE_CALLBACK(channel, server->udp_socket, 0, 0);
|
SOCK_STATE_CALLBACK(channel, server->udp_socket, 0, 0);
|
||||||
closesocket(server->udp_socket);
|
sclose(server->udp_socket);
|
||||||
server->udp_socket = ARES_SOCKET_BAD;
|
server->udp_socket = ARES_SOCKET_BAD;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
/* Copyright 1998, 2009 by the Massachusetts Institute of Technology.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
* software and its documentation for any purpose and without
|
* software and its documentation for any purpose and without
|
||||||
@@ -15,152 +15,225 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if !defined(WIN32) || defined(WATT32)
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#endif
|
||||||
#include <arpa/inet.h>
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netdb.h>
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
# include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
|
||||||
#include "inet_net_pton.h"
|
#include "inet_net_pton.h"
|
||||||
|
#include "ares_private.h"
|
||||||
|
|
||||||
int ares__get_hostent(FILE *fp, int family, struct hostent **host)
|
int ares__get_hostent(FILE *fp, int family, struct hostent **host)
|
||||||
{
|
{
|
||||||
char *line = NULL, *p, *q, *canonical, **alias;
|
char *line = NULL, *p, *q, **alias;
|
||||||
int status, linesize, end_at_hostname, naliases;
|
char *txtaddr, *txthost, *txtalias;
|
||||||
struct in_addr addr;
|
int status;
|
||||||
struct in6_addr addr6;
|
size_t addrlen, linesize, naliases;
|
||||||
int addrlen = sizeof(struct in_addr);
|
struct ares_addr addr;
|
||||||
struct hostent *hostent = NULL;
|
struct hostent *hostent = NULL;
|
||||||
|
|
||||||
|
*host = NULL; /* Assume failure */
|
||||||
|
|
||||||
|
/* Validate family */
|
||||||
|
switch (family) {
|
||||||
|
case AF_INET:
|
||||||
|
case AF_INET6:
|
||||||
|
case AF_UNSPEC:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return ARES_EBADFAMILY;
|
||||||
|
}
|
||||||
|
|
||||||
while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
|
while ((status = ares__read_line(fp, &line, &linesize)) == ARES_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Skip comment lines; terminate line at comment character. */
|
|
||||||
if (*line == '#' || !*line)
|
|
||||||
continue;
|
|
||||||
p = strchr(line, '#');
|
|
||||||
if (p)
|
|
||||||
*p = 0;
|
|
||||||
|
|
||||||
/* Get the address part. */
|
/* Trim line comment. */
|
||||||
p = line;
|
p = line;
|
||||||
|
while (*p && (*p != '#'))
|
||||||
|
p++;
|
||||||
|
*p = '\0';
|
||||||
|
|
||||||
|
/* Trim trailing whitespace. */
|
||||||
|
q = p - 1;
|
||||||
|
while ((q >= line) && ISSPACE(*q))
|
||||||
|
q--;
|
||||||
|
*++q = '\0';
|
||||||
|
|
||||||
|
/* Skip leading whitespace. */
|
||||||
|
p = line;
|
||||||
|
while (*p && ISSPACE(*p))
|
||||||
|
p++;
|
||||||
|
if (!*p)
|
||||||
|
/* Ignore line if empty. */
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* Pointer to start of IPv4 or IPv6 address part. */
|
||||||
|
txtaddr = p;
|
||||||
|
|
||||||
|
/* Advance past address part. */
|
||||||
while (*p && !ISSPACE(*p))
|
while (*p && !ISSPACE(*p))
|
||||||
p++;
|
p++;
|
||||||
if (!*p)
|
if (!*p)
|
||||||
continue;
|
/* Ignore line if reached end of line. */
|
||||||
*p = 0;
|
|
||||||
addr.s_addr = inet_addr(line);
|
|
||||||
if (addr.s_addr == INADDR_NONE)
|
|
||||||
{
|
|
||||||
if (ares_inet_pton(AF_INET6, line, &addr6) > 0)
|
|
||||||
{
|
|
||||||
if (family != AF_INET6)
|
|
||||||
continue;
|
|
||||||
addrlen = sizeof(struct in6_addr);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if (family != AF_INET)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Get the canonical hostname. */
|
/* Null terminate address part. */
|
||||||
|
*p = '\0';
|
||||||
|
|
||||||
|
/* Advance to host name */
|
||||||
p++;
|
p++;
|
||||||
while (ISSPACE(*p))
|
while (*p && ISSPACE(*p))
|
||||||
p++;
|
p++;
|
||||||
if (!*p)
|
if (!*p)
|
||||||
|
/* Ignore line if reached end of line. */
|
||||||
continue;
|
continue;
|
||||||
q = p;
|
|
||||||
while (*q && !ISSPACE(*q))
|
|
||||||
q++;
|
|
||||||
end_at_hostname = (*q == 0);
|
|
||||||
*q = 0;
|
|
||||||
canonical = p;
|
|
||||||
|
|
||||||
naliases = 0;
|
/* Pointer to start of host name. */
|
||||||
if (!end_at_hostname)
|
txthost = p;
|
||||||
{
|
|
||||||
/* Count the aliases. */
|
/* Advance past host name. */
|
||||||
p = q + 1;
|
while (*p && !ISSPACE(*p))
|
||||||
while (ISSPACE(*p))
|
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
|
/* Pointer to start of first alias. */
|
||||||
|
txtalias = NULL;
|
||||||
|
if (*p)
|
||||||
|
{
|
||||||
|
q = p + 1;
|
||||||
|
while (*q && ISSPACE(*q))
|
||||||
|
q++;
|
||||||
|
if (*q)
|
||||||
|
txtalias = q;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Null terminate host name. */
|
||||||
|
*p = '\0';
|
||||||
|
|
||||||
|
/* find out number of aliases. */
|
||||||
|
naliases = 0;
|
||||||
|
if (txtalias)
|
||||||
|
{
|
||||||
|
p = txtalias;
|
||||||
while (*p)
|
while (*p)
|
||||||
{
|
{
|
||||||
while (*p && !ISSPACE(*p))
|
while (*p && !ISSPACE(*p))
|
||||||
p++;
|
p++;
|
||||||
while (ISSPACE(*p))
|
while (*p && ISSPACE(*p))
|
||||||
p++;
|
p++;
|
||||||
naliases++;
|
naliases++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate memory for the host structure. */
|
/* Convert address string to network address for the requested family. */
|
||||||
|
addrlen = 0;
|
||||||
|
addr.family = AF_UNSPEC;
|
||||||
|
addr.addrV4.s_addr = INADDR_NONE;
|
||||||
|
if ((family == AF_INET) || (family == AF_UNSPEC))
|
||||||
|
{
|
||||||
|
addr.addrV4.s_addr = inet_addr(txtaddr);
|
||||||
|
if (addr.addrV4.s_addr != INADDR_NONE)
|
||||||
|
{
|
||||||
|
/* Actual network address family and length. */
|
||||||
|
addr.family = AF_INET;
|
||||||
|
addrlen = sizeof(struct in_addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((family == AF_INET6) || ((family == AF_UNSPEC) && (!addrlen)))
|
||||||
|
{
|
||||||
|
if (ares_inet_pton(AF_INET6, txtaddr, &addr.addrV6) > 0)
|
||||||
|
{
|
||||||
|
/* Actual network address family and length. */
|
||||||
|
addr.family = AF_INET6;
|
||||||
|
addrlen = sizeof(struct in6_addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!addrlen)
|
||||||
|
/* Ignore line if invalid address string for the requested family. */
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Actual address family possible values are AF_INET and AF_INET6 only.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Allocate memory for the hostent structure. */
|
||||||
hostent = malloc(sizeof(struct hostent));
|
hostent = malloc(sizeof(struct hostent));
|
||||||
if (!hostent)
|
if (!hostent)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* Initialize fields for out of memory condition. */
|
||||||
hostent->h_aliases = NULL;
|
hostent->h_aliases = NULL;
|
||||||
hostent->h_addr_list = NULL;
|
hostent->h_addr_list = NULL;
|
||||||
hostent->h_name = strdup(canonical);
|
|
||||||
|
/* Copy official host name. */
|
||||||
|
hostent->h_name = strdup(txthost);
|
||||||
if (!hostent->h_name)
|
if (!hostent->h_name)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* Copy network address. */
|
||||||
hostent->h_addr_list = malloc(2 * sizeof(char *));
|
hostent->h_addr_list = malloc(2 * sizeof(char *));
|
||||||
if (!hostent->h_addr_list)
|
if (!hostent->h_addr_list)
|
||||||
break;
|
break;
|
||||||
|
hostent->h_addr_list[1] = NULL;
|
||||||
hostent->h_addr_list[0] = malloc(addrlen);
|
hostent->h_addr_list[0] = malloc(addrlen);
|
||||||
if (!hostent->h_addr_list[0])
|
if (!hostent->h_addr_list[0])
|
||||||
break;
|
break;
|
||||||
|
if (addr.family == AF_INET)
|
||||||
|
memcpy(hostent->h_addr_list[0], &addr.addrV4, sizeof(struct in_addr));
|
||||||
|
else
|
||||||
|
memcpy(hostent->h_addr_list[0], &addr.addrV6, sizeof(struct in6_addr));
|
||||||
|
|
||||||
|
/* Copy aliases. */
|
||||||
hostent->h_aliases = malloc((naliases + 1) * sizeof(char *));
|
hostent->h_aliases = malloc((naliases + 1) * sizeof(char *));
|
||||||
if (!hostent->h_aliases)
|
if (!hostent->h_aliases)
|
||||||
break;
|
break;
|
||||||
|
alias = hostent->h_aliases;
|
||||||
/* Copy in aliases. */
|
while (naliases)
|
||||||
naliases = 0;
|
*(alias + naliases--) = NULL;
|
||||||
if (!end_at_hostname)
|
*alias = NULL;
|
||||||
|
while (txtalias)
|
||||||
{
|
{
|
||||||
p = canonical + strlen(canonical) + 1;
|
p = txtalias;
|
||||||
while (ISSPACE(*p))
|
while (*p && !ISSPACE(*p))
|
||||||
p++;
|
p++;
|
||||||
while (*p)
|
|
||||||
{
|
|
||||||
q = p;
|
q = p;
|
||||||
while (*q && !ISSPACE(*q))
|
while (*q && ISSPACE(*q))
|
||||||
q++;
|
q++;
|
||||||
hostent->h_aliases[naliases] = malloc(q - p + 1);
|
*p = '\0';
|
||||||
if (hostent->h_aliases[naliases] == NULL)
|
if ((*alias = strdup(txtalias)) == NULL)
|
||||||
break;
|
break;
|
||||||
memcpy(hostent->h_aliases[naliases], p, q - p);
|
alias++;
|
||||||
hostent->h_aliases[naliases][q - p] = 0;
|
txtalias = *q ? q : NULL;
|
||||||
p = q;
|
|
||||||
while (ISSPACE(*p))
|
|
||||||
p++;
|
|
||||||
naliases++;
|
|
||||||
}
|
}
|
||||||
if (*p)
|
if (txtalias)
|
||||||
|
/* Alias memory allocation failure. */
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
hostent->h_aliases[naliases] = NULL;
|
|
||||||
|
|
||||||
hostent->h_addrtype = family;
|
/* Copy actual network address family and length. */
|
||||||
hostent->h_length = addrlen;
|
hostent->h_addrtype = addr.family;
|
||||||
if (family == AF_INET)
|
hostent->h_length = (int)addrlen;
|
||||||
memcpy(hostent->h_addr_list[0], &addr, addrlen);
|
|
||||||
else if (family == AF_INET6)
|
/* Free line buffer. */
|
||||||
memcpy(hostent->h_addr_list[0], &addr6, addrlen);
|
|
||||||
hostent->h_addr_list[1] = NULL;
|
|
||||||
*host = hostent;
|
|
||||||
free(line);
|
free(line);
|
||||||
|
|
||||||
|
/* Return hostent successfully */
|
||||||
|
*host = hostent;
|
||||||
return ARES_SUCCESS;
|
return ARES_SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
if(line)
|
|
||||||
|
/* If allocated, free line buffer. */
|
||||||
|
if (line)
|
||||||
free(line);
|
free(line);
|
||||||
|
|
||||||
if (status == ARES_SUCCESS)
|
if (status == ARES_SUCCESS)
|
||||||
@@ -168,22 +241,22 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host)
|
|||||||
/* Memory allocation failure; clean up. */
|
/* Memory allocation failure; clean up. */
|
||||||
if (hostent)
|
if (hostent)
|
||||||
{
|
{
|
||||||
if(hostent->h_name)
|
if (hostent->h_name)
|
||||||
free((char *) hostent->h_name);
|
free((char *) hostent->h_name);
|
||||||
if (hostent->h_aliases)
|
if (hostent->h_aliases)
|
||||||
{
|
{
|
||||||
for (alias = hostent->h_aliases; *alias; alias++)
|
for (alias = hostent->h_aliases; *alias; alias++)
|
||||||
free(*alias);
|
free(*alias);
|
||||||
}
|
|
||||||
if(hostent->h_aliases)
|
|
||||||
free(hostent->h_aliases);
|
free(hostent->h_aliases);
|
||||||
if (hostent->h_addr_list && hostent->h_addr_list[0])
|
}
|
||||||
|
if (hostent->h_addr_list)
|
||||||
|
{
|
||||||
|
if (hostent->h_addr_list[0])
|
||||||
free(hostent->h_addr_list[0]);
|
free(hostent->h_addr_list[0]);
|
||||||
if(hostent->h_addr_list)
|
|
||||||
free(hostent->h_addr_list);
|
free(hostent->h_addr_list);
|
||||||
|
}
|
||||||
free(hostent);
|
free(hostent);
|
||||||
}
|
}
|
||||||
*host = NULL;
|
|
||||||
return ARES_ENOMEM;
|
return ARES_ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
* appropriate. The initial value of *buf should be NULL. After the
|
* appropriate. The initial value of *buf should be NULL. After the
|
||||||
* calling routine is done reading lines, it should free *buf.
|
* calling routine is done reading lines, it should free *buf.
|
||||||
*/
|
*/
|
||||||
int ares__read_line(FILE *fp, char **buf, int *bufsize)
|
int ares__read_line(FILE *fp, char **buf, size_t *bufsize)
|
||||||
{
|
{
|
||||||
char *newbuf;
|
char *newbuf;
|
||||||
size_t offset = 0;
|
size_t offset = 0;
|
||||||
@@ -46,7 +46,7 @@ int ares__read_line(FILE *fp, char **buf, int *bufsize)
|
|||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
if (!fgets(*buf + offset, *bufsize - (int)offset, fp))
|
if (!fgets(*buf + offset, (int)(*bufsize - offset), fp))
|
||||||
return (offset != 0) ? 0 : (ferror(fp)) ? ARES_EFILE : ARES_EOF;
|
return (offset != 0) ? 0 : (ferror(fp)) ? ARES_EFILE : ARES_EOF;
|
||||||
len = offset + strlen(*buf + offset);
|
len = offset + strlen(*buf + offset);
|
||||||
if ((*buf)[len - 1] == '\n')
|
if ((*buf)[len - 1] == '\n')
|
||||||
|
|||||||
112
ares/ares__timeval.c
Normal file
112
ares/ares__timeval.c
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 2008 by Daniel Stenberg et al
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software and its
|
||||||
|
* documentation for any purpose and without fee is hereby granted, provided
|
||||||
|
* that the above copyright notice appear in all copies and that both that
|
||||||
|
* copyright notice and this permission notice appear in supporting
|
||||||
|
* documentation, and that the name of M.I.T. not be used in advertising or
|
||||||
|
* publicity pertaining to distribution of the software without specific,
|
||||||
|
* written prior permission. M.I.T. makes no representations about the
|
||||||
|
* suitability of this software for any purpose. It is provided "as is"
|
||||||
|
* without express or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ares_setup.h"
|
||||||
|
#include "ares.h"
|
||||||
|
#include "ares_private.h"
|
||||||
|
|
||||||
|
#if defined(WIN32) && !defined(MSDOS)
|
||||||
|
|
||||||
|
struct timeval ares__tvnow(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
** GetTickCount() is available on _all_ Windows versions from W95 up
|
||||||
|
** to nowadays. Returns milliseconds elapsed since last system boot,
|
||||||
|
** increases monotonically and wraps once 49.7 days have elapsed.
|
||||||
|
*/
|
||||||
|
struct timeval now;
|
||||||
|
DWORD milliseconds = GetTickCount();
|
||||||
|
now.tv_sec = milliseconds / 1000;
|
||||||
|
now.tv_usec = (milliseconds % 1000) * 1000;
|
||||||
|
return now;
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif defined(HAVE_CLOCK_GETTIME_MONOTONIC)
|
||||||
|
|
||||||
|
struct timeval ares__tvnow(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
** clock_gettime() is granted to be increased monotonically when the
|
||||||
|
** monotonic clock is queried. Time starting point is unspecified, it
|
||||||
|
** could be the system start-up time, the Epoch, or something else,
|
||||||
|
** in any case the time starting point does not change once that the
|
||||||
|
** system has started up.
|
||||||
|
*/
|
||||||
|
struct timeval now;
|
||||||
|
struct timespec tsnow;
|
||||||
|
if(0 == clock_gettime(CLOCK_MONOTONIC, &tsnow)) {
|
||||||
|
now.tv_sec = tsnow.tv_sec;
|
||||||
|
now.tv_usec = tsnow.tv_nsec / 1000;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
** Even when the configure process has truly detected monotonic clock
|
||||||
|
** availability, it might happen that it is not actually available at
|
||||||
|
** run-time. When this occurs simply fallback to other time source.
|
||||||
|
*/
|
||||||
|
#ifdef HAVE_GETTIMEOFDAY
|
||||||
|
else
|
||||||
|
(void)gettimeofday(&now, NULL);
|
||||||
|
#else
|
||||||
|
else {
|
||||||
|
now.tv_sec = (long)time(NULL);
|
||||||
|
now.tv_usec = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return now;
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif defined(HAVE_GETTIMEOFDAY)
|
||||||
|
|
||||||
|
struct timeval ares__tvnow(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
** gettimeofday() is not granted to be increased monotonically, due to
|
||||||
|
** clock drifting and external source time synchronization it can jump
|
||||||
|
** forward or backward in time.
|
||||||
|
*/
|
||||||
|
struct timeval now;
|
||||||
|
(void)gettimeofday(&now, NULL);
|
||||||
|
return now;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
struct timeval ares__tvnow(void)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
** time() returns the value of time in seconds since the Epoch.
|
||||||
|
*/
|
||||||
|
struct timeval now;
|
||||||
|
now.tv_sec = (long)time(NULL);
|
||||||
|
now.tv_usec = 0;
|
||||||
|
return now;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0 /* Not used */
|
||||||
|
/*
|
||||||
|
* Make sure that the first argument is the more recent time, as otherwise
|
||||||
|
* we'll get a weird negative time-diff back...
|
||||||
|
*
|
||||||
|
* Returns: the time difference in number of milliseconds.
|
||||||
|
*/
|
||||||
|
long ares__tvdiff(struct timeval newer, struct timeval older)
|
||||||
|
{
|
||||||
|
return (newer.tv_sec-older.tv_sec)*1000+
|
||||||
|
(newer.tv_usec-older.tv_usec)/1000;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
253
ares/ares_build.h.dist
Normal file
253
ares/ares_build.h.dist
Normal file
@@ -0,0 +1,253 @@
|
|||||||
|
#ifndef __CARES_BUILD_H
|
||||||
|
#define __CARES_BUILD_H
|
||||||
|
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 2009 by Daniel Stenberg et al
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software and its
|
||||||
|
* documentation for any purpose and without fee is hereby granted, provided
|
||||||
|
* that the above copyright notice appear in all copies and that both that
|
||||||
|
* copyright notice and this permission notice appear in supporting
|
||||||
|
* documentation, and that the name of M.I.T. not be used in advertising or
|
||||||
|
* publicity pertaining to distribution of the software without specific,
|
||||||
|
* written prior permission. M.I.T. makes no representations about the
|
||||||
|
* suitability of this software for any purpose. It is provided "as is"
|
||||||
|
* without express or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ================================================================ */
|
||||||
|
/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
|
||||||
|
/* ================================================================ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE 1:
|
||||||
|
* -------
|
||||||
|
*
|
||||||
|
* See file ares_build.h.in, run configure, and forget that this file
|
||||||
|
* exists it is only used for non-configure systems.
|
||||||
|
* But you can keep reading if you want ;-)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ================================================================ */
|
||||||
|
/* NOTES FOR NON-CONFIGURE SYSTEMS */
|
||||||
|
/* ================================================================ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE 1:
|
||||||
|
* -------
|
||||||
|
*
|
||||||
|
* Nothing in this file is intended to be modified or adjusted by the
|
||||||
|
* c-ares library user nor by the c-ares library builder.
|
||||||
|
*
|
||||||
|
* If you think that something actually needs to be changed, adjusted
|
||||||
|
* or fixed in this file, then, report it on the c-ares development
|
||||||
|
* mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
|
||||||
|
*
|
||||||
|
* Try to keep one section per platform, compiler and architecture,
|
||||||
|
* otherwise, if an existing section is reused for a different one and
|
||||||
|
* later on the original is adjusted, probably the piggybacking one can
|
||||||
|
* be adversely changed.
|
||||||
|
*
|
||||||
|
* In order to differentiate between platforms/compilers/architectures
|
||||||
|
* use only compiler built in predefined preprocessor symbols.
|
||||||
|
*
|
||||||
|
* This header file shall only export symbols which are 'cares' or 'CARES'
|
||||||
|
* prefixed, otherwise public name space would be polluted.
|
||||||
|
*
|
||||||
|
* NOTE 2:
|
||||||
|
* -------
|
||||||
|
*
|
||||||
|
* Right now you might be staring at file ares_build.h.dist or ares_build.h,
|
||||||
|
* this is due to the following reason: file ares_build.h.dist is renamed
|
||||||
|
* to ares_build.h when the c-ares source code distribution archive file is
|
||||||
|
* created.
|
||||||
|
*
|
||||||
|
* File ares_build.h.dist is not included in the distribution archive.
|
||||||
|
* File ares_build.h is not present in the CVS tree.
|
||||||
|
*
|
||||||
|
* The distributed ares_build.h file is only intended to be used on systems
|
||||||
|
* which can not run the also distributed configure script.
|
||||||
|
*
|
||||||
|
* On systems capable of running the configure script, the configure process
|
||||||
|
* will overwrite the distributed ares_build.h file with one that is suitable
|
||||||
|
* and specific to the library being configured and built, which is generated
|
||||||
|
* from the ares_build.h.in template file.
|
||||||
|
*
|
||||||
|
* If you check out from CVS on a non-configure platform, you must run the
|
||||||
|
* appropriate buildconf* script to set up ares_build.h and other local files.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ================================================================ */
|
||||||
|
/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
|
||||||
|
/* ================================================================ */
|
||||||
|
|
||||||
|
#ifdef CARES_SIZEOF_LONG
|
||||||
|
# error "CARES_SIZEOF_LONG shall not be defined except in ares_build.h"
|
||||||
|
Error Compilation_aborted_CARES_SIZEOF_LONG_already_defined
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||||
|
# error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
|
||||||
|
Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CARES_SIZEOF_ARES_SOCKLEN_T
|
||||||
|
# error "CARES_SIZEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
|
||||||
|
Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_already_defined
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* ================================================================ */
|
||||||
|
/* EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY */
|
||||||
|
/* ================================================================ */
|
||||||
|
|
||||||
|
#if defined(__DJGPP__) || defined(__GO32__)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
#elif defined(__SALFORDC__)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
#elif defined(__BORLANDC__)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
#elif defined(__TURBOC__)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
#elif defined(__WATCOMC__)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
#elif defined(__POCC__)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
#elif defined(__LCC__)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
#elif defined(__SYMBIAN32__)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
#elif defined(__MWERKS__)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
#elif defined(_WIN32_WCE)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
#elif defined(__MINGW32__)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
#elif defined(__VMS)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
#elif defined(__OS400__)
|
||||||
|
# if defined(__ILEC400__)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
# define CARES_PULL_SYS_TYPES_H 1
|
||||||
|
# define CARES_PULL_SYS_SOCKET_H 1
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__MVS__)
|
||||||
|
# if defined(__IBMC__) || defined(__IBMCPP__)
|
||||||
|
# if defined(_ILP32)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# elif defined(_LP64)
|
||||||
|
# define CARES_SIZEOF_LONG 8
|
||||||
|
# endif
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
# define CARES_PULL_SYS_TYPES_H 1
|
||||||
|
# define CARES_PULL_SYS_SOCKET_H 1
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(__370__)
|
||||||
|
# if defined(__IBMC__) || defined(__IBMCPP__)
|
||||||
|
# if defined(_ILP32)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# elif defined(_LP64)
|
||||||
|
# define CARES_SIZEOF_LONG 8
|
||||||
|
# endif
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
# define CARES_PULL_SYS_TYPES_H 1
|
||||||
|
# define CARES_PULL_SYS_SOCKET_H 1
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#elif defined(TPF)
|
||||||
|
# define CARES_SIZEOF_LONG 8
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
/* ===================================== */
|
||||||
|
/* KEEP MSVC THE PENULTIMATE ENTRY */
|
||||||
|
/* ===================================== */
|
||||||
|
|
||||||
|
#elif defined(_MSC_VER)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T int
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
|
||||||
|
/* ===================================== */
|
||||||
|
/* KEEP GENERIC GCC THE LAST ENTRY */
|
||||||
|
/* ===================================== */
|
||||||
|
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
# if defined(__i386__) || defined(__ppc__)
|
||||||
|
# define CARES_SIZEOF_LONG 4
|
||||||
|
# elif defined(__x86_64__) || defined(__ppc64__)
|
||||||
|
# define CARES_SIZEOF_LONG 8
|
||||||
|
# endif
|
||||||
|
# define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
|
||||||
|
# define CARES_SIZEOF_ARES_SOCKLEN_T 4
|
||||||
|
# define CARES_PULL_SYS_TYPES_H 1
|
||||||
|
# define CARES_PULL_SYS_SOCKET_H 1
|
||||||
|
|
||||||
|
#else
|
||||||
|
# error "Unknown non-configure build target!"
|
||||||
|
Error Compilation_aborted_Unknown_non_configure_build_target
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* CARES_PULL_SYS_TYPES_H is defined above when inclusion of header file */
|
||||||
|
/* sys/types.h is required here to properly make type definitions below. */
|
||||||
|
#ifdef CARES_PULL_SYS_TYPES_H
|
||||||
|
# include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* CARES_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
|
||||||
|
/* sys/socket.h is required here to properly make type definitions below. */
|
||||||
|
#ifdef CARES_PULL_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Data type definition of ares_socklen_t. */
|
||||||
|
|
||||||
|
#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||||
|
typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __CARES_BUILD_H */
|
||||||
111
ares/ares_build.h.in
Normal file
111
ares/ares_build.h.in
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
#ifndef __CARES_BUILD_H
|
||||||
|
#define __CARES_BUILD_H
|
||||||
|
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 2009 by Daniel Stenberg et al
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software and its
|
||||||
|
* documentation for any purpose and without fee is hereby granted, provided
|
||||||
|
* that the above copyright notice appear in all copies and that both that
|
||||||
|
* copyright notice and this permission notice appear in supporting
|
||||||
|
* documentation, and that the name of M.I.T. not be used in advertising or
|
||||||
|
* publicity pertaining to distribution of the software without specific,
|
||||||
|
* written prior permission. M.I.T. makes no representations about the
|
||||||
|
* suitability of this software for any purpose. It is provided "as is"
|
||||||
|
* without express or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ================================================================ */
|
||||||
|
/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
|
||||||
|
/* ================================================================ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE 1:
|
||||||
|
* -------
|
||||||
|
*
|
||||||
|
* Nothing in this file is intended to be modified or adjusted by the
|
||||||
|
* c-ares library user nor by the c-ares library builder.
|
||||||
|
*
|
||||||
|
* If you think that something actually needs to be changed, adjusted
|
||||||
|
* or fixed in this file, then, report it on the c-ares development
|
||||||
|
* mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
|
||||||
|
*
|
||||||
|
* This header file shall only export symbols which are 'cares' or 'CARES'
|
||||||
|
* prefixed, otherwise public name space would be polluted.
|
||||||
|
*
|
||||||
|
* NOTE 2:
|
||||||
|
* -------
|
||||||
|
*
|
||||||
|
* Right now you might be staring at file ares_build.h.in or ares_build.h,
|
||||||
|
* this is due to the following reason:
|
||||||
|
*
|
||||||
|
* On systems capable of running the configure script, the configure process
|
||||||
|
* will overwrite the distributed ares_build.h file with one that is suitable
|
||||||
|
* and specific to the library being configured and built, which is generated
|
||||||
|
* from the ares_build.h.in template file.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ================================================================ */
|
||||||
|
/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
|
||||||
|
/* ================================================================ */
|
||||||
|
|
||||||
|
#ifdef CARES_SIZEOF_LONG
|
||||||
|
# error "CARES_SIZEOF_LONG shall not be defined except in ares_build.h"
|
||||||
|
Error Compilation_aborted_CARES_SIZEOF_LONG_already_defined
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||||
|
# error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
|
||||||
|
Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CARES_SIZEOF_ARES_SOCKLEN_T
|
||||||
|
# error "CARES_SIZEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
|
||||||
|
Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_already_defined
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* ================================================================ */
|
||||||
|
/* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
|
||||||
|
/* ================================================================ */
|
||||||
|
|
||||||
|
/* Configure process defines this to 1 when it finds out that system */
|
||||||
|
/* header file ws2tcpip.h must be included by the external interface. */
|
||||||
|
#undef CARES_PULL_WS2TCPIP_H
|
||||||
|
#ifdef CARES_PULL_WS2TCPIP_H
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
# include <winsock2.h>
|
||||||
|
# include <ws2tcpip.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Configure process defines this to 1 when it finds out that system */
|
||||||
|
/* header file sys/types.h must be included by the external interface. */
|
||||||
|
#undef CARES_PULL_SYS_TYPES_H
|
||||||
|
#ifdef CARES_PULL_SYS_TYPES_H
|
||||||
|
# include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Configure process defines this to 1 when it finds out that system */
|
||||||
|
/* header file sys/socket.h must be included by the external interface. */
|
||||||
|
#undef CARES_PULL_SYS_SOCKET_H
|
||||||
|
#ifdef CARES_PULL_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The size of `long', as computed by sizeof. */
|
||||||
|
#undef CARES_SIZEOF_LONG
|
||||||
|
|
||||||
|
/* Integral data type used for ares_socklen_t. */
|
||||||
|
#undef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||||
|
|
||||||
|
/* The size of `ares_socklen_t', as computed by sizeof. */
|
||||||
|
#undef CARES_SIZEOF_ARES_SOCKLEN_T
|
||||||
|
|
||||||
|
/* Data type definition of ares_socklen_t. */
|
||||||
|
typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;
|
||||||
|
|
||||||
|
#endif /* __CARES_BUILD_H */
|
||||||
@@ -27,7 +27,7 @@ ares_cancel \- Cancel a resolve
|
|||||||
The \fBares_cancel\fP function cancels all lookups/requests made on the the
|
The \fBares_cancel\fP function cancels all lookups/requests made on the the
|
||||||
name service channel identified by \fIchannel\fP. \fBares_cancel\fP invokes
|
name service channel identified by \fIchannel\fP. \fBares_cancel\fP invokes
|
||||||
the callbacks for each pending query on the channel, passing a status of
|
the callbacks for each pending query on the channel, passing a status of
|
||||||
.BR ARES_ETIMEOUT .
|
.BR ARES_ECANCELLED .
|
||||||
These calls give the callbacks a chance to clean up any state which
|
These calls give the callbacks a chance to clean up any state which
|
||||||
might have been stored in their arguments.
|
might have been stored in their arguments.
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
@@ -35,5 +35,10 @@ might have been stored in their arguments.
|
|||||||
.BR ares_destroy (3)
|
.BR ares_destroy (3)
|
||||||
.SH NOTES
|
.SH NOTES
|
||||||
This function was added in c-ares 1.2.0
|
This function was added in c-ares 1.2.0
|
||||||
|
|
||||||
|
c-ares 1.6.0 and earlier pass a status of
|
||||||
|
.BR ARES_ETIMEOUT
|
||||||
|
instead of
|
||||||
|
.BR ARES_ECANCELLED .
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
Dirk Manske
|
Dirk Manske
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
@@ -36,7 +36,7 @@ void ares_cancel(ares_channel channel)
|
|||||||
{
|
{
|
||||||
query = list_node->data;
|
query = list_node->data;
|
||||||
list_node = list_node->next; /* since we're deleting the query */
|
list_node = list_node->next; /* since we're deleting the query */
|
||||||
query->callback(query->arg, ARES_ETIMEOUT, 0, NULL, 0);
|
query->callback(query->arg, ARES_ECANCELLED, 0, NULL, 0);
|
||||||
ares__free_query(query);
|
ares__free_query(query);
|
||||||
}
|
}
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
|
|||||||
44
ares/ares_dup.3
Normal file
44
ares/ares_dup.3
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.\" Copyright (C) 2004-2009 by Daniel Stenberg
|
||||||
|
.\"
|
||||||
|
.\" Permission to use, copy, modify, and distribute this
|
||||||
|
.\" software and its documentation for any purpose and without
|
||||||
|
.\" fee is hereby granted, provided that the above copyright
|
||||||
|
.\" notice appear in all copies and that both that copyright
|
||||||
|
.\" notice and this permission notice appear in supporting
|
||||||
|
.\" documentation, and that the name of M.I.T. not be used in
|
||||||
|
.\" advertising or publicity pertaining to distribution of the
|
||||||
|
.\" software without specific, written prior permission.
|
||||||
|
.\" M.I.T. makes no representations about the suitability of
|
||||||
|
.\" this software for any purpose. It is provided "as is"
|
||||||
|
.\" without express or implied warranty.
|
||||||
|
.\"
|
||||||
|
.TH ARES_DUP 3 "26 May 2009"
|
||||||
|
.SH NAME
|
||||||
|
ares_dup \- Duplicate a resolver channel
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.nf
|
||||||
|
.B #include <ares.h>
|
||||||
|
.PP
|
||||||
|
.B int ares_dup(ares_channel *\fIchannel\fP, ares_channel \fIsource\fP)
|
||||||
|
.fi
|
||||||
|
.SH DESCRIPTION
|
||||||
|
The \fBares_dup(3)\fP function duplicates an existing communications channel
|
||||||
|
for name service lookups. If it returns successfully, \fBares_dup(3)\fP will
|
||||||
|
set the variable pointed to by \fIchannel\fP to a handle used to identify the
|
||||||
|
name service channel. The caller should invoke \fIares_destroy(3)\fP on the
|
||||||
|
handle when the channel is no longer needed.
|
||||||
|
|
||||||
|
The \fBares_dup_options\fP function also initializes a name service channel,
|
||||||
|
with additional options set exactly as the \fIsource\fP channel has them
|
||||||
|
configured.
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR ares_destroy(3),
|
||||||
|
.BR ares_init(3),
|
||||||
|
.BR ares_library_init(3)
|
||||||
|
.SH AVAILABILITY
|
||||||
|
ares_dup(3) was added in c-ares 1.6.0
|
||||||
|
.SH AUTHOR
|
||||||
|
Daniel Stenberg
|
||||||
|
|
||||||
@@ -15,16 +15,21 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include "nameser.h"
|
# include <sys/socket.h>
|
||||||
#else
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/nameser.h>
|
|
||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
|
||||||
#include <arpa/nameser_compat.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
# include <arpa/nameser_compat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -66,10 +71,10 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
|
|||||||
const unsigned char *p;
|
const unsigned char *p;
|
||||||
|
|
||||||
len = name_length(encoded, abuf, alen);
|
len = name_length(encoded, abuf, alen);
|
||||||
if (len == -1)
|
if (len < 0)
|
||||||
return ARES_EBADNAME;
|
return ARES_EBADNAME;
|
||||||
|
|
||||||
*s = malloc(len + 1);
|
*s = malloc(((size_t)len) + 1);
|
||||||
if (!*s)
|
if (!*s)
|
||||||
return ARES_ENOMEM;
|
return ARES_ENOMEM;
|
||||||
q = *s;
|
q = *s;
|
||||||
@@ -172,3 +177,14 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf,
|
|||||||
*/
|
*/
|
||||||
return (n) ? n - 1 : n;
|
return (n) ? n - 1 : n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Like ares_expand_name but returns EBADRESP in case of invalid input. */
|
||||||
|
int ares__expand_name_for_response(const unsigned char *encoded,
|
||||||
|
const unsigned char *abuf, int alen,
|
||||||
|
char **s, long *enclen)
|
||||||
|
{
|
||||||
|
int status = ares_expand_name(encoded, abuf, alen, s, enclen);
|
||||||
|
if (status == ARES_EBADNAME)
|
||||||
|
status = ARES_EBADRESP;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,13 +15,18 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include "nameser.h"
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
# include "nameser.h"
|
||||||
#include <arpa/nameser.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#if !defined(WIN32) || defined(WATT32)
|
#if !defined(WIN32) || defined(WATT32)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
#include "ares_private.h"
|
||||||
|
|||||||
@@ -14,18 +14,27 @@
|
|||||||
* this software for any purpose. It is provided "as is"
|
* this software for any purpose. It is provided "as is"
|
||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include "nameser.h"
|
# include <sys/socket.h>
|
||||||
#else
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <arpa/nameser.h>
|
|
||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
|
||||||
#include <arpa/nameser_compat.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
# include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
# include <arpa/nameser_compat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -33,8 +42,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
|
||||||
#include "inet_net_pton.h"
|
#include "inet_net_pton.h"
|
||||||
|
#include "ares_private.h"
|
||||||
|
|
||||||
#ifdef WATT32
|
#ifdef WATT32
|
||||||
#undef WIN32
|
#undef WIN32
|
||||||
@@ -43,8 +52,7 @@
|
|||||||
struct addr_query {
|
struct addr_query {
|
||||||
/* Arguments passed to ares_gethostbyaddr() */
|
/* Arguments passed to ares_gethostbyaddr() */
|
||||||
ares_channel channel;
|
ares_channel channel;
|
||||||
union ares_addr addr;
|
struct ares_addr addr;
|
||||||
int family;
|
|
||||||
ares_host_callback callback;
|
ares_host_callback callback;
|
||||||
void *arg;
|
void *arg;
|
||||||
|
|
||||||
@@ -57,8 +65,8 @@ static void addr_callback(void *arg, int status, int timeouts,
|
|||||||
unsigned char *abuf, int alen);
|
unsigned char *abuf, int alen);
|
||||||
static void end_aquery(struct addr_query *aquery, int status,
|
static void end_aquery(struct addr_query *aquery, int status,
|
||||||
struct hostent *host);
|
struct hostent *host);
|
||||||
static int file_lookup(union ares_addr *addr, int family, struct hostent **host);
|
static int file_lookup(struct ares_addr *addr, struct hostent **host);
|
||||||
static void ptr_rr_name(char *name, int family, union ares_addr *addr);
|
static void ptr_rr_name(char *name, const struct ares_addr *addr);
|
||||||
|
|
||||||
void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
|
void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
|
||||||
int family, ares_host_callback callback, void *arg)
|
int family, ares_host_callback callback, void *arg)
|
||||||
@@ -86,10 +94,10 @@ void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
|
|||||||
}
|
}
|
||||||
aquery->channel = channel;
|
aquery->channel = channel;
|
||||||
if (family == AF_INET)
|
if (family == AF_INET)
|
||||||
memcpy(&aquery->addr.addr4, addr, sizeof(struct in_addr));
|
memcpy(&aquery->addr.addrV4, addr, sizeof(struct in_addr));
|
||||||
else
|
else
|
||||||
memcpy(&aquery->addr.addr6, addr, sizeof(struct in6_addr));
|
memcpy(&aquery->addr.addrV6, addr, sizeof(struct in6_addr));
|
||||||
aquery->family = family;
|
aquery->addr.family = family;
|
||||||
aquery->callback = callback;
|
aquery->callback = callback;
|
||||||
aquery->arg = arg;
|
aquery->arg = arg;
|
||||||
aquery->remaining_lookups = channel->lookups;
|
aquery->remaining_lookups = channel->lookups;
|
||||||
@@ -110,13 +118,13 @@ static void next_lookup(struct addr_query *aquery)
|
|||||||
switch (*p)
|
switch (*p)
|
||||||
{
|
{
|
||||||
case 'b':
|
case 'b':
|
||||||
ptr_rr_name(name, aquery->family, &aquery->addr);
|
ptr_rr_name(name, &aquery->addr);
|
||||||
aquery->remaining_lookups = p + 1;
|
aquery->remaining_lookups = p + 1;
|
||||||
ares_query(aquery->channel, name, C_IN, T_PTR, addr_callback,
|
ares_query(aquery->channel, name, C_IN, T_PTR, addr_callback,
|
||||||
aquery);
|
aquery);
|
||||||
return;
|
return;
|
||||||
case 'f':
|
case 'f':
|
||||||
status = file_lookup(&aquery->addr, aquery->family, &host);
|
status = file_lookup(&aquery->addr, &host);
|
||||||
|
|
||||||
/* this status check below previously checked for !ARES_ENOTFOUND,
|
/* this status check below previously checked for !ARES_ENOTFOUND,
|
||||||
but we should not assume that this single error code is the one
|
but we should not assume that this single error code is the one
|
||||||
@@ -137,16 +145,23 @@ static void addr_callback(void *arg, int status, int timeouts,
|
|||||||
{
|
{
|
||||||
struct addr_query *aquery = (struct addr_query *) arg;
|
struct addr_query *aquery = (struct addr_query *) arg;
|
||||||
struct hostent *host;
|
struct hostent *host;
|
||||||
|
size_t addrlen;
|
||||||
|
|
||||||
aquery->timeouts += timeouts;
|
aquery->timeouts += timeouts;
|
||||||
if (status == ARES_SUCCESS)
|
if (status == ARES_SUCCESS)
|
||||||
{
|
{
|
||||||
if (aquery->family == AF_INET)
|
if (aquery->addr.family == AF_INET)
|
||||||
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addr4,
|
{
|
||||||
sizeof(struct in_addr), AF_INET, &host);
|
addrlen = sizeof(struct in_addr);
|
||||||
|
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV4,
|
||||||
|
(int)addrlen, AF_INET, &host);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addr6,
|
{
|
||||||
sizeof(struct in6_addr), AF_INET6, &host);
|
addrlen = sizeof(struct in6_addr);
|
||||||
|
status = ares_parse_ptr_reply(abuf, alen, &aquery->addr.addrV6,
|
||||||
|
(int)addrlen, AF_INET6, &host);
|
||||||
|
}
|
||||||
end_aquery(aquery, status, host);
|
end_aquery(aquery, status, host);
|
||||||
}
|
}
|
||||||
else if (status == ARES_EDESTRUCTION)
|
else if (status == ARES_EDESTRUCTION)
|
||||||
@@ -164,7 +179,7 @@ static void end_aquery(struct addr_query *aquery, int status,
|
|||||||
free(aquery);
|
free(aquery);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int file_lookup(union ares_addr *addr, int family, struct hostent **host)
|
static int file_lookup(struct ares_addr *addr, struct hostent **host)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int status;
|
int status;
|
||||||
@@ -217,21 +232,21 @@ static int file_lookup(union ares_addr *addr, int family, struct hostent **host)
|
|||||||
return ARES_EFILE;
|
return ARES_EFILE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while ((status = ares__get_hostent(fp, family, host)) == ARES_SUCCESS)
|
while ((status = ares__get_hostent(fp, addr->family, host)) == ARES_SUCCESS)
|
||||||
{
|
{
|
||||||
if (family != (*host)->h_addrtype)
|
if (addr->family != (*host)->h_addrtype)
|
||||||
{
|
{
|
||||||
ares_free_hostent(*host);
|
ares_free_hostent(*host);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (family == AF_INET)
|
if (addr->family == AF_INET)
|
||||||
{
|
{
|
||||||
if (memcmp((*host)->h_addr, &addr->addr4, sizeof(struct in_addr)) == 0)
|
if (memcmp((*host)->h_addr, &addr->addrV4, sizeof(struct in_addr)) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (family == AF_INET6)
|
else if (addr->family == AF_INET6)
|
||||||
{
|
{
|
||||||
if (memcmp((*host)->h_addr, &addr->addr6, sizeof(struct in6_addr)) == 0)
|
if (memcmp((*host)->h_addr, &addr->addrV6, sizeof(struct in6_addr)) == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ares_free_hostent(*host);
|
ares_free_hostent(*host);
|
||||||
@@ -244,11 +259,11 @@ static int file_lookup(union ares_addr *addr, int family, struct hostent **host)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ptr_rr_name(char *name, int family, union ares_addr *addr)
|
static void ptr_rr_name(char *name, const struct ares_addr *addr)
|
||||||
{
|
{
|
||||||
if (family == AF_INET)
|
if (addr->family == AF_INET)
|
||||||
{
|
{
|
||||||
unsigned long laddr = ntohl(addr->addr4.s_addr);
|
unsigned long laddr = ntohl(addr->addrV4.s_addr);
|
||||||
int a1 = (int)((laddr >> 24) & 0xff);
|
int a1 = (int)((laddr >> 24) & 0xff);
|
||||||
int a2 = (int)((laddr >> 16) & 0xff);
|
int a2 = (int)((laddr >> 16) & 0xff);
|
||||||
int a3 = (int)((laddr >> 8) & 0xff);
|
int a3 = (int)((laddr >> 8) & 0xff);
|
||||||
@@ -257,14 +272,17 @@ static void ptr_rr_name(char *name, int family, union ares_addr *addr)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned char *bytes = (unsigned char *)&addr->addr6.s6_addr;
|
unsigned char *bytes = (unsigned char *)&addr->addrV6.s6_addr;
|
||||||
|
/* There are too many arguments to do this in one line using
|
||||||
|
* minimally C89-compliant compilers */
|
||||||
sprintf(name,
|
sprintf(name,
|
||||||
"%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x."
|
"%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.",
|
||||||
"%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.arpa",
|
|
||||||
bytes[15]&0xf, bytes[15] >> 4, bytes[14]&0xf, bytes[14] >> 4,
|
bytes[15]&0xf, bytes[15] >> 4, bytes[14]&0xf, bytes[14] >> 4,
|
||||||
bytes[13]&0xf, bytes[13] >> 4, bytes[12]&0xf, bytes[12] >> 4,
|
bytes[13]&0xf, bytes[13] >> 4, bytes[12]&0xf, bytes[12] >> 4,
|
||||||
bytes[11]&0xf, bytes[11] >> 4, bytes[10]&0xf, bytes[10] >> 4,
|
bytes[11]&0xf, bytes[11] >> 4, bytes[10]&0xf, bytes[10] >> 4,
|
||||||
bytes[9]&0xf, bytes[9] >> 4, bytes[8]&0xf, bytes[8] >> 4,
|
bytes[9]&0xf, bytes[9] >> 4, bytes[8]&0xf, bytes[8] >> 4);
|
||||||
|
sprintf(name+strlen(name),
|
||||||
|
"%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.%x.ip6.arpa",
|
||||||
bytes[7]&0xf, bytes[7] >> 4, bytes[6]&0xf, bytes[6] >> 4,
|
bytes[7]&0xf, bytes[7] >> 4, bytes[6]&0xf, bytes[6] >> 4,
|
||||||
bytes[5]&0xf, bytes[5] >> 4, bytes[4]&0xf, bytes[4] >> 4,
|
bytes[5]&0xf, bytes[5] >> 4, bytes[4]&0xf, bytes[4] >> 4,
|
||||||
bytes[3]&0xf, bytes[3] >> 4, bytes[2]&0xf, bytes[2] >> 4,
|
bytes[3]&0xf, bytes[3] >> 4, bytes[2]&0xf, bytes[2] >> 4,
|
||||||
|
|||||||
@@ -15,32 +15,41 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include "nameser.h"
|
# include <sys/socket.h>
|
||||||
#else
|
#endif
|
||||||
#include <sys/socket.h>
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#endif
|
||||||
#include <netdb.h>
|
#ifdef HAVE_NETDB_H
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
# include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_ARPA_NAMESER_H
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
#include <arpa/nameser.h>
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
#include <arpa/nameser_compat.h>
|
# include <arpa/nameser_compat.h>
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
|
||||||
#include "inet_net_pton.h"
|
#include "inet_net_pton.h"
|
||||||
#include "bitncmp.h"
|
#include "bitncmp.h"
|
||||||
|
#include "ares_private.h"
|
||||||
|
|
||||||
#ifdef WATT32
|
#ifdef WATT32
|
||||||
#undef WIN32
|
#undef WIN32
|
||||||
@@ -52,7 +61,8 @@ struct host_query {
|
|||||||
char *name;
|
char *name;
|
||||||
ares_host_callback callback;
|
ares_host_callback callback;
|
||||||
void *arg;
|
void *arg;
|
||||||
int family;
|
int sent_family; /* this family is what was is being used */
|
||||||
|
int want_family; /* this family is what is asked for in the API */
|
||||||
const char *remaining_lookups;
|
const char *remaining_lookups;
|
||||||
int timeouts;
|
int timeouts;
|
||||||
};
|
};
|
||||||
@@ -62,26 +72,31 @@ static void host_callback(void *arg, int status, int timeouts,
|
|||||||
unsigned char *abuf, int alen);
|
unsigned char *abuf, int alen);
|
||||||
static void end_hquery(struct host_query *hquery, int status,
|
static void end_hquery(struct host_query *hquery, int status,
|
||||||
struct hostent *host);
|
struct hostent *host);
|
||||||
static int fake_hostent(const char *name, int family, ares_host_callback callback,
|
static int fake_hostent(const char *name, int family,
|
||||||
void *arg);
|
ares_host_callback callback, void *arg);
|
||||||
static int file_lookup(const char *name, int family, struct hostent **host);
|
static int file_lookup(const char *name, int family, struct hostent **host);
|
||||||
static void sort_addresses(struct hostent *host, struct apattern *sortlist,
|
static void sort_addresses(struct hostent *host,
|
||||||
int nsort);
|
const struct apattern *sortlist, int nsort);
|
||||||
static void sort6_addresses(struct hostent *host, struct apattern *sortlist,
|
static void sort6_addresses(struct hostent *host,
|
||||||
int nsort);
|
const struct apattern *sortlist, int nsort);
|
||||||
static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
|
static int get_address_index(const struct in_addr *addr,
|
||||||
int nsort);
|
const struct apattern *sortlist, int nsort);
|
||||||
static int get6_address_index(struct in6_addr *addr, struct apattern *sortlist,
|
static int get6_address_index(const struct in6_addr *addr,
|
||||||
int nsort);
|
const struct apattern *sortlist, int nsort);
|
||||||
|
|
||||||
void ares_gethostbyname(ares_channel channel, const char *name, int family,
|
void ares_gethostbyname(ares_channel channel, const char *name, int family,
|
||||||
ares_host_callback callback, void *arg)
|
ares_host_callback callback, void *arg)
|
||||||
{
|
{
|
||||||
struct host_query *hquery;
|
struct host_query *hquery;
|
||||||
|
|
||||||
/* Right now we only know how to look up Internet addresses. */
|
/* Right now we only know how to look up Internet addresses - and unspec
|
||||||
if (family != AF_INET && family != AF_INET6)
|
means try both basically. */
|
||||||
{
|
switch (family) {
|
||||||
|
case AF_INET:
|
||||||
|
case AF_INET6:
|
||||||
|
case AF_UNSPEC:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
callback(arg, ARES_ENOTIMP, 0, NULL);
|
callback(arg, ARES_ENOTIMP, 0, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -98,9 +113,9 @@ void ares_gethostbyname(ares_channel channel, const char *name, int family,
|
|||||||
}
|
}
|
||||||
hquery->channel = channel;
|
hquery->channel = channel;
|
||||||
hquery->name = strdup(name);
|
hquery->name = strdup(name);
|
||||||
hquery->family = family;
|
hquery->want_family = family;
|
||||||
if (!hquery->name)
|
hquery->sent_family = -1; /* nothing is sent yet */
|
||||||
{
|
if (!hquery->name) {
|
||||||
free(hquery);
|
free(hquery);
|
||||||
callback(arg, ARES_ENOMEM, 0, NULL);
|
callback(arg, ARES_ENOMEM, 0, NULL);
|
||||||
return;
|
return;
|
||||||
@@ -127,17 +142,23 @@ static void next_lookup(struct host_query *hquery, int status_code)
|
|||||||
case 'b':
|
case 'b':
|
||||||
/* DNS lookup */
|
/* DNS lookup */
|
||||||
hquery->remaining_lookups = p + 1;
|
hquery->remaining_lookups = p + 1;
|
||||||
if (hquery->family == AF_INET6)
|
if ((hquery->want_family == AF_INET6) ||
|
||||||
|
(hquery->want_family == AF_UNSPEC)) {
|
||||||
|
/* if inet6 or unspec, start out with AAAA */
|
||||||
|
hquery->sent_family = AF_INET6;
|
||||||
ares_search(hquery->channel, hquery->name, C_IN, T_AAAA,
|
ares_search(hquery->channel, hquery->name, C_IN, T_AAAA,
|
||||||
host_callback, hquery);
|
host_callback, hquery);
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
|
hquery->sent_family = AF_INET;
|
||||||
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
|
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
|
||||||
hquery);
|
hquery);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
/* Host file lookup */
|
/* Host file lookup */
|
||||||
status = file_lookup(hquery->name, hquery->family, &host);
|
status = file_lookup(hquery->name, hquery->want_family, &host);
|
||||||
|
|
||||||
/* this status check below previously checked for !ARES_ENOTFOUND,
|
/* this status check below previously checked for !ARES_ENOTFOUND,
|
||||||
but we should not assume that this single error code is the one
|
but we should not assume that this single error code is the one
|
||||||
@@ -159,29 +180,39 @@ static void host_callback(void *arg, int status, int timeouts,
|
|||||||
{
|
{
|
||||||
struct host_query *hquery = (struct host_query *) arg;
|
struct host_query *hquery = (struct host_query *) arg;
|
||||||
ares_channel channel = hquery->channel;
|
ares_channel channel = hquery->channel;
|
||||||
struct hostent *host;
|
struct hostent *host = NULL;
|
||||||
|
|
||||||
hquery->timeouts += timeouts;
|
hquery->timeouts += timeouts;
|
||||||
if (status == ARES_SUCCESS)
|
if (status == ARES_SUCCESS)
|
||||||
{
|
{
|
||||||
if (hquery->family == AF_INET)
|
if (hquery->sent_family == AF_INET)
|
||||||
{
|
{
|
||||||
status = ares_parse_a_reply(abuf, alen, &host, NULL, NULL);
|
status = ares_parse_a_reply(abuf, alen, &host, NULL, NULL);
|
||||||
if (host && channel->nsort)
|
if (host && channel->nsort)
|
||||||
sort_addresses(host, channel->sortlist, channel->nsort);
|
sort_addresses(host, channel->sortlist, channel->nsort);
|
||||||
}
|
}
|
||||||
else if (hquery->family == AF_INET6)
|
else if (hquery->sent_family == AF_INET6)
|
||||||
{
|
{
|
||||||
status = ares_parse_aaaa_reply(abuf, alen, &host, NULL, NULL);
|
status = ares_parse_aaaa_reply(abuf, alen, &host, NULL, NULL);
|
||||||
|
if (status == ARES_ENODATA || status == ARES_EBADRESP) {
|
||||||
|
/* The query returned something but either there were no AAAA records (e.g. just CNAME)
|
||||||
|
or the response was malformed. Try looking up A instead.
|
||||||
|
We should possibly limit this attempt-next logic to AF_UNSPEC lookups only. */
|
||||||
|
hquery->sent_family = AF_INET;
|
||||||
|
ares_search(hquery->channel, hquery->name, C_IN, T_A,
|
||||||
|
host_callback, hquery);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (host && channel->nsort)
|
if (host && channel->nsort)
|
||||||
sort6_addresses(host, channel->sortlist, channel->nsort);
|
sort6_addresses(host, channel->sortlist, channel->nsort);
|
||||||
}
|
}
|
||||||
end_hquery(hquery, status, host);
|
end_hquery(hquery, status, host);
|
||||||
}
|
}
|
||||||
else if (status == ARES_ENODATA && hquery->family == AF_INET6)
|
else if ((status == ARES_ENODATA || status == ARES_EBADRESP || status == ARES_ETIMEOUT) && hquery->sent_family == AF_INET6)
|
||||||
{
|
{
|
||||||
/* There was no AAAA. Now lookup an A */
|
/* The AAAA query yielded no useful result. Now look up an A instead.
|
||||||
hquery->family = AF_INET;
|
We should possibly limit this attempt-next logic to AF_UNSPEC lookups only. */
|
||||||
|
hquery->sent_family = AF_INET;
|
||||||
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
|
ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback,
|
||||||
hquery);
|
hquery);
|
||||||
}
|
}
|
||||||
@@ -214,15 +245,16 @@ static int fake_hostent(const char *name, int family, ares_host_callback callbac
|
|||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
struct in6_addr in6;
|
struct in6_addr in6;
|
||||||
|
|
||||||
if (family == AF_INET)
|
if (family == AF_INET || family == AF_INET6)
|
||||||
{
|
{
|
||||||
/* It only looks like an IP address if it's all numbers and dots. */
|
/* It only looks like an IP address if it's all numbers and dots. */
|
||||||
int numdots = 0;
|
int numdots = 0, valid = 1;
|
||||||
const char *p;
|
const char *p;
|
||||||
for (p = name; *p; p++)
|
for (p = name; *p; p++)
|
||||||
{
|
{
|
||||||
if (!ISDIGIT(*p) && *p != '.') {
|
if (!ISDIGIT(*p) && *p != '.') {
|
||||||
return 0;
|
valid = 0;
|
||||||
|
break;
|
||||||
} else if (*p == '.') {
|
} else if (*p == '.') {
|
||||||
numdots++;
|
numdots++;
|
||||||
}
|
}
|
||||||
@@ -231,12 +263,15 @@ static int fake_hostent(const char *name, int family, ares_host_callback callbac
|
|||||||
/* if we don't have 3 dots, it is illegal
|
/* if we don't have 3 dots, it is illegal
|
||||||
* (although inet_addr doesn't think so).
|
* (although inet_addr doesn't think so).
|
||||||
*/
|
*/
|
||||||
if (numdots != 3)
|
if (numdots != 3 || !valid)
|
||||||
result = 0;
|
result = 0;
|
||||||
else
|
else
|
||||||
result = ((in.s_addr = inet_addr(name)) == INADDR_NONE ? 0 : 1);
|
result = ((in.s_addr = inet_addr(name)) == INADDR_NONE ? 0 : 1);
|
||||||
|
|
||||||
|
if (result)
|
||||||
|
family = AF_INET;
|
||||||
}
|
}
|
||||||
else if (family == AF_INET6)
|
if (family == AF_INET6)
|
||||||
result = (ares_inet_pton(AF_INET6, name, &in6) < 1 ? 0 : 1);
|
result = (ares_inet_pton(AF_INET6, name, &in6) < 1 ? 0 : 1);
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -244,12 +279,12 @@ static int fake_hostent(const char *name, int family, ares_host_callback callbac
|
|||||||
|
|
||||||
if (family == AF_INET)
|
if (family == AF_INET)
|
||||||
{
|
{
|
||||||
hostent.h_length = sizeof(struct in_addr);
|
hostent.h_length = (int)sizeof(struct in_addr);
|
||||||
addrs[0] = (char *)∈
|
addrs[0] = (char *)∈
|
||||||
}
|
}
|
||||||
else if (family == AF_INET6)
|
else if (family == AF_INET6)
|
||||||
{
|
{
|
||||||
hostent.h_length = sizeof(struct in6_addr);
|
hostent.h_length = (int)sizeof(struct in6_addr);
|
||||||
addrs[0] = (char *)&in6;
|
addrs[0] = (char *)&in6;
|
||||||
}
|
}
|
||||||
/* Duplicate the name, to avoid a constness violation. */
|
/* Duplicate the name, to avoid a constness violation. */
|
||||||
@@ -271,6 +306,33 @@ static int fake_hostent(const char *name, int family, ares_host_callback callbac
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This is an API method */
|
||||||
|
int ares_gethostbyname_file(ares_channel channel, const char *name,
|
||||||
|
int family, struct hostent **host)
|
||||||
|
{
|
||||||
|
int result;
|
||||||
|
|
||||||
|
/* We only take the channel to ensure that ares_init() been called. */
|
||||||
|
if(channel == NULL)
|
||||||
|
{
|
||||||
|
/* Anything will do, really. This seems fine, and is consistent with
|
||||||
|
other error cases. */
|
||||||
|
*host = NULL;
|
||||||
|
return ARES_ENOTFOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Just chain to the internal implementation we use here; it's exactly
|
||||||
|
* what we want.
|
||||||
|
*/
|
||||||
|
result = file_lookup(name, family, host);
|
||||||
|
if(result != ARES_SUCCESS)
|
||||||
|
{
|
||||||
|
/* We guarantee a NULL hostent on failure. */
|
||||||
|
*host = NULL;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
static int file_lookup(const char *name, int family, struct hostent **host)
|
static int file_lookup(const char *name, int family, struct hostent **host)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@@ -346,7 +408,7 @@ static int file_lookup(const char *name, int family, struct hostent **host)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sort_addresses(struct hostent *host, struct apattern *sortlist,
|
static void sort_addresses(struct hostent *host, const struct apattern *sortlist,
|
||||||
int nsort)
|
int nsort)
|
||||||
{
|
{
|
||||||
struct in_addr a1, a2;
|
struct in_addr a1, a2;
|
||||||
@@ -376,7 +438,8 @@ static void sort_addresses(struct hostent *host, struct apattern *sortlist,
|
|||||||
/* Find the first entry in sortlist which matches addr. Return nsort
|
/* Find the first entry in sortlist which matches addr. Return nsort
|
||||||
* if none of them match.
|
* if none of them match.
|
||||||
*/
|
*/
|
||||||
static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
|
static int get_address_index(const struct in_addr *addr,
|
||||||
|
const struct apattern *sortlist,
|
||||||
int nsort)
|
int nsort)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -387,13 +450,13 @@ static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
|
|||||||
continue;
|
continue;
|
||||||
if (sortlist[i].type == PATTERN_MASK)
|
if (sortlist[i].type == PATTERN_MASK)
|
||||||
{
|
{
|
||||||
if ((addr->s_addr & sortlist[i].mask.addr.addr4.s_addr)
|
if ((addr->s_addr & sortlist[i].mask.addr4.s_addr)
|
||||||
== sortlist[i].addr.addr4.s_addr)
|
== sortlist[i].addrV4.s_addr)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!ares_bitncmp(&addr->s_addr, &sortlist[i].addr.addr4.s_addr,
|
if (!ares_bitncmp(&addr->s_addr, &sortlist[i].addrV4.s_addr,
|
||||||
sortlist[i].mask.bits))
|
sortlist[i].mask.bits))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -401,7 +464,7 @@ static int get_address_index(struct in_addr *addr, struct apattern *sortlist,
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sort6_addresses(struct hostent *host, struct apattern *sortlist,
|
static void sort6_addresses(struct hostent *host, const struct apattern *sortlist,
|
||||||
int nsort)
|
int nsort)
|
||||||
{
|
{
|
||||||
struct in6_addr a1, a2;
|
struct in6_addr a1, a2;
|
||||||
@@ -431,7 +494,8 @@ static void sort6_addresses(struct hostent *host, struct apattern *sortlist,
|
|||||||
/* Find the first entry in sortlist which matches addr. Return nsort
|
/* Find the first entry in sortlist which matches addr. Return nsort
|
||||||
* if none of them match.
|
* if none of them match.
|
||||||
*/
|
*/
|
||||||
static int get6_address_index(struct in6_addr *addr, struct apattern *sortlist,
|
static int get6_address_index(const struct in6_addr *addr,
|
||||||
|
const struct apattern *sortlist,
|
||||||
int nsort)
|
int nsort)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -440,7 +504,7 @@ static int get6_address_index(struct in6_addr *addr, struct apattern *sortlist,
|
|||||||
{
|
{
|
||||||
if (sortlist[i].family != AF_INET6)
|
if (sortlist[i].family != AF_INET6)
|
||||||
continue;
|
continue;
|
||||||
if (!ares_bitncmp(&addr->s6_addr, &sortlist[i].addr.addr6.s6_addr, sortlist[i].mask.bits))
|
if (!ares_bitncmp(&addr->s6_addr, &sortlist[i].addrV6.s6_addr, sortlist[i].mask.bits))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
|
|||||||
84
ares/ares_gethostbyname_file.3
Normal file
84
ares/ares_gethostbyname_file.3
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
.\"
|
||||||
|
.\" Permission to use, copy, modify, and distribute this
|
||||||
|
.\" software and its documentation for any purpose and without
|
||||||
|
.\" fee is hereby granted, provided that the above copyright
|
||||||
|
.\" notice appear in all copies and that both that copyright
|
||||||
|
.\" notice and this permission notice appear in supporting
|
||||||
|
.\" documentation, and that the name of M.I.T. not be used in
|
||||||
|
.\" advertising or publicity pertaining to distribution of the
|
||||||
|
.\" software without specific, written prior permission.
|
||||||
|
.\" M.I.T. makes no representations about the suitability of
|
||||||
|
.\" this software for any purpose. It is provided "as is"
|
||||||
|
.\" without express or implied warranty.
|
||||||
|
.\"
|
||||||
|
.TH ARES_GETHOSTBYNAME 3 "25 July 1998"
|
||||||
|
.SH NAME
|
||||||
|
ares_gethostbyname_file \- Lookup a name in the system's hosts file
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.nf
|
||||||
|
.B #include <ares.h>
|
||||||
|
.PP
|
||||||
|
.B void ares_gethostbyname_file(ares_channel \fIchannel\fP, const char *\fIname\fP,
|
||||||
|
.B int \fIfamily\fP, struct hostent **host)
|
||||||
|
.fi
|
||||||
|
.SH DESCRIPTION
|
||||||
|
The
|
||||||
|
.B ares_gethostbyname_file
|
||||||
|
function performs a host lookup by name against the system's hosts file (or equivalent local hostname database).
|
||||||
|
The
|
||||||
|
.IR channel
|
||||||
|
parameter is required, but no asynchronous queries are performed. Instead, the
|
||||||
|
lookup is done via the same mechanism used to perform 'f' lookups
|
||||||
|
(see the
|
||||||
|
.I lookups
|
||||||
|
options field in \fIares_init_options(3)\fP).
|
||||||
|
The parameter
|
||||||
|
.I name
|
||||||
|
gives the hostname as a NUL-terminated C string, and
|
||||||
|
.I family
|
||||||
|
gives the desired type of address for the resulting host entry.
|
||||||
|
.PP
|
||||||
|
The return value indicates whether the query succeeded and, if not, how it
|
||||||
|
failed. It may have any of the following values:
|
||||||
|
.TP 19
|
||||||
|
.B ARES_SUCCESS
|
||||||
|
The host lookup completed successfully and
|
||||||
|
.I host
|
||||||
|
now points to the result (and must be freed with \fIares_free_hostent(3)\fP).
|
||||||
|
.TP 19
|
||||||
|
.B ARES_ENOTFOUND
|
||||||
|
The hostname
|
||||||
|
.I name
|
||||||
|
was not found.
|
||||||
|
.TP 19
|
||||||
|
.B ARES_EFILE
|
||||||
|
There was a file I/O error while performing the lookup.
|
||||||
|
.TP 19
|
||||||
|
.B ARES_ENOMEM
|
||||||
|
Memory was exhausted.
|
||||||
|
.PP
|
||||||
|
On successful completion of the query, the pointer pointed to by
|
||||||
|
.I host
|
||||||
|
points to a
|
||||||
|
.B struct hostent
|
||||||
|
containing the address of the host returned by the lookup. The user must
|
||||||
|
free the memory pointed to by
|
||||||
|
.IR host
|
||||||
|
when finished with it by calling \fIares_free_hostent(3)\fP. If the lookup did
|
||||||
|
not complete successfully,
|
||||||
|
.I host
|
||||||
|
will be
|
||||||
|
.BR NULL .
|
||||||
|
.SH AVAILABILITY
|
||||||
|
Added in c-ares 1.5.4
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR ares_gethostbyname (3),
|
||||||
|
.BR ares_free_hostent (3),
|
||||||
|
.BR ares_init_options (3)
|
||||||
|
.SH AUTHOR
|
||||||
|
Brad Spencer
|
||||||
|
.br
|
||||||
|
Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
.\" this software for any purpose. It is provided "as is"
|
.\" this software for any purpose. It is provided "as is"
|
||||||
.\" without express or implied warranty.
|
.\" without express or implied warranty.
|
||||||
.\"
|
.\"
|
||||||
.TH ARES_GETNAMEINFO 3 "16 May 2005"
|
.TH ARES_GETNAMEINFO 3 "1 May 2009"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
ares_getnameinfo \- Address-to-nodename translation in protocol-independent manner
|
ares_getnameinfo \- Address-to-nodename translation in protocol-independent manner
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -25,7 +25,7 @@ ares_getnameinfo \- Address-to-nodename translation in protocol-independent mann
|
|||||||
.B int \fItimeouts\fP, char *\fInode\fP, char *\fIservice\fP)
|
.B int \fItimeouts\fP, char *\fInode\fP, char *\fIservice\fP)
|
||||||
.PP
|
.PP
|
||||||
.B void ares_getnameinfo(ares_channel \fIchannel\fP, const struct sockaddr *\fIsa\fP,
|
.B void ares_getnameinfo(ares_channel \fIchannel\fP, const struct sockaddr *\fIsa\fP,
|
||||||
.B socklen_t \fIsalen\fP, int \fIflags\fP, ares_nameinfo_callback \fIcallback\fP,
|
.B ares_socklen_t \fIsalen\fP, int \fIflags\fP, ares_nameinfo_callback \fIcallback\fP,
|
||||||
.B void *\fIarg\fP)
|
.B void *\fIarg\fP)
|
||||||
.fi
|
.fi
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
|
|||||||
@@ -14,19 +14,34 @@
|
|||||||
* this software for any purpose. It is provided "as is"
|
* this software for any purpose. It is provided "as is"
|
||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_GETSERVBYPORT_R
|
||||||
#include "nameser.h"
|
# if !defined(GETSERVBYPORT_R_ARGS) || \
|
||||||
#else
|
(GETSERVBYPORT_R_ARGS < 4) || (GETSERVBYPORT_R_ARGS > 6)
|
||||||
#include <sys/socket.h>
|
# error "you MUST specifiy a valid number of arguments for getservbyport_r"
|
||||||
#include <netinet/in.h>
|
# endif
|
||||||
#include <netdb.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <arpa/nameser.h>
|
|
||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
|
||||||
#include <arpa/nameser_compat.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
# include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
# include <arpa/nameser_compat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NET_IF_H
|
#ifdef HAVE_NET_IF_H
|
||||||
@@ -42,9 +57,9 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
|
||||||
#include "ares_ipv6.h"
|
#include "ares_ipv6.h"
|
||||||
#include "inet_ntop.h"
|
#include "inet_ntop.h"
|
||||||
|
#include "ares_private.h"
|
||||||
|
|
||||||
#ifdef WATT32
|
#ifdef WATT32
|
||||||
#undef WIN32
|
#undef WIN32
|
||||||
@@ -77,18 +92,26 @@ static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int scopeid,
|
|||||||
#endif
|
#endif
|
||||||
static char *ares_striendstr(const char *s1, const char *s2);
|
static char *ares_striendstr(const char *s1, const char *s2);
|
||||||
|
|
||||||
void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t salen,
|
void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
|
||||||
|
ares_socklen_t salen,
|
||||||
int flags, ares_nameinfo_callback callback, void *arg)
|
int flags, ares_nameinfo_callback callback, void *arg)
|
||||||
{
|
{
|
||||||
struct sockaddr_in *addr = NULL;
|
struct sockaddr_in *addr = NULL;
|
||||||
struct sockaddr_in6 *addr6 = NULL;
|
struct sockaddr_in6 *addr6 = NULL;
|
||||||
struct nameinfo_query *niquery;
|
struct nameinfo_query *niquery;
|
||||||
|
unsigned int port = 0;
|
||||||
|
|
||||||
/* Verify the buffer size */
|
/* Verify the buffer size */
|
||||||
if (salen == sizeof(struct sockaddr_in))
|
if (salen == sizeof(struct sockaddr_in))
|
||||||
|
{
|
||||||
addr = (struct sockaddr_in *)sa;
|
addr = (struct sockaddr_in *)sa;
|
||||||
|
port = addr->sin_port;
|
||||||
|
}
|
||||||
else if (salen == sizeof(struct sockaddr_in6))
|
else if (salen == sizeof(struct sockaddr_in6))
|
||||||
|
{
|
||||||
addr6 = (struct sockaddr_in6 *)sa;
|
addr6 = (struct sockaddr_in6 *)sa;
|
||||||
|
port = addr6->sin6_port;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
callback(arg, ARES_ENOTIMP, 0, NULL, NULL);
|
callback(arg, ARES_ENOTIMP, 0, NULL, NULL);
|
||||||
@@ -103,12 +126,7 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
|
|||||||
if ((flags & ARES_NI_LOOKUPSERVICE) && !(flags & ARES_NI_LOOKUPHOST))
|
if ((flags & ARES_NI_LOOKUPSERVICE) && !(flags & ARES_NI_LOOKUPHOST))
|
||||||
{
|
{
|
||||||
char buf[33], *service;
|
char buf[33], *service;
|
||||||
unsigned int port = 0;
|
|
||||||
|
|
||||||
if (salen == sizeof(struct sockaddr_in))
|
|
||||||
port = addr->sin_port;
|
|
||||||
else
|
|
||||||
port = addr6->sin6_port;
|
|
||||||
service = lookup_service((unsigned short)(port & 0xffff),
|
service = lookup_service((unsigned short)(port & 0xffff),
|
||||||
flags, buf, sizeof(buf));
|
flags, buf, sizeof(buf));
|
||||||
callback(arg, ARES_SUCCESS, 0, NULL, service);
|
callback(arg, ARES_SUCCESS, 0, NULL, service);
|
||||||
@@ -121,7 +139,6 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
|
|||||||
/* A numeric host can be handled without DNS */
|
/* A numeric host can be handled without DNS */
|
||||||
if ((flags & ARES_NI_NUMERICHOST))
|
if ((flags & ARES_NI_NUMERICHOST))
|
||||||
{
|
{
|
||||||
unsigned int port = 0;
|
|
||||||
char ipbuf[IPBUFSIZ];
|
char ipbuf[IPBUFSIZ];
|
||||||
char srvbuf[33];
|
char srvbuf[33];
|
||||||
char *service = NULL;
|
char *service = NULL;
|
||||||
@@ -138,7 +155,6 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
|
|||||||
if (salen == sizeof(struct sockaddr_in6))
|
if (salen == sizeof(struct sockaddr_in6))
|
||||||
{
|
{
|
||||||
ares_inet_ntop(AF_INET6, &addr6->sin6_addr, ipbuf, IPBUFSIZ);
|
ares_inet_ntop(AF_INET6, &addr6->sin6_addr, ipbuf, IPBUFSIZ);
|
||||||
port = addr6->sin6_port;
|
|
||||||
/* If the system supports scope IDs, use it */
|
/* If the system supports scope IDs, use it */
|
||||||
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
|
||||||
append_scopeid(addr6, flags, ipbuf, sizeof(ipbuf));
|
append_scopeid(addr6, flags, ipbuf, sizeof(ipbuf));
|
||||||
@@ -147,7 +163,6 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, socklen_t
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ares_inet_ntop(AF_INET, &addr->sin_addr, ipbuf, IPBUFSIZ);
|
ares_inet_ntop(AF_INET, &addr->sin_addr, ipbuf, IPBUFSIZ);
|
||||||
port = addr->sin_port;
|
|
||||||
}
|
}
|
||||||
/* They also want a service */
|
/* They also want a service */
|
||||||
if (flags & ARES_NI_LOOKUPSERVICE)
|
if (flags & ARES_NI_LOOKUPSERVICE)
|
||||||
@@ -210,6 +225,7 @@ static void nameinfo_callback(void *arg, int status, int timeouts, struct hosten
|
|||||||
We do this by determining our own domain name, then searching the string
|
We do this by determining our own domain name, then searching the string
|
||||||
for this domain name and removing it.
|
for this domain name and removing it.
|
||||||
*/
|
*/
|
||||||
|
#ifdef HAVE_GETHOSTNAME
|
||||||
if (niquery->flags & ARES_NI_NOFQDN)
|
if (niquery->flags & ARES_NI_NOFQDN)
|
||||||
{
|
{
|
||||||
char buf[255];
|
char buf[255];
|
||||||
@@ -222,6 +238,7 @@ static void nameinfo_callback(void *arg, int status, int timeouts, struct hosten
|
|||||||
*end = 0;
|
*end = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, (char *)(host->h_name),
|
niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, (char *)(host->h_name),
|
||||||
service);
|
service);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ ares_getopt(int nargc, char * const nargv[], const char *ostr)
|
|||||||
}
|
}
|
||||||
} /* option letter okay? */
|
} /* option letter okay? */
|
||||||
if ((optopt = (int)*place++) == (int)':' ||
|
if ((optopt = (int)*place++) == (int)':' ||
|
||||||
!(oli = strchr(ostr, optopt))) {
|
(oli = strchr(ostr, optopt)) == NULL) {
|
||||||
/*
|
/*
|
||||||
* if the user didn't specify '-' as an option,
|
* if the user didn't specify '-' as an option,
|
||||||
* assume it means EOF.
|
* assume it means EOF.
|
||||||
|
|||||||
@@ -33,6 +33,12 @@
|
|||||||
|
|
||||||
int ares_getopt(int nargc, char * const nargv[], const char *ostr);
|
int ares_getopt(int nargc, char * const nargv[], const char *ostr);
|
||||||
|
|
||||||
|
#if defined(WATT32)
|
||||||
|
#undef optarg
|
||||||
|
#undef optind
|
||||||
|
#undef opterr
|
||||||
|
#endif
|
||||||
|
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
extern int optind;
|
extern int optind;
|
||||||
extern int opterr;
|
extern int opterr;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
.\" $Id$
|
.\" $Id$
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
.\" Copyright (C) 2004-2009 by Daniel Stenberg
|
||||||
.\"
|
.\"
|
||||||
.\" Permission to use, copy, modify, and distribute this
|
.\" Permission to use, copy, modify, and distribute this
|
||||||
.\" software and its documentation for any purpose and without
|
.\" software and its documentation for any purpose and without
|
||||||
@@ -14,7 +15,7 @@
|
|||||||
.\" this software for any purpose. It is provided "as is"
|
.\" this software for any purpose. It is provided "as is"
|
||||||
.\" without express or implied warranty.
|
.\" without express or implied warranty.
|
||||||
.\"
|
.\"
|
||||||
.TH ARES_INIT 3 "7 December 2004"
|
.TH ARES_INIT 3 "26 May 2009"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
ares_init, ares_init_options \- Initialize a resolver channel
|
ares_init, ares_init_options \- Initialize a resolver channel
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -49,10 +50,22 @@ description of possible flag values.
|
|||||||
.B ARES_OPT_TIMEOUT
|
.B ARES_OPT_TIMEOUT
|
||||||
.B int \fItimeout\fP;
|
.B int \fItimeout\fP;
|
||||||
.br
|
.br
|
||||||
The number of seconds each name server is given to respond to a query
|
The number of seconds each name server is given to respond to a query on the
|
||||||
on the first try. (After the first try, the timeout algorithm becomes
|
first try. (After the first try, the timeout algorithm becomes more
|
||||||
more complicated, but scales linearly with the value of
|
complicated, but scales linearly with the value of \fItimeout\fP.) The
|
||||||
\fItimeout\fP.) The default is five seconds.
|
default is five seconds. This option is being deprecated by
|
||||||
|
\fIARES_OPT_TIMEOUTMS\fP starting in c-ares 1.5.2.
|
||||||
|
.TP 18
|
||||||
|
.B ARES_OPT_TIMEOUTMS
|
||||||
|
.B int \fItimeout\fP;
|
||||||
|
.br
|
||||||
|
The number of milliseconds each name server is given to respond to a query on
|
||||||
|
the first try. (After the first try, the timeout algorithm becomes more
|
||||||
|
complicated, but scales linearly with the value of \fItimeout\fP.) The
|
||||||
|
default is five seconds. Note that this option is specified with the same
|
||||||
|
struct field as the former \fIARES_OPT_TIMEOUT\fP, it is but the option bits
|
||||||
|
that tell c-ares how to interpret the number. This option was added in c-ares
|
||||||
|
1.5.2.
|
||||||
.TP 18
|
.TP 18
|
||||||
.B ARES_OPT_TRIES
|
.B ARES_OPT_TRIES
|
||||||
.B int \fItries\fP;
|
.B int \fItries\fP;
|
||||||
@@ -141,7 +154,7 @@ recursion for you. Recursion must be handled by the application calling ares
|
|||||||
if \fIARES_FLAG_NORECURSE\fP is set.
|
if \fIARES_FLAG_NORECURSE\fP is set.
|
||||||
.TP 23
|
.TP 23
|
||||||
.B ARES_FLAG_STAYOPEN
|
.B ARES_FLAG_STAYOPEN
|
||||||
Do not close communciations sockets when the number of active queries
|
Do not close communications sockets when the number of active queries
|
||||||
drops to zero.
|
drops to zero.
|
||||||
.TP 23
|
.TP 23
|
||||||
.B ARES_FLAG_NOSEARCH
|
.B ARES_FLAG_NOSEARCH
|
||||||
@@ -171,9 +184,16 @@ A configuration file could not be read.
|
|||||||
.TP 14
|
.TP 14
|
||||||
.B ARES_ENOMEM
|
.B ARES_ENOMEM
|
||||||
The process's available memory was exhausted.
|
The process's available memory was exhausted.
|
||||||
|
.TP 14
|
||||||
|
.B ARES_ENOTINITIALIZED
|
||||||
|
c-ares library initialization not yet performed.
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR ares_destroy (3)
|
.BR ares_destroy(3),
|
||||||
|
.BR ares_dup(3),
|
||||||
|
.BR ares_library_init(3)
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
Greg Hudson, MIT Information Systems
|
Greg Hudson, MIT Information Systems
|
||||||
.br
|
.br
|
||||||
Copyright 1998 by the Massachusetts Institute of Technology.
|
Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
.br
|
||||||
|
Copyright (C) 2004-2009 by Daniel Stenberg.
|
||||||
|
|||||||
420
ares/ares_init.c
420
ares/ares_init.c
@@ -1,6 +1,7 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
* Copyright (C) 2007-2009 by Daniel Stenberg
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
* software and its documentation for any purpose and without
|
* software and its documentation for any purpose and without
|
||||||
@@ -15,14 +16,12 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
|
||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
#include <malloc.h>
|
#endif
|
||||||
|
|
||||||
#else
|
|
||||||
#ifdef HAVE_SYS_PARAM_H
|
#ifdef HAVE_SYS_PARAM_H
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -35,20 +34,30 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <arpa/nameser.h>
|
|
||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
|
||||||
#include <arpa/nameser_compat.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
#include <netdb.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
# include <arpa/nameser_compat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_PROCESS_H
|
|
||||||
#include <process.h> /* Some have getpid() here */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -57,8 +66,9 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
|
||||||
#include "inet_net_pton.h"
|
#include "inet_net_pton.h"
|
||||||
|
#include "ares_library_init.h"
|
||||||
|
#include "ares_private.h"
|
||||||
|
|
||||||
#ifdef WATT32
|
#ifdef WATT32
|
||||||
#undef WIN32 /* Redefined in MingW/MSVC headers */
|
#undef WIN32 /* Redefined in MingW/MSVC headers */
|
||||||
@@ -70,14 +80,16 @@ static int init_by_environment(ares_channel channel);
|
|||||||
static int init_by_resolv_conf(ares_channel channel);
|
static int init_by_resolv_conf(ares_channel channel);
|
||||||
static int init_by_defaults(ares_channel channel);
|
static int init_by_defaults(ares_channel channel);
|
||||||
|
|
||||||
|
#ifndef WATT32
|
||||||
static int config_nameserver(struct server_state **servers, int *nservers,
|
static int config_nameserver(struct server_state **servers, int *nservers,
|
||||||
char *str);
|
char *str);
|
||||||
|
#endif
|
||||||
static int set_search(ares_channel channel, const char *str);
|
static int set_search(ares_channel channel, const char *str);
|
||||||
static int set_options(ares_channel channel, const char *str);
|
static int set_options(ares_channel channel, const char *str);
|
||||||
static const char *try_option(const char *p, const char *q, const char *opt);
|
static const char *try_option(const char *p, const char *q, const char *opt);
|
||||||
static int init_id_key(rc4_key* key,int key_data_len);
|
static int init_id_key(rc4_key* key,int key_data_len);
|
||||||
|
|
||||||
#ifndef WIN32
|
#if !defined(WIN32) && !defined(WATT32)
|
||||||
static int sortlist_alloc(struct apattern **sortlist, int *nsort, struct apattern *pat);
|
static int sortlist_alloc(struct apattern **sortlist, int *nsort, struct apattern *pat);
|
||||||
static int ip_addr(const char *s, int len, struct in_addr *addr);
|
static int ip_addr(const char *s, int len, struct in_addr *addr);
|
||||||
static void natural_mask(struct apattern *pat);
|
static void natural_mask(struct apattern *pat);
|
||||||
@@ -107,6 +119,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
|||||||
int i;
|
int i;
|
||||||
int status = ARES_SUCCESS;
|
int status = ARES_SUCCESS;
|
||||||
struct server_state *server;
|
struct server_state *server;
|
||||||
|
struct timeval now;
|
||||||
|
|
||||||
#ifdef CURLDEBUG
|
#ifdef CURLDEBUG
|
||||||
const char *env = getenv("CARES_MEMDEBUG");
|
const char *env = getenv("CARES_MEMDEBUG");
|
||||||
@@ -118,12 +131,17 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
|||||||
curl_memlimit(atoi(env));
|
curl_memlimit(atoi(env));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (ares_library_initialized() != ARES_SUCCESS)
|
||||||
|
return ARES_ENOTINITIALIZED;
|
||||||
|
|
||||||
channel = malloc(sizeof(struct ares_channeldata));
|
channel = malloc(sizeof(struct ares_channeldata));
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
*channelptr = NULL;
|
*channelptr = NULL;
|
||||||
return ARES_ENOMEM;
|
return ARES_ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
now = ares__tvnow();
|
||||||
|
|
||||||
/* Set everything to distinguished values so we know they haven't
|
/* Set everything to distinguished values so we know they haven't
|
||||||
* been set yet.
|
* been set yet.
|
||||||
*/
|
*/
|
||||||
@@ -131,6 +149,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
|||||||
channel->timeout = -1;
|
channel->timeout = -1;
|
||||||
channel->tries = -1;
|
channel->tries = -1;
|
||||||
channel->ndots = -1;
|
channel->ndots = -1;
|
||||||
|
channel->rotate = -1;
|
||||||
channel->udp_port = -1;
|
channel->udp_port = -1;
|
||||||
channel->tcp_port = -1;
|
channel->tcp_port = -1;
|
||||||
channel->socket_send_buffer_size = -1;
|
channel->socket_send_buffer_size = -1;
|
||||||
@@ -145,8 +164,11 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
|||||||
channel->servers = NULL;
|
channel->servers = NULL;
|
||||||
channel->sock_state_cb = NULL;
|
channel->sock_state_cb = NULL;
|
||||||
channel->sock_state_cb_data = NULL;
|
channel->sock_state_cb_data = NULL;
|
||||||
|
channel->sock_create_cb = NULL;
|
||||||
|
channel->sock_create_cb_data = NULL;
|
||||||
|
|
||||||
channel->last_timeout_processed = (long)time(NULL);
|
channel->last_server = 0;
|
||||||
|
channel->last_timeout_processed = (time_t)now.tv_sec;
|
||||||
|
|
||||||
/* Initialize our lists of queries */
|
/* Initialize our lists of queries */
|
||||||
ares__init_list_head(&(channel->all_queries));
|
ares__init_list_head(&(channel->all_queries));
|
||||||
@@ -181,12 +203,15 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
|||||||
DEBUGF(fprintf(stderr, "Error: init_by_resolv_conf failed: %s\n",
|
DEBUGF(fprintf(stderr, "Error: init_by_resolv_conf failed: %s\n",
|
||||||
ares_strerror(status)));
|
ares_strerror(status)));
|
||||||
}
|
}
|
||||||
if (status == ARES_SUCCESS) {
|
|
||||||
|
/*
|
||||||
|
* No matter what failed or succeeded, seed defaults to provide
|
||||||
|
* useful behavior for things that we missed.
|
||||||
|
*/
|
||||||
status = init_by_defaults(channel);
|
status = init_by_defaults(channel);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
DEBUGF(fprintf(stderr, "Error: init_by_defaults failed: %s\n",
|
DEBUGF(fprintf(stderr, "Error: init_by_defaults failed: %s\n",
|
||||||
ares_strerror(status)));
|
ares_strerror(status)));
|
||||||
}
|
|
||||||
|
|
||||||
/* Generate random key */
|
/* Generate random key */
|
||||||
|
|
||||||
@@ -242,6 +267,40 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
|
|||||||
return ARES_SUCCESS;
|
return ARES_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ares_dup() duplicates a channel handle with all its options and returns a
|
||||||
|
new channel handle */
|
||||||
|
int ares_dup(ares_channel *dest, ares_channel src)
|
||||||
|
{
|
||||||
|
struct ares_options opts;
|
||||||
|
int rc;
|
||||||
|
int optmask;
|
||||||
|
|
||||||
|
*dest = NULL; /* in case of failure return NULL explicitly */
|
||||||
|
|
||||||
|
/* First get the options supported by the old ares_save_options() function,
|
||||||
|
which is most of them */
|
||||||
|
rc = ares_save_options(src, &opts, &optmask);
|
||||||
|
if(rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
/* Then create the new channel with those options */
|
||||||
|
rc = ares_init_options(dest, &opts, optmask);
|
||||||
|
|
||||||
|
/* destroy the options copy to not leak any memory */
|
||||||
|
ares_destroy_options(&opts);
|
||||||
|
|
||||||
|
if(rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
|
/* Now clone the options that ares_save_options() doesn't support. */
|
||||||
|
(*dest)->sock_create_cb = src->sock_create_cb;
|
||||||
|
(*dest)->sock_create_cb_data = src->sock_create_cb_data;
|
||||||
|
|
||||||
|
|
||||||
|
return ARES_SUCCESS; /* everything went fine */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* Save options from initialized channel */
|
/* Save options from initialized channel */
|
||||||
int ares_save_options(ares_channel channel, struct ares_options *options,
|
int ares_save_options(ares_channel channel, struct ares_options *options,
|
||||||
int *optmask)
|
int *optmask)
|
||||||
@@ -254,13 +313,20 @@ int ares_save_options(ares_channel channel, struct ares_options *options,
|
|||||||
if (!ARES_CONFIG_CHECK(channel))
|
if (!ARES_CONFIG_CHECK(channel))
|
||||||
return ARES_ENODATA;
|
return ARES_ENODATA;
|
||||||
|
|
||||||
(*optmask) = (ARES_OPT_FLAGS|ARES_OPT_TIMEOUT|ARES_OPT_TRIES|ARES_OPT_NDOTS|
|
/* Traditionally the optmask wasn't saved in the channel struct so it was
|
||||||
|
recreated here. ROTATE is the first option that has no struct field of
|
||||||
|
its own in the public config struct */
|
||||||
|
(*optmask) = (ARES_OPT_FLAGS|ARES_OPT_TRIES|ARES_OPT_NDOTS|
|
||||||
ARES_OPT_UDP_PORT|ARES_OPT_TCP_PORT|ARES_OPT_SOCK_STATE_CB|
|
ARES_OPT_UDP_PORT|ARES_OPT_TCP_PORT|ARES_OPT_SOCK_STATE_CB|
|
||||||
ARES_OPT_SERVERS|ARES_OPT_DOMAINS|ARES_OPT_LOOKUPS|
|
ARES_OPT_SERVERS|ARES_OPT_DOMAINS|ARES_OPT_LOOKUPS|
|
||||||
ARES_OPT_SORTLIST);
|
ARES_OPT_SORTLIST|ARES_OPT_TIMEOUTMS) |
|
||||||
|
(channel->optmask & ARES_OPT_ROTATE);
|
||||||
|
|
||||||
/* Copy easy stuff */
|
/* Copy easy stuff */
|
||||||
options->flags = channel->flags;
|
options->flags = channel->flags;
|
||||||
|
|
||||||
|
/* We return full millisecond resolution but that's only because we don't
|
||||||
|
set the ARES_OPT_TIMEOUT anymore, only the new ARES_OPT_TIMEOUTMS */
|
||||||
options->timeout = channel->timeout;
|
options->timeout = channel->timeout;
|
||||||
options->tries = channel->tries;
|
options->tries = channel->tries;
|
||||||
options->ndots = channel->ndots;
|
options->ndots = channel->ndots;
|
||||||
@@ -328,12 +394,16 @@ static int init_by_options(ares_channel channel,
|
|||||||
/* Easy stuff. */
|
/* Easy stuff. */
|
||||||
if ((optmask & ARES_OPT_FLAGS) && channel->flags == -1)
|
if ((optmask & ARES_OPT_FLAGS) && channel->flags == -1)
|
||||||
channel->flags = options->flags;
|
channel->flags = options->flags;
|
||||||
if ((optmask & ARES_OPT_TIMEOUT) && channel->timeout == -1)
|
if ((optmask & ARES_OPT_TIMEOUTMS) && channel->timeout == -1)
|
||||||
channel->timeout = options->timeout;
|
channel->timeout = options->timeout;
|
||||||
|
else if ((optmask & ARES_OPT_TIMEOUT) && channel->timeout == -1)
|
||||||
|
channel->timeout = options->timeout * 1000;
|
||||||
if ((optmask & ARES_OPT_TRIES) && channel->tries == -1)
|
if ((optmask & ARES_OPT_TRIES) && channel->tries == -1)
|
||||||
channel->tries = options->tries;
|
channel->tries = options->tries;
|
||||||
if ((optmask & ARES_OPT_NDOTS) && channel->ndots == -1)
|
if ((optmask & ARES_OPT_NDOTS) && channel->ndots == -1)
|
||||||
channel->ndots = options->ndots;
|
channel->ndots = options->ndots;
|
||||||
|
if ((optmask & ARES_OPT_ROTATE) && channel->rotate == -1)
|
||||||
|
channel->rotate = 1;
|
||||||
if ((optmask & ARES_OPT_UDP_PORT) && channel->udp_port == -1)
|
if ((optmask & ARES_OPT_UDP_PORT) && channel->udp_port == -1)
|
||||||
channel->udp_port = options->udp_port;
|
channel->udp_port = options->udp_port;
|
||||||
if ((optmask & ARES_OPT_TCP_PORT) && channel->tcp_port == -1)
|
if ((optmask & ARES_OPT_TCP_PORT) && channel->tcp_port == -1)
|
||||||
@@ -404,11 +474,14 @@ static int init_by_options(ares_channel channel,
|
|||||||
return ARES_ENOMEM;
|
return ARES_ENOMEM;
|
||||||
for (i = 0; i < options->nsort; i++)
|
for (i = 0; i < options->nsort; i++)
|
||||||
{
|
{
|
||||||
memcpy(&(channel->sortlist[i]), &(options->sortlist[i]), sizeof(struct apattern));
|
memcpy(&(channel->sortlist[i]), &(options->sortlist[i]),
|
||||||
|
sizeof(struct apattern));
|
||||||
}
|
}
|
||||||
channel->nsort = options->nsort;
|
channel->nsort = options->nsort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
channel->optmask = optmask;
|
||||||
|
|
||||||
return ARES_SUCCESS;
|
return ARES_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -494,11 +567,8 @@ static int get_res_interfaces_nt(HKEY hKey, const char *subkey, char **obuf)
|
|||||||
|
|
||||||
static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
|
static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
|
||||||
{
|
{
|
||||||
FIXED_INFO *fi = alloca (sizeof(*fi));
|
FIXED_INFO *fi, *newfi;
|
||||||
DWORD size = sizeof (*fi);
|
DWORD size = sizeof (*fi);
|
||||||
typedef DWORD (WINAPI* get_net_param_func) (FIXED_INFO*, DWORD*);
|
|
||||||
get_net_param_func fpGetNetworkParams; /* available only on Win-98/2000+ */
|
|
||||||
HMODULE handle;
|
|
||||||
IP_ADDR_STRING *ipAddr;
|
IP_ADDR_STRING *ipAddr;
|
||||||
int i, count = 0;
|
int i, count = 0;
|
||||||
int debug = 0;
|
int debug = 0;
|
||||||
@@ -507,23 +577,21 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
|
|||||||
char *ret = ret_buf;
|
char *ret = ret_buf;
|
||||||
HRESULT res;
|
HRESULT res;
|
||||||
|
|
||||||
|
fi = malloc(size);
|
||||||
if (!fi)
|
if (!fi)
|
||||||
return (0);
|
return 0;
|
||||||
|
|
||||||
handle = LoadLibrary ("iphlpapi.dll");
|
|
||||||
if (!handle)
|
|
||||||
return (0);
|
|
||||||
|
|
||||||
fpGetNetworkParams = (get_net_param_func) GetProcAddress (handle, "GetNetworkParams");
|
|
||||||
if (!fpGetNetworkParams)
|
|
||||||
goto quit;
|
|
||||||
|
|
||||||
res = (*fpGetNetworkParams) (fi, &size);
|
res = (*fpGetNetworkParams) (fi, &size);
|
||||||
if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
|
if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS))
|
||||||
goto quit;
|
goto quit;
|
||||||
|
|
||||||
fi = alloca (size);
|
newfi = realloc(fi, size);
|
||||||
if (!fi || (*fpGetNetworkParams) (fi, &size) != ERROR_SUCCESS)
|
if (!newfi)
|
||||||
|
goto quit;
|
||||||
|
|
||||||
|
fi = newfi;
|
||||||
|
res = (*fpGetNetworkParams) (fi, &size);
|
||||||
|
if (res != ERROR_SUCCESS)
|
||||||
goto quit;
|
goto quit;
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@@ -556,20 +624,22 @@ static int get_iphlpapi_dns_info (char *ret_buf, size_t ret_size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
quit:
|
quit:
|
||||||
if (handle)
|
if (fi)
|
||||||
FreeLibrary (handle);
|
free(fi);
|
||||||
|
|
||||||
if (debug && left <= ip_size)
|
if (debug && left <= ip_size)
|
||||||
printf ("Too many nameservers. Truncating to %d addressess", count);
|
printf ("Too many nameservers. Truncating to %d addressess", count);
|
||||||
if (ret > ret_buf)
|
if (ret > ret_buf)
|
||||||
ret[-1] = '\0';
|
ret[-1] = '\0';
|
||||||
return (count);
|
return count;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int init_by_resolv_conf(ares_channel channel)
|
static int init_by_resolv_conf(ares_channel channel)
|
||||||
{
|
{
|
||||||
|
#ifndef WATT32
|
||||||
char *line = NULL;
|
char *line = NULL;
|
||||||
|
#endif
|
||||||
int status = -1, nservers = 0, nsort = 0;
|
int status = -1, nservers = 0, nsort = 0;
|
||||||
struct server_state *servers = NULL;
|
struct server_state *servers = NULL;
|
||||||
struct apattern *sortlist = NULL;
|
struct apattern *sortlist = NULL;
|
||||||
@@ -666,7 +736,7 @@ DhcpNameServer
|
|||||||
{
|
{
|
||||||
if (bytes)
|
if (bytes)
|
||||||
{
|
{
|
||||||
line = (char *)malloc(bytes+1);
|
line = malloc(bytes+1);
|
||||||
if (RegQueryValueEx(mykey, NAMESERVER, NULL, &data_type,
|
if (RegQueryValueEx(mykey, NAMESERVER, NULL, &data_type,
|
||||||
(unsigned char *)line, &bytes) ==
|
(unsigned char *)line, &bytes) ==
|
||||||
ERROR_SUCCESS)
|
ERROR_SUCCESS)
|
||||||
@@ -739,7 +809,7 @@ DhcpNameServer
|
|||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int linesize;
|
size_t linesize;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
/* Don't read resolv.conf and friends if we don't have to */
|
/* Don't read resolv.conf and friends if we don't have to */
|
||||||
@@ -903,7 +973,11 @@ okay:
|
|||||||
|
|
||||||
static int init_by_defaults(ares_channel channel)
|
static int init_by_defaults(ares_channel channel)
|
||||||
{
|
{
|
||||||
char hostname[MAXHOSTNAMELEN + 1];
|
char *hostname = NULL;
|
||||||
|
int rc = ARES_SUCCESS;
|
||||||
|
#ifdef HAVE_GETHOSTNAME
|
||||||
|
char *dot;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (channel->flags == -1)
|
if (channel->flags == -1)
|
||||||
channel->flags = 0;
|
channel->flags = 0;
|
||||||
@@ -913,61 +987,115 @@ static int init_by_defaults(ares_channel channel)
|
|||||||
channel->tries = DEFAULT_TRIES;
|
channel->tries = DEFAULT_TRIES;
|
||||||
if (channel->ndots == -1)
|
if (channel->ndots == -1)
|
||||||
channel->ndots = 1;
|
channel->ndots = 1;
|
||||||
|
if (channel->rotate == -1)
|
||||||
|
channel->rotate = 0;
|
||||||
if (channel->udp_port == -1)
|
if (channel->udp_port == -1)
|
||||||
channel->udp_port = htons(NAMESERVER_PORT);
|
channel->udp_port = htons(NAMESERVER_PORT);
|
||||||
if (channel->tcp_port == -1)
|
if (channel->tcp_port == -1)
|
||||||
channel->tcp_port = htons(NAMESERVER_PORT);
|
channel->tcp_port = htons(NAMESERVER_PORT);
|
||||||
|
|
||||||
if (channel->nservers == -1)
|
if (channel->nservers == -1) {
|
||||||
{
|
|
||||||
/* If nobody specified servers, try a local named. */
|
/* If nobody specified servers, try a local named. */
|
||||||
channel->servers = malloc(sizeof(struct server_state));
|
channel->servers = malloc(sizeof(struct server_state));
|
||||||
if (!channel->servers)
|
if (!channel->servers) {
|
||||||
return ARES_ENOMEM;
|
rc = ARES_ENOMEM;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
channel->servers[0].addr.s_addr = htonl(INADDR_LOOPBACK);
|
channel->servers[0].addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||||
channel->nservers = 1;
|
channel->nservers = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channel->ndomains == -1)
|
#ifdef ENAMETOOLONG
|
||||||
{
|
#define toolong(x) (x == -1) && ((ENAMETOOLONG == errno) || (EINVAL == errno))
|
||||||
|
#else
|
||||||
|
#define toolong(x) (x == -1) && (EINVAL == errno)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (channel->ndomains == -1) {
|
||||||
/* Derive a default domain search list from the kernel hostname,
|
/* Derive a default domain search list from the kernel hostname,
|
||||||
* or set it to empty if the hostname isn't helpful.
|
* or set it to empty if the hostname isn't helpful.
|
||||||
*/
|
*/
|
||||||
if (gethostname(hostname, sizeof(hostname)) == -1
|
size_t len = 64;
|
||||||
|| !strchr(hostname, '.'))
|
int res;
|
||||||
{
|
channel->ndomains = 0; /* default to none */
|
||||||
channel->ndomains = 0;
|
|
||||||
}
|
#ifdef HAVE_GETHOSTNAME
|
||||||
else
|
hostname = malloc(len);
|
||||||
{
|
if(!hostname) {
|
||||||
channel->domains = malloc(sizeof(char *));
|
rc = ARES_ENOMEM;
|
||||||
if (!channel->domains)
|
goto error;
|
||||||
return ARES_ENOMEM;
|
|
||||||
channel->ndomains = 0;
|
|
||||||
channel->domains[0] = strdup(strchr(hostname, '.') + 1);
|
|
||||||
if (!channel->domains[0])
|
|
||||||
return ARES_ENOMEM;
|
|
||||||
channel->ndomains = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channel->nsort == -1)
|
do {
|
||||||
{
|
res = gethostname(hostname, len);
|
||||||
|
|
||||||
|
if(toolong(res)) {
|
||||||
|
char *p;
|
||||||
|
len *= 2;
|
||||||
|
p = realloc(hostname, len);
|
||||||
|
if(!p) {
|
||||||
|
rc = ARES_ENOMEM;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
hostname = p;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if(res) {
|
||||||
|
rc = ARES_EBADNAME;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
} while(0);
|
||||||
|
|
||||||
|
dot = strchr(hostname, '.');
|
||||||
|
if (dot) {
|
||||||
|
/* a dot was found */
|
||||||
|
channel->domains = malloc(sizeof(char *));
|
||||||
|
if (!channel->domains) {
|
||||||
|
rc = ARES_ENOMEM;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
channel->domains[0] = strdup(dot + 1);
|
||||||
|
if (!channel->domains[0]) {
|
||||||
|
rc = ARES_ENOMEM;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
channel->ndomains = 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (channel->nsort == -1) {
|
||||||
channel->sortlist = NULL;
|
channel->sortlist = NULL;
|
||||||
channel->nsort = 0;
|
channel->nsort = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!channel->lookups)
|
if (!channel->lookups) {
|
||||||
{
|
|
||||||
channel->lookups = strdup("fb");
|
channel->lookups = strdup("fb");
|
||||||
if (!channel->lookups)
|
if (!channel->lookups)
|
||||||
return ARES_ENOMEM;
|
rc = ARES_ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ARES_SUCCESS;
|
error:
|
||||||
|
if(rc) {
|
||||||
|
if(channel->servers)
|
||||||
|
free(channel->servers);
|
||||||
|
|
||||||
|
if(channel->domains && channel->domains[0])
|
||||||
|
free(channel->domains[0]);
|
||||||
|
if(channel->domains)
|
||||||
|
free(channel->domains);
|
||||||
|
if(channel->lookups)
|
||||||
|
free(channel->lookups);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(hostname)
|
||||||
|
free(hostname);
|
||||||
|
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
#if !defined(WIN32) && !defined(WATT32)
|
||||||
static int config_domain(ares_channel channel, char *str)
|
static int config_domain(ares_channel channel, char *str)
|
||||||
{
|
{
|
||||||
char *q;
|
char *q;
|
||||||
@@ -1007,9 +1135,9 @@ static int config_lookup(ares_channel channel, const char *str,
|
|||||||
channel->lookups = strdup(lookups);
|
channel->lookups = strdup(lookups);
|
||||||
return (channel->lookups) ? ARES_SUCCESS : ARES_ENOMEM;
|
return (channel->lookups) ? ARES_SUCCESS : ARES_ENOMEM;
|
||||||
}
|
}
|
||||||
|
#endif /* !WIN32 & !WATT32 */
|
||||||
|
|
||||||
#endif
|
#ifndef WATT32
|
||||||
|
|
||||||
static int config_nameserver(struct server_state **servers, int *nservers,
|
static int config_nameserver(struct server_state **servers, int *nservers,
|
||||||
char *str)
|
char *str)
|
||||||
{
|
{
|
||||||
@@ -1104,8 +1232,8 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
|
|||||||
/* Lets see if it is CIDR */
|
/* Lets see if it is CIDR */
|
||||||
/* First we'll try IPv6 */
|
/* First we'll try IPv6 */
|
||||||
if ((bits = ares_inet_net_pton(AF_INET6, ipbufpfx[0] ? ipbufpfx : ipbuf,
|
if ((bits = ares_inet_net_pton(AF_INET6, ipbufpfx[0] ? ipbufpfx : ipbuf,
|
||||||
&pat.addr.addr6,
|
&pat.addrV6,
|
||||||
sizeof(pat.addr.addr6))) > 0)
|
sizeof(pat.addrV6))) > 0)
|
||||||
{
|
{
|
||||||
pat.type = PATTERN_CIDR;
|
pat.type = PATTERN_CIDR;
|
||||||
pat.mask.bits = (unsigned short)bits;
|
pat.mask.bits = (unsigned short)bits;
|
||||||
@@ -1114,8 +1242,8 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
|
|||||||
return ARES_ENOMEM;
|
return ARES_ENOMEM;
|
||||||
}
|
}
|
||||||
if (ipbufpfx[0] &&
|
if (ipbufpfx[0] &&
|
||||||
(bits = ares_inet_net_pton(AF_INET, ipbufpfx, &pat.addr.addr4,
|
(bits = ares_inet_net_pton(AF_INET, ipbufpfx, &pat.addrV4,
|
||||||
sizeof(pat.addr.addr4))) > 0)
|
sizeof(pat.addrV4))) > 0)
|
||||||
{
|
{
|
||||||
pat.type = PATTERN_CIDR;
|
pat.type = PATTERN_CIDR;
|
||||||
pat.mask.bits = (unsigned short)bits;
|
pat.mask.bits = (unsigned short)bits;
|
||||||
@@ -1124,13 +1252,13 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
|
|||||||
return ARES_ENOMEM;
|
return ARES_ENOMEM;
|
||||||
}
|
}
|
||||||
/* See if it is just a regular IP */
|
/* See if it is just a regular IP */
|
||||||
else if (ip_addr(ipbuf, (int)(q-str), &pat.addr.addr4) == 0)
|
else if (ip_addr(ipbuf, (int)(q-str), &pat.addrV4) == 0)
|
||||||
{
|
{
|
||||||
if (ipbufpfx[0])
|
if (ipbufpfx[0])
|
||||||
{
|
{
|
||||||
memcpy(ipbuf, str, (int)(q-str));
|
memcpy(ipbuf, str, (int)(q-str));
|
||||||
ipbuf[(int)(q-str)] = '\0';
|
ipbuf[(int)(q-str)] = '\0';
|
||||||
if (ip_addr(ipbuf, (int)(q - str), &pat.mask.addr.addr4) != 0)
|
if (ip_addr(ipbuf, (int)(q - str), &pat.mask.addr4) != 0)
|
||||||
natural_mask(&pat);
|
natural_mask(&pat);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1152,7 +1280,8 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
|
|||||||
|
|
||||||
return ARES_SUCCESS;
|
return ARES_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* !WIN32 */
|
||||||
|
#endif /* !WATT32 */
|
||||||
|
|
||||||
static int set_search(ares_channel channel, const char *str)
|
static int set_search(ares_channel channel, const char *str)
|
||||||
{
|
{
|
||||||
@@ -1233,6 +1362,9 @@ static int set_options(ares_channel channel, const char *str)
|
|||||||
val = try_option(p, q, "retry:");
|
val = try_option(p, q, "retry:");
|
||||||
if (val && channel->tries == -1)
|
if (val && channel->tries == -1)
|
||||||
channel->tries = atoi(val);
|
channel->tries = atoi(val);
|
||||||
|
val = try_option(p, q, "rotate");
|
||||||
|
if (val && channel->rotate == -1)
|
||||||
|
channel->rotate = 1;
|
||||||
p = q;
|
p = q;
|
||||||
while (ISSPACE(*p))
|
while (ISSPACE(*p))
|
||||||
p++;
|
p++;
|
||||||
@@ -1241,29 +1373,76 @@ static int set_options(ares_channel channel, const char *str)
|
|||||||
return ARES_SUCCESS;
|
return ARES_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
static char *try_config(char *s, const char *opt)
|
|
||||||
{
|
|
||||||
size_t len;
|
|
||||||
|
|
||||||
len = strlen(opt);
|
|
||||||
if (strncmp(s, opt, len) != 0 || !ISSPACE(s[len]))
|
|
||||||
return NULL;
|
|
||||||
s += len;
|
|
||||||
while (ISSPACE(*s))
|
|
||||||
s++;
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const char *try_option(const char *p, const char *q, const char *opt)
|
static const char *try_option(const char *p, const char *q, const char *opt)
|
||||||
{
|
{
|
||||||
size_t len = strlen(opt);
|
size_t len = strlen(opt);
|
||||||
return ((size_t)(q - p) > len && !strncmp(p, opt, len)) ? &p[len] : NULL;
|
return ((size_t)(q - p) >= len && !strncmp(p, opt, len)) ? &p[len] : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if !defined(WIN32) && !defined(WATT32)
|
||||||
|
static char *try_config(char *s, const char *opt)
|
||||||
|
{
|
||||||
|
size_t len;
|
||||||
|
char *p;
|
||||||
|
char *q;
|
||||||
|
|
||||||
|
if (!s || !opt)
|
||||||
|
/* no line or no option */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* trim line comment */
|
||||||
|
p = s;
|
||||||
|
while (*p && (*p != '#'))
|
||||||
|
p++;
|
||||||
|
*p = '\0';
|
||||||
|
|
||||||
|
/* trim trailing whitespace */
|
||||||
|
q = p - 1;
|
||||||
|
while ((q >= s) && ISSPACE(*q))
|
||||||
|
q--;
|
||||||
|
*++q = '\0';
|
||||||
|
|
||||||
|
/* skip leading whitespace */
|
||||||
|
p = s;
|
||||||
|
while (*p && ISSPACE(*p))
|
||||||
|
p++;
|
||||||
|
|
||||||
|
if (!*p)
|
||||||
|
/* empty line */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if ((len = strlen(opt)) == 0)
|
||||||
|
/* empty option */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (strncmp(p, opt, len) != 0)
|
||||||
|
/* line and option do not match */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* skip over given option name */
|
||||||
|
p += len;
|
||||||
|
|
||||||
|
if (!*p)
|
||||||
|
/* no option value */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if ((opt[len-1] != ':') && (opt[len-1] != '=') && !ISSPACE(*p))
|
||||||
|
/* whitespace between option name and value is mandatory
|
||||||
|
for given option names which do not end with ':' or '=' */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* skip over whitespace */
|
||||||
|
while (*p && ISSPACE(*p))
|
||||||
|
p++;
|
||||||
|
|
||||||
|
if (!*p)
|
||||||
|
/* no option value */
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
/* return pointer to option value */
|
||||||
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
static int sortlist_alloc(struct apattern **sortlist, int *nsort,
|
static int sortlist_alloc(struct apattern **sortlist, int *nsort,
|
||||||
struct apattern *pat)
|
struct apattern *pat)
|
||||||
{
|
{
|
||||||
@@ -1297,19 +1476,20 @@ static void natural_mask(struct apattern *pat)
|
|||||||
/* Store a host-byte-order copy of pat in a struct in_addr. Icky,
|
/* Store a host-byte-order copy of pat in a struct in_addr. Icky,
|
||||||
* but portable.
|
* but portable.
|
||||||
*/
|
*/
|
||||||
addr.s_addr = ntohl(pat->addr.addr4.s_addr);
|
addr.s_addr = ntohl(pat->addrV4.s_addr);
|
||||||
|
|
||||||
/* This is out of date in the CIDR world, but some people might
|
/* This is out of date in the CIDR world, but some people might
|
||||||
* still rely on it.
|
* still rely on it.
|
||||||
*/
|
*/
|
||||||
if (IN_CLASSA(addr.s_addr))
|
if (IN_CLASSA(addr.s_addr))
|
||||||
pat->mask.addr.addr4.s_addr = htonl(IN_CLASSA_NET);
|
pat->mask.addr4.s_addr = htonl(IN_CLASSA_NET);
|
||||||
else if (IN_CLASSB(addr.s_addr))
|
else if (IN_CLASSB(addr.s_addr))
|
||||||
pat->mask.addr.addr4.s_addr = htonl(IN_CLASSB_NET);
|
pat->mask.addr4.s_addr = htonl(IN_CLASSB_NET);
|
||||||
else
|
else
|
||||||
pat->mask.addr.addr4.s_addr = htonl(IN_CLASSC_NET);
|
pat->mask.addr4.s_addr = htonl(IN_CLASSC_NET);
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* !WIN32 && !WATT32 */
|
||||||
|
|
||||||
/* initialize an rc4 key. If possible a cryptographically secure random key
|
/* initialize an rc4 key. If possible a cryptographically secure random key
|
||||||
is generated using a suitable function (for example win32's RtlGenRandom as
|
is generated using a suitable function (for example win32's RtlGenRandom as
|
||||||
described in
|
described in
|
||||||
@@ -1322,24 +1502,18 @@ static void randomize_key(unsigned char* key,int key_data_len)
|
|||||||
int randomized = 0;
|
int randomized = 0;
|
||||||
int counter=0;
|
int counter=0;
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
HMODULE lib=LoadLibrary("ADVAPI32.DLL");
|
BOOLEAN res;
|
||||||
if (lib) {
|
if (fpSystemFunction036)
|
||||||
BOOLEAN (APIENTRY *pfn)(void*, ULONG) =
|
{
|
||||||
(BOOLEAN (APIENTRY *)(void*,ULONG))GetProcAddress(lib,"SystemFunction036");
|
res = (*fpSystemFunction036) (key, key_data_len);
|
||||||
if (pfn && pfn(key,key_data_len) )
|
if (res)
|
||||||
randomized = 1;
|
randomized = 1;
|
||||||
|
|
||||||
FreeLibrary(lib);
|
|
||||||
}
|
}
|
||||||
#else /* !WIN32 */
|
#else /* !WIN32 */
|
||||||
#ifdef RANDOM_FILE
|
#ifdef RANDOM_FILE
|
||||||
char buffer[256];
|
|
||||||
FILE *f = fopen(RANDOM_FILE, "rb");
|
FILE *f = fopen(RANDOM_FILE, "rb");
|
||||||
if(f) {
|
if(f) {
|
||||||
size_t i;
|
counter = fread(key, 1, key_data_len, f);
|
||||||
size_t rc = fread(buffer, key_data_len, 1, f);
|
|
||||||
for(i=0; i<rc && counter < key_data_len; i++)
|
|
||||||
key[counter++]=buffer[i];
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1363,11 +1537,11 @@ static int init_id_key(rc4_key* key,int key_data_len)
|
|||||||
if (!key_data_ptr)
|
if (!key_data_ptr)
|
||||||
return ARES_ENOMEM;
|
return ARES_ENOMEM;
|
||||||
|
|
||||||
randomize_key(key->state,key_data_len);
|
|
||||||
state = &key->state[0];
|
state = &key->state[0];
|
||||||
for(counter = 0; counter < 256; counter++)
|
for(counter = 0; counter < 256; counter++)
|
||||||
/* unnecessary AND but it keeps some compilers happier */
|
/* unnecessary AND but it keeps some compilers happier */
|
||||||
state[counter] = (unsigned char)(counter & 0xff);
|
state[counter] = (unsigned char)(counter & 0xff);
|
||||||
|
randomize_key(key->state,key_data_len);
|
||||||
key->x = 0;
|
key->x = 0;
|
||||||
key->y = 0;
|
key->y = 0;
|
||||||
index1 = 0;
|
index1 = 0;
|
||||||
@@ -1384,9 +1558,17 @@ static int init_id_key(rc4_key* key,int key_data_len)
|
|||||||
return ARES_SUCCESS;
|
return ARES_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
short ares__generate_new_id(rc4_key* key)
|
unsigned short ares__generate_new_id(rc4_key* key)
|
||||||
{
|
{
|
||||||
short r=0;
|
unsigned short r=0;
|
||||||
ares__rc4(key, (unsigned char *)&r, sizeof(r));
|
ares__rc4(key, (unsigned char *)&r, sizeof(r));
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ares_set_socket_callback(ares_channel channel,
|
||||||
|
ares_sock_create_callback cb,
|
||||||
|
void *data)
|
||||||
|
{
|
||||||
|
channel->sock_create_cb = cb;
|
||||||
|
channel->sock_create_cb_data = data;
|
||||||
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ struct addrinfo
|
|||||||
int ai_family;
|
int ai_family;
|
||||||
int ai_socktype;
|
int ai_socktype;
|
||||||
int ai_protocol;
|
int ai_protocol;
|
||||||
socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
|
ares_socklen_t ai_addrlen; /* Follow rfc3493 struct addrinfo */
|
||||||
char *ai_canonname;
|
char *ai_canonname;
|
||||||
struct sockaddr *ai_addr;
|
struct sockaddr *ai_addr;
|
||||||
struct addrinfo *ai_next;
|
struct addrinfo *ai_next;
|
||||||
|
|||||||
74
ares/ares_library_cleanup.3
Normal file
74
ares/ares_library_cleanup.3
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
.\" Copyright (C) 2004-2009 by Daniel Stenberg
|
||||||
|
.\"
|
||||||
|
.\" Permission to use, copy, modify, and distribute this
|
||||||
|
.\" software and its documentation for any purpose and without
|
||||||
|
.\" fee is hereby granted, provided that the above copyright
|
||||||
|
.\" notice appear in all copies and that both that copyright
|
||||||
|
.\" notice and this permission notice appear in supporting
|
||||||
|
.\" documentation, and that the name of M.I.T. not be used in
|
||||||
|
.\" advertising or publicity pertaining to distribution of the
|
||||||
|
.\" software without specific, written prior permission.
|
||||||
|
.\" M.I.T. makes no representations about the suitability of
|
||||||
|
.\" this software for any purpose. It is provided "as is"
|
||||||
|
.\" without express or implied warranty.
|
||||||
|
.\"
|
||||||
|
.TH ARES_LIBRARY_CLEANUP 3 "19 May 2009"
|
||||||
|
.SH NAME
|
||||||
|
ares_library_cleanup \- c-ares library deinitialization
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.nf
|
||||||
|
.B #include <ares.h>
|
||||||
|
.PP
|
||||||
|
.B void ares_library_cleanup(void)
|
||||||
|
.PP
|
||||||
|
.B cc file.c -lcares
|
||||||
|
.fi
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.PP
|
||||||
|
The
|
||||||
|
.B ares_library_cleanup
|
||||||
|
function uninitializes the c-ares library, freeing all resources
|
||||||
|
previously aquired by \fIares_library_init(3)\fP when the library
|
||||||
|
was initialized.
|
||||||
|
.PP
|
||||||
|
This function must be called when the program using c-ares will
|
||||||
|
no longer need any c-ares function. Once the program has called
|
||||||
|
\fIares_library_cleanup(3)\fP it shall not make any further call to any
|
||||||
|
c-ares function.
|
||||||
|
.PP
|
||||||
|
This function does not cancel any pending c-ares lookups or requests
|
||||||
|
previously done. Program must use \fIares_cancel(3)\fP for this purpose.
|
||||||
|
.PP
|
||||||
|
.B This function is not thread safe.
|
||||||
|
You have to call it once the program is about to terminate, but this call must
|
||||||
|
be done once the program has terminated every single thread that it could have
|
||||||
|
initiated. This is required to avoid potential race conditions in library
|
||||||
|
deinitialization, and also due to the fact that \fIares_library_cleanup(3)\fP
|
||||||
|
might call functions from other libraries that are thread unsafe, and could
|
||||||
|
conflict with any other thread that is already using these other libraries.
|
||||||
|
.PP
|
||||||
|
Win32/64 application DLLs shall not call \fIares_library_cleanup(3)\fP from
|
||||||
|
the DllMain function. Doing so will produce deadlocks and other problems.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
This function was first introduced in c-ares version 1.6.1 along with the
|
||||||
|
definition of preprocessor symbol \fICARES_HAVE_ARES_LIBRARY_CLEANUP\fP as an
|
||||||
|
indication of the availability of this function.
|
||||||
|
.PP
|
||||||
|
Since the introduction of this function, it is absolutely mandatory to call it
|
||||||
|
for any Win32/64 program using c-ares.
|
||||||
|
.PP
|
||||||
|
Non-Win32/64 systems can still use c-ares version 1.6.1 without calling
|
||||||
|
\fIares_library_cleanup(3)\fP due to the fact that it is nearly a do-nothing
|
||||||
|
function on non-Win32/64 platforms.
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR ares_library_init(3),
|
||||||
|
.BR ares_cancel(3)
|
||||||
|
.SH AUTHOR
|
||||||
|
Yang Tse
|
||||||
|
.PP
|
||||||
|
Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
.br
|
||||||
|
Copyright (C) 2004-2009 by Daniel Stenberg.
|
||||||
97
ares/ares_library_init.3
Normal file
97
ares/ares_library_init.3
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
.\" Copyright (C) 2004-2009 by Daniel Stenberg
|
||||||
|
.\"
|
||||||
|
.\" Permission to use, copy, modify, and distribute this
|
||||||
|
.\" software and its documentation for any purpose and without
|
||||||
|
.\" fee is hereby granted, provided that the above copyright
|
||||||
|
.\" notice appear in all copies and that both that copyright
|
||||||
|
.\" notice and this permission notice appear in supporting
|
||||||
|
.\" documentation, and that the name of M.I.T. not be used in
|
||||||
|
.\" advertising or publicity pertaining to distribution of the
|
||||||
|
.\" software without specific, written prior permission.
|
||||||
|
.\" M.I.T. makes no representations about the suitability of
|
||||||
|
.\" this software for any purpose. It is provided "as is"
|
||||||
|
.\" without express or implied warranty.
|
||||||
|
.\"
|
||||||
|
.TH ARES_LIBRARY_INIT 3 "19 May 2009"
|
||||||
|
.SH NAME
|
||||||
|
ares_library_init \- c-ares library initialization
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.nf
|
||||||
|
.B #include <ares.h>
|
||||||
|
.PP
|
||||||
|
.B int ares_library_init(int \fIflags\fP)
|
||||||
|
.PP
|
||||||
|
.B cc file.c -lcares
|
||||||
|
.fi
|
||||||
|
.SH DESCRIPTION
|
||||||
|
.PP
|
||||||
|
The
|
||||||
|
.B ares_library_init
|
||||||
|
function performs initializations internally required by the c-ares
|
||||||
|
library that must take place before any other function provided by
|
||||||
|
c-ares can be used in a program.
|
||||||
|
.PP
|
||||||
|
This function must be called one time within the life of a program,
|
||||||
|
before the program actually executes any other c-ares library function.
|
||||||
|
Initializations done by this function remain effective until a
|
||||||
|
call to \fIares_library_cleanup(3)\fP is performed.
|
||||||
|
.PP
|
||||||
|
Successive calls to this function do nothing, only the first call done
|
||||||
|
when c-ares is in an uninitialized state is actually effective.
|
||||||
|
.PP
|
||||||
|
The
|
||||||
|
.I flags
|
||||||
|
parameter is a bit pattern that tells c-ares exactly which features
|
||||||
|
should be initialized, as described below. Set the desired bits by
|
||||||
|
ORing the values together. In normal operation you should specify
|
||||||
|
\fIARES_LIB_INIT_ALL\fP. Don't use any other value unless you are
|
||||||
|
familiar with it and trying to control some internal c-ares feature.
|
||||||
|
.PP
|
||||||
|
.B This function is not thread safe.
|
||||||
|
You have to call it once the program has started, but this call must be done
|
||||||
|
before the program starts any other thread. This is required to avoid
|
||||||
|
potential race conditions in library initialization, and also due to the fact
|
||||||
|
that \fIares_library_init(3)\fP might call functions from other libraries that
|
||||||
|
are thread unsafe, and could conflict with any other thread that is already
|
||||||
|
using these other libraries.
|
||||||
|
.PP
|
||||||
|
Win32/64 application DLLs shall not call \fIares_library_init(3)\fP from the
|
||||||
|
DllMain function. Doing so will produce deadlocks and other problems.
|
||||||
|
.SH FLAGS
|
||||||
|
.TP 5
|
||||||
|
.B ARES_LIB_INIT_ALL
|
||||||
|
Initialize everything possible. This sets all known bits.
|
||||||
|
.TP
|
||||||
|
.B ARES_LIB_INIT_WIN32
|
||||||
|
Initialize Win32/64 specific libraries.
|
||||||
|
.TP
|
||||||
|
.B ARES_LIB_INIT_NONE
|
||||||
|
Initialize nothing extra. This sets no bit.
|
||||||
|
.SH RETURN VALUE
|
||||||
|
Upon successful completion, ares_library_init() will return 0. Otherwise, a
|
||||||
|
non-zero error number will be returned to indicate the error. Except for
|
||||||
|
\fIares_strerror(3)\fP, you shall not call any other c-ares function upon
|
||||||
|
\fIares_library_init(3)\fP failure.
|
||||||
|
.SH AVAILABILITY
|
||||||
|
This function was first introduced in c-ares version 1.6.1 along with the
|
||||||
|
definition of preprocessor symbol \fICARES_HAVE_ARES_LIBRARY_INIT\fP as an
|
||||||
|
indication of the availability of this function.
|
||||||
|
.PP
|
||||||
|
Since the introduction of this function it is absolutely mandatory to
|
||||||
|
call it for any Win32/64 program using c-ares.
|
||||||
|
.PP
|
||||||
|
Non-Win32/64 systems can still use c-ares version 1.6.1 without calling
|
||||||
|
\fIares_library_init(3)\fP due to the fact that it is nearly a do-nothing
|
||||||
|
function on non-Win32/64 platforms at this point.
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR ares_library_cleanup(3),
|
||||||
|
.BR ares_strerror(3)
|
||||||
|
.SH AUTHOR
|
||||||
|
Yang Tse
|
||||||
|
.PP
|
||||||
|
Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
.br
|
||||||
|
Copyright (C) 2004-2009 by Daniel Stenberg.
|
||||||
133
ares/ares_library_init.c
Normal file
133
ares/ares_library_init.c
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
* Copyright (C) 2004-2009 by Daniel Stenberg
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this
|
||||||
|
* software and its documentation for any purpose and without
|
||||||
|
* fee is hereby granted, provided that the above copyright
|
||||||
|
* notice appear in all copies and that both that copyright
|
||||||
|
* notice and this permission notice appear in supporting
|
||||||
|
* documentation, and that the name of M.I.T. not be used in
|
||||||
|
* advertising or publicity pertaining to distribution of the
|
||||||
|
* software without specific, written prior permission.
|
||||||
|
* M.I.T. makes no representations about the suitability of
|
||||||
|
* this software for any purpose. It is provided "as is"
|
||||||
|
* without express or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ares_setup.h"
|
||||||
|
|
||||||
|
#include "ares.h"
|
||||||
|
#include "ares_library_init.h"
|
||||||
|
#include "ares_private.h"
|
||||||
|
|
||||||
|
/* library-private global and unique instance vars */
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
fpGetNetworkParams_t fpGetNetworkParams = ZERO_NULL;
|
||||||
|
fpSystemFunction036_t fpSystemFunction036 = ZERO_NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* library-private global vars with source visibility restricted to this file */
|
||||||
|
|
||||||
|
static unsigned int ares_initialized;
|
||||||
|
static int ares_init_flags;
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
static HMODULE hnd_iphlpapi;
|
||||||
|
static HMODULE hnd_advapi32;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
static int ares_win32_init(void)
|
||||||
|
{
|
||||||
|
#ifdef WIN32
|
||||||
|
|
||||||
|
hnd_iphlpapi = 0;
|
||||||
|
hnd_iphlpapi = LoadLibrary("iphlpapi.dll");
|
||||||
|
if (!hnd_iphlpapi)
|
||||||
|
return ARES_ELOADIPHLPAPI;
|
||||||
|
|
||||||
|
fpGetNetworkParams = (fpGetNetworkParams_t)
|
||||||
|
GetProcAddress(hnd_iphlpapi, "GetNetworkParams");
|
||||||
|
if (!fpGetNetworkParams)
|
||||||
|
{
|
||||||
|
FreeLibrary(hnd_iphlpapi);
|
||||||
|
return ARES_EADDRGETNETWORKPARAMS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When advapi32.dll is unavailable or advapi32.dll has no SystemFunction036,
|
||||||
|
* also known as RtlGenRandom, which is the case for Windows versions prior
|
||||||
|
* to WinXP then c-ares uses portable rand() function. Then don't error here.
|
||||||
|
*/
|
||||||
|
|
||||||
|
hnd_advapi32 = 0;
|
||||||
|
hnd_advapi32 = LoadLibrary("advapi32.dll");
|
||||||
|
if (hnd_advapi32)
|
||||||
|
{
|
||||||
|
fpSystemFunction036 = (fpSystemFunction036_t)
|
||||||
|
GetProcAddress(hnd_advapi32, "SystemFunction036");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
return ARES_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void ares_win32_cleanup(void)
|
||||||
|
{
|
||||||
|
#ifdef WIN32
|
||||||
|
if (hnd_advapi32)
|
||||||
|
FreeLibrary(hnd_advapi32);
|
||||||
|
if (hnd_iphlpapi)
|
||||||
|
FreeLibrary(hnd_iphlpapi);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int ares_library_init(int flags)
|
||||||
|
{
|
||||||
|
int res;
|
||||||
|
|
||||||
|
if (ares_initialized)
|
||||||
|
return ARES_SUCCESS;
|
||||||
|
ares_initialized++;
|
||||||
|
|
||||||
|
if (flags & ARES_LIB_INIT_WIN32)
|
||||||
|
{
|
||||||
|
res = ares_win32_init();
|
||||||
|
if (res != ARES_SUCCESS)
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
ares_init_flags = flags;
|
||||||
|
|
||||||
|
return ARES_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ares_library_cleanup(void)
|
||||||
|
{
|
||||||
|
if (!ares_initialized)
|
||||||
|
return;
|
||||||
|
ares_initialized--;
|
||||||
|
|
||||||
|
if (ares_init_flags & ARES_LIB_INIT_WIN32)
|
||||||
|
ares_win32_cleanup();
|
||||||
|
|
||||||
|
ares_init_flags = ARES_LIB_INIT_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int ares_library_initialized(void)
|
||||||
|
{
|
||||||
|
#ifdef WIN32
|
||||||
|
if (!ares_initialized)
|
||||||
|
return ARES_ENOTINITIALIZED;
|
||||||
|
#endif
|
||||||
|
return ARES_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
40
ares/ares_library_init.h
Normal file
40
ares/ares_library_init.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#ifndef HEADER_CARES_LIBRARY_INIT_H
|
||||||
|
#define HEADER_CARES_LIBRARY_INIT_H
|
||||||
|
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
* Copyright (C) 2004-2009 by Daniel Stenberg
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this
|
||||||
|
* software and its documentation for any purpose and without
|
||||||
|
* fee is hereby granted, provided that the above copyright
|
||||||
|
* notice appear in all copies and that both that copyright
|
||||||
|
* notice and this permission notice appear in supporting
|
||||||
|
* documentation, and that the name of M.I.T. not be used in
|
||||||
|
* advertising or publicity pertaining to distribution of the
|
||||||
|
* software without specific, written prior permission.
|
||||||
|
* M.I.T. makes no representations about the suitability of
|
||||||
|
* this software for any purpose. It is provided "as is"
|
||||||
|
* without express or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ares_setup.h"
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
|
||||||
|
#include <iphlpapi.h>
|
||||||
|
|
||||||
|
typedef DWORD (WINAPI *fpGetNetworkParams_t) (FIXED_INFO*, DWORD*);
|
||||||
|
typedef BOOLEAN (APIENTRY *fpSystemFunction036_t) (void*, ULONG);
|
||||||
|
|
||||||
|
/* Forward-declaration of variables defined in ares_library_init.c */
|
||||||
|
/* that are global and unique instances for whole c-ares library. */
|
||||||
|
|
||||||
|
extern fpGetNetworkParams_t fpGetNetworkParams;
|
||||||
|
extern fpSystemFunction036_t fpSystemFunction036;
|
||||||
|
|
||||||
|
#endif /* WIN32 */
|
||||||
|
|
||||||
|
#endif /* HEADER_CARES_LIBRARY_INIT_H */
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
#include "ares_private.h"
|
||||||
|
|||||||
@@ -15,16 +15,21 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include "nameser.h"
|
# include <sys/socket.h>
|
||||||
#else
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/nameser.h>
|
|
||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
|
||||||
#include <arpa/nameser_compat.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
# include <arpa/nameser_compat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.TH ARES_PARSE_A_REPLY 3 "25 July 1998"
|
.TH ARES_PARSE_A_REPLY 3 "25 July 1998"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
ares_parse_a_reply \- Parse a reply to a DNS query of type A into a hostent
|
ares_parse_a_reply \- Parse a reply to a DNS query of type A
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.nf
|
.nf
|
||||||
.B #include <ares.h>
|
.B #include <ares.h>
|
||||||
|
|||||||
@@ -15,24 +15,39 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include "nameser.h"
|
# include <sys/socket.h>
|
||||||
#else
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <arpa/nameser.h>
|
|
||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
|
||||||
#include <arpa/nameser_compat.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
# include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
# include <arpa/nameser_compat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <limits.h>
|
#ifdef HAVE_LIMITS_H
|
||||||
|
# include <limits.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_dns.h"
|
#include "ares_dns.h"
|
||||||
#include "ares_private.h"
|
#include "ares_private.h"
|
||||||
@@ -71,7 +86,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
|||||||
|
|
||||||
/* Expand the name from the question, and skip past the question. */
|
/* Expand the name from the question, and skip past the question. */
|
||||||
aptr = abuf + HFIXEDSZ;
|
aptr = abuf + HFIXEDSZ;
|
||||||
status = ares_expand_name(aptr, abuf, alen, &hostname, &len);
|
status = ares__expand_name_for_response(aptr, abuf, alen, &hostname, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||||
@@ -83,7 +98,8 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
|||||||
|
|
||||||
if (host)
|
if (host)
|
||||||
{
|
{
|
||||||
/* Allocate addresses and aliases; ancount gives an upper bound for both. */
|
/* Allocate addresses and aliases; ancount gives an upper bound for
|
||||||
|
both. */
|
||||||
addrs = malloc(ancount * sizeof(struct in_addr));
|
addrs = malloc(ancount * sizeof(struct in_addr));
|
||||||
if (!addrs)
|
if (!addrs)
|
||||||
{
|
{
|
||||||
@@ -111,7 +127,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
|||||||
for (i = 0; i < (int)ancount; i++)
|
for (i = 0; i < (int)ancount; i++)
|
||||||
{
|
{
|
||||||
/* Decode the RR up to the data field. */
|
/* Decode the RR up to the data field. */
|
||||||
status = ares_expand_name(aptr, abuf, alen, &rr_name, &len);
|
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
break;
|
break;
|
||||||
aptr += len;
|
aptr += len;
|
||||||
@@ -164,7 +180,8 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
|||||||
naliases++;
|
naliases++;
|
||||||
|
|
||||||
/* Decode the RR data and replace the hostname with it. */
|
/* Decode the RR data and replace the hostname with it. */
|
||||||
status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
|
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||||
|
&len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
break;
|
break;
|
||||||
free(hostname);
|
free(hostname);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.TH ARES_PARSE_AAAA_REPLY 3 "10 March 2005"
|
.TH ARES_PARSE_AAAA_REPLY 3 "10 March 2005"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
ares_parse_aaaa_reply \- Parse a reply to a DNS query of type AAAA into a hostent
|
ares_parse_aaaa_reply \- Parse a reply to a DNS query of type AAAA
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.nf
|
.nf
|
||||||
.B #include <ares.h>
|
.B #include <ares.h>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright 2005 Dominick Meglio
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
* Copyright 2005 Dominick Meglio
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
* software and its documentation for any purpose and without
|
* software and its documentation for any purpose and without
|
||||||
@@ -15,26 +16,39 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include "nameser.h"
|
# include <sys/socket.h>
|
||||||
#else
|
#endif
|
||||||
#include <sys/socket.h>
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
# include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#endif
|
||||||
#include <netdb.h>
|
#ifdef HAVE_NETDB_H
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
# include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_ARPA_NAMESER_H
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
#include <arpa/nameser.h>
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
#include <arpa/nameser_compat.h>
|
# include <arpa/nameser_compat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <limits.h>
|
#ifdef HAVE_LIMITS_H
|
||||||
|
# include <limits.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_dns.h"
|
#include "ares_dns.h"
|
||||||
#include "inet_net_pton.h"
|
#include "inet_net_pton.h"
|
||||||
@@ -74,7 +88,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
|||||||
|
|
||||||
/* Expand the name from the question, and skip past the question. */
|
/* Expand the name from the question, and skip past the question. */
|
||||||
aptr = abuf + HFIXEDSZ;
|
aptr = abuf + HFIXEDSZ;
|
||||||
status = ares_expand_name(aptr, abuf, alen, &hostname, &len);
|
status = ares__expand_name_for_response(aptr, abuf, alen, &hostname, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||||
@@ -113,7 +127,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
|||||||
for (i = 0; i < (int)ancount; i++)
|
for (i = 0; i < (int)ancount; i++)
|
||||||
{
|
{
|
||||||
/* Decode the RR up to the data field. */
|
/* Decode the RR up to the data field. */
|
||||||
status = ares_expand_name(aptr, abuf, alen, &rr_name, &len);
|
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
break;
|
break;
|
||||||
aptr += len;
|
aptr += len;
|
||||||
@@ -166,7 +180,8 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
|
|||||||
naliases++;
|
naliases++;
|
||||||
|
|
||||||
/* Decode the RR data and replace the hostname with it. */
|
/* Decode the RR data and replace the hostname with it. */
|
||||||
status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
|
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||||
|
&len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
break;
|
break;
|
||||||
free(hostname);
|
free(hostname);
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
|
/* $Id */
|
||||||
|
|
||||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
* software and its documentation for any purpose and without
|
* software and its documentation for any purpose and without
|
||||||
* fee is hereby granted, provided that the above copyright
|
* fee is hereby granted, provided that the above copyright
|
||||||
* notice appear in all copies and that both that copyright
|
* notice appear in all copies and that both that copyright
|
||||||
* notice and this permission notice appear in supporting
|
* notice and this permission notice appear in supporting
|
||||||
* documentation, and that the name of M.I.T. not be used in
|
* documentation, and that the name of M.I.T. not be used in
|
||||||
* advertising or publicity pertaining to distribution of the
|
* advertising or publicity pertaining to distribution of the
|
||||||
* software without specific, written prior permission.
|
* software without specific, written prior permission.
|
||||||
* M.I.T. makes no representations about the suitability of
|
* M.I.T. makes no representations about the suitability of
|
||||||
* this software for any purpose. It is provided "as is"
|
* this software for any purpose. It is provided "as is"
|
||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
@@ -18,19 +20,27 @@
|
|||||||
* on behalf of AVIRA Gmbh - http://www.avira.com
|
* on behalf of AVIRA Gmbh - http://www.avira.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include "nameser.h"
|
# include <sys/socket.h>
|
||||||
#else
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <arpa/nameser.h>
|
|
||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
|
||||||
#include <arpa/nameser_compat.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
# include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
# include <arpa/nameser_compat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -65,7 +75,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
|
|||||||
|
|
||||||
/* Expand the name from the question, and skip past the question. */
|
/* Expand the name from the question, and skip past the question. */
|
||||||
aptr = abuf + HFIXEDSZ;
|
aptr = abuf + HFIXEDSZ;
|
||||||
status = ares_expand_name( aptr, abuf, alen, &hostname, &len );
|
status = ares__expand_name_for_response( aptr, abuf, alen, &hostname, &len);
|
||||||
if ( status != ARES_SUCCESS )
|
if ( status != ARES_SUCCESS )
|
||||||
return status;
|
return status;
|
||||||
if ( aptr + len + QFIXEDSZ > abuf + alen )
|
if ( aptr + len + QFIXEDSZ > abuf + alen )
|
||||||
@@ -88,7 +98,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
|
|||||||
for ( i = 0; i < ( int ) ancount; i++ )
|
for ( i = 0; i < ( int ) ancount; i++ )
|
||||||
{
|
{
|
||||||
/* Decode the RR up to the data field. */
|
/* Decode the RR up to the data field. */
|
||||||
status = ares_expand_name( aptr, abuf, alen, &rr_name, &len );
|
status = ares__expand_name_for_response( aptr, abuf, alen, &rr_name, &len );
|
||||||
if ( status != ARES_SUCCESS )
|
if ( status != ARES_SUCCESS )
|
||||||
break;
|
break;
|
||||||
aptr += len;
|
aptr += len;
|
||||||
@@ -105,7 +115,8 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen,
|
|||||||
if ( rr_class == C_IN && rr_type == T_NS )
|
if ( rr_class == C_IN && rr_type == T_NS )
|
||||||
{
|
{
|
||||||
/* Decode the RR data and add it to the nameservers list */
|
/* Decode the RR data and add it to the nameservers list */
|
||||||
status = ares_expand_name( aptr, abuf, alen, &rr_data, &len );
|
status = ares__expand_name_for_response( aptr, abuf, alen, &rr_data,
|
||||||
|
&len);
|
||||||
if ( status != ARES_SUCCESS )
|
if ( status != ARES_SUCCESS )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -15,18 +15,28 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include "nameser.h"
|
# include <sys/socket.h>
|
||||||
#else
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <arpa/nameser.h>
|
|
||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
|
||||||
#include <arpa/nameser_compat.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
# include <arpa/nameser_compat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -44,6 +54,9 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
|||||||
const unsigned char *aptr;
|
const unsigned char *aptr;
|
||||||
char *ptrname, *hostname, *rr_name, *rr_data;
|
char *ptrname, *hostname, *rr_name, *rr_data;
|
||||||
struct hostent *hostent;
|
struct hostent *hostent;
|
||||||
|
int aliascnt = 0;
|
||||||
|
int alias_alloc = 8;
|
||||||
|
char ** aliases;
|
||||||
|
|
||||||
/* Set *host to NULL for all failure cases. */
|
/* Set *host to NULL for all failure cases. */
|
||||||
*host = NULL;
|
*host = NULL;
|
||||||
@@ -60,7 +73,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
|||||||
|
|
||||||
/* Expand the name from the question, and skip past the question. */
|
/* Expand the name from the question, and skip past the question. */
|
||||||
aptr = abuf + HFIXEDSZ;
|
aptr = abuf + HFIXEDSZ;
|
||||||
status = ares_expand_name(aptr, abuf, alen, &ptrname, &len);
|
status = ares__expand_name_for_response(aptr, abuf, alen, &ptrname, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
return status;
|
return status;
|
||||||
if (aptr + len + QFIXEDSZ > abuf + alen)
|
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||||
@@ -72,10 +85,16 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
|||||||
|
|
||||||
/* Examine each answer resource record (RR) in turn. */
|
/* Examine each answer resource record (RR) in turn. */
|
||||||
hostname = NULL;
|
hostname = NULL;
|
||||||
|
aliases = malloc(alias_alloc * sizeof(char *));
|
||||||
|
if (!aliases)
|
||||||
|
{
|
||||||
|
free(ptrname);
|
||||||
|
return ARES_ENOMEM;
|
||||||
|
}
|
||||||
for (i = 0; i < (int)ancount; i++)
|
for (i = 0; i < (int)ancount; i++)
|
||||||
{
|
{
|
||||||
/* Decode the RR up to the data field. */
|
/* Decode the RR up to the data field. */
|
||||||
status = ares_expand_name(aptr, abuf, alen, &rr_name, &len);
|
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_name, &len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
break;
|
break;
|
||||||
aptr += len;
|
aptr += len;
|
||||||
@@ -93,18 +112,38 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
|||||||
&& strcasecmp(rr_name, ptrname) == 0)
|
&& strcasecmp(rr_name, ptrname) == 0)
|
||||||
{
|
{
|
||||||
/* Decode the RR data and set hostname to it. */
|
/* Decode the RR data and set hostname to it. */
|
||||||
status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
|
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||||
|
&len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
break;
|
break;
|
||||||
if (hostname)
|
if (hostname)
|
||||||
free(hostname);
|
free(hostname);
|
||||||
hostname = rr_data;
|
hostname = rr_data;
|
||||||
|
aliases[aliascnt] = malloc((strlen(rr_data)+1) * sizeof(char *));
|
||||||
|
if (!aliases[aliascnt])
|
||||||
|
{
|
||||||
|
status = ARES_ENOMEM;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
strncpy(aliases[aliascnt], rr_data, strlen(rr_data)+1);
|
||||||
|
aliascnt++;
|
||||||
|
if (aliascnt >= alias_alloc) {
|
||||||
|
char **ptr;
|
||||||
|
alias_alloc *= 2;
|
||||||
|
ptr = realloc(aliases, alias_alloc * sizeof(char *));
|
||||||
|
if(!ptr) {
|
||||||
|
status = ARES_ENOMEM;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
aliases = ptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rr_class == C_IN && rr_type == T_CNAME)
|
if (rr_class == C_IN && rr_type == T_CNAME)
|
||||||
{
|
{
|
||||||
/* Decode the RR data and replace ptrname with it. */
|
/* Decode the RR data and replace ptrname with it. */
|
||||||
status = ares_expand_name(aptr, abuf, alen, &rr_data, &len);
|
status = ares__expand_name_for_response(aptr, abuf, alen, &rr_data,
|
||||||
|
&len);
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
break;
|
break;
|
||||||
free(ptrname);
|
free(ptrname);
|
||||||
@@ -134,17 +173,20 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
|||||||
hostent->h_addr_list[0] = malloc(addrlen);
|
hostent->h_addr_list[0] = malloc(addrlen);
|
||||||
if (hostent->h_addr_list[0])
|
if (hostent->h_addr_list[0])
|
||||||
{
|
{
|
||||||
hostent->h_aliases = malloc(sizeof (char *));
|
hostent->h_aliases = malloc((aliascnt+1) * sizeof (char *));
|
||||||
if (hostent->h_aliases)
|
if (hostent->h_aliases)
|
||||||
{
|
{
|
||||||
/* Fill in the hostent and return successfully. */
|
/* Fill in the hostent and return successfully. */
|
||||||
hostent->h_name = hostname;
|
hostent->h_name = hostname;
|
||||||
hostent->h_aliases[0] = NULL;
|
for (i=0 ; i<aliascnt ; i++)
|
||||||
|
hostent->h_aliases[i] = aliases[i];
|
||||||
|
hostent->h_aliases[aliascnt] = NULL;
|
||||||
hostent->h_addrtype = family;
|
hostent->h_addrtype = family;
|
||||||
hostent->h_length = addrlen;
|
hostent->h_length = addrlen;
|
||||||
memcpy(hostent->h_addr_list[0], addr, addrlen);
|
memcpy(hostent->h_addr_list[0], addr, addrlen);
|
||||||
hostent->h_addr_list[1] = NULL;
|
hostent->h_addr_list[1] = NULL;
|
||||||
*host = hostent;
|
*host = hostent;
|
||||||
|
free(aliases);
|
||||||
free(ptrname);
|
free(ptrname);
|
||||||
return ARES_SUCCESS;
|
return ARES_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -156,6 +198,10 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
|
|||||||
}
|
}
|
||||||
status = ARES_ENOMEM;
|
status = ARES_ENOMEM;
|
||||||
}
|
}
|
||||||
|
for (i=0 ; i<aliascnt ; i++)
|
||||||
|
if (aliases[i])
|
||||||
|
free(aliases[i]);
|
||||||
|
free(aliases);
|
||||||
if (hostname)
|
if (hostname)
|
||||||
free(hostname);
|
free(hostname);
|
||||||
free(ptrname);
|
free(ptrname);
|
||||||
|
|||||||
77
ares/ares_parse_srv_reply.3
Normal file
77
ares/ares_parse_srv_reply.3
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
.\"
|
||||||
|
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
.\"
|
||||||
|
.\" Permission to use, copy, modify, and distribute this
|
||||||
|
.\" software and its documentation for any purpose and without
|
||||||
|
.\" fee is hereby granted, provided that the above copyright
|
||||||
|
.\" notice appear in all copies and that both that copyright
|
||||||
|
.\" notice and this permission notice appear in supporting
|
||||||
|
.\" documentation, and that the name of M.I.T. not be used in
|
||||||
|
.\" advertising or publicity pertaining to distribution of the
|
||||||
|
.\" software without specific, written prior permission.
|
||||||
|
.\" M.I.T. makes no representations about the suitability of
|
||||||
|
.\" this software for any purpose. It is provided "as is"
|
||||||
|
.\" without express or implied warranty.
|
||||||
|
.\"
|
||||||
|
.TH ARES_PARSE_SRV_REPLY 3 "4 August 2009"
|
||||||
|
.SH NAME
|
||||||
|
ares_parse_srv_reply \- Parse a reply to a DNS query of type SRV
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.nf
|
||||||
|
.B #include <ares.h>
|
||||||
|
.PP
|
||||||
|
.B int ares_parse_srv_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||||
|
.B struct ares_srv_reply** \fIsrv_out\fP, int *\fInsrvreply\fP);
|
||||||
|
.fi
|
||||||
|
.SH DESCRIPTION
|
||||||
|
The
|
||||||
|
.B ares_parse_srv_reply
|
||||||
|
function parses the response to a query of type SRV into a
|
||||||
|
.I struct ares_srv_reply
|
||||||
|
The parameters
|
||||||
|
.I abuf
|
||||||
|
and
|
||||||
|
.I alen
|
||||||
|
give the contents of the response. The result is stored in allocated
|
||||||
|
memory and a pointer to it stored into the variable pointed to by
|
||||||
|
.IR srv_out .
|
||||||
|
The number of responses is stored into the variable pointed to by
|
||||||
|
.IR nsrvreply .
|
||||||
|
It is the caller's responsibility to free the resulting
|
||||||
|
.IR srv_out
|
||||||
|
structure when it is no longer needed.
|
||||||
|
.PP
|
||||||
|
The structure
|
||||||
|
.I ares_srv_reply
|
||||||
|
contains the following fields:
|
||||||
|
.sp
|
||||||
|
.in +4n
|
||||||
|
.nf
|
||||||
|
struct ares_srv_reply {
|
||||||
|
unsigned short weight;
|
||||||
|
unsigned short priority;
|
||||||
|
unsigned short port;
|
||||||
|
char *host;
|
||||||
|
};
|
||||||
|
.fi
|
||||||
|
.in
|
||||||
|
.PP
|
||||||
|
.SH RETURN VALUES
|
||||||
|
.B ares_parse_srv_reply
|
||||||
|
can return any of the following values:
|
||||||
|
.TP 15
|
||||||
|
.B ARES_SUCCESS
|
||||||
|
The response was successfully parsed.
|
||||||
|
.TP 15
|
||||||
|
.B ARES_EBADRESP
|
||||||
|
The response was malformatted.
|
||||||
|
.TP 15
|
||||||
|
.B ARES_ENODATA
|
||||||
|
The response did not contain an answer to the query.
|
||||||
|
.TP 15
|
||||||
|
.B ARES_ENOMEM
|
||||||
|
Memory was exhausted.
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR ares_query (3)
|
||||||
|
.SH AUTHOR
|
||||||
|
Written by Jakub Hrozek <jhrozek@redhat.com>, on behalf of Red Hat, Inc http://www.redhat.com
|
||||||
173
ares/ares_parse_srv_reply.c
Normal file
173
ares/ares_parse_srv_reply.c
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
/* Id$ */
|
||||||
|
|
||||||
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this
|
||||||
|
* software and its documentation for any purpose and without
|
||||||
|
* fee is hereby granted, provided that the above copyright
|
||||||
|
* notice appear in all copies and that both that copyright
|
||||||
|
* notice and this permission notice appear in supporting
|
||||||
|
* documentation, and that the name of M.I.T. not be used in
|
||||||
|
* advertising or publicity pertaining to distribution of the
|
||||||
|
* software without specific, written prior permission.
|
||||||
|
* M.I.T. makes no representations about the suitability of
|
||||||
|
* this software for any purpose. It is provided "as is"
|
||||||
|
* without express or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ares_parse_srv_reply created by Jakub Hrozek <jhrozek@redhat.com>
|
||||||
|
* on behalf of Red Hat - http://www.redhat.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ares_setup.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
# include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
# include <arpa/nameser_compat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "ares.h"
|
||||||
|
#include "ares_dns.h"
|
||||||
|
#include "ares_private.h"
|
||||||
|
|
||||||
|
/* AIX portability check */
|
||||||
|
#ifndef T_SRV
|
||||||
|
# define T_SRV 33 /* server selection */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
ares_parse_srv_reply (const unsigned char *abuf, int alen,
|
||||||
|
struct ares_srv_reply **srv_out, int *nsrvreply)
|
||||||
|
{
|
||||||
|
unsigned int qdcount, ancount;
|
||||||
|
const unsigned char *aptr;
|
||||||
|
int status, i, rr_type, rr_class, rr_len;
|
||||||
|
long len;
|
||||||
|
char *hostname = NULL, *rr_name = NULL;
|
||||||
|
struct ares_srv_reply *srv = NULL;
|
||||||
|
|
||||||
|
/* Set *srv_out to NULL for all failure cases. */
|
||||||
|
*srv_out = NULL;
|
||||||
|
|
||||||
|
/* Same with *nsrvreply. */
|
||||||
|
*nsrvreply = 0;
|
||||||
|
|
||||||
|
/* Give up if abuf doesn't have room for a header. */
|
||||||
|
if (alen < HFIXEDSZ)
|
||||||
|
return ARES_EBADRESP;
|
||||||
|
|
||||||
|
/* Fetch the question and answer count from the header. */
|
||||||
|
qdcount = DNS_HEADER_QDCOUNT (abuf);
|
||||||
|
ancount = DNS_HEADER_ANCOUNT (abuf);
|
||||||
|
if (qdcount != 1)
|
||||||
|
return ARES_EBADRESP;
|
||||||
|
if (ancount == 0)
|
||||||
|
return ARES_ENODATA;
|
||||||
|
|
||||||
|
/* Expand the name from the question, and skip past the question. */
|
||||||
|
aptr = abuf + HFIXEDSZ;
|
||||||
|
status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||||
|
{
|
||||||
|
free (hostname);
|
||||||
|
return ARES_EBADRESP;
|
||||||
|
}
|
||||||
|
aptr += len + QFIXEDSZ;
|
||||||
|
|
||||||
|
/* Allocate ares_srv_reply array; ancount gives an upper bound */
|
||||||
|
srv = malloc ((ancount) * sizeof (struct ares_srv_reply));
|
||||||
|
if (!srv)
|
||||||
|
{
|
||||||
|
free (hostname);
|
||||||
|
return ARES_ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Examine each answer resource record (RR) in turn. */
|
||||||
|
for (i = 0; i < (int) ancount; i++)
|
||||||
|
{
|
||||||
|
/* Decode the RR up to the data field. */
|
||||||
|
status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
aptr += len;
|
||||||
|
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||||
|
{
|
||||||
|
status = ARES_EBADRESP;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
rr_type = DNS_RR_TYPE (aptr);
|
||||||
|
rr_class = DNS_RR_CLASS (aptr);
|
||||||
|
rr_len = DNS_RR_LEN (aptr);
|
||||||
|
aptr += RRFIXEDSZ;
|
||||||
|
|
||||||
|
/* Check if we are really looking at a SRV record */
|
||||||
|
if (rr_class == C_IN && rr_type == T_SRV)
|
||||||
|
{
|
||||||
|
/* parse the SRV record itself */
|
||||||
|
if (rr_len < 6)
|
||||||
|
{
|
||||||
|
status = ARES_EBADRESP;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
srv[i].priority = ntohs (*((unsigned short *)aptr));
|
||||||
|
aptr += sizeof(unsigned short);
|
||||||
|
srv[i].weight = ntohs (*((unsigned short *)aptr));
|
||||||
|
aptr += sizeof(unsigned short);
|
||||||
|
srv[i].port = ntohs (*((unsigned short *)aptr));
|
||||||
|
aptr += sizeof(unsigned short);
|
||||||
|
|
||||||
|
status = ares_expand_name (aptr, abuf, alen, &srv[i].host, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* Move on to the next record */
|
||||||
|
aptr += len;
|
||||||
|
|
||||||
|
/* Don't lose memory in the next iteration */
|
||||||
|
free (rr_name);
|
||||||
|
rr_name = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* clean up on error */
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
{
|
||||||
|
free (srv);
|
||||||
|
free (hostname);
|
||||||
|
free (rr_name);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* everything looks fine, return the data */
|
||||||
|
*srv_out = srv;
|
||||||
|
*nsrvreply = ancount;
|
||||||
|
|
||||||
|
free (hostname);
|
||||||
|
free (rr_name);
|
||||||
|
return status;
|
||||||
|
}
|
||||||
76
ares/ares_parse_txt_reply.3
Normal file
76
ares/ares_parse_txt_reply.3
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
.\"
|
||||||
|
.\" Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
.\"
|
||||||
|
.\" Permission to use, copy, modify, and distribute this
|
||||||
|
.\" software and its documentation for any purpose and without
|
||||||
|
.\" fee is hereby granted, provided that the above copyright
|
||||||
|
.\" notice appear in all copies and that both that copyright
|
||||||
|
.\" notice and this permission notice appear in supporting
|
||||||
|
.\" documentation, and that the name of M.I.T. not be used in
|
||||||
|
.\" advertising or publicity pertaining to distribution of the
|
||||||
|
.\" software without specific, written prior permission.
|
||||||
|
.\" M.I.T. makes no representations about the suitability of
|
||||||
|
.\" this software for any purpose. It is provided "as is"
|
||||||
|
.\" without express or implied warranty.
|
||||||
|
.\"
|
||||||
|
.TH ARES_PARSE_TXT_REPLY 3 "27 October 2009"
|
||||||
|
.SH NAME
|
||||||
|
ares_parse_txt_reply \- Parse a reply to a DNS query of type TXT
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.nf
|
||||||
|
.B #include <ares.h>
|
||||||
|
.PP
|
||||||
|
.B int ares_parse_txt_reply(const unsigned char* \fIabuf\fP, int \fIalen\fP,
|
||||||
|
.B struct ares_txt_reply **\fItxt_out\fP, int *\fIntxtreply\fP);
|
||||||
|
.fi
|
||||||
|
.SH DESCRIPTION
|
||||||
|
The
|
||||||
|
.B ares_parse_txt_reply
|
||||||
|
function parses the response to a query of type TXT into a
|
||||||
|
.I struct ares_txt_reply
|
||||||
|
The parameters
|
||||||
|
.I abuf
|
||||||
|
and
|
||||||
|
.I alen
|
||||||
|
give the contents of the response. The result is stored in allocated
|
||||||
|
memory and a pointer to it stored into the variable pointed to by
|
||||||
|
.IR txt_out .
|
||||||
|
The number of responses is stored into the variable pointed to by
|
||||||
|
.IR ntxtreply .
|
||||||
|
It is the caller's responsibility to free the resulting
|
||||||
|
.IR txt_out
|
||||||
|
structure when it is no longer needed.
|
||||||
|
.PP
|
||||||
|
The structure
|
||||||
|
.I ares_txt_reply
|
||||||
|
contains the following fields:
|
||||||
|
.sp
|
||||||
|
.in +4n
|
||||||
|
.nf
|
||||||
|
struct ares_txt_reply {
|
||||||
|
unsigned int length;
|
||||||
|
unsigned char *txt;
|
||||||
|
};
|
||||||
|
.fi
|
||||||
|
.in
|
||||||
|
.PP
|
||||||
|
.SH RETURN VALUES
|
||||||
|
.B ares_parse_txt_reply
|
||||||
|
can return any of the following values:
|
||||||
|
.TP 15
|
||||||
|
.B ARES_SUCCESS
|
||||||
|
The response was successfully parsed.
|
||||||
|
.TP 15
|
||||||
|
.B ARES_EBADRESP
|
||||||
|
The response was malformatted.
|
||||||
|
.TP 15
|
||||||
|
.B ARES_ENODATA
|
||||||
|
The response did not contain an answer to the query.
|
||||||
|
.TP 15
|
||||||
|
.B ARES_ENOMEM
|
||||||
|
Memory was exhausted.
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR ares_query (3)
|
||||||
|
.SH AUTHOR
|
||||||
|
Written by Jakub Hrozek <jhrozek@redhat.com>, on behalf of Red Hat, Inc http://www.redhat.com
|
||||||
|
|
||||||
205
ares/ares_parse_txt_reply.c
Normal file
205
ares/ares_parse_txt_reply.c
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
* Copyright (C) 2009 Jakub Hrozek <jhrozek@redhat.com>
|
||||||
|
* Copyright (C) 2009 Yang Tse <yangsita@gmail.com>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this
|
||||||
|
* software and its documentation for any purpose and without
|
||||||
|
* fee is hereby granted, provided that the above copyright
|
||||||
|
* notice appear in all copies and that both that copyright
|
||||||
|
* notice and this permission notice appear in supporting
|
||||||
|
* documentation, and that the name of M.I.T. not be used in
|
||||||
|
* advertising or publicity pertaining to distribution of the
|
||||||
|
* software without specific, written prior permission.
|
||||||
|
* M.I.T. makes no representations about the suitability of
|
||||||
|
* this software for any purpose. It is provided "as is"
|
||||||
|
* without express or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ares_setup.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
|
# include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_NETDB_H
|
||||||
|
# include <netdb.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
# include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
# include <arpa/nameser_compat.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
# include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "ares.h"
|
||||||
|
#include "ares_dns.h"
|
||||||
|
#include "ares_private.h"
|
||||||
|
|
||||||
|
int
|
||||||
|
ares_parse_txt_reply (const unsigned char *abuf, int alen,
|
||||||
|
struct ares_txt_reply **txt_out, int *ntxtreply)
|
||||||
|
{
|
||||||
|
size_t substr_len, str_len;
|
||||||
|
unsigned int qdcount, ancount, i;
|
||||||
|
const unsigned char *aptr;
|
||||||
|
const unsigned char *strptr;
|
||||||
|
int status, rr_type, rr_class, rr_len;
|
||||||
|
long len;
|
||||||
|
char *hostname = NULL, *rr_name = NULL;
|
||||||
|
struct ares_txt_reply *txt = NULL;
|
||||||
|
|
||||||
|
/* Set *txt_out to NULL for all failure cases. */
|
||||||
|
*txt_out = NULL;
|
||||||
|
|
||||||
|
/* Same with *ntxtreply. */
|
||||||
|
*ntxtreply = 0;
|
||||||
|
|
||||||
|
/* Give up if abuf doesn't have room for a header. */
|
||||||
|
if (alen < HFIXEDSZ)
|
||||||
|
return ARES_EBADRESP;
|
||||||
|
|
||||||
|
/* Fetch the question and answer count from the header. */
|
||||||
|
qdcount = DNS_HEADER_QDCOUNT (abuf);
|
||||||
|
ancount = DNS_HEADER_ANCOUNT (abuf);
|
||||||
|
if (qdcount != 1)
|
||||||
|
return ARES_EBADRESP;
|
||||||
|
if (ancount == 0)
|
||||||
|
return ARES_ENODATA;
|
||||||
|
|
||||||
|
/* Expand the name from the question, and skip past the question. */
|
||||||
|
aptr = abuf + HFIXEDSZ;
|
||||||
|
status = ares_expand_name (aptr, abuf, alen, &hostname, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
if (aptr + len + QFIXEDSZ > abuf + alen)
|
||||||
|
{
|
||||||
|
free (hostname);
|
||||||
|
return ARES_EBADRESP;
|
||||||
|
}
|
||||||
|
aptr += len + QFIXEDSZ;
|
||||||
|
|
||||||
|
/* Allocate ares_txt_reply array; ancount gives an upper bound */
|
||||||
|
txt = malloc ((ancount) * sizeof (struct ares_txt_reply));
|
||||||
|
if (!txt)
|
||||||
|
{
|
||||||
|
free (hostname);
|
||||||
|
return ARES_ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialize ares_txt_reply array */
|
||||||
|
for (i = 0; i < ancount; i++)
|
||||||
|
{
|
||||||
|
txt[i].txt = NULL;
|
||||||
|
txt[i].length = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Examine each answer resource record (RR) in turn. */
|
||||||
|
for (i = 0; i < ancount; i++)
|
||||||
|
{
|
||||||
|
/* Decode the RR up to the data field. */
|
||||||
|
status = ares_expand_name (aptr, abuf, alen, &rr_name, &len);
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
aptr += len;
|
||||||
|
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||||
|
{
|
||||||
|
status = ARES_EBADRESP;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
rr_type = DNS_RR_TYPE (aptr);
|
||||||
|
rr_class = DNS_RR_CLASS (aptr);
|
||||||
|
rr_len = DNS_RR_LEN (aptr);
|
||||||
|
aptr += RRFIXEDSZ;
|
||||||
|
|
||||||
|
/* Check if we are really looking at a TXT record */
|
||||||
|
if (rr_class == C_IN && rr_type == T_TXT)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* There may be multiple substrings in a single TXT record. Each
|
||||||
|
* substring may be up to 255 characters in length, with a
|
||||||
|
* "length byte" indicating the size of the substring payload.
|
||||||
|
* RDATA contains both the length-bytes and payloads of all
|
||||||
|
* substrings contained therein.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Compute total length to allow a single memory allocation */
|
||||||
|
strptr = aptr;
|
||||||
|
while (strptr < (aptr + rr_len))
|
||||||
|
{
|
||||||
|
substr_len = (unsigned char)*strptr;
|
||||||
|
txt[i].length += substr_len;
|
||||||
|
strptr += substr_len + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Including null byte */
|
||||||
|
txt[i].txt = malloc (txt[i].length + 1);
|
||||||
|
if (txt[i].txt == NULL)
|
||||||
|
{
|
||||||
|
status = ARES_ENOMEM;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Step through the list of substrings, concatenating them */
|
||||||
|
str_len = 0;
|
||||||
|
strptr = aptr;
|
||||||
|
while (strptr < (aptr + rr_len))
|
||||||
|
{
|
||||||
|
substr_len = (unsigned char)*strptr;
|
||||||
|
strptr++;
|
||||||
|
memcpy ((char *) txt[i].txt + str_len, strptr, substr_len);
|
||||||
|
str_len += substr_len;
|
||||||
|
strptr += substr_len;
|
||||||
|
}
|
||||||
|
/* Make sure we NULL-terminate */
|
||||||
|
txt[i].txt[txt[i].length] = '\0';
|
||||||
|
|
||||||
|
/* Move on to the next record */
|
||||||
|
aptr += rr_len;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Don't lose memory in the next iteration */
|
||||||
|
free (rr_name);
|
||||||
|
rr_name = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hostname)
|
||||||
|
free (hostname);
|
||||||
|
if (rr_name)
|
||||||
|
free (rr_name);
|
||||||
|
|
||||||
|
/* clean up on error */
|
||||||
|
if (status != ARES_SUCCESS)
|
||||||
|
{
|
||||||
|
for (i = 0; i < ancount; i++)
|
||||||
|
{
|
||||||
|
if (txt[i].txt)
|
||||||
|
free (txt[i].txt);
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* everything looks fine, return the data */
|
||||||
|
*txt_out = txt;
|
||||||
|
*ntxtreply = ancount;
|
||||||
|
|
||||||
|
return ARES_SUCCESS;
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
* Copyright (C) 2004-2009 by Daniel Stenberg
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
* software and its documentation for any purpose and without
|
* software and its documentation for any purpose and without
|
||||||
@@ -31,24 +32,20 @@
|
|||||||
|
|
||||||
#if !defined(WIN32) || defined(WATT32)
|
#if !defined(WIN32) || defined(WATT32)
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
/* We define closesocket() here so that we can use this function all over
|
|
||||||
the source code for closing sockets. */
|
|
||||||
#define closesocket(x) close(x)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WATT32
|
#ifdef WATT32
|
||||||
#include <tcp.h>
|
#include <tcp.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#undef closesocket
|
|
||||||
#define closesocket(s) close_s(s)
|
|
||||||
#define writev(s,v,c) writev_s(s,v,c)
|
#define writev(s,v,c) writev_s(s,v,c)
|
||||||
|
#define HAVE_WRITEV 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NETWARE
|
#ifdef NETWARE
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEFAULT_TIMEOUT 5
|
#define DEFAULT_TIMEOUT 5000 /* milliseconds */
|
||||||
#define DEFAULT_TRIES 4
|
#define DEFAULT_TRIES 4
|
||||||
#ifndef INADDR_NONE
|
#ifndef INADDR_NONE
|
||||||
#define INADDR_NONE 0xffffffff
|
#define INADDR_NONE 0xffffffff
|
||||||
@@ -93,6 +90,36 @@
|
|||||||
#include "ares_ipv6.h"
|
#include "ares_ipv6.h"
|
||||||
#include "ares_llist.h"
|
#include "ares_llist.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_STRDUP
|
||||||
|
# include "ares_strdup.h"
|
||||||
|
# define strdup(ptr) ares_strdup(ptr)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRCASECMP
|
||||||
|
# include "ares_strcasecmp.h"
|
||||||
|
# define strcasecmp(p1,p2) ares_strcasecmp(p1,p2)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRNCASECMP
|
||||||
|
# include "ares_strcasecmp.h"
|
||||||
|
# define strncasecmp(p1,p2,n) ares_strncasecmp(p1,p2,n)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_WRITEV
|
||||||
|
# include "ares_writev.h"
|
||||||
|
# define writev(s,ptr,cnt) ares_writev(s,ptr,cnt)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct ares_addr {
|
||||||
|
int family;
|
||||||
|
union {
|
||||||
|
struct in_addr addr4;
|
||||||
|
struct in6_addr addr6;
|
||||||
|
} addr;
|
||||||
|
};
|
||||||
|
#define addrV4 addr.addr4
|
||||||
|
#define addrV6 addr.addr6
|
||||||
|
|
||||||
struct query;
|
struct query;
|
||||||
|
|
||||||
struct send_request {
|
struct send_request {
|
||||||
@@ -149,7 +176,7 @@ struct server_state {
|
|||||||
struct query {
|
struct query {
|
||||||
/* Query ID from qbuf, for faster lookup, and current timeout */
|
/* Query ID from qbuf, for faster lookup, and current timeout */
|
||||||
unsigned short qid;
|
unsigned short qid;
|
||||||
time_t timeout;
|
struct timeval timeout;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Links for the doubly-linked lists in which we insert a query.
|
* Links for the doubly-linked lists in which we insert a query.
|
||||||
@@ -173,8 +200,8 @@ struct query {
|
|||||||
void *arg;
|
void *arg;
|
||||||
|
|
||||||
/* Query status */
|
/* Query status */
|
||||||
int try;
|
int try; /* Number of times we tried this query already. */
|
||||||
int server;
|
int server; /* Server this query has last been sent to. */
|
||||||
struct query_server_info *server_info; /* per-server state */
|
struct query_server_info *server_info; /* per-server state */
|
||||||
int using_tcp;
|
int using_tcp;
|
||||||
int error_status;
|
int error_status;
|
||||||
@@ -191,16 +218,16 @@ struct query_server_info {
|
|||||||
#define PATTERN_MASK 0x1
|
#define PATTERN_MASK 0x1
|
||||||
#define PATTERN_CIDR 0x2
|
#define PATTERN_CIDR 0x2
|
||||||
|
|
||||||
union ares_addr {
|
|
||||||
struct in_addr addr4;
|
|
||||||
struct in6_addr addr6;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct apattern {
|
struct apattern {
|
||||||
union ares_addr addr;
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
union ares_addr addr;
|
struct in_addr addr4;
|
||||||
|
struct in6_addr addr6;
|
||||||
|
} addr;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
struct in_addr addr4;
|
||||||
|
struct in6_addr addr6;
|
||||||
unsigned short bits;
|
unsigned short bits;
|
||||||
} mask;
|
} mask;
|
||||||
int family;
|
int family;
|
||||||
@@ -217,9 +244,10 @@ typedef struct rc4_key
|
|||||||
struct ares_channeldata {
|
struct ares_channeldata {
|
||||||
/* Configuration data */
|
/* Configuration data */
|
||||||
int flags;
|
int flags;
|
||||||
int timeout;
|
int timeout; /* in milliseconds */
|
||||||
int tries;
|
int tries;
|
||||||
int ndots;
|
int ndots;
|
||||||
|
int rotate; /* if true, all servers specified are used */
|
||||||
int udp_port;
|
int udp_port;
|
||||||
int tcp_port;
|
int tcp_port;
|
||||||
int socket_send_buffer_size;
|
int socket_send_buffer_size;
|
||||||
@@ -230,6 +258,8 @@ struct ares_channeldata {
|
|||||||
int nsort;
|
int nsort;
|
||||||
char *lookups;
|
char *lookups;
|
||||||
|
|
||||||
|
int optmask; /* the option bitfield passed in at init time */
|
||||||
|
|
||||||
/* Server addresses and communications state */
|
/* Server addresses and communications state */
|
||||||
struct server_state *servers;
|
struct server_state *servers;
|
||||||
int nservers;
|
int nservers;
|
||||||
@@ -242,9 +272,13 @@ struct ares_channeldata {
|
|||||||
/* Generation number to use for the next TCP socket open/close */
|
/* Generation number to use for the next TCP socket open/close */
|
||||||
int tcp_connection_generation;
|
int tcp_connection_generation;
|
||||||
|
|
||||||
/* The time at which we last called process_timeouts() */
|
/* The time at which we last called process_timeouts(). Uses integer seconds
|
||||||
|
just to draw the line somewhere. */
|
||||||
time_t last_timeout_processed;
|
time_t last_timeout_processed;
|
||||||
|
|
||||||
|
/* Last server we sent a query to. */
|
||||||
|
int last_server;
|
||||||
|
|
||||||
/* Circular, doubly-linked list of queries, bucketed various ways.... */
|
/* Circular, doubly-linked list of queries, bucketed various ways.... */
|
||||||
/* All active queries in a single list: */
|
/* All active queries in a single list: */
|
||||||
struct list_node all_queries;
|
struct list_node all_queries;
|
||||||
@@ -257,15 +291,37 @@ struct ares_channeldata {
|
|||||||
|
|
||||||
ares_sock_state_cb sock_state_cb;
|
ares_sock_state_cb sock_state_cb;
|
||||||
void *sock_state_cb_data;
|
void *sock_state_cb_data;
|
||||||
|
|
||||||
|
ares_sock_create_callback sock_create_cb;
|
||||||
|
void *sock_create_cb_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* return true if now is exactly check time or later */
|
||||||
|
int ares__timedout(struct timeval *now,
|
||||||
|
struct timeval *check);
|
||||||
|
/* add the specific number of milliseconds to the time in the first argument */
|
||||||
|
int ares__timeadd(struct timeval *now,
|
||||||
|
int millisecs);
|
||||||
|
/* return time offset between now and (future) check, in milliseconds */
|
||||||
|
long ares__timeoffset(struct timeval *now,
|
||||||
|
struct timeval *check);
|
||||||
|
/* returns ARES_SUCCESS if library has been initialized */
|
||||||
|
int ares_library_initialized(void);
|
||||||
void ares__rc4(rc4_key* key,unsigned char *buffer_ptr, int buffer_len);
|
void ares__rc4(rc4_key* key,unsigned char *buffer_ptr, int buffer_len);
|
||||||
void ares__send_query(ares_channel channel, struct query *query, time_t now);
|
void ares__send_query(ares_channel channel, struct query *query,
|
||||||
|
struct timeval *now);
|
||||||
void ares__close_sockets(ares_channel channel, struct server_state *server);
|
void ares__close_sockets(ares_channel channel, struct server_state *server);
|
||||||
int ares__get_hostent(FILE *fp, int family, struct hostent **host);
|
int ares__get_hostent(FILE *fp, int family, struct hostent **host);
|
||||||
int ares__read_line(FILE *fp, char **buf, int *bufsize);
|
int ares__read_line(FILE *fp, char **buf, size_t *bufsize);
|
||||||
void ares__free_query(struct query *query);
|
void ares__free_query(struct query *query);
|
||||||
short ares__generate_new_id(rc4_key* key);
|
unsigned short ares__generate_new_id(rc4_key* key);
|
||||||
|
struct timeval ares__tvnow(void);
|
||||||
|
int ares__expand_name_for_response(const unsigned char *encoded,
|
||||||
|
const unsigned char *abuf, int alen,
|
||||||
|
char **s, long *enclen);
|
||||||
|
#if 0 /* Not used */
|
||||||
|
long ares__tvdiff(struct timeval t1, struct timeval t2);
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ARES_SWAP_BYTE(a,b) \
|
#define ARES_SWAP_BYTE(a,b) \
|
||||||
{ unsigned char swapByte = *(a); *(a) = *(b); *(b) = swapByte; }
|
{ unsigned char swapByte = *(a); *(a) = *(b); *(b) = swapByte; }
|
||||||
@@ -279,8 +335,8 @@ short ares__generate_new_id(rc4_key* key);
|
|||||||
#ifdef CURLDEBUG
|
#ifdef CURLDEBUG
|
||||||
/* This is low-level hard-hacking memory leak tracking and similar. Using the
|
/* This is low-level hard-hacking memory leak tracking and similar. Using the
|
||||||
libcurl lowlevel code from within library is ugly and only works when
|
libcurl lowlevel code from within library is ugly and only works when
|
||||||
c-ares is built and linked with a similarly debug-build libcurl, but we do
|
c-ares is built and linked with a similarly curldebug-enabled libcurl,
|
||||||
this anyway for convenience. */
|
but we do this anyway for convenience. */
|
||||||
#include "../lib/memdebug.h"
|
#include "../lib/memdebug.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
* Copyright (C) 2004-2009 by Daniel Stenberg
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
* software and its documentation for any purpose and without
|
* software and its documentation for any purpose and without
|
||||||
@@ -15,43 +16,47 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
|
||||||
#include "nameser.h"
|
|
||||||
|
|
||||||
#else
|
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
# include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_UIO_H
|
#ifdef HAVE_SYS_UIO_H
|
||||||
#include <sys/uio.h>
|
# include <sys/uio.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h> /* <netinet/tcp.h> may need it */
|
# include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_TCP_H
|
#ifdef HAVE_NETINET_TCP_H
|
||||||
#include <netinet/tcp.h> /* for TCP_NODELAY */
|
# include <netinet/tcp.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETDB_H
|
#ifdef HAVE_NETDB_H
|
||||||
#include <netdb.h>
|
# include <netdb.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ARPA_NAMESER_H
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
#include <arpa/nameser.h>
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
#include <arpa/nameser_compat.h>
|
# include <arpa/nameser_compat.h>
|
||||||
#endif
|
#endif
|
||||||
#endif /* WIN32 && !WATT32 */
|
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_TIME_H
|
||||||
|
# include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
# include <strings.h>
|
||||||
|
#endif
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_IOCTL_H
|
#ifdef HAVE_SYS_IOCTL_H
|
||||||
#include <sys/ioctl.h>
|
# include <sys/ioctl.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef NETWARE
|
#ifdef NETWARE
|
||||||
#include <sys/filio.h>
|
# include <sys/filio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@@ -68,21 +73,25 @@
|
|||||||
|
|
||||||
static int try_again(int errnum);
|
static int try_again(int errnum);
|
||||||
static void write_tcp_data(ares_channel channel, fd_set *write_fds,
|
static void write_tcp_data(ares_channel channel, fd_set *write_fds,
|
||||||
ares_socket_t write_fd, time_t now);
|
ares_socket_t write_fd, struct timeval *now);
|
||||||
static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
||||||
ares_socket_t read_fd, time_t now);
|
ares_socket_t read_fd, struct timeval *now);
|
||||||
static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
||||||
ares_socket_t read_fd, time_t now);
|
ares_socket_t read_fd, struct timeval *now);
|
||||||
static void advance_tcp_send_queue(ares_channel channel, int whichserver,
|
static void advance_tcp_send_queue(ares_channel channel, int whichserver,
|
||||||
ssize_t num_bytes);
|
ssize_t num_bytes);
|
||||||
static void process_timeouts(ares_channel channel, time_t now);
|
static void process_timeouts(ares_channel channel, struct timeval *now);
|
||||||
static void process_broken_connections(ares_channel channel, time_t now);
|
static void process_broken_connections(ares_channel channel,
|
||||||
|
struct timeval *now);
|
||||||
static void process_answer(ares_channel channel, unsigned char *abuf,
|
static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||||
int alen, int whichserver, int tcp, time_t now);
|
int alen, int whichserver, int tcp,
|
||||||
static void handle_error(ares_channel channel, int whichserver, time_t now);
|
struct timeval *now);
|
||||||
|
static void handle_error(ares_channel channel, int whichserver,
|
||||||
|
struct timeval *now);
|
||||||
static void skip_server(ares_channel channel, struct query *query,
|
static void skip_server(ares_channel channel, struct query *query,
|
||||||
int whichserver);
|
int whichserver);
|
||||||
static void next_server(ares_channel channel, struct query *query, time_t now);
|
static void next_server(ares_channel channel, struct query *query,
|
||||||
|
struct timeval *now);
|
||||||
static int configure_socket(int s, ares_channel channel);
|
static int configure_socket(int s, ares_channel channel);
|
||||||
static int open_tcp_socket(ares_channel channel, struct server_state *server);
|
static int open_tcp_socket(ares_channel channel, struct server_state *server);
|
||||||
static int open_udp_socket(ares_channel channel, struct server_state *server);
|
static int open_udp_socket(ares_channel channel, struct server_state *server);
|
||||||
@@ -91,19 +100,57 @@ static int same_questions(const unsigned char *qbuf, int qlen,
|
|||||||
static void end_query(ares_channel channel, struct query *query, int status,
|
static void end_query(ares_channel channel, struct query *query, int status,
|
||||||
unsigned char *abuf, int alen);
|
unsigned char *abuf, int alen);
|
||||||
|
|
||||||
|
/* return true if now is exactly check time or later */
|
||||||
|
int ares__timedout(struct timeval *now,
|
||||||
|
struct timeval *check)
|
||||||
|
{
|
||||||
|
long secs = (now->tv_sec - check->tv_sec);
|
||||||
|
|
||||||
|
if(secs > 0)
|
||||||
|
return 1; /* yes, timed out */
|
||||||
|
if(secs < 0)
|
||||||
|
return 0; /* nope, not timed out */
|
||||||
|
|
||||||
|
/* if the full seconds were identical, check the sub second parts */
|
||||||
|
return (now->tv_usec - check->tv_usec >= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* add the specific number of milliseconds to the time in the first argument */
|
||||||
|
int ares__timeadd(struct timeval *now,
|
||||||
|
int millisecs)
|
||||||
|
{
|
||||||
|
now->tv_sec += millisecs/1000;
|
||||||
|
now->tv_usec += (millisecs%1000)*1000;
|
||||||
|
|
||||||
|
if(now->tv_usec >= 1000000) {
|
||||||
|
++(now->tv_sec);
|
||||||
|
now->tv_usec -= 1000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return time offset between now and (future) check, in milliseconds */
|
||||||
|
long ares__timeoffset(struct timeval *now,
|
||||||
|
struct timeval *check)
|
||||||
|
{
|
||||||
|
return (check->tv_sec - now->tv_sec)*1000 +
|
||||||
|
(check->tv_usec - now->tv_usec)/1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Something interesting happened on the wire, or there was a timeout.
|
/* Something interesting happened on the wire, or there was a timeout.
|
||||||
* See what's up and respond accordingly.
|
* See what's up and respond accordingly.
|
||||||
*/
|
*/
|
||||||
void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
|
void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds)
|
||||||
{
|
{
|
||||||
time_t now;
|
struct timeval now = ares__tvnow();
|
||||||
|
|
||||||
time(&now);
|
write_tcp_data(channel, write_fds, ARES_SOCKET_BAD, &now);
|
||||||
write_tcp_data(channel, write_fds, ARES_SOCKET_BAD, now);
|
read_tcp_data(channel, read_fds, ARES_SOCKET_BAD, &now);
|
||||||
read_tcp_data(channel, read_fds, ARES_SOCKET_BAD, now);
|
read_udp_packets(channel, read_fds, ARES_SOCKET_BAD, &now);
|
||||||
read_udp_packets(channel, read_fds, ARES_SOCKET_BAD, now);
|
process_timeouts(channel, &now);
|
||||||
process_timeouts(channel, now);
|
process_broken_connections(channel, &now);
|
||||||
process_broken_connections(channel, now);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Something interesting happened on the wire, or there was a timeout.
|
/* Something interesting happened on the wire, or there was a timeout.
|
||||||
@@ -114,13 +161,12 @@ void ares_process_fd(ares_channel channel,
|
|||||||
file descriptors */
|
file descriptors */
|
||||||
ares_socket_t write_fd)
|
ares_socket_t write_fd)
|
||||||
{
|
{
|
||||||
time_t now;
|
struct timeval now = ares__tvnow();
|
||||||
|
|
||||||
time(&now);
|
write_tcp_data(channel, NULL, write_fd, &now);
|
||||||
write_tcp_data(channel, NULL, write_fd, now);
|
read_tcp_data(channel, NULL, read_fd, &now);
|
||||||
read_tcp_data(channel, NULL, read_fd, now);
|
read_udp_packets(channel, NULL, read_fd, &now);
|
||||||
read_udp_packets(channel, NULL, read_fd, now);
|
process_timeouts(channel, &now);
|
||||||
process_timeouts(channel, now);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -155,7 +201,7 @@ static int try_again(int errnum)
|
|||||||
static void write_tcp_data(ares_channel channel,
|
static void write_tcp_data(ares_channel channel,
|
||||||
fd_set *write_fds,
|
fd_set *write_fds,
|
||||||
ares_socket_t write_fd,
|
ares_socket_t write_fd,
|
||||||
time_t now)
|
struct timeval *now)
|
||||||
{
|
{
|
||||||
struct server_state *server;
|
struct server_state *server;
|
||||||
struct send_request *sendreq;
|
struct send_request *sendreq;
|
||||||
@@ -174,7 +220,8 @@ static void write_tcp_data(ares_channel channel,
|
|||||||
/* Make sure server has data to send and is selected in write_fds or
|
/* Make sure server has data to send and is selected in write_fds or
|
||||||
write_fd. */
|
write_fd. */
|
||||||
server = &channel->servers[i];
|
server = &channel->servers[i];
|
||||||
if (!server->qhead || server->tcp_socket == ARES_SOCKET_BAD || server->is_broken)
|
if (!server->qhead || server->tcp_socket == ARES_SOCKET_BAD ||
|
||||||
|
server->is_broken)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(write_fds) {
|
if(write_fds) {
|
||||||
@@ -278,7 +325,7 @@ static void advance_tcp_send_queue(ares_channel channel, int whichserver,
|
|||||||
* a packet if we finish reading one.
|
* a packet if we finish reading one.
|
||||||
*/
|
*/
|
||||||
static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
||||||
ares_socket_t read_fd, time_t now)
|
ares_socket_t read_fd, struct timeval *now)
|
||||||
{
|
{
|
||||||
struct server_state *server;
|
struct server_state *server;
|
||||||
int i;
|
int i;
|
||||||
@@ -374,12 +421,16 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds,
|
|||||||
|
|
||||||
/* If any UDP sockets select true for reading, process them. */
|
/* If any UDP sockets select true for reading, process them. */
|
||||||
static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
||||||
ares_socket_t read_fd, time_t now)
|
ares_socket_t read_fd, struct timeval *now)
|
||||||
{
|
{
|
||||||
struct server_state *server;
|
struct server_state *server;
|
||||||
int i;
|
int i;
|
||||||
ssize_t count;
|
ssize_t count;
|
||||||
unsigned char buf[PACKETSZ + 1];
|
unsigned char buf[PACKETSZ + 1];
|
||||||
|
#ifdef HAVE_RECVFROM
|
||||||
|
struct sockaddr_in from;
|
||||||
|
ares_socklen_t fromlen;
|
||||||
|
#endif
|
||||||
|
|
||||||
if(!read_fds && (read_fd == ARES_SOCKET_BAD))
|
if(!read_fds && (read_fd == ARES_SOCKET_BAD))
|
||||||
/* no possible action */
|
/* no possible action */
|
||||||
@@ -413,11 +464,24 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
|||||||
/* To reduce event loop overhead, read and process as many
|
/* To reduce event loop overhead, read and process as many
|
||||||
* packets as we can. */
|
* packets as we can. */
|
||||||
do {
|
do {
|
||||||
|
#ifdef HAVE_RECVFROM
|
||||||
|
fromlen = sizeof(from);
|
||||||
|
count = (ssize_t)recvfrom(server->udp_socket, (void *)buf, sizeof(buf),
|
||||||
|
0, (struct sockaddr *)&from, &fromlen);
|
||||||
|
#else
|
||||||
count = sread(server->udp_socket, buf, sizeof(buf));
|
count = sread(server->udp_socket, buf, sizeof(buf));
|
||||||
|
#endif
|
||||||
if (count == -1 && try_again(SOCKERRNO))
|
if (count == -1 && try_again(SOCKERRNO))
|
||||||
continue;
|
continue;
|
||||||
else if (count <= 0)
|
else if (count <= 0)
|
||||||
handle_error(channel, i, now);
|
handle_error(channel, i, now);
|
||||||
|
#ifdef HAVE_RECVFROM
|
||||||
|
else if (from.sin_addr.s_addr != server->addr.s_addr)
|
||||||
|
/* Address response came from did not match the address
|
||||||
|
* we sent the request to. Someone may be attempting
|
||||||
|
* to perform a cache poisoning attack */
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
process_answer(channel, buf, (int)count, i, 0, now);
|
process_answer(channel, buf, (int)count, i, 0, now);
|
||||||
} while (count > 0);
|
} while (count > 0);
|
||||||
@@ -425,7 +489,7 @@ static void read_udp_packets(ares_channel channel, fd_set *read_fds,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If any queries have timed out, note the timeout and move them on. */
|
/* If any queries have timed out, note the timeout and move them on. */
|
||||||
static void process_timeouts(ares_channel channel, time_t now)
|
static void process_timeouts(ares_channel channel, struct timeval *now)
|
||||||
{
|
{
|
||||||
time_t t; /* the time of the timeouts we're processing */
|
time_t t; /* the time of the timeouts we're processing */
|
||||||
struct query *query;
|
struct query *query;
|
||||||
@@ -438,14 +502,14 @@ static void process_timeouts(ares_channel channel, time_t now)
|
|||||||
* only a handful of requests that fall into the "now" bucket, so
|
* only a handful of requests that fall into the "now" bucket, so
|
||||||
* this should be quite quick.
|
* this should be quite quick.
|
||||||
*/
|
*/
|
||||||
for (t = channel->last_timeout_processed; t <= now; t++)
|
for (t = channel->last_timeout_processed; t <= now->tv_sec; t++)
|
||||||
{
|
{
|
||||||
list_head = &(channel->queries_by_timeout[t % ARES_TIMEOUT_TABLE_SIZE]);
|
list_head = &(channel->queries_by_timeout[t % ARES_TIMEOUT_TABLE_SIZE]);
|
||||||
for (list_node = list_head->next; list_node != list_head; )
|
for (list_node = list_head->next; list_node != list_head; )
|
||||||
{
|
{
|
||||||
query = list_node->data;
|
query = list_node->data;
|
||||||
list_node = list_node->next; /* in case the query gets deleted */
|
list_node = list_node->next; /* in case the query gets deleted */
|
||||||
if (query->timeout != 0 && now >= query->timeout)
|
if (query->timeout.tv_sec && ares__timedout(now, &query->timeout))
|
||||||
{
|
{
|
||||||
query->error_status = ARES_ETIMEOUT;
|
query->error_status = ARES_ETIMEOUT;
|
||||||
++query->timeouts;
|
++query->timeouts;
|
||||||
@@ -453,12 +517,13 @@ static void process_timeouts(ares_channel channel, time_t now)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
channel->last_timeout_processed = now;
|
channel->last_timeout_processed = now->tv_sec;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle an answer from a server. */
|
/* Handle an answer from a server. */
|
||||||
static void process_answer(ares_channel channel, unsigned char *abuf,
|
static void process_answer(ares_channel channel, unsigned char *abuf,
|
||||||
int alen, int whichserver, int tcp, time_t now)
|
int alen, int whichserver, int tcp,
|
||||||
|
struct timeval *now)
|
||||||
{
|
{
|
||||||
int tc, rcode;
|
int tc, rcode;
|
||||||
unsigned short id;
|
unsigned short id;
|
||||||
@@ -536,7 +601,8 @@ static void process_answer(ares_channel channel, unsigned char *abuf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Close all the connections that are no longer usable. */
|
/* Close all the connections that are no longer usable. */
|
||||||
static void process_broken_connections(ares_channel channel, time_t now)
|
static void process_broken_connections(ares_channel channel,
|
||||||
|
struct timeval *now)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < channel->nservers; i++)
|
for (i = 0; i < channel->nservers; i++)
|
||||||
@@ -549,7 +615,8 @@ static void process_broken_connections(ares_channel channel, time_t now)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_error(ares_channel channel, int whichserver, time_t now)
|
static void handle_error(ares_channel channel, int whichserver,
|
||||||
|
struct timeval *now)
|
||||||
{
|
{
|
||||||
struct server_state *server;
|
struct server_state *server;
|
||||||
struct query *query;
|
struct query *query;
|
||||||
@@ -600,15 +667,21 @@ static void skip_server(ares_channel channel, struct query *query,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void next_server(ares_channel channel, struct query *query, time_t now)
|
static void next_server(ares_channel channel, struct query *query,
|
||||||
|
struct timeval *now)
|
||||||
{
|
{
|
||||||
/* Advance to the next server or try. */
|
/* We need to try each server channel->tries times. We have channel->nservers
|
||||||
query->server++;
|
* servers to try. In total, we need to do channel->nservers * channel->tries
|
||||||
for (; query->try < channel->tries; query->try++)
|
* attempts. Use query->try to remember how many times we already attempted
|
||||||
|
* this query. Use modular arithmetic to find the next server to try. */
|
||||||
|
while (++(query->try) < (channel->nservers * channel->tries))
|
||||||
{
|
{
|
||||||
for (; query->server < channel->nservers; query->server++)
|
struct server_state *server;
|
||||||
{
|
|
||||||
struct server_state *server = &channel->servers[query->server];
|
/* Move on to the next server. */
|
||||||
|
query->server = (query->server + 1) % channel->nservers;
|
||||||
|
server = &channel->servers[query->server];
|
||||||
|
|
||||||
/* We don't want to use this server if (1) we decided this
|
/* We don't want to use this server if (1) we decided this
|
||||||
* connection is broken, and thus about to be closed, (2)
|
* connection is broken, and thus about to be closed, (2)
|
||||||
* we've decided to skip this server because of earlier
|
* we've decided to skip this server because of earlier
|
||||||
@@ -624,8 +697,6 @@ static void next_server(ares_channel channel, struct query *query, time_t now)
|
|||||||
ares__send_query(channel, query, now);
|
ares__send_query(channel, query, now);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
query->server = 0;
|
|
||||||
|
|
||||||
/* You might think that with TCP we only need one try. However,
|
/* You might think that with TCP we only need one try. However,
|
||||||
* even when using TCP, servers can time-out our connection just
|
* even when using TCP, servers can time-out our connection just
|
||||||
@@ -634,13 +705,17 @@ static void next_server(ares_channel channel, struct query *query, time_t now)
|
|||||||
* tickle a bug that drops our request.
|
* tickle a bug that drops our request.
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we are here, all attempts to perform query failed. */
|
||||||
end_query(channel, query, query->error_status, NULL, 0);
|
end_query(channel, query, query->error_status, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
void ares__send_query(ares_channel channel, struct query *query,
|
||||||
|
struct timeval *now)
|
||||||
{
|
{
|
||||||
struct send_request *sendreq;
|
struct send_request *sendreq;
|
||||||
struct server_state *server;
|
struct server_state *server;
|
||||||
|
int timeplus;
|
||||||
|
|
||||||
server = &channel->servers[query->server];
|
server = &channel->servers[query->server];
|
||||||
if (query->using_tcp)
|
if (query->using_tcp)
|
||||||
@@ -704,16 +779,18 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
query->timeout = now
|
timeplus = channel->timeout << (query->try / channel->nservers);
|
||||||
+ ((query->try == 0) ? channel->timeout
|
timeplus = (timeplus * (9 + (rand () & 7))) / 16;
|
||||||
: channel->timeout << query->try / channel->nservers);
|
query->timeout = *now;
|
||||||
|
ares__timeadd(&query->timeout,
|
||||||
|
timeplus);
|
||||||
/* Keep track of queries bucketed by timeout, so we can process
|
/* Keep track of queries bucketed by timeout, so we can process
|
||||||
* timeout events quickly.
|
* timeout events quickly.
|
||||||
*/
|
*/
|
||||||
ares__remove_from_list(&(query->queries_by_timeout));
|
ares__remove_from_list(&(query->queries_by_timeout));
|
||||||
ares__insert_in_list(
|
ares__insert_in_list(
|
||||||
&(query->queries_by_timeout),
|
&(query->queries_by_timeout),
|
||||||
&(channel->queries_by_timeout[query->timeout %
|
&(channel->queries_by_timeout[query->timeout.tv_sec %
|
||||||
ARES_TIMEOUT_TABLE_SIZE]));
|
ARES_TIMEOUT_TABLE_SIZE]));
|
||||||
|
|
||||||
/* Keep track of queries bucketed by server, so we can process server
|
/* Keep track of queries bucketed by server, so we can process server
|
||||||
@@ -731,68 +808,51 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
|
|||||||
static int setsocknonblock(ares_socket_t sockfd, /* operate on this */
|
static int setsocknonblock(ares_socket_t sockfd, /* operate on this */
|
||||||
int nonblock /* TRUE or FALSE */)
|
int nonblock /* TRUE or FALSE */)
|
||||||
{
|
{
|
||||||
#undef SETBLOCK
|
#if defined(USE_BLOCKING_SOCKETS)
|
||||||
#define SETBLOCK 0
|
|
||||||
#ifdef HAVE_O_NONBLOCK
|
return 0; /* returns success */
|
||||||
|
|
||||||
|
#elif defined(HAVE_FCNTL_O_NONBLOCK)
|
||||||
|
|
||||||
/* most recent unix versions */
|
/* most recent unix versions */
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
flags = fcntl(sockfd, F_GETFL, 0);
|
flags = fcntl(sockfd, F_GETFL, 0);
|
||||||
if (FALSE != nonblock)
|
if (FALSE != nonblock)
|
||||||
return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);
|
return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);
|
||||||
else
|
else
|
||||||
return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK));
|
return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK));
|
||||||
#undef SETBLOCK
|
|
||||||
#define SETBLOCK 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HAVE_FIONBIO) && (SETBLOCK == 0)
|
#elif defined(HAVE_IOCTL_FIONBIO)
|
||||||
|
|
||||||
/* older unix versions */
|
/* older unix versions */
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
flags = nonblock;
|
flags = nonblock;
|
||||||
return ioctl(sockfd, FIONBIO, &flags);
|
return ioctl(sockfd, FIONBIO, &flags);
|
||||||
#undef SETBLOCK
|
|
||||||
#define SETBLOCK 2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HAVE_IOCTLSOCKET) && (SETBLOCK == 0)
|
#elif defined(HAVE_IOCTLSOCKET_FIONBIO)
|
||||||
|
|
||||||
#ifdef WATT32
|
#ifdef WATT32
|
||||||
char flags;
|
char flags;
|
||||||
#else
|
#else
|
||||||
/* Windows? */
|
/* Windows */
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
#endif
|
#endif
|
||||||
flags = nonblock;
|
flags = nonblock;
|
||||||
|
|
||||||
return ioctlsocket(sockfd, FIONBIO, &flags);
|
return ioctlsocket(sockfd, FIONBIO, &flags);
|
||||||
#undef SETBLOCK
|
|
||||||
#define SETBLOCK 3
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HAVE_IOCTLSOCKET_CASE) && (SETBLOCK == 0)
|
#elif defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO)
|
||||||
/* presumably for Amiga */
|
|
||||||
|
/* Amiga */
|
||||||
return IoctlSocket(sockfd, FIONBIO, (long)nonblock);
|
return IoctlSocket(sockfd, FIONBIO, (long)nonblock);
|
||||||
#undef SETBLOCK
|
|
||||||
#define SETBLOCK 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HAVE_SO_NONBLOCK) && (SETBLOCK == 0)
|
#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK)
|
||||||
|
|
||||||
/* BeOS */
|
/* BeOS */
|
||||||
long b = nonblock ? 1 : 0;
|
long b = nonblock ? 1 : 0;
|
||||||
return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
|
return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
|
||||||
#undef SETBLOCK
|
|
||||||
#define SETBLOCK 5
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_DISABLED_NONBLOCKING
|
#else
|
||||||
return 0; /* returns success */
|
# error "no non-blocking method was found/used/set"
|
||||||
#undef SETBLOCK
|
|
||||||
#define SETBLOCK 6
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (SETBLOCK == 0)
|
|
||||||
#error "no non-blocking method was found/used/set"
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -836,10 +896,11 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
|||||||
/* Configure it. */
|
/* Configure it. */
|
||||||
if (configure_socket(s, channel) < 0)
|
if (configure_socket(s, channel) < 0)
|
||||||
{
|
{
|
||||||
close(s);
|
sclose(s);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef TCP_NODELAY
|
||||||
/*
|
/*
|
||||||
* Disable the Nagle algorithm (only relevant for TCP sockets, and thus not in
|
* Disable the Nagle algorithm (only relevant for TCP sockets, and thus not in
|
||||||
* configure_socket). In general, in DNS lookups we're pretty much interested
|
* configure_socket). In general, in DNS lookups we're pretty much interested
|
||||||
@@ -850,24 +911,38 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
|
|||||||
if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY,
|
if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY,
|
||||||
(void *)&opt, sizeof(opt)) == -1)
|
(void *)&opt, sizeof(opt)) == -1)
|
||||||
{
|
{
|
||||||
close(s);
|
sclose(s);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Connect to the server. */
|
/* Connect to the server. */
|
||||||
memset(&sockin, 0, sizeof(sockin));
|
memset(&sockin, 0, sizeof(sockin));
|
||||||
sockin.sin_family = AF_INET;
|
sockin.sin_family = AF_INET;
|
||||||
sockin.sin_addr = server->addr;
|
sockin.sin_addr = server->addr;
|
||||||
sockin.sin_port = (unsigned short)(channel->tcp_port & 0xffff);
|
sockin.sin_port = (unsigned short)(channel->tcp_port & 0xffff);
|
||||||
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1) {
|
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1)
|
||||||
|
{
|
||||||
int err = SOCKERRNO;
|
int err = SOCKERRNO;
|
||||||
|
|
||||||
if (err != EINPROGRESS && err != EWOULDBLOCK) {
|
if (err != EINPROGRESS && err != EWOULDBLOCK)
|
||||||
closesocket(s);
|
{
|
||||||
|
sclose(s);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (channel->sock_create_cb)
|
||||||
|
{
|
||||||
|
int err = channel->sock_create_cb(s, SOCK_STREAM,
|
||||||
|
channel->sock_create_cb_data);
|
||||||
|
if (err < 0)
|
||||||
|
{
|
||||||
|
sclose(s);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SOCK_STATE_CALLBACK(channel, s, 1, 0);
|
SOCK_STATE_CALLBACK(channel, s, 1, 0);
|
||||||
server->tcp_buffer_pos = 0;
|
server->tcp_buffer_pos = 0;
|
||||||
server->tcp_socket = s;
|
server->tcp_socket = s;
|
||||||
@@ -888,7 +963,7 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
|
|||||||
/* Set the socket non-blocking. */
|
/* Set the socket non-blocking. */
|
||||||
if (configure_socket(s, channel) < 0)
|
if (configure_socket(s, channel) < 0)
|
||||||
{
|
{
|
||||||
close(s);
|
sclose(s);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -899,9 +974,25 @@ static int open_udp_socket(ares_channel channel, struct server_state *server)
|
|||||||
sockin.sin_port = (unsigned short)(channel->udp_port & 0xffff);
|
sockin.sin_port = (unsigned short)(channel->udp_port & 0xffff);
|
||||||
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1)
|
if (connect(s, (struct sockaddr *) &sockin, sizeof(sockin)) == -1)
|
||||||
{
|
{
|
||||||
closesocket(s);
|
int err = SOCKERRNO;
|
||||||
|
|
||||||
|
if (err != EINPROGRESS && err != EWOULDBLOCK)
|
||||||
|
{
|
||||||
|
sclose(s);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (channel->sock_create_cb)
|
||||||
|
{
|
||||||
|
int err = channel->sock_create_cb(s, SOCK_DGRAM,
|
||||||
|
channel->sock_create_cb_data);
|
||||||
|
if (err < 0)
|
||||||
|
{
|
||||||
|
sclose(s);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SOCK_STATE_CALLBACK(channel, s, 1, 0);
|
SOCK_STATE_CALLBACK(channel, s, 1, 0);
|
||||||
|
|
||||||
|
|||||||
@@ -15,16 +15,21 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include "nameser.h"
|
# include <sys/socket.h>
|
||||||
#else
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/nameser.h>
|
|
||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
|
||||||
#include <arpa/nameser_compat.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
# include <arpa/nameser_compat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -65,7 +70,7 @@ void ares__rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len)
|
|||||||
key->y = y;
|
key->y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct query* find_query_by_id(ares_channel channel, int id)
|
static struct query* find_query_by_id(ares_channel channel, unsigned short id)
|
||||||
{
|
{
|
||||||
unsigned short qid;
|
unsigned short qid;
|
||||||
struct list_node* list_head;
|
struct list_node* list_head;
|
||||||
@@ -90,15 +95,15 @@ static struct query* find_query_by_id(ares_channel channel, int id)
|
|||||||
performed per id generation. In practice this search should happen only
|
performed per id generation. In practice this search should happen only
|
||||||
once per newly generated id
|
once per newly generated id
|
||||||
*/
|
*/
|
||||||
static int generate_unique_id(ares_channel channel)
|
static unsigned short generate_unique_id(ares_channel channel)
|
||||||
{
|
{
|
||||||
int id;
|
unsigned short id;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
id = ares__generate_new_id(&channel->id_key);
|
id = ares__generate_new_id(&channel->id_key);
|
||||||
} while (find_query_by_id(channel,id));
|
} while (find_query_by_id(channel, id));
|
||||||
|
|
||||||
return id;
|
return (unsigned short)id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ares_query(ares_channel channel, const char *name, int dnsclass,
|
void ares_query(ares_channel channel, const char *name, int dnsclass,
|
||||||
|
|||||||
145
ares/ares_rules.h
Normal file
145
ares/ares_rules.h
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
#ifndef __CARES_RULES_H
|
||||||
|
#define __CARES_RULES_H
|
||||||
|
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 2009 by Daniel Stenberg et al
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software and its
|
||||||
|
* documentation for any purpose and without fee is hereby granted, provided
|
||||||
|
* that the above copyright notice appear in all copies and that both that
|
||||||
|
* copyright notice and this permission notice appear in supporting
|
||||||
|
* documentation, and that the name of M.I.T. not be used in advertising or
|
||||||
|
* publicity pertaining to distribution of the software without specific,
|
||||||
|
* written prior permission. M.I.T. makes no representations about the
|
||||||
|
* suitability of this software for any purpose. It is provided "as is"
|
||||||
|
* without express or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ================================================================ */
|
||||||
|
/* COMPILE TIME SANITY CHECKS */
|
||||||
|
/* ================================================================ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE 1:
|
||||||
|
* -------
|
||||||
|
*
|
||||||
|
* All checks done in this file are intentionally placed in a public
|
||||||
|
* header file which is pulled by ares.h when an application is
|
||||||
|
* being built using an already built c-ares library. Additionally
|
||||||
|
* this file is also included and used when building the library.
|
||||||
|
*
|
||||||
|
* If compilation fails on this file it is certainly sure that the
|
||||||
|
* problem is elsewhere. It could be a problem in the ares_build.h
|
||||||
|
* header file, or simply that you are using different compilation
|
||||||
|
* settings than those used to build the library.
|
||||||
|
*
|
||||||
|
* Nothing in this file is intended to be modified or adjusted by the
|
||||||
|
* c-ares library user nor by the c-ares library builder.
|
||||||
|
*
|
||||||
|
* Do not deactivate any check, these are done to make sure that the
|
||||||
|
* library is properly built and used.
|
||||||
|
*
|
||||||
|
* You can find further help on the c-ares development mailing list:
|
||||||
|
* http://cool.haxx.se/mailman/listinfo/c-ares/
|
||||||
|
*
|
||||||
|
* NOTE 2
|
||||||
|
* ------
|
||||||
|
*
|
||||||
|
* Some of the following compile time checks are based on the fact
|
||||||
|
* that the dimension of a constant array can not be a negative one.
|
||||||
|
* In this way if the compile time verification fails, the compilation
|
||||||
|
* will fail issuing an error. The error description wording is compiler
|
||||||
|
* dependent but it will be quite similar to one of the following:
|
||||||
|
*
|
||||||
|
* "negative subscript or subscript is too large"
|
||||||
|
* "array must have at least one element"
|
||||||
|
* "-1 is an illegal array size"
|
||||||
|
* "size of array is negative"
|
||||||
|
*
|
||||||
|
* If you are building an application which tries to use an already
|
||||||
|
* built c-ares library and you are getting this kind of errors on
|
||||||
|
* this file, it is a clear indication that there is a mismatch between
|
||||||
|
* how the library was built and how you are trying to use it for your
|
||||||
|
* application. Your already compiled or binary library provider is the
|
||||||
|
* only one who can give you the details you need to properly use it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Verify that some macros are actually defined.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CARES_SIZEOF_LONG
|
||||||
|
# error "CARES_SIZEOF_LONG definition is missing!"
|
||||||
|
Error Compilation_aborted_CARES_SIZEOF_LONG_is_missing
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||||
|
# error "CARES_TYPEOF_ARES_SOCKLEN_T definition is missing!"
|
||||||
|
Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_is_missing
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CARES_SIZEOF_ARES_SOCKLEN_T
|
||||||
|
# error "CARES_SIZEOF_ARES_SOCKLEN_T definition is missing!"
|
||||||
|
Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_is_missing
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Macros private to this header file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define CareschkszEQ(t, s) sizeof(t) == s ? 1 : -1
|
||||||
|
|
||||||
|
#define CareschkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Verify that the size previously defined and expected for long
|
||||||
|
* is the same as the one reported by sizeof() at compile time.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef char
|
||||||
|
__cares_rule_01__
|
||||||
|
[CareschkszEQ(long, CARES_SIZEOF_LONG)];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Verify that the size previously defined and expected for
|
||||||
|
* ares_socklen_t is actually the the same as the one reported
|
||||||
|
* by sizeof() at compile time.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef char
|
||||||
|
__cares_rule_02__
|
||||||
|
[CareschkszEQ(ares_socklen_t, CARES_SIZEOF_ARES_SOCKLEN_T)];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Verify at compile time that the size of ares_socklen_t as reported
|
||||||
|
* by sizeof() is greater or equal than the one reported for int for
|
||||||
|
* the current compilation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef char
|
||||||
|
__cares_rule_03__
|
||||||
|
[CareschkszGE(ares_socklen_t, int)];
|
||||||
|
|
||||||
|
/* ================================================================ */
|
||||||
|
/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
|
||||||
|
/* ================================================================ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get rid of macros private to this header file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#undef CareschkszEQ
|
||||||
|
#undef CareschkszGE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get rid of macros not intended to exist beyond this point.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#undef CARES_PULL_WS2TCPIP_H
|
||||||
|
#undef CARES_PULL_SYS_TYPES_H
|
||||||
|
#undef CARES_PULL_SYS_SOCKET_H
|
||||||
|
|
||||||
|
#undef CARES_TYPEOF_ARES_SOCKLEN_T
|
||||||
|
|
||||||
|
#endif /* __CARES_RULES_H */
|
||||||
@@ -24,9 +24,7 @@ ares_save_options \- Save configuration values obtained from initialized ares_ch
|
|||||||
.B void ares_save_options(ares_channel \fIchannel\fP, struct ares_options *\fIoptions\fP, int *\fIoptmask\fP)
|
.B void ares_save_options(ares_channel \fIchannel\fP, struct ares_options *\fIoptions\fP, int *\fIoptmask\fP)
|
||||||
.fi
|
.fi
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
The
|
The \fBares_save_options(3)\fP function saves the channel data identified by
|
||||||
.B ares_save_options
|
|
||||||
function saves the channel data identified by
|
|
||||||
.IR channel ,
|
.IR channel ,
|
||||||
into the options struct identified by
|
into the options struct identified by
|
||||||
.IR options ,
|
.IR options ,
|
||||||
@@ -38,11 +36,18 @@ The resultant options and optmask are then able to be
|
|||||||
passed directly to ares_init_options. When the options
|
passed directly to ares_init_options. When the options
|
||||||
are no longer needed, ares_destroy_options should be called
|
are no longer needed, ares_destroy_options should be called
|
||||||
to free any associated memory.
|
to free any associated memory.
|
||||||
|
.SH NOTE
|
||||||
|
Since c-ares 1.6.0 the ares_options struct has been "locked" meaning that it
|
||||||
|
won't be extended to cover new funtions. This function will remain
|
||||||
|
functioning, but it can only return config data that can be represented in
|
||||||
|
this config struct, which may no longer be the complete set of config
|
||||||
|
options. \fBares_dup(3)\fP will not have that restriction.
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.BR ares_destroy_options (3),
|
.BR ares_destroy_options (3),
|
||||||
.BR ares_init_options (3)
|
.BR ares_init_options (3),
|
||||||
|
.BR ares_dup (3)
|
||||||
|
.SH AVAILABILITY
|
||||||
|
ares_save_options(3) was added in c-ares 1.4.0
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
Brad House
|
Brad House
|
||||||
.br
|
.br
|
||||||
|
|||||||
@@ -15,15 +15,16 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_STRINGS_H
|
||||||
#include "nameser.h"
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
@@ -237,7 +238,8 @@ static int single_domain(ares_channel channel, const char *name, char **s)
|
|||||||
const char *hostaliases;
|
const char *hostaliases;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char *line = NULL;
|
char *line = NULL;
|
||||||
int linesize, status;
|
int status;
|
||||||
|
size_t linesize;
|
||||||
const char *p, *q;
|
const char *p, *q;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
@@ -291,7 +293,7 @@ static int single_domain(ares_channel channel, const char *name, char **s)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
error = ERRNO;
|
error = errno;
|
||||||
switch(error)
|
switch(error)
|
||||||
{
|
{
|
||||||
case ENOENT:
|
case ENOENT:
|
||||||
|
|||||||
@@ -15,16 +15,21 @@
|
|||||||
* without express or implied warranty.
|
* without express or implied warranty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "setup.h"
|
#include "ares_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(WATT32)
|
#ifdef HAVE_SYS_SOCKET_H
|
||||||
#include "nameser.h"
|
# include <sys/socket.h>
|
||||||
#else
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/nameser.h>
|
|
||||||
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
|
||||||
#include <arpa/nameser_compat.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NETINET_IN_H
|
||||||
|
# include <netinet/in.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_H
|
||||||
|
# include <arpa/nameser.h>
|
||||||
|
#else
|
||||||
|
# include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
|
||||||
|
# include <arpa/nameser_compat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -39,7 +44,7 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
|||||||
{
|
{
|
||||||
struct query *query;
|
struct query *query;
|
||||||
int i;
|
int i;
|
||||||
time_t now;
|
struct timeval now;
|
||||||
|
|
||||||
/* Verify that the query is at least long enough to hold the header. */
|
/* Verify that the query is at least long enough to hold the header. */
|
||||||
if (qlen < HFIXEDSZ || qlen >= (1 << 16))
|
if (qlen < HFIXEDSZ || qlen >= (1 << 16))
|
||||||
@@ -74,7 +79,8 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
|||||||
|
|
||||||
/* Compute the query ID. Start with no timeout. */
|
/* Compute the query ID. Start with no timeout. */
|
||||||
query->qid = (unsigned short)DNS_HEADER_QID(qbuf);
|
query->qid = (unsigned short)DNS_HEADER_QID(qbuf);
|
||||||
query->timeout = 0;
|
query->timeout.tv_sec = 0;
|
||||||
|
query->timeout.tv_usec = 0;
|
||||||
|
|
||||||
/* Form the TCP query buffer by prepending qlen (as two
|
/* Form the TCP query buffer by prepending qlen (as two
|
||||||
* network-order bytes) to qbuf.
|
* network-order bytes) to qbuf.
|
||||||
@@ -92,7 +98,13 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
|||||||
|
|
||||||
/* Initialize query status. */
|
/* Initialize query status. */
|
||||||
query->try = 0;
|
query->try = 0;
|
||||||
query->server = 0;
|
|
||||||
|
/* Choose the server to send the query to. If rotation is enabled, keep track
|
||||||
|
* of the next server we want to use. */
|
||||||
|
query->server = channel->last_server;
|
||||||
|
if (channel->rotate == 1)
|
||||||
|
channel->last_server = (channel->last_server + 1) % channel->nservers;
|
||||||
|
|
||||||
for (i = 0; i < channel->nservers; i++)
|
for (i = 0; i < channel->nservers; i++)
|
||||||
{
|
{
|
||||||
query->server_info[i].skip_server = 0;
|
query->server_info[i].skip_server = 0;
|
||||||
@@ -118,6 +130,6 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
|
|||||||
&(channel->queries_by_qid[query->qid % ARES_QID_TABLE_SIZE]));
|
&(channel->queries_by_qid[query->qid % ARES_QID_TABLE_SIZE]));
|
||||||
|
|
||||||
/* Perform the first query action. */
|
/* Perform the first query action. */
|
||||||
time(&now);
|
now = ares__tvnow();
|
||||||
ares__send_query(channel, query, now);
|
ares__send_query(channel, query, &now);
|
||||||
}
|
}
|
||||||
|
|||||||
24
ares/ares_set_socket_callback.3
Normal file
24
ares/ares_set_socket_callback.3
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
.\" $Id$
|
||||||
|
.\"
|
||||||
|
.TH ARES_SET_SOCKET_CALLBACK 3 "2 Dec 2008"
|
||||||
|
.SH NAME
|
||||||
|
ares_set_socket_callback \- Set a socket creation callback
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.nf
|
||||||
|
int ares_set_socket_callback(ares_channel \fIchannel\fP,
|
||||||
|
ares_sock_create_callback \fIcallback\fP,
|
||||||
|
void *\fIuserdata\fP)
|
||||||
|
.fi
|
||||||
|
.SH DESCRIPTION
|
||||||
|
This function sets a \fIcallback\fP in the given ares channel handle. This
|
||||||
|
callback function will be invoked after the socket has been created, and
|
||||||
|
connected to the remote server. The callback must return ARES_SUCCESS if
|
||||||
|
things are fine, or use the standard ares error codes to signal errors
|
||||||
|
back. Returned errors will abort the ares operation.
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR ares_init_options (3)
|
||||||
|
.SH AVAILABILITY
|
||||||
|
ares_set_socket_callback(3) was added in c-ares 1.6.0
|
||||||
|
.SH AUTHOR
|
||||||
|
Gregor Jasny
|
||||||
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
#ifndef __ARES_SETUP_H
|
#ifndef HEADER_CARES_SETUP_H
|
||||||
#define __ARES_SETUP_H
|
#define HEADER_CARES_SETUP_H
|
||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/* Copyright (C) 2004 - 2007 by Daniel Stenberg et al
|
/* Copyright (C) 2004 - 2009 by Daniel Stenberg et al
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this software and its
|
* Permission to use, copy, modify, and distribute this software and its
|
||||||
* documentation for any purpose and without fee is hereby granted, provided
|
* documentation for any purpose and without fee is hereby granted, provided
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "ares_config.h"
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@@ -39,11 +39,55 @@
|
|||||||
|
|
||||||
#endif /* HAVE_CONFIG_H */
|
#endif /* HAVE_CONFIG_H */
|
||||||
|
|
||||||
|
/* ================================================================ */
|
||||||
|
/* Definition of preprocessor macros/symbols which modify compiler */
|
||||||
|
/* behaviour or generated code characteristics must be done here, */
|
||||||
|
/* as appropriate, before any system header file is included. It is */
|
||||||
|
/* also possible to have them defined in the config file included */
|
||||||
|
/* before this point. As a result of all this we frown inclusion of */
|
||||||
|
/* system header files in our config files, avoid this at any cost. */
|
||||||
|
/* ================================================================ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Tru64 needs _REENTRANT set for a few function prototypes and
|
||||||
|
* things to appear in the system header files. Unixware needs it
|
||||||
|
* to build proper reentrant code. Others may also need it.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef NEED_REENTRANT
|
||||||
|
# ifndef _REENTRANT
|
||||||
|
# define _REENTRANT
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* ================================================================ */
|
||||||
|
/* If you need to include a system header file for your platform, */
|
||||||
|
/* please, do it beyond the point further indicated in this file. */
|
||||||
|
/* ================================================================ */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* c-ares external interface definitions are also used internally,
|
||||||
|
* and might also include required system header files to define them.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <ares_build.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compile time sanity checks must also be done when building the library.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <ares_rules.h>
|
||||||
|
|
||||||
|
/* ================================================================= */
|
||||||
|
/* No system header file shall be included in this file before this */
|
||||||
|
/* point. The only allowed ones are those included from ares_build.h */
|
||||||
|
/* ================================================================= */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Include header files for windows builds before redefining anything.
|
* Include header files for windows builds before redefining anything.
|
||||||
* Use this preproessor block only to include or exclude windows.h,
|
* Use this preproessor block only to include or exclude windows.h,
|
||||||
* winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
|
* winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
|
||||||
* to any other further and independant block. Under Cygwin things work
|
* to any other further and independent block. Under Cygwin things work
|
||||||
* just as under linux (e.g. <sys/socket.h>) and the winsock headers should
|
* just as under linux (e.g. <sys/socket.h>) and the winsock headers should
|
||||||
* never be included when __CYGWIN__ is defined. configure script takes
|
* never be included when __CYGWIN__ is defined. configure script takes
|
||||||
* care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
|
* care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
|
||||||
@@ -89,32 +133,6 @@
|
|||||||
|
|
||||||
#ifndef HAVE_CONFIG_H
|
#ifndef HAVE_CONFIG_H
|
||||||
|
|
||||||
#if defined(__DJGPP__) || (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
|
|
||||||
defined(__POCC__)
|
|
||||||
#else
|
|
||||||
#define ssize_t int
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* HAVE_CONFIG_H */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Recent autoconf versions define these symbols in config.h. We don't
|
|
||||||
* want them (since they collide with the libcurl ones when we build
|
|
||||||
* --enable-debug) so we undef them again here.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#undef PACKAGE_STRING
|
|
||||||
#undef PACKAGE_TARNAME
|
|
||||||
#undef PACKAGE_VERSION
|
|
||||||
#undef PACKAGE_BUGREPORT
|
|
||||||
#undef PACKAGE_NAME
|
|
||||||
#undef VERSION
|
|
||||||
#undef PACKAGE
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Assume a few thing unless they're set by configure
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER) && !defined(__WATCOMC__)
|
#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER) && !defined(__WATCOMC__)
|
||||||
#define HAVE_SYS_TIME_H
|
#define HAVE_SYS_TIME_H
|
||||||
#endif
|
#endif
|
||||||
@@ -127,24 +145,28 @@
|
|||||||
#define HAVE_SYS_UIO_H
|
#define HAVE_SYS_UIO_H
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined(WIN32) || defined(WATT32)) && \
|
#endif /* HAVE_CONFIG_H */
|
||||||
!(defined(__MINGW32__) || defined(NETWARE) || defined(__DJGPP__))
|
|
||||||
/* protos for the functions we provide in windows_port.c */
|
|
||||||
int ares_strncasecmp(const char *s1, const char *s2, int n);
|
|
||||||
int ares_strcasecmp(const char *s1, const char *s2);
|
|
||||||
|
|
||||||
/* use this define magic to prevent us from adding symbol names to the library
|
#ifdef __POCC__
|
||||||
that is a high-risk to collide with another libraries' attempts to do the
|
# include <sys/types.h>
|
||||||
same */
|
# include <unistd.h>
|
||||||
#define strncasecmp(a,b,c) ares_strncasecmp(a,b,c)
|
# define ESRCH 3
|
||||||
#define strcasecmp(a,b) ares_strcasecmp(a,b)
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
# if _MSC_VER >= 1400
|
|
||||||
# define strdup(a) _strdup(a)
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Recent autoconf versions define these symbols in ares_config.h. We don't
|
||||||
|
* want them (since they collide with the libcurl ones when we build
|
||||||
|
* --enable-debug) so we undef them again here.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#undef PACKAGE_STRING
|
||||||
|
#undef PACKAGE_TARNAME
|
||||||
|
#undef PACKAGE_VERSION
|
||||||
|
#undef PACKAGE_BUGREPORT
|
||||||
|
#undef PACKAGE_NAME
|
||||||
|
#undef VERSION
|
||||||
|
#undef PACKAGE
|
||||||
|
|
||||||
/* IPv6 compatibility */
|
/* IPv6 compatibility */
|
||||||
#if !defined(HAVE_AF_INET6)
|
#if !defined(HAVE_AF_INET6)
|
||||||
#if defined(HAVE_PF_INET6)
|
#if defined(HAVE_PF_INET6)
|
||||||
@@ -162,4 +184,4 @@ int ares_strcasecmp(const char *s1, const char *s2);
|
|||||||
#include "setup_once.h"
|
#include "setup_once.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __ARES_SETUP_H */
|
#endif /* HEADER_CARES_SETUP_H */
|
||||||
67
ares/ares_strcasecmp.c
Normal file
67
ares/ares_strcasecmp.c
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this
|
||||||
|
* software and its documentation for any purpose and without
|
||||||
|
* fee is hereby granted, provided that the above copyright
|
||||||
|
* notice appear in all copies and that both that copyright
|
||||||
|
* notice and this permission notice appear in supporting
|
||||||
|
* documentation, and that the name of M.I.T. not be used in
|
||||||
|
* advertising or publicity pertaining to distribution of the
|
||||||
|
* software without specific, written prior permission.
|
||||||
|
* M.I.T. makes no representations about the suitability of
|
||||||
|
* this software for any purpose. It is provided "as is"
|
||||||
|
* without express or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ares_setup.h"
|
||||||
|
#include "ares_strcasecmp.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_STRCASECMP
|
||||||
|
int ares_strcasecmp(const char *a, const char *b)
|
||||||
|
{
|
||||||
|
#if defined(HAVE_STRCMPI)
|
||||||
|
return strcmpi(a, b);
|
||||||
|
#elif defined(HAVE_STRICMP)
|
||||||
|
return stricmp(a, b);
|
||||||
|
#else
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for (i = 0; i < (size_t)-1; i++) {
|
||||||
|
int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i];
|
||||||
|
int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i];
|
||||||
|
if (c1 != c2)
|
||||||
|
return c1-c2;
|
||||||
|
if (!c1)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRNCASECMP
|
||||||
|
int ares_strncasecmp(const char *a, const char *b, size_t n)
|
||||||
|
{
|
||||||
|
#if defined(HAVE_STRNCMPI)
|
||||||
|
return strncmpi(a, b, n);
|
||||||
|
#elif defined(HAVE_STRNICMP)
|
||||||
|
return strnicmp(a, b, n);
|
||||||
|
#else
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for (i = 0; i < n; i++) {
|
||||||
|
int c1 = ISUPPER(a[i]) ? tolower(a[i]) : a[i];
|
||||||
|
int c2 = ISUPPER(b[i]) ? tolower(b[i]) : b[i];
|
||||||
|
if (c1 != c2)
|
||||||
|
return c1-c2;
|
||||||
|
if (!c1)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
31
ares/ares_strcasecmp.h
Normal file
31
ares/ares_strcasecmp.h
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
#ifndef HEADER_CARES_STRCASECMP_H
|
||||||
|
#define HEADER_CARES_STRCASECMP_H
|
||||||
|
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this
|
||||||
|
* software and its documentation for any purpose and without
|
||||||
|
* fee is hereby granted, provided that the above copyright
|
||||||
|
* notice appear in all copies and that both that copyright
|
||||||
|
* notice and this permission notice appear in supporting
|
||||||
|
* documentation, and that the name of M.I.T. not be used in
|
||||||
|
* advertising or publicity pertaining to distribution of the
|
||||||
|
* software without specific, written prior permission.
|
||||||
|
* M.I.T. makes no representations about the suitability of
|
||||||
|
* this software for any purpose. It is provided "as is"
|
||||||
|
* without express or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ares_setup.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_STRCASECMP
|
||||||
|
extern int ares_strcasecmp(const char *a, const char *b);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRNCASECMP
|
||||||
|
extern int ares_strncasecmp(const char *a, const char *b, size_t n);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* HEADER_CARES_STRCASECMP_H */
|
||||||
43
ares/ares_strdup.c
Normal file
43
ares/ares_strdup.c
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright 1998 by the Massachusetts Institute of Technology.
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this
|
||||||
|
* software and its documentation for any purpose and without
|
||||||
|
* fee is hereby granted, provided that the above copyright
|
||||||
|
* notice appear in all copies and that both that copyright
|
||||||
|
* notice and this permission notice appear in supporting
|
||||||
|
* documentation, and that the name of M.I.T. not be used in
|
||||||
|
* advertising or publicity pertaining to distribution of the
|
||||||
|
* software without specific, written prior permission.
|
||||||
|
* M.I.T. makes no representations about the suitability of
|
||||||
|
* this software for any purpose. It is provided "as is"
|
||||||
|
* without express or implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ares_setup.h"
|
||||||
|
#include "ares_strdup.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_STRDUP
|
||||||
|
char *ares_strdup(const char *s1)
|
||||||
|
{
|
||||||
|
size_t sz;
|
||||||
|
char * s2;
|
||||||
|
|
||||||
|
if(s1) {
|
||||||
|
sz = strlen(s1);
|
||||||
|
if(sz < (size_t)-1) {
|
||||||
|
sz++;
|
||||||
|
if(sz < ((size_t)-1) / sizeof(char)) {
|
||||||
|
s2 = malloc(sz * sizeof(char));
|
||||||
|
if(s2) {
|
||||||
|
memcpy(s2, s1, sz * sizeof(char));
|
||||||
|
return s2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (char *)NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user