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 Dns_Types, rr_type.dnskey_record_type, rr_type.rrsig_record_type, unsigned_types, rr_type;
19WITH Spark.Ada.Text_IO;
20
21use type Rr_Type.RrItemType;
22use type dns_types.Query_Type;
23USE TYPE Spark.Ada.Text_IO.Exception_T;
24use type Unsigned_Types.Unsigned32;
25
26--# inherit Dns_Types, dns_table_pkg, error_msgs, parser_utilities, rr_type.a_record_type,
27--# rr_type.aaaa_record_type, rr_type.cname_record_type, rr_type.dnskey_record_type, rr_type.mx_record_type, rr_type.srv_record_type,
28--# rr_type.ns_record_type, rr_type.nsec_record_type, rr_type.ptr_record_type, rr_type.rrsig_record_type,
29--# spark.ada.text_io, unsigned_types, rr_type, zone_file_parser;
30
31package process_first_line_of_record is
32   procedure ProcessFirstLineOfRecord (CurrentRecordType : in Dns_Types.Query_Type;
33         --common to all record types
34         currentOrigin : in Rr_Type.DomainNameStringType;
35         currentOwner : in Rr_Type.DomainNameStringType;
36         currentTTL : in unsigned_types.Unsigned32;
37         currentClass : in Rr_Type.ClassType;
38         currentLine : in rr_type.LineFromFileType;
39         Lastpos : in Rr_Type.Linelengthindex;
40         LineCount : Unsigned_Types.Unsigned32;
41         --for multiline records
42         InMultilineRecord : out Boolean;
43         LineInRecordCtr : out Unsigned_Types.Unsigned32;
44         --SOA record fields
45         currentNameServer : out rr_Type.DomainNameStringType;
46         CurrentEmail : out Rr_Type.DomainNameStringType;
47         --DNSKEY record (if needed)
48         DNSKEY_Rec : out Rr_Type.Dnskey_Record_Type.DNSKeyRecordType;
49         --RRSIG record (if needed)
50         RRSIG_Rec : out Rr_Type.rrsig_record_type.RRSIGRecordType;
51         recordSuccessfullyInserted : out Boolean;
52         Success : in out boolean);
53      --# global in out dns_table_pkg.DNS_Table;
54      --# derives dns_table_pkg.DNS_Table from dns_table_pkg.DNS_Table, currentRecordType,
55      --#   currentOrigin, currentOwner, currentTTL, CurrentClass, currentLine, lastPos, success
56      --# & inMultilineRecord, lineInRecordCtr from currentRecordType
57      --# & currentNameServer, currentEmail from currentOrigin, currentRecordType, currentLine, lastPos, success
58      --# & DNSKEY_Rec from currentRecordType, currentLine, lastPos, success
59      --# & RRSIG_Rec from currentRecordType, currentLine, lastPos, success
60      --# & recordSuccessfullyInserted from dns_table_pkg.DNS_Table, currentRecordType,
61      --#    currentOrigin, currentOwner, currentLine, lastPos, success
62      --# & success from currentRecordType, currentOrigin, currentLine, lastPos, success
63      --# & null from lineCount;
64      --# pre lastPos >= 1 and lastPos <= rr_type.lineLengthIndex'last;
65end process_first_line_of_record;
66