Internet Direct (Indy) Version 9.0.1 Beta
TWKSRecord
Represents a Well Known Service Resource Record from a DNS Response packet.

TWKSRecord = class(TResultRecord)
Description
TWKSRecord is a TResultRecord descendant that represents a resource record returned in the results for a DNS query. TWKSRecord is the collection item created to represent a resource resource returned when TIdDNSResolver.QueryRecords includes the value qtWKS for Well Known Service resource records.

Well Known Service resoure records are used to describe the well known services supported by a particular protocol on a particular internet address. If a server supports both TCP and UDP variants of a service, multiple WKS resource records are returned in a DNS response.

A Well Known Service resoure record uses the same DNS packet layout as other TResultRecord-based responses, but extends the use of RData to include the following definition and format:

  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  |                    ADDRESS                    |
  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  |       PROTOCOL        |                       |
  +--+--+--+--+--+--+--+--+                       |
  |                                               |
  .                                               .
  .                    BIT MAP                    .
  .                                               .
  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    

TWKSRecord extends TResultRecord to implement the specifics of accessing RData values as properties, including Address, Protocol, ByteCount, and BitMap. TWKSRecord also overrides the Parse method to read the values in RData into their property counterparts.

The appropriate values and mnemonics for ports and protocols are specified in RFC 1010. For example, if PROTOCOL=TCP, the 26th bit corresponds to TCP port 25 (SMTP). If this bit is set, a SMTP server should be listening on TCP port 25; if zero, SMTP service is not supported on the specified address.

Protocol specifies the IP protocol the host supports, as described in RFC 1010, and may contain one of the following values: