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 Unsigned_Types, Rr_Type;
19use type Unsigned_Types.Unsigned32,Unsigned_Types.Unsigned16;
20--# inherit Unsigned_Types, rr_type;
21package Rr_Type.SRV_Record_Type is
22   --sufficiently below 2^16-1 that we can detect too large values without wraparound
23   MAX_PREF_VAL : constant Unsigned_Types.Unsigned16 := 2**15-1;
24   MAX_WEIGHT_VAL : constant Unsigned_Types.Unsigned16 := 2**15-1;
25   MAX_PORT_VAL : constant Unsigned_Types.Unsigned16 := 2**15-1;
26   type SRVRecordType is new Rr_Type.ResourceRecordType with
27      record
28         Pref          : Unsigned_Types.Unsigned16; --change MAX_PREF_VAL above if this type changes
29         Weight        : Unsigned_Types.Unsigned16; --change MAX_WEIGHT_VAL above if this type changes
30         PortNum       : Unsigned_Types.Unsigned16; --change MAX_PORT_VAL above if this type changes
31         ServerName    : Rr_Type.WireStringType;
32      end record;
33
34   --placeholder for empty slots in hash table
35   BlankSRVRecord : constant SRVRecordType := SRVRecordType'(
36      TtlInSeconds => 0,
37      Class => Rr_Type.INTERNET,
38      Pref => 0,
39      Weight => 0,
40      PortNum => 0,
41      ServerName => "empty.SRV.resource.record        " & Rr_Type.Spaces32
42      & Rr_Type.Spaces32 & Rr_Type.Spaces32);
43
44   --hash table (2d array) for SRV records
45   type SRVRecordBucketType is array (Rr_Type.ReturnedRecordsIndexType) of SRVRecordType;
46   type SRVRecordHashTableType is array (Rr_Type.NumBucketsIndexType) of SRVRecordBucketType;
47
48end Rr_Type.SRV_Record_Type;
49
50