Difference between revisions of "Unit DNS"

From Ultibo.org
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 77: Line 77:
 
<br />  
 
<br />  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''DNS field mask''' <code> DNS_OPCODE_* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''DNS field mask''' <code> DNS_*_MASK </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 91: Line 91:
 
<br />  
 
<br />  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
<div style="font-size: 14px; padding-left: 12px;">'''DNS opcode''' <code> DNS_OPCODE* </code></div>
+
<div style="font-size: 14px; padding-left: 12px;">'''DNS opcode''' <code> DNS_OPCODE_* </code></div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
Line 105: Line 105:
 
|-
 
|-
 
| <code>DNS_OPCODE_UNKNOWN = 3;</code>
 
| <code>DNS_OPCODE_UNKNOWN = 3;</code>
| &nbsp;)
+
| &nbsp;
 
|-
 
|-
 
| <code>DNS_OPCODE_NOTIFY = 4;</code>
 
| <code>DNS_OPCODE_NOTIFY = 4;</code>
Line 508: Line 508:
 
|-
 
|-
 
|}
 
|}
</div></div>
+
</div></div>
 +
 
 +
'''DNS client name'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PDNSClientName = ^TDNSClientName;</code>
 +
 
 +
<code>TDNSClientName = array[0..MAX_NAME_SIZE - 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: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div> 
  
 
'''DNS client data'''
 
'''DNS client data'''
Line 526: Line 541:
 
| style="width: 50%;"|&nbsp;
 
| style="width: 50%;"|&nbsp;
 
|-
 
|-
| <code>HostEntName:array[0..MAX_NAME_SIZE - 1] of Char;</code>
+
| <code>HostEntName:TDNSClientName;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
| <code>HostAliasesPtr:PChar;</code>
+
| <code>HostAliasesPtr:array[0..MAX_NAME_ALIASES] of PChar;</code>
| &nbsp;
+
| One extra for terminating null pointer
 
|-
 
|-
| <code>HostAliases:array[0..(MAX_NAME_SIZE * MAX_NAME_ALIASES) - 1] of Char;</code>
+
| <code>HostAliases:array[0..MAX_NAME_ALIASES - 1] of TDNSClientName;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
| <code>HostAddrListPtr:PChar;</code>
+
| <code>HostAddrListPtr:array[0..MAX_HOST_ALIASES] of PChar;</code>
| &nbsp;
+
| One extra for terminating null pointer
 
|-
 
|-
 
| <code>HostAddrList:array[0..MAX_HOST_ALIASES - 1] of TInAddr;</code>
 
| <code>HostAddrList:array[0..MAX_HOST_ALIASES - 1] of TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>HostAddr6ListPtr:array[0..MAX_HOST_ALIASES] of PChar;</code>
 +
| One extra for terminating null pointer
 +
|-
 +
| <code>HostAddr6List:array[0..MAX_HOST_ALIASES - 1] of TIn6Addr;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
Line 546: Line 567:
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
| <code>NetEntName:array[0..MAX_NAME_SIZE - 1] of Char;</code>
+
| <code>NetEntName:TDNSClientName;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
| <code>NetAliasesPtr:PChar;</code>
+
| <code>NetAliasesPtr:array[0..MAX_NAME_ALIASES] of PChar;</code>
| &nbsp;
+
| One extra for terminating null pointer
 
|-
 
|-
| <code>NetAliases:array[0..(MAX_NAME_SIZE * MAX_NAME_ALIASES) - 1] of Char;</code>
+
| <code>NetAliases:array[0..MAX_NAME_ALIASES - 1] of TDNSClientName;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
Line 560: Line 581:
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
| <code>ServEntName:array[0..MAX_NAME_SIZE - 1] of Char;</code>
+
| <code>ServEntName:TDNSClientName;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
| <code>ServAliasesPtr:PChar;</code>
+
| <code>ServAliasesPtr:array[0..MAX_NAME_ALIASES] of PChar;</code>
| &nbsp;
+
| One extra for terminating null pointer
 
|-
 
|-
| <code>ServAliases:array[0..(MAX_NAME_SIZE * MAX_NAME_ALIASES) - 1] of Char;</code>
+
| <code>ServAliases:array[0..MAX_NAME_ALIASES - 1] of TDNSClientName;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
| <code>ServEntProto:array[0..MAX_NAME_SIZE - 1] of Char;</code>
+
| <code>ServEntProto:TDNSClientName;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
Line 577: Line 598:
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
| <code>ProtoEntName:array[0..MAX_NAME_SIZE - 1] of Char;</code>
+
| <code>ProtoEntName:TDNSClientName;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
| <code>ProtoAliasesPtr:PChar;</code>
+
| <code>ProtoAliasesPtr:array[0..MAX_NAME_ALIASES] of PChar;</code>
| &nbsp;
+
| One extra for terminating null pointer
 
|-
 
|-
| <code>ProtoAliases:array[0..(MAX_NAME_SIZE * MAX_NAME_ALIASES) - 1] of Char;</code>
+
| <code>ProtoAliases:array[0..MAX_NAME_ALIASES - 1] of TDNSClientName;</code>
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-

Latest revision as of 02:24, 6 March 2025

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 DNS_FLAG_*


[Expand]
DNS field mask DNS_*_MASK


[Expand]
DNS opcode DNS_OPCODE_*


[Expand]
DNS response code DNS_RESPONSE_*


[Expand]
DNS record type DNS_TYPE_*


[Expand]
DNS address class DNS_CLASS_*


[Expand]
DNS message compression DNS_POINTER_*


Type definitions



DNS specific types

[Expand]

PDNSHeader = ^TDNSHeader;

TDNSHeader = packed record

DNS message

[Expand]

PDNSMessage = ^TDNSMessage;

TDNSMessage = packed record

DNS 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

DNS client name

[Expand]

PDNSClientName = ^TDNSClientName;

TDNSClientName = array[0..MAX_NAME_SIZE - 1] of Char;

DNS client data

[Expand]

PDNSClientData = ^TDNSClientData;

TDNSClientData = record


Class definitions



DNS specific classes

TDNSClient = class(TNetworkClient)


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