2
This file is part of the Free Pascal run time library.
3
Copyright (c) 2003 by the Free Pascal development team
5
test netdb unit, host part
7
See the file COPYING.FPC, included in this distribution,
8
for details about the copyright.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
**********************************************************************}
22
Procedure DumpHostEntry(Const H : THostEntry);
27
Writeln('Name : ',Name);
28
Writeln('Addr : ',HostAddrToStr(Addr));
29
Writeln('Aliases : ',Aliases);
34
Procedure TestAddr(Addr : string);
40
If ResolveHostByAddr(StrToHostAddr(Addr),H) then
43
Writeln('No entry for address ',Addr)
46
Procedure TestName(Const N : string);
52
If ResolveHostByName(N,H) then
55
Writeln('No entry for hostname ',N)
60
Ans : Array [1..10] of THostAddr;
62
NAns : Array[1..10] of String;
67
Writeln('Resolving name ');
68
l:=ResolveName('db.wisa.be',Ans);
69
Writeln('Got : ',l,' answers');
71
Writeln(i:2,': ',hostAddrtostr(Ans[i]));
72
Writeln('Resolving address ');
73
H:=StrtoHostAddr('212.224.143.202');
74
L:=ResolveAddress(H,NAns);
75
Writeln('Got : ',l,' answers');
77
Writeln(i:2,': ',NAns[i]);
78
Writeln('ResolveHostByName:');
79
testname('malpertuus.wisa.be');
80
Writeln('ResolveHostByAddr:');
81
testaddr('212.224.143.202');