X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/ac55319310f2e0b8ac5d848c1591b5e72d49c9b3..31d4361fb52761b6486f55af10268a51ee536a6f:/dnssync.pas?ds=inline diff --git a/dnssync.pas b/dnssync.pas old mode 100755 new mode 100644 index a91d6f1..c603b92 --- a/dnssync.pas +++ b/dnssync.pas @@ -34,17 +34,17 @@ interface //on error the binip will have a family of 0 (other fiels are also currently //zeroed out but may be used for further error information in future) //timeout is in miliseconds, it is ignored when using windows dns -function forwardlookup(name:string;timeout:integer):tbinip; +function forwardlookup(name:ansistring;timeout:integer):tbinip; //convert a name to a list of all IP's returned //this returns both v4 and v6 IP's, or possibly only v4 or v6, depending on settings //on error, returns an empty list -function forwardlookuplist(name:string;timeout:integer):tbiniplist; +function forwardlookuplist(name:ansistring;timeout:integer):tbiniplist; //convert an IP to a name, on error a null string will be returned, other //details as above -function reverselookup(ip:tbinip;timeout:integer):string; +function reverselookup(ip:tbinip;timeout:integer):ansistring; @@ -75,14 +75,14 @@ implementation {$i unixstuff.inc} + +{$ifdef syncdnscore} var numsockused:integer; fd:array[0..numsock-1] of integer; state:array[0..numsock-1] of tdnsstate; toaddr:array[0..numsock-1] of tbinip; -{$ifdef syncdnscore} - {$ifdef win32} const winsocket = 'wsock32.dll'; @@ -109,9 +109,8 @@ end; function sendquery(socknum:integer;const packet:tdnspacket;len:integer):boolean; var - a:integer; - addr : string; - port : string; + addr : ansistring; + port : ansistring; inaddr : TInetSockAddrV; begin { writeln('sendquery ',decodename(state.packet,state.packetlen,12,0,a),' ',state.requesttype);} @@ -138,7 +137,7 @@ var inAddrtemp : TInetSockAddrV; a:integer; biniptemp:tbinip; - addr:string; + addr:ansistring; begin //init both sockets smultaneously, always, so they get succesive fd's if fd[0] > 0 then exit; @@ -177,7 +176,6 @@ var currenttime : integer; lag : ttimeval; - currenttimeout : ttimeval; selecttimeout : ttimeval; socknum:integer; needprocessing:array[0..numsock-1] of boolean; @@ -188,7 +186,7 @@ var Srcx : {$ifdef win32}sockaddr_in{$else}TInetSockAddrV{$endif} absolute Src; SrcLen : Integer; fromip:tbinip; - fromport:string; + fromport:ansistring; begin if timeout < mintimeout then timeout := defaulttimeout; @@ -296,10 +294,10 @@ end; -function forwardlookuplist(name:string;timeout:integer):tbiniplist; +function forwardlookuplist(name:ansistring;timeout:integer):tbiniplist; var dummy : integer; - a,b:integer; + a:integer; biniptemp:tbinip; l:tbiniplist; begin @@ -367,7 +365,7 @@ begin end; end; -function forwardlookup(name:string;timeout:integer):tbinip; +function forwardlookup(name:ansistring;timeout:integer):tbinip; var listtemp:tbiniplist; begin @@ -375,7 +373,7 @@ begin result := biniplist_get(listtemp,0); end; -function reverselookup(ip:tbinip;timeout:integer):string; +function reverselookup(ip:tbinip;timeout:integer):ansistring; var dummy : integer; begin