Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/DNS-query/Ada/dns-query-1.ada
Normal file
13
Task/DNS-query/Ada/dns-query-1.ada
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
with GNAT.Sockets; use GNAT.Sockets;
|
||||
|
||||
procedure DNSQuerying is
|
||||
|
||||
Host : Host_Entry_Type (1, 1);
|
||||
Inet_Addr_V4 : Inet_Addr_Type (Family_Inet);
|
||||
begin
|
||||
|
||||
Host := Get_Host_By_Name (Name => "www.kame.net");
|
||||
Inet_Addr_V4 := Addresses (Host);
|
||||
Put ("IPv4: " & Image (Value => Inet_Addr_V4));
|
||||
end DNSQuerying;
|
||||
14
Task/DNS-query/Ada/dns-query-2.ada
Normal file
14
Task/DNS-query/Ada/dns-query-2.ada
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
with GNAT.Sockets; use Gnat.Sockets;
|
||||
procedure DNSQuerying is
|
||||
procedure Print_Address_Info (Host, Serv : String; Family : Family_Type := Family_Unspec) is
|
||||
Addresses : Address_Info_Array := Get_Address_Info (Host, Serv, Family, Passive => False, Numeric_Host => False);
|
||||
Inet_Addr_V6: Inet_Addr_Type(Family_Inet6);
|
||||
begin
|
||||
Sort (Addresses, IPv6_TCP_Preferred'Access);
|
||||
Inet_Addr_V6 := Addresses(1).Addr.Addr;
|
||||
Put_Line("IPv6: " & Image(Value => Inet_Addr_V6));
|
||||
end Print_Address_Info;
|
||||
begin
|
||||
Print_Address_Info ("ipv6.google.com", "https", Family_Inet6);
|
||||
end DNSQuerying;
|
||||
Loading…
Add table
Add a link
Reference in a new issue