//for this dnsasync object. This is not a reccomended mode of operation\r
//because it limits the app to one dns server but is kept for compatibility\r
//and special uses.\r
- addr,port:string;\r
+ addr,port:ansistring;\r
\r
overrideaf : integer;\r
\r
procedure cancel;//cancel an outstanding dns request\r
- function dnsresult:string; //get result of dnslookup as a string\r
+ function dnsresult:ansistring; //get result of dnslookup as a string\r
procedure dnsresultbin(var binip:tbinip); //get result of dnslookup as a tbinip\r
property dnsresultlist : tbiniplist read fresultlist;\r
- procedure forwardlookup(const name:string); //start forward lookup,\r
+ procedure forwardlookup(const name:ansistring); //start forward lookup,\r
//preffering ipv4\r
procedure reverselookup(const binip:tbinip); //start reverse lookup\r
- procedure customlookup(const name:string;querytype:integer); //start custom type lookup\r
+ procedure customlookup(const name:ansistring;querytype:integer); //start custom type lookup\r
\r
constructor create(aowner:tcomponent); override;\r
destructor destroy; override;\r
Src : TInetSockAddrV;\r
SrcLen : Integer;\r
fromip:tbinip;\r
- fromport:string;\r
+ fromport:ansistring;\r
begin\r
socketno := tlsocket(sender).tag;\r
//writeln('got a reply on socket number ',socketno);\r
\r
function tdnsasync.sendquery(socketno:integer;const packet:tdnspacket;len:integer):boolean;\r
var\r
- destination : string;\r
+ destination : ansistring;\r
inaddr : tinetsockaddrv;\r
trytolisten:integer;\r
begin\r
inc(numsockused);\r
end;\r
{$endif}\r
+\r
for i := 0 to numsockused-1 do begin\r
asyncprocess(i);\r
end;\r
-\r
end;\r
\r
procedure tdnsasync.reverselookup;\r
when a packet is received the application should put the packet in\r
recvbuf/recvbuflen , set state.parsepacket and call state_process again\r
\r
- once the app gets action_done it can determine sucess or failure in the\r
+ once the app gets action_done it can determine success or failure in the\r
following ways.\r
\r
on failure state.resultstr will be an empty string and state.resultbin will\r
failurereason := 'decoding name: got out of range2';\r
exit;\r
end;\r
- result := result + char(arr[a]);\r
+ result := result + ansichar(arr[a]);\r
end;\r
inc(numread,b+1);\r
\r
type\r
tip_addr_string=packed record\r
Next :pointer;\r
- IpAddress : array[0..15] of char;\r
- ipmask : array[0..15] of char;\r
+ IpAddress : array[0..15] of ansichar;\r
+ ipmask : array[0..15] of ansichar;\r
context : dword;\r
end;\r
pip_addr_string=^tip_addr_string;\r
tFIXED_INFO=packed record\r
- HostName : array[0..MAX_HOSTNAME_LEN-1] of char;\r
- DomainName : array[0..MAX_DOMAIN_NAME_LEN-1] of char;\r
+ HostName : array[0..MAX_HOSTNAME_LEN-1] of ansichar;\r
+ DomainName : array[0..MAX_DOMAIN_NAME_LEN-1] of ansichar;\r
currentdnsserver : pip_addr_string;\r
dnsserverlist : tip_addr_string;\r
nodetype : longint;\r
- ScopeId : array[0..MAX_SCOPE_ID_LEN + 4] of char;\r
+ ScopeId : array[0..MAX_SCOPE_ID_LEN + 4] of ansichar;\r
enablerouting : longbool;\r
enableproxy : longbool;\r
enabledns : longbool;\r
//on error the binip will have a family of 0 (other fiels are also currently\r
//zeroed out but may be used for further error information in future)\r
//timeout is in miliseconds, it is ignored when using windows dns\r
-function forwardlookup(name:string;timeout:integer):tbinip;\r
+function forwardlookup(name:ansistring;timeout:integer):tbinip;\r
\r
//convert a name to a list of all IP's returned\r
//this returns both v4 and v6 IP's, or possibly only v4 or v6, depending on settings\r
//on error, returns an empty list\r
-function forwardlookuplist(name:string;timeout:integer):tbiniplist;\r
+function forwardlookuplist(name:ansistring;timeout:integer):tbiniplist;\r
\r
\r
//convert an IP to a name, on error a null string will be returned, other\r
//details as above\r
-function reverselookup(ip:tbinip;timeout:integer):string;\r
+function reverselookup(ip:tbinip;timeout:integer):ansistring;\r
\r
\r
\r
function sendquery(socknum:integer;const packet:tdnspacket;len:integer):boolean;\r
var\r
a:integer;\r
- addr : string;\r
- port : string;\r
+ addr : ansistring;\r
+ port : ansistring;\r
inaddr : TInetSockAddrV;\r
begin\r
{ writeln('sendquery ',decodename(state.packet,state.packetlen,12,0,a),' ',state.requesttype);}\r
inAddrtemp : TInetSockAddrV;\r
a:integer;\r
biniptemp:tbinip;\r
- addr:string;\r
+ addr:ansistring;\r
begin\r
//init both sockets smultaneously, always, so they get succesive fd's\r
if fd[0] > 0 then exit;\r
Srcx : {$ifdef win32}sockaddr_in{$else}TInetSockAddrV{$endif} absolute Src;\r
SrcLen : Integer;\r
fromip:tbinip;\r
- fromport:string;\r
+ fromport:ansistring;\r
\r
begin\r
if timeout < mintimeout then timeout := defaulttimeout;\r
\r
\r
\r
-function forwardlookuplist(name:string;timeout:integer):tbiniplist;\r
+function forwardlookuplist(name:ansistring;timeout:integer):tbiniplist;\r
var\r
dummy : integer;\r
a,b:integer;\r
end;\r
end;\r
\r
-function forwardlookup(name:string;timeout:integer):tbinip;\r
+function forwardlookup(name:ansistring;timeout:integer):tbinip;\r
var\r
listtemp:tbiniplist;\r
begin\r
result := biniplist_get(listtemp,0);\r
end;\r
\r
-function reverselookup(ip:tbinip;timeout:integer):string;\r
+function reverselookup(ip:tbinip;timeout:integer):ansistring;\r
var\r
dummy : integer;\r
begin\r