           {*******************************************************}
                               {FDL Declarations}
                             {Examiner GPL Edition}

           {*******************************************************}


             {procedure Process_Dns_Request.Create_Response_EDNS}


title procedure create_response_edns;

  function round__(real) : integer;
  type character = integer;
  type dns_types__packet_length_range = integer;
  type dns_types__packet_bytes_range = integer;
  type dns_types__byte = integer;
  type dns_types__unsigned_short = integer;
  type dns_types__opcode_type = (dns_types__query, 
     dns_types__iquery, dns_types__status);
  type dns_types__response_code = (dns_types__no_error, 
     dns_types__format_error, dns_types__server_failure, 
     dns_types__name_error, dns_types__not_implemented, 
     dns_types__refused);
  type dns_types__query_type = (dns_types__a, dns_types__ns, 
     dns_types__cname, dns_types__soa, dns_types__wks, 
     dns_types__ptr, dns_types__mx, dns_types__aaaa, 
     dns_types__srv, dns_types__a6, dns_types__opt, dns_types__ds, 
     dns_types__rrsig, dns_types__nsec, dns_types__dnskey, 
     dns_types__any, dns_types__caa, dns_types__error, 
     dns_types__unimplemented);
  type dns_types__header_type = record
        messageid : dns_types__unsigned_short;
        qr : boolean;
        opcode : dns_types__opcode_type;
        aa : boolean;
        tc : boolean;
        rd : boolean;
        ra : boolean;
        res1 : boolean;
        res2 : boolean;
        res3 : boolean;
        rcode : dns_types__response_code;
        qdcount : dns_types__unsigned_short;
        ancount : dns_types__unsigned_short;
        nscount : dns_types__unsigned_short;
        arcount : dns_types__unsigned_short
     end;
  type dns_types__edns_record = record
        root : character;
        code : dns_types__query_type;
        payload_size : dns_types__unsigned_short;
        rcode : dns_types__byte;
        version : dns_types__byte;
        ztop : dns_types__byte;
        zbottom : dns_types__byte;
        rdlen : dns_types__unsigned_short
     end;
  type dns_types__bytes_array_type = array [
     dns_types__packet_bytes_range] of dns_types__byte;
  type dns_types__dns_packet = record
        header : dns_types__header_type;
        bytes : dns_types__bytes_array_type
     end;
  const dns_types__packet_size : integer = pending;
  const dns_types__header_bits : integer = pending;
  const dns_types__udp_max_size : dns_types__packet_length_range = pending;
  const dns_types__dnssecmask : integer = pending;
  const system__min_int : integer = pending;
  const system__max_int : integer = pending;
  const dns_types__query_type__base__first : 
     dns_types__query_type = pending; 
  const dns_types__query_type__base__last : dns_types__query_type = pending; 
  const dns_types__response_code__base__first : 
     dns_types__response_code = pending; 
  const dns_types__response_code__base__last : 
     dns_types__response_code = pending; 
  const dns_types__opcode_type__base__first : 
     dns_types__opcode_type = pending; 
  const dns_types__opcode_type__base__last : 
     dns_types__opcode_type = pending; 
  const dns_types__unsigned_short__base__first : 
     dns_types__unsigned_short = pending; 
  const dns_types__unsigned_short__base__last : 
     dns_types__unsigned_short = pending; 
  const dns_types__byte__base__first : dns_types__byte = pending; 
  const dns_types__byte__base__last : dns_types__byte = pending; 
  const dns_types__packet_bytes_range__base__first : 
     dns_types__packet_bytes_range = pending; 
  const dns_types__packet_bytes_range__base__last : 
     dns_types__packet_bytes_range = pending; 
  const dns_types__packet_length_range__base__first : 
     dns_types__packet_length_range = pending; 
  const dns_types__packet_length_range__base__last : 
     dns_types__packet_length_range = pending; 
  const character__base__first : character = pending; 
  const character__base__last : character = pending; 
  const integer__base__first : integer = pending; 
  const integer__base__last : integer = pending; 
  const dns_types__dns_packet__size : integer = pending; 
  const dns_types__edns_record__size : integer = pending; 
  const dns_types__query_type__first : dns_types__query_type = pending; 
  const dns_types__query_type__last : dns_types__query_type = pending; 
  const dns_types__query_type__size : integer = pending; 
  const dns_types__header_type__size : integer = pending; 
  const dns_types__response_code__first : 
     dns_types__response_code = pending; 
  const dns_types__response_code__last : dns_types__response_code = pending; 
  const dns_types__response_code__size : integer = pending; 
  const dns_types__opcode_type__first : dns_types__opcode_type = pending; 
  const dns_types__opcode_type__last : dns_types__opcode_type = pending; 
  const dns_types__opcode_type__size : integer = pending; 
  const dns_types__unsigned_short__first : 
     dns_types__unsigned_short = pending; 
  const dns_types__unsigned_short__last : 
     dns_types__unsigned_short = pending; 
  function dns_types__unsigned_short__min(
     dns_types__unsigned_short, dns_types__unsigned_short) : 
     dns_types__unsigned_short;
  const dns_types__unsigned_short__size : integer = pending; 
  const dns_types__byte__first : dns_types__byte = pending; 
  const dns_types__byte__last : dns_types__byte = pending; 
  const dns_types__byte__modulus : integer = pending; 
  const dns_types__byte__size : integer = pending; 
  const dns_types__packet_bytes_range__first : 
     dns_types__packet_bytes_range = pending; 
  const dns_types__packet_bytes_range__last : 
     dns_types__packet_bytes_range = pending; 
  const dns_types__packet_bytes_range__size : integer = pending; 
  const dns_types__packet_length_range__first : 
     dns_types__packet_length_range = pending; 
  const dns_types__packet_length_range__last : 
     dns_types__packet_length_range = pending; 
  function dns_types__packet_length_range__max(
     dns_types__packet_length_range, 
     dns_types__packet_length_range) : 
     dns_types__packet_length_range;
  const dns_types__packet_length_range__size : integer = pending; 
  const character__first : character = pending; 
  const character__last : character = pending; 
  const character__size : integer = pending; 
  const integer__first : integer = pending; 
  const integer__last : integer = pending; 
  const integer__size : integer = pending; 
  var input_packet : dns_types__dns_packet;
  var input_bytes : dns_types__packet_length_range;
  var query_end_byte : dns_types__packet_bytes_range;
  var start_byte : dns_types__packet_bytes_range;
  var output_packet : dns_types__dns_packet;
  var additional_count : dns_types__unsigned_short;
  var edns_rec : dns_types__edns_record;
  function to_query_type(dns_types__unsigned_short) : 
     dns_types__query_type;
  function from_query_type(dns_types__query_type) : 
     dns_types__unsigned_short;

end;
