Difference between revisions of "Unit DNS"
From Ultibo.org
Line 425: | Line 425: | ||
---- | ---- | ||
− | '' | + | |
+ | '''DNS client''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code> TDNSClient = class(TNetworkClient)</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>constructor Create(AProtocol:TNetworkProtocol);</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>destructor Destroy; override;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div> | ||
+ | |- | ||
+ | | <code>FTlsIndex:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function GetClientData:PDNSClientData;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function CreateClientData:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function AddressEntryToHostEnt(AddressEntry:TIPAddressEntry; const AName:String; ACount:Integer):PHostEnt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function HostEntryToHostEnt(HostEntry:TIPHostEntry):PHostEnt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function NetworkEntryToNetEnt(NetworkEntry:TIPNetworkEntry):PNetEnt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function ServEntryToServEnt(ServEntry:TIPServEntry):PServEnt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function ProtoEntryToProtoEnt(ProtoEntry:TIPProtoEntry):PProtoEnt;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function InAddrToName(const AAddress:TInAddr):String;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function NameToInAddr(const AName:String):TInAddr;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function In6AddrToName(const AAddress:TIn6Addr):String;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function NameToIn6Addr(const AName:String):TIn6Addr;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function GetDNSMessageSize(AMessage:PDNSMessage):Integer;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function GetDNSNameSize(AMessage:PDNSMessage; AOffset:Word):Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetDNSQuestionSize(AMessage:PDNSMessage; AOffset:Word):Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetDNSResourceSize(AMessage:PDNSMessage; AOffset:Word):Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function GetDNSQuestionOffset(AMessage:PDNSMessage; ACount:Word):Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetDNSAnswerOffset(AMessage:PDNSMessage; ACount:Word):Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetDNSAuthorityOffset(AMessage:PDNSMessage; ACount:Word):Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetDNSAdditionalOffset(AMessage:PDNSMessage; ACount:Word):Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function CreateDNSQuery(AMessage:PDNSMessage; AIdentifier:Word):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function CheckDNSResponse(AMessage:PDNSMessage; AIdentifier:Word):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function HandleDNSResponse(AMessage:PDNSMessage; AIdentifier:Word):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function SendDNSQuery(ASocket:TProtocolSocket; const AServer:TInAddr; AData:Pointer; ALength,AType,AClass,AIdentifier:Word):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function RecvDNSResponse(ASocket:TProtocolSocket; AType,AClass,AIdentifier:Word):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function InsertDNSName(AMessage:PDNSMessage; AOffset:Word; AName:Pointer; ALength:Word):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function ExtractDNSName(AMessage:PDNSMessage; AOffset:Word; AName:Pointer; var ALength:Word):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function ExtractDNSRData(AMessage:PDNSMessage; AOffset:Word; AData:Pointer; var ALength:Word; AType,AClass:Word):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function InsertDNSQuestion(AMessage:PDNSMessage; ACount:Word; AData:Pointer; ALength,AType,AClass:Word):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function ExtractDNSAnswer(AMessage:PDNSMessage; ACount:Word; AName,AData:Pointer; var ANameLength,ADataLength,AType,AClass:Word; var ATtl:LongWord):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function ExtractDNSAuthority(AMessage:PDNSMessage; ACount:Word; AName,AData:Pointer; var ANameLength,ADataLength,AType,AClass:Word; var ATtl:LongWord):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function ExtractDNSAdditional(AMessage:PDNSMessage; ACount:Word; AName,AData:Pointer; var ANameLength,ADataLength,AType,AClass:Word; var ATtl:LongWord):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | | <code>function GetHostByAddr(AAddr:Pointer; ALength,AFamily:Integer):PHostEnt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetHostByName(AName:PChar):PHostEnt;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function GetHostName(AName:PChar; ALength:Integer):Integer;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function GetServByPort(APort:Integer; AProto:PChar):PServEnt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetServByName(AName,AProto:PChar):PServEnt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetProtoByNumber(AProto:Integer):PProtoEnt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetProtoByName(AName:PChar):PProtoEnt;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function GetNetByAddr(AAddr:Pointer; ALength,AStruct:Integer):PNetEnt;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetNetByName(AName:PChar):PNetEnt;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function StartClient:Boolean; override;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function StopClient:Boolean; override;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Public variables === | === Public variables === |
Revision as of 05:27, 9 March 2017
Return to Unit Reference
Contents
[hide]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
DNS message
DNA name
DNS question
DNS resource
DNA client data
Class definitions
DNS client
[Expand]
TDNSClient = class(TNetworkClient)
Public variables
None defined
Function declarations
Initialization functions
Return to Unit Reference