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:
geby 2008-04-24 07:00:43 +00:00
parent 18bbf79351
commit 3afdb0701b
12 changed files with 110 additions and 24 deletions

View File

@ -1,5 +1,5 @@
{==============================================================================|
| Project : Delphree - Synapse | 001.003.001 |
| Project : Delphree - Synapse | 001.003.002 |
|==============================================================================|
| Content: support for ASN.1 coding and decoding |
|==============================================================================|
@ -25,6 +25,8 @@
| (Found at URL: http://www.ararat.cz/synapse/) |
|==============================================================================}
{$Q-}
unit ASN1Util;
interface

View File

@ -25,6 +25,8 @@
//RFC-1035, RFC-1183, RFC1706, RFC1712, RFC2163, RFC2230
{$Q-}
unit DNSsend;
interface
@ -63,7 +65,7 @@ const
Qtype_AAAA =28; //IP6 Address [Susan Thomson]
Qtype_LOC =29; //RFC-1876
Qtype_NXT =30; //RFC-2065
Qtype_SRV =33; //RFC-2052
Qtype_NAPTR =35; //RFC-2168
Qtype_KX =36;

View File

@ -1,5 +1,5 @@
{==============================================================================|
| Project : Delphree - Synapse | 002.000.000 |
| Project : Delphree - Synapse | 002.001.000 |
|==============================================================================|
| Content: HTTP client |
|==============================================================================|
@ -71,6 +71,7 @@ type
function HttpGetText(URL:string;Response:TStrings):Boolean;
function HttpGetBinary(URL:string;Response:TStream):Boolean;
function HttpPostBinary(URL:string;Data:TStream):Boolean;
function HttpPostURL(URL:string;URLData:string;Data:TStream):Boolean;
implementation
@ -422,5 +423,23 @@ begin
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.

View File

@ -23,6 +23,8 @@
| (Found at URL: http://www.ararat.cz/synapse/) |
|==============================================================================}
{$Q-}
unit MIMEchar;
interface

View File

@ -29,7 +29,7 @@ unit MIMEmess;
interface
uses
classes, Sysutils, MimePart, MimeChar, SynaUtil, MIMEInLn;
classes, Sysutils, MIMEpart, MimeChar, SynaUtil, MIMEInLn;
type

View File

@ -45,6 +45,8 @@ After you change the registry, you need to restart your computer!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
{$Q-}
unit PINGsend;
interface

View File

@ -1,5 +1,5 @@
{==============================================================================|
| Project : Delphree - Synapse | 002.003.000 |
| Project : Delphree - Synapse | 002.003.001 |
|==============================================================================|
| Content: SNMP client |
|==============================================================================|
@ -24,12 +24,14 @@
| (Found at URL: http://www.ararat.cz/synapse/) |
|==============================================================================}
{$Q-}
unit SNMPSend;
interface
uses
BlckSock, synautil, classes, sysutils, ASN1util;
BlckSock, synautil, classes, sysutils, ASN1Util;
const
@ -190,11 +192,11 @@ begin
data := data + ASNObject(s, ASN1_SEQ);
end;
data:=ASNObject(data,ASN1_SEQ);
data:=ASNObject(char(Self.ID),ASN1_INT)
+ASNObject(char(Self.ErrorStatus),ASN1_INT)
+ASNObject(char(Self.ErrorIndex),ASN1_INT)
data:=ASNObject(ASNEncInt(Self.ID),ASN1_INT)
+ASNObject(ASNEncInt(Self.ErrorStatus),ASN1_INT)
+ASNObject(ASNEncInt(Self.ErrorIndex),ASN1_INT)
+data;
data:=ASNObject(char(Self.Version),ASN1_INT)
data:=ASNObject(ASNEncInt(Self.Version),ASN1_INT)
+ASNObject(Self.community,ASN1_OCTSTR)
+ASNObject(data,Self.PDUType);
data:=ASNObject(data,ASN1_SEQ);

View File

@ -1,5 +1,5 @@
{==============================================================================|
| Project : Delphree - Synapse | 002.002.000 |
| Project : Delphree - Synapse | 002.002.001 |
|==============================================================================|
| Content: SNMP traps |
|==============================================================================|
@ -24,6 +24,8 @@
| (Found at URL: http://www.ararat.cz/synapse/) |
|==============================================================================}
{$Q-}
unit SNMPTrap;
interface
@ -197,12 +199,12 @@ begin
Buffer := ASNObject(Buffer, ASN1_SEQ);
Buffer := ASNObject(ASNEncInt(GenTrap), ASN1_INT)
+ ASNObject(ASNEncInt(SpecTrap), ASN1_INT)
+ ASNObject(ASNEncInt(TimeTicks), ASN1_TIMETICKS)
+ ASNObject(ASNEncUInt(TimeTicks), ASN1_TIMETICKS)
+ Buffer;
Buffer := ASNObject(MibToID(Enterprise), ASN1_OBJID)
+ ASNObject(IPToID(TrapHost), ASN1_IPADDR)
+ Buffer;
Buffer := ASNObject(Char(Version), ASN1_INT)
Buffer := ASNObject(ASNEncInt(Version), ASN1_INT)
+ ASNObject(Community, ASN1_OCTSTR)
+ ASNObject(Buffer, Self.PDUType);
Buffer := ASNObject(Buffer, ASN1_SEQ);

View File

@ -23,6 +23,7 @@
| (Found at URL: http://www.ararat.cz/synapse/) |
|==============================================================================}
{$Q-}
unit SNTPsend;

View File

@ -1,5 +1,5 @@
{==============================================================================|
| Project : Delphree - Synapse | 001.003.003 |
| Project : Delphree - Synapse | 001.004.000 |
|==============================================================================|
| Content: Coding and decoding support |
|==============================================================================|
@ -23,6 +23,8 @@
| (Found at URL: http://www.ararat.cz/synapse/) |
|==============================================================================}
{$Q-}
unit SynaCode;
interface
@ -30,10 +32,18 @@ interface
uses
sysutils;
type
TSpecials=set of char;
const
SpecialChar:set of char
SpecialChar:TSpecials
=['=','(',')','[',']','<','>',':',';','.',',','@','/','?','\','"','_'];
URLFullSpecialChar:TSpecials
=[';','/','?',':','@','=','&','#'];
URLSpecialChar:TSpecials
=[#$00..#$1f,'_','<','>','"','%','{','}','|','\','^','~','[',']','`',#$7f..#$ff];
TableBase64=
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
TableUU=
@ -153,8 +163,13 @@ type
1: (BufLong: array[0..15] of integer);
end;
function DecodeTriplet(Value:string;limiter:char):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 EncodeURLElement(value:string):string;
function EncodeURL(value:string):string;
function Decode4to3(value,table:string):string;
function DecodeBase64(value:string):string;
function EncodeBase64(value:string):string;
@ -170,8 +185,8 @@ function HMAC_MD5(text,key:string):string;
implementation
{==============================================================================}
{DecodeQuotedPrintable}
function DecodeQuotedPrintable(value:string):string;
{DecodeTriplet}
function DecodeTriplet(Value:string;limiter:char):string;
var
x:integer;
c:char;
@ -183,7 +198,7 @@ begin
begin
c:=value[x];
inc(x);
if c<>'='
if c<>limiter
then result:=result+c
else
if x<length(value)
@ -197,8 +212,22 @@ begin
end;
{==============================================================================}
{EncodeQuotedPrintable}
function EncodeQuotedPrintable(value:string):string;
{DecodeQuotedPrintable}
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
n:integer;
s:string;
@ -207,12 +236,33 @@ begin
for n:=1 to length(value) do
begin
s:=value[n];
if s[1] in (SpecialChar+[char(1)..char(31),char(128)..char(255)])
then s:='='+inttohex(ord(s[1]),2);
if s[1] in Specials
then s:=limiter+inttohex(ord(s[1]),2);
result:=result+s;
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}
function Decode4to3(value,table:string):string;

View File

@ -25,6 +25,8 @@
| (Found at URL: http://www.ararat.cz/synapse/) |
|==============================================================================}
{$Q-}
unit SynaUtil;
interface

View File

@ -1,5 +1,5 @@
{==============================================================================|
| Project : Delphree - Synapse | 001.000.000 |
| Project : Delphree - Synapse | 001.000.001 |
|==============================================================================|
| Content: Socket Independent Platform |
|==============================================================================|
@ -254,9 +254,11 @@ implementation
function LSWSAStartup (wVersionRequired: Word; var WSData: TWSAData): Integer;
begin
WSData.wVersion:=wVersionRequired;
WSData.wHighVersion:=wVersionRequired;
WSData.wHighVersion:=$101;
WSData.szDescription:='Synapse Platform Independent Socket Layer';
WSData.szSystemStatus:='On Linux';
WSData.iMaxSockets:=32768;
WSData.iMaxUdpDg:=8192;
result:=0;
end;