Release 22
git-svn-id: https://svn.code.sf.net/p/synalist/code/trunk@47 7c85be65-684b-0410-a082-b2ed4fbef004
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
{==============================================================================|
|
{==============================================================================|
|
||||||
| Project : Delphree - Synapse | 001.003.001 |
|
| Project : Delphree - Synapse | 001.003.002 |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
| Content: support for ASN.1 coding and decoding |
|
| Content: support for ASN.1 coding and decoding |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
@ -25,6 +25,8 @@
|
|||||||
| (Found at URL: http://www.ararat.cz/synapse/) |
|
| (Found at URL: http://www.ararat.cz/synapse/) |
|
||||||
|==============================================================================}
|
|==============================================================================}
|
||||||
|
|
||||||
|
{$Q-}
|
||||||
|
|
||||||
unit ASN1Util;
|
unit ASN1Util;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
//RFC-1035, RFC-1183, RFC1706, RFC1712, RFC2163, RFC2230
|
//RFC-1035, RFC-1183, RFC1706, RFC1712, RFC2163, RFC2230
|
||||||
|
|
||||||
|
{$Q-}
|
||||||
|
|
||||||
unit DNSsend;
|
unit DNSsend;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
21
httpsend.pas
21
httpsend.pas
@ -1,5 +1,5 @@
|
|||||||
{==============================================================================|
|
{==============================================================================|
|
||||||
| Project : Delphree - Synapse | 002.000.000 |
|
| Project : Delphree - Synapse | 002.001.000 |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
| Content: HTTP client |
|
| Content: HTTP client |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
@ -71,6 +71,7 @@ type
|
|||||||
function HttpGetText(URL:string;Response:TStrings):Boolean;
|
function HttpGetText(URL:string;Response:TStrings):Boolean;
|
||||||
function HttpGetBinary(URL:string;Response:TStream):Boolean;
|
function HttpGetBinary(URL:string;Response:TStream):Boolean;
|
||||||
function HttpPostBinary(URL:string;Data:TStream):Boolean;
|
function HttpPostBinary(URL:string;Data:TStream):Boolean;
|
||||||
|
function HttpPostURL(URL:string;URLData:string;Data:TStream):Boolean;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -422,5 +423,23 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{HttpPostURL}
|
||||||
|
function HttpPostURL(URL:string;URLData:string;Data:TStream):Boolean;
|
||||||
|
var
|
||||||
|
HTTP:THTTPSend;
|
||||||
|
begin
|
||||||
|
Result:=False;
|
||||||
|
HTTP:=THTTPSend.Create;
|
||||||
|
try
|
||||||
|
HTTP.Document.Write(pointer(URLData)^,Length(URLData));
|
||||||
|
HTTP.MimeType:='application/x-url-encoded';
|
||||||
|
Result:=HTTP.HTTPmethod('POST',URL);
|
||||||
|
data.Seek(0,soFromBeginning);
|
||||||
|
data.CopyFrom(HTTP.document,0);
|
||||||
|
finally
|
||||||
|
HTTP.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
| (Found at URL: http://www.ararat.cz/synapse/) |
|
| (Found at URL: http://www.ararat.cz/synapse/) |
|
||||||
|==============================================================================}
|
|==============================================================================}
|
||||||
|
|
||||||
|
{$Q-}
|
||||||
|
|
||||||
unit MIMEchar;
|
unit MIMEchar;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
@ -29,7 +29,7 @@ unit MIMEmess;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
classes, Sysutils, MimePart, MimeChar, SynaUtil, MIMEInLn;
|
classes, Sysutils, MIMEpart, MimeChar, SynaUtil, MIMEInLn;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
@ -45,6 +45,8 @@ After you change the registry, you need to restart your computer!
|
|||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{$Q-}
|
||||||
|
|
||||||
unit PINGsend;
|
unit PINGsend;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
14
snmpsend.pas
14
snmpsend.pas
@ -1,5 +1,5 @@
|
|||||||
{==============================================================================|
|
{==============================================================================|
|
||||||
| Project : Delphree - Synapse | 002.003.000 |
|
| Project : Delphree - Synapse | 002.003.001 |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
| Content: SNMP client |
|
| Content: SNMP client |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
@ -24,12 +24,14 @@
|
|||||||
| (Found at URL: http://www.ararat.cz/synapse/) |
|
| (Found at URL: http://www.ararat.cz/synapse/) |
|
||||||
|==============================================================================}
|
|==============================================================================}
|
||||||
|
|
||||||
|
{$Q-}
|
||||||
|
|
||||||
unit SNMPSend;
|
unit SNMPSend;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
BlckSock, synautil, classes, sysutils, ASN1util;
|
BlckSock, synautil, classes, sysutils, ASN1Util;
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
||||||
@ -190,11 +192,11 @@ begin
|
|||||||
data := data + ASNObject(s, ASN1_SEQ);
|
data := data + ASNObject(s, ASN1_SEQ);
|
||||||
end;
|
end;
|
||||||
data:=ASNObject(data,ASN1_SEQ);
|
data:=ASNObject(data,ASN1_SEQ);
|
||||||
data:=ASNObject(char(Self.ID),ASN1_INT)
|
data:=ASNObject(ASNEncInt(Self.ID),ASN1_INT)
|
||||||
+ASNObject(char(Self.ErrorStatus),ASN1_INT)
|
+ASNObject(ASNEncInt(Self.ErrorStatus),ASN1_INT)
|
||||||
+ASNObject(char(Self.ErrorIndex),ASN1_INT)
|
+ASNObject(ASNEncInt(Self.ErrorIndex),ASN1_INT)
|
||||||
+data;
|
+data;
|
||||||
data:=ASNObject(char(Self.Version),ASN1_INT)
|
data:=ASNObject(ASNEncInt(Self.Version),ASN1_INT)
|
||||||
+ASNObject(Self.community,ASN1_OCTSTR)
|
+ASNObject(Self.community,ASN1_OCTSTR)
|
||||||
+ASNObject(data,Self.PDUType);
|
+ASNObject(data,Self.PDUType);
|
||||||
data:=ASNObject(data,ASN1_SEQ);
|
data:=ASNObject(data,ASN1_SEQ);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{==============================================================================|
|
{==============================================================================|
|
||||||
| Project : Delphree - Synapse | 002.002.000 |
|
| Project : Delphree - Synapse | 002.002.001 |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
| Content: SNMP traps |
|
| Content: SNMP traps |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
@ -24,6 +24,8 @@
|
|||||||
| (Found at URL: http://www.ararat.cz/synapse/) |
|
| (Found at URL: http://www.ararat.cz/synapse/) |
|
||||||
|==============================================================================}
|
|==============================================================================}
|
||||||
|
|
||||||
|
{$Q-}
|
||||||
|
|
||||||
unit SNMPTrap;
|
unit SNMPTrap;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
@ -197,12 +199,12 @@ begin
|
|||||||
Buffer := ASNObject(Buffer, ASN1_SEQ);
|
Buffer := ASNObject(Buffer, ASN1_SEQ);
|
||||||
Buffer := ASNObject(ASNEncInt(GenTrap), ASN1_INT)
|
Buffer := ASNObject(ASNEncInt(GenTrap), ASN1_INT)
|
||||||
+ ASNObject(ASNEncInt(SpecTrap), ASN1_INT)
|
+ ASNObject(ASNEncInt(SpecTrap), ASN1_INT)
|
||||||
+ ASNObject(ASNEncInt(TimeTicks), ASN1_TIMETICKS)
|
+ ASNObject(ASNEncUInt(TimeTicks), ASN1_TIMETICKS)
|
||||||
+ Buffer;
|
+ Buffer;
|
||||||
Buffer := ASNObject(MibToID(Enterprise), ASN1_OBJID)
|
Buffer := ASNObject(MibToID(Enterprise), ASN1_OBJID)
|
||||||
+ ASNObject(IPToID(TrapHost), ASN1_IPADDR)
|
+ ASNObject(IPToID(TrapHost), ASN1_IPADDR)
|
||||||
+ Buffer;
|
+ Buffer;
|
||||||
Buffer := ASNObject(Char(Version), ASN1_INT)
|
Buffer := ASNObject(ASNEncInt(Version), ASN1_INT)
|
||||||
+ ASNObject(Community, ASN1_OCTSTR)
|
+ ASNObject(Community, ASN1_OCTSTR)
|
||||||
+ ASNObject(Buffer, Self.PDUType);
|
+ ASNObject(Buffer, Self.PDUType);
|
||||||
Buffer := ASNObject(Buffer, ASN1_SEQ);
|
Buffer := ASNObject(Buffer, ASN1_SEQ);
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
| (Found at URL: http://www.ararat.cz/synapse/) |
|
| (Found at URL: http://www.ararat.cz/synapse/) |
|
||||||
|==============================================================================}
|
|==============================================================================}
|
||||||
|
|
||||||
|
{$Q-}
|
||||||
|
|
||||||
unit SNTPsend;
|
unit SNTPsend;
|
||||||
|
|
||||||
|
68
synacode.pas
68
synacode.pas
@ -1,5 +1,5 @@
|
|||||||
{==============================================================================|
|
{==============================================================================|
|
||||||
| Project : Delphree - Synapse | 001.003.003 |
|
| Project : Delphree - Synapse | 001.004.000 |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
| Content: Coding and decoding support |
|
| Content: Coding and decoding support |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
@ -23,6 +23,8 @@
|
|||||||
| (Found at URL: http://www.ararat.cz/synapse/) |
|
| (Found at URL: http://www.ararat.cz/synapse/) |
|
||||||
|==============================================================================}
|
|==============================================================================}
|
||||||
|
|
||||||
|
{$Q-}
|
||||||
|
|
||||||
unit SynaCode;
|
unit SynaCode;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
@ -30,10 +32,18 @@ interface
|
|||||||
uses
|
uses
|
||||||
sysutils;
|
sysutils;
|
||||||
|
|
||||||
|
type
|
||||||
|
TSpecials=set of char;
|
||||||
|
|
||||||
const
|
const
|
||||||
SpecialChar:set of char
|
SpecialChar:TSpecials
|
||||||
=['=','(',')','[',']','<','>',':',';','.',',','@','/','?','\','"','_'];
|
=['=','(',')','[',']','<','>',':',';','.',',','@','/','?','\','"','_'];
|
||||||
|
|
||||||
|
URLFullSpecialChar:TSpecials
|
||||||
|
=[';','/','?',':','@','=','&','#'];
|
||||||
|
URLSpecialChar:TSpecials
|
||||||
|
=[#$00..#$1f,'_','<','>','"','%','{','}','|','\','^','~','[',']','`',#$7f..#$ff];
|
||||||
|
|
||||||
TableBase64=
|
TableBase64=
|
||||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
||||||
TableUU=
|
TableUU=
|
||||||
@ -153,8 +163,13 @@ type
|
|||||||
1: (BufLong: array[0..15] of integer);
|
1: (BufLong: array[0..15] of integer);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function DecodeTriplet(Value:string;limiter:char):string;
|
||||||
function DecodeQuotedPrintable(value:string):string;
|
function DecodeQuotedPrintable(value:string):string;
|
||||||
|
function DecodeURL(value:string):string;
|
||||||
|
function EncodeTriplet(value:string;limiter:char;specials:TSpecials):string;
|
||||||
function EncodeQuotedPrintable(value:string):string;
|
function EncodeQuotedPrintable(value:string):string;
|
||||||
|
function EncodeURLElement(value:string):string;
|
||||||
|
function EncodeURL(value:string):string;
|
||||||
function Decode4to3(value,table:string):string;
|
function Decode4to3(value,table:string):string;
|
||||||
function DecodeBase64(value:string):string;
|
function DecodeBase64(value:string):string;
|
||||||
function EncodeBase64(value:string):string;
|
function EncodeBase64(value:string):string;
|
||||||
@ -170,8 +185,8 @@ function HMAC_MD5(text,key:string):string;
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
{==============================================================================}
|
{==============================================================================}
|
||||||
{DecodeQuotedPrintable}
|
{DecodeTriplet}
|
||||||
function DecodeQuotedPrintable(value:string):string;
|
function DecodeTriplet(Value:string;limiter:char):string;
|
||||||
var
|
var
|
||||||
x:integer;
|
x:integer;
|
||||||
c:char;
|
c:char;
|
||||||
@ -183,7 +198,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
c:=value[x];
|
c:=value[x];
|
||||||
inc(x);
|
inc(x);
|
||||||
if c<>'='
|
if c<>limiter
|
||||||
then result:=result+c
|
then result:=result+c
|
||||||
else
|
else
|
||||||
if x<length(value)
|
if x<length(value)
|
||||||
@ -197,8 +212,22 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{==============================================================================}
|
{==============================================================================}
|
||||||
{EncodeQuotedPrintable}
|
{DecodeQuotedPrintable}
|
||||||
function EncodeQuotedPrintable(value:string):string;
|
function DecodeQuotedPrintable(value:string):string;
|
||||||
|
begin
|
||||||
|
Result:=DecodeTriplet(Value,'=');
|
||||||
|
end;
|
||||||
|
|
||||||
|
{==============================================================================}
|
||||||
|
{DecodeURL}
|
||||||
|
function DecodeURL(value:string):string;
|
||||||
|
begin
|
||||||
|
Result:=DecodeTriplet(Value,'%');
|
||||||
|
end;
|
||||||
|
|
||||||
|
{==============================================================================}
|
||||||
|
{EncodeTriplet}
|
||||||
|
function EncodeTriplet(value:string;limiter:char;specials:TSpecials):string;
|
||||||
var
|
var
|
||||||
n:integer;
|
n:integer;
|
||||||
s:string;
|
s:string;
|
||||||
@ -207,12 +236,33 @@ begin
|
|||||||
for n:=1 to length(value) do
|
for n:=1 to length(value) do
|
||||||
begin
|
begin
|
||||||
s:=value[n];
|
s:=value[n];
|
||||||
if s[1] in (SpecialChar+[char(1)..char(31),char(128)..char(255)])
|
if s[1] in Specials
|
||||||
then s:='='+inttohex(ord(s[1]),2);
|
then s:=limiter+inttohex(ord(s[1]),2);
|
||||||
result:=result+s;
|
result:=result+s;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{==============================================================================}
|
||||||
|
{EncodeQuotedPrintable}
|
||||||
|
function EncodeQuotedPrintable(value:string):string;
|
||||||
|
begin
|
||||||
|
Result:=EncodeTriplet(Value,'=',SpecialChar+[char(1)..char(31),char(128)..char(255)]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{==============================================================================}
|
||||||
|
{EncodeURLElement}
|
||||||
|
function EncodeURLElement(value:string):string;
|
||||||
|
begin
|
||||||
|
Result:=EncodeTriplet(Value,'%',URLSpecialChar+URLFullSpecialChar);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{==============================================================================}
|
||||||
|
{EncodeURL}
|
||||||
|
function EncodeURL(value:string):string;
|
||||||
|
begin
|
||||||
|
Result:=EncodeTriplet(Value,'%',URLSpecialChar);
|
||||||
|
end;
|
||||||
|
|
||||||
{==============================================================================}
|
{==============================================================================}
|
||||||
{Decode4to3}
|
{Decode4to3}
|
||||||
function Decode4to3(value,table:string):string;
|
function Decode4to3(value,table:string):string;
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
| (Found at URL: http://www.ararat.cz/synapse/) |
|
| (Found at URL: http://www.ararat.cz/synapse/) |
|
||||||
|==============================================================================}
|
|==============================================================================}
|
||||||
|
|
||||||
|
{$Q-}
|
||||||
|
|
||||||
unit SynaUtil;
|
unit SynaUtil;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{==============================================================================|
|
{==============================================================================|
|
||||||
| Project : Delphree - Synapse | 001.000.000 |
|
| Project : Delphree - Synapse | 001.000.001 |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
| Content: Socket Independent Platform |
|
| Content: Socket Independent Platform |
|
||||||
|==============================================================================|
|
|==============================================================================|
|
||||||
@ -254,9 +254,11 @@ implementation
|
|||||||
function LSWSAStartup (wVersionRequired: Word; var WSData: TWSAData): Integer;
|
function LSWSAStartup (wVersionRequired: Word; var WSData: TWSAData): Integer;
|
||||||
begin
|
begin
|
||||||
WSData.wVersion:=wVersionRequired;
|
WSData.wVersion:=wVersionRequired;
|
||||||
WSData.wHighVersion:=wVersionRequired;
|
WSData.wHighVersion:=$101;
|
||||||
WSData.szDescription:='Synapse Platform Independent Socket Layer';
|
WSData.szDescription:='Synapse Platform Independent Socket Layer';
|
||||||
WSData.szSystemStatus:='On Linux';
|
WSData.szSystemStatus:='On Linux';
|
||||||
|
WSData.iMaxSockets:=32768;
|
||||||
|
WSData.iMaxUdpDg:=8192;
|
||||||
result:=0;
|
result:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user