Indy 9
|
TNAMERecord = class(TResultRecord)
TNAMERecord is the ancestor for other resource record classes that implement a Host name property in the specific context of the resource record type, including TNSRecord, TNSRecord, and TPTRRecord.
TNAMERecord resource record definitions are likely to occur in any DNS response. Because their RData format is known, all host or domain names in the RData section of these resource records may be compressed.
The host name is represented in RData as a series of labels, and terminated by a label with zero length. The first label is a single octet that indicates the length of the host name, and is followed by that number of characters. The length octet is treated as binary information, and the host anme can be up to 256 characters in length (including the length octet).
TNameRecord extends TResultRecord to implement the specifics of accessing RData values as properties, including HostName. TNameRecord also overrides the Parse method to read the values in RData into their property counterparts.
property HostName: string;
procedure Assign(Source: TPersistent); override;
constructor Create(Collection: TCollection); 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 label and value for the HostName property.