Indy 9
TWKSRecord
Hierarchy, Properties, Methods, Unit: IdDNSResolver
Represents a Well Known Service Resource Record from a DNS Response packet.
TWKSRecord = class(TResultRecord)
Unit
IdDNSResolver
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                    .
  .                                               .
  +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

  • ADDRESS - 32-bit Internet address.

  • PROTOCOL - 8-bit IP protocol number. Uses BITMAP to indicate one bit per port of the specified protocol.

  • BITMAP - Variable length bit map with a length that is a multiple of 8- bits long. The first bit corresponds to port 0, the second to port 1, etc. If the bit map does not include a bit for a protocol of interest, that bit is assumed zero.

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:

  • 0 - Reserved

  • 1 - ICMP Internet Control Message

  • 2 - IGMP Internet Group Management

  • 3 - GGP Gateway-to-Gateway

  • 4 - Unassigned

  • 5 - ST Stream

  • 6 - TCP Transmission Control

  • 7 - UCL

  • 8 - EGP Exterior Gateway Protocol

  • 9 - IGP any private interior gateway

  • 10 - BBN-RCC-MON BBN RCC Monitoring

  • 11 - NVP-II Network Voice Protocol

  • 12 - PUP

  • 13 - ARGUS

  • 14 - EMCON

  • 15 - XNET Cross Net Debugger

  • 16 - CHAOS

  • 17 - UDP User Datagram

  • 18 - MUX Multiplexing

  • 19 - DCN-MEAS DCN Measurement Subsystems

  • 20 - HMP Host Monitoring

  • 21 - PRM Packet Radio Measurement

  • 22 - XNS-IDP XEROX NS IDP

  • 23 - TRUNK-1 Trunk-1

  • 24 - TRUNK-2 Trunk-2

  • 25 - LEAF-1 Leaf-1

  • 26 - LEAF-2 Leaf-2

  • 27 - RDP Reliable Data Protocol

  • 28 - IRTP Internet Reliable Transaction

  • 29 - ISO-TP4 ISO Transport Protocol Class 4

  • 30 - NETBLT Bulk Data Transfer Protocol

  • 31 - MFE-NSP MFE Network Services Protocol

  • 32 - MERIT-INP MERIT Internodal Protocol

  • 33 - SEP Sequential Exchange Protocol

  • 34 though 60 - Unassigned

  • 61 - any host internal protocol

  • 62 - CFTP

  • 63 - any local network

  • 64 - SAT-EXPAK SATNET and Backroom EXPAK

  • 65 - MIT-SUBNET MIT Subnet Support

  • 66 - RVD MIT Remote Virtual Disk Protocol

  • 67 - IPPC Internet Pluribus Packet Core

  • 68 - any distributed file system

  • 69 - SAT-MON SATNET Monitoring

  • 70 - Unassigned

  • 71 - IPCV Internet Packet Core Utility

  • 72 through 75 - Unassigned

  • 76 - BR-SAT-MON Backroom SATNET Monitoring

  • 77 - Unassigned

  • 78 - WB-MON WIDEBAND Monitoring

  • 79 - WB-EXPAK WIDEBAND EXPAK

  • 80 through 254 - Unassigned

  • 255 - Reserved

TWKSRecord.Address
TWKSRecord, See Also
IP Address for the Well Known Service Host.
property Address: String;
Description
Address is a Cardinal property that represents the 32-bit IP address for the host implementing the Protocol for the Well Known Service. Use Protocol and Bitmap to access the protocol or implemented features for the Well Known Service.

TWKSRecord.BitMap
TWKSRecord
Represents bits that indicate port usage for the Well Known Service.
property BitMap [index: integer]: Byte;
Description
BitMap is a read-only Byte property that provides indexed access to the port numbers used on the Host at the specified Address. BitMap is a variable length storage area that can be accessed using a zero-based index into the individual bits used to signify the port numbers allowed for the Protocol of the Well Known Service.

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.


TWKSRecord.ByteCount
TWKSRecord, See Also
ByteCount is not currently used in TWKSRecord.
property ByteCount: integer;
Description
ByteCount is not currently used in TWKSRecord. ByteCount is not currently used in TWKSRecord. ByteCount is not currently used in TWKSRecord. ByteCount is not currently used in TWKSRecord.

TWKSRecord.Protocol
TWKSRecord
Protocol for the Well Known Service host.
property Protocol: Word;
Description
Protocol is a read-only Byte property that specifies the IP protocol supported for the Well Know Service host. Protocol can be one of the following values:

  • 0 Reserved

  • 1 ICMP Internet Control Message

  • 2 IGMP Internet Group Management

  • 3 GGP Gateway-to-Gateway

  • 4 Unassigned

  • 5 ST Stream

  • 6 TCP Transmission Control

  • 7 UCL UCL

  • 8 EGP Exterior Gateway Protocol

  • 9 IGP any private interior gateway

  • 10 BBN-RCC-MON BBN RCC Monitoring

  • 11 NVP-II Network Voice Protocol

  • 12 PUP PUP

  • 13 ARGUS ARGUS

  • 14 EMCON EMCON

  • 15 XNET Cross Net Debugger

  • 16 CHAOS Chaos

  • 17 UDP User Datagram

  • 18 MUX Multiplexing

  • 19 DCN-MEAS DCN Measurement Subsystems

  • 20 HMP Host Monitoring

  • 21 PRM Packet Radio Measurement

  • 22 XNS-IDP XEROX NS IDP

  • 23 TRUNK-1 Trunk-1

  • 24 TRUNK-2 Trunk-2

  • 25 LEAF-1 Leaf-1

  • 26 LEAF-2 Leaf-2

  • 27 RDP Reliable Data Protocol

  • 28 IRTP Internet Reliable Transaction

  • 29 ISO-TP4 ISO Transport Protocol Class 4

  • 30 NETBLT Bulk Data Transfer Protocol

  • 31 MFE-NSP MFE Network Services Protocol

  • 32 MERIT-INP MERIT Internodal Protocol

  • 33 SEP Sequential Exchange Protocol

  • 34-60 Unassigned

  • 61 any host internal protocol

  • 62 CFTP CFTP

  • 63 any local network

  • 64 SAT-EXPAK SATNET and Backroom EXPAK

  • 65 MIT-SUBNET MIT Subnet Support

  • 66 RVD MIT Remote Virtual Disk Protocol

  • 67 IPPC Internet Pluribus Packet Core

  • 68 any distributed file system

  • 69 SAT-MON SATNET Monitoring

  • 70 Unassigned

  • 71 IPCV Internet Packet Core Utility

  • 72-75 Unassigned

  • 76 BR-SAT-MON Backroom SATNET Monitoring

  • 77 Unassigned

  • 78 WB-MON WIDEBAND Monitoring

  • 79 WB-EXPAK WIDEBAND EXPAK

  • 80-254 Unassigned

  • 255 Reserved

TWKSRecord.Create
TWKSRecord
Constructor for the object instance.
constructor Create(Collection: TCollection); override;
Parameters
Collection: TCollection
Owner of the collection item.
Description
Create is the constructor for the object instance. Create calls the inherited Create method using Collection as the owner of the collection item.

TWKSRecord.Destroy
TWKSRecord, See Also
Frees the resource record collection item.
destructor Destroy; override;
Description
Destroy is the destructor for the object instance. Destroy calls the inherited Destroy method prior to exiting.

TWKSRecord.Parse
TWKSRecord
Parses RData values into properties.
procedure Parse(CompleteMessage: String; APos: Integer); override;
Parameters
CompleteMessage: String
Contents of the resource record.
APos: Integer
Position where RData values begin in the answer.
Description
Parse is an overridden procedure that implements a routine to parse resource record values in the DNS response into their property-based counterparts.

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.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.