1----------------------------------------------------------------
2-- IRONSIDES - DNS SERVER
3--
4-- By: Martin C. Carlisle and Barry S. Fagin
5--     Department of Computer Science
6--     United States Air Force Academy
7--
8-- This is free software; you can redistribute it and/or
9-- modify without restriction.  We do ask that you please keep
10-- the original author information, and clearly indicate if the
11-- software has been modified.
12--
13-- This software is distributed in the hope that it will be useful,
14-- but WITHOUT ANY WARRANTY; without even the implied warranty
15-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16----------------------------------------------------------------
17
18with Udp_Dns_Package;
19with Tcp_Dns_Package;
20with Spark_Ada_Command_Line;
21with Spark.Ada.Text_IO;
22with DNS_Table_Pkg;
23with Zone_File_Io;
24--# inherit udp_dns_package, dns_table_pkg, Tcp_Dns_Package, Protected_SPARK_IO_05,
25--#    DNS_Network, zone_file_io, Spark_Ada_Command_Line, Spark.Ada.Text_IO;
26--# main_program
27--# global in out DNS_Network.Network;
28--#        in out Protected_SPARK_IO_05.SPARK_IO_PO;
29--#        in out Udp_Dns_Package.Startup_Suspension;
30--#        in out Tcp_Dns_Package.Startup_Suspension;
31--#        in out DNS_Table_Pkg.DNS_Table;
32--#        in Spark_Ada_Command_Line.State;
33--# derives DNS_Network.Network from *, tcp_dns_package.startup_suspension,
34--#             udp_dns_package.startup_suspension, dns_table_pkg.dns_table, spark_ada_command_line.state &
35--#         Protected_SPARK_IO_05.SPARK_IO_PO from *, DNS_Network.Network, udp_dns_package.startup_suspension,
36--#               tcp_dns_package.startup_suspension, spark_ada_command_line.state, dns_table_pkg.dns_table &
37--#         Udp_Dns_Package.Startup_Suspension from * &
38--#         Tcp_Dns_Package.Startup_Suspension from * &
39--#         DNS_Table_Pkg.DNS_Table from *, Spark_Ada_Command_Line.State;
40procedure Spark_Dns_Main
41--# global out Tcp_Dns_Package.Startup_Suspension;
42--#        out Udp_Dns_Package.Startup_Suspension;
43--#        in out DNS_Table_Pkg.DNS_Table;
44--#        in Spark_Ada_Command_Line.State;
45--# derives tcp_dns_package.startup_suspension from  &
46--#         DNS_Table_Pkg.DNS_Table from *, Spark_Ada_Command_Line.State &
47--#         udp_dns_package.startup_suspension from;
48--# declare delay;
49is
50   Success : Boolean;
51--   Error : constant String := "Error--please shut down and correct zone file";
52--   Good : constant String := "Correct zone file";
53   pragma Priority(0);
54   zoneFile : Spark.Ada.Text_IO.File_type;
55begin
56   Spark_Ada_Command_Line.Create_File_From_Argument(1,ZoneFile);
57--# accept Flow, 10, zoneFile, "done with file after this call";
58   zone_file_io.processzoneFile(zoneFile, success);
59--# end accept;
60   if Success=False then
61      Spark_Ada_Command_Line.Exit_With_Status(Spark_Ada_Command_Line.Failure);
62   end if;
63   tcp_dns_package.Initialization_Done;
64   Udp_Dns_Package.Initialization_Done;
65end Spark_Dns_Main;
66
67