Indy 9
|
TWKSRecord = class(TResultRecord)
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:
property Address: String;
property BitMap [index: integer]: Byte;
The appropriate values and mnemonics for ports numbers are specified in RFC 1010. For example, if Protocol is the value for 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.
property ByteCount: integer;
property Protocol: Word;
constructor Create(Collection: TCollection); override;
destructor Destroy; override;
procedure Parse(CompleteMessage: String; APos: Integer); override;
CompleteMessage is the contents of the resource record. Since the DNS message can contain compressed data, the whole message is needed for parsing and pointer location.
APos is the position in the resource record where RData values for this record type are located in the DNS Answer.
Parse calls the inherited Parse method, and retrieves the DNS labels and values for the Address, Protocol, ByteCount, and BitMap properties.