Difference between revisions of "Unit DNS"

From Ultibo.org
Jump to: navigation, search
Line 221: Line 221:
 
----
 
----
  
''To be documented''
+
 
 +
'''DNS specific types'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PDNSHeader = ^TDNSHeader;</code>
 +
 
 +
<code>TDNSHeader = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: All Network Order
 +
|-
 +
| <code>Identifier:Word;</code>
 +
| unique identifier
 +
|-
 +
| <code>Flags:Word;</code>
 +
| QD/Opcode/AA/TC/RD/RA/RCODE
 +
|-
 +
| <code>QuestionCount:Word;</code>
 +
| question section, number of entries
 +
|-
 +
| <code>AnswerCount:Word;</code>
 +
| answers, how many
 +
|-
 +
| <code>AuthorityCount:Word;</code>
 +
| count of name server RRs
 +
|-
 +
| <code>AdditionalCount:Word;</code>
 +
| number of "additional" records
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''DNS message'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PDNSMessage = ^TDNSMessage;</code>
 +
 
 +
<code>TDNSMessage = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>DNS:TDNSHeader;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Data:array[0..(MAX_DNS_MESSAGE - DNS_HEADER_SIZE) - 1] of Byte;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''DNA name'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PDNSName = ^TDNSName;</code>
 +
 
 +
<code>TDNSName = array[0..MAX_DNS_NAME - 1] of Char;</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| &nbsp;
 +
| style="width: 90%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''DNS question'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PDNSQuestion = ^TDNSQuestion;</code>
 +
 
 +
<code>TDNSQuestion = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: All Network Order
 +
|-
 +
| <code>Name:TDNSName;</code>
 +
| variable length question name
 +
|-
 +
| <code>QuestionType:Word;</code>
 +
| question type (eg DNS_TYPE_A)
 +
|-
 +
| <code>QuestionClass:Word;</code>
 +
| question class (eg DNS_CLASS_IN)
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''DNS resource'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PDNSResource = ^TDNSResource;</code>
 +
 
 +
<code>TDNSResource = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: All Network Order
 +
|-
 +
| <code>Name:TDNSName;</code>
 +
| variable length resource name
 +
|-
 +
| <code>RecordType:Word;</code>
 +
| resource record type (eg DNS_TYPE_A)
 +
|-
 +
| <code>RecordClass:Word;</code>
 +
| resource record class (eg DNS_CLASS_IN)
 +
|-
 +
| <code>Ttl:LongWord;</code>
 +
| time-to-live, changed to 32 bits
 +
|-
 +
| <code>DataLength:Word;</code>
 +
| length of data field
 +
|-
 +
| <code>RecordData:array[0..MAX_DNS_MESSAGE - 1] of Byte;</code>
 +
| data field
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''DNA client data'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PDNSClientData = ^TDNSClientData;</code>
 +
 
 +
<code>TDNSClientData = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Used for TLS Data
 +
|-
 +
|colspan="2"|''Host Ent''
 +
|-
 +
| <code>HostEnt:THostEnt;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>HostEntName:array[0..MAX_NAME_SIZE - 1] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>HostAliasesPtr:PChar;</code>
 +
| &nbsp;
 +
|-
 +
| <code>HostAliases:array[0..(MAX_NAME_SIZE * MAX_NAME_ALIASES) - 1] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>HostAddrListPtr:PChar;</code>
 +
| &nbsp;
 +
|-
 +
| <code>HostAddrList:array[0..MAX_HOST_ALIASES - 1] of TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Net Ent''
 +
|-
 +
| <code>NetEnt:TNetEnt;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NetEntName:array[0..MAX_NAME_SIZE - 1] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NetAliasesPtr:PChar;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NetAliases:array[0..(MAX_NAME_SIZE * MAX_NAME_ALIASES) - 1] of Char;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Serv Ent''
 +
|-
 +
| <code>ServEnt:TServEnt;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ServEntName:array[0..MAX_NAME_SIZE - 1] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ServAliasesPtr:PChar;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ServAliases:array[0..(MAX_NAME_SIZE * MAX_NAME_ALIASES) - 1] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ServEntProto:array[0..MAX_NAME_SIZE - 1] of Char;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|''Proto Ent''
 +
|-
 +
| <code>ProtoEnt:TProtoEnt;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ProtoEntName:array[0..MAX_NAME_SIZE - 1] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ProtoAliasesPtr:PChar;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ProtoAliases:array[0..(MAX_NAME_SIZE * MAX_NAME_ALIASES) - 1] of Char;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Class definitions ===
 
=== Class definitions ===

Revision as of 00:54, 18 January 2017

Return to Unit Reference


Description


Ultibo DNS client unit

Note: DNS Client is IPv4 based, for IPv6 see new Winsock2 functions

See RFC 1035 Section 4 for details

Constants



[Expand]
DNS specific constants DNS_*


[Expand]
DNS flag constants DNS_FLAG_*


[Expand]
DNS field masks constants DNS_OPCODE_*


[Expand]
DNS query code constants DNS_QUERY*


[Expand]
DNS response code constants DNS_NO_*


[Expand]
DNS record type constants DNS_TYPE_*


[Expand]
DNS address class constants DNS_CLASS_*


[Expand]
DNS message compression constants DNS_POINTER_*


Type definitions



DNS specific types

[Expand]

PDNSHeader = ^TDNSHeader;

TDNSHeader = packed record

DNS message

[Expand]

PDNSMessage = ^TDNSMessage;

TDNSMessage = packed record

DNA name

[Expand]

PDNSName = ^TDNSName;

TDNSName = array[0..MAX_DNS_NAME - 1] of Char;

DNS question

[Expand]

PDNSQuestion = ^TDNSQuestion;

TDNSQuestion = packed record

DNS resource

[Expand]

PDNSResource = ^TDNSResource;

TDNSResource = packed record

DNA client data

[Expand]

PDNSClientData = ^TDNSClientData;

TDNSClientData = record


Class definitions


To be documented

Public variables


None defined

Function declarations



Initialization functions

[Expand]
procedure DNSInit;
Description: To be documented


[Expand]
function DNSStart:LongWord;
Description: To be documented


[Expand]
function DNSStop:LongWord;
Description: To be documented


Return to Unit Reference