asn1util.pas - support for encoding of 64bit MIB element

git-svn-id: https://svn.code.sf.net/p/synalist/code/trunk@229 7c85be65-684b-0410-a082-b2ed4fbef004
This commit is contained in:
geby 2021-06-18 13:16:38 +00:00
parent b0bd027e70
commit 6c49b09f77

View File

@ -1,9 +1,9 @@
{==============================================================================| {==============================================================================|
| Project : Ararat Synapse | 002.001.000 | | Project : Ararat Synapse | 002.001.001 |
|==============================================================================| |==============================================================================|
| Content: support for ASN.1 BER coding and decoding | | Content: support for ASN.1 BER coding and decoding |
|==============================================================================| |==============================================================================|
| Copyright (c)1999-2014, Lukas Gebauer | | Copyright (c)1999-2021, Lukas Gebauer |
| All rights reserved. | | All rights reserved. |
| | | |
| Redistribution and use in source and binary forms, with or without | | Redistribution and use in source and binary forms, with or without |
@ -33,7 +33,7 @@
| DAMAGE. | | DAMAGE. |
|==============================================================================| |==============================================================================|
| The Initial Developer of the Original Code is Lukas Gebauer (Czech Republic).| | The Initial Developer of the Original Code is Lukas Gebauer (Czech Republic).|
| Portions created by Lukas Gebauer are Copyright (c) 1999-2014 | | Portions created by Lukas Gebauer are Copyright (c) 1999-2021 |
| Portions created by Hernan Sanchez are Copyright (c) 2000. | | Portions created by Hernan Sanchez are Copyright (c) 2000. |
| All Rights Reserved. | | All Rights Reserved. |
|==============================================================================| |==============================================================================|
@ -378,9 +378,9 @@ end;
{==============================================================================} {==============================================================================}
function MibToId(Mib: String): AnsiString; function MibToId(Mib: String): AnsiString;
var var
x: Integer; x: int64;
function WalkInt(var s: String): Integer; function WalkInt(var s: String): int64;
var var
x: Integer; x: Integer;
t: AnsiString; t: AnsiString;
@ -396,7 +396,7 @@ var
t := Copy(s, 1, x - 1); t := Copy(s, 1, x - 1);
s := Copy(s, x + 1, Length(s) - x); s := Copy(s, x + 1, Length(s) - x);
end; end;
Result := StrToIntDef(t, 0); Result := StrToInt64Def(t, 0);
end; end;
begin begin
@ -414,7 +414,8 @@ end;
{==============================================================================} {==============================================================================}
function IdToMib(const Id: AnsiString): String; function IdToMib(const Id: AnsiString): String;
var var
x, y, n: Integer; x, y: int64;
n: Integer;
begin begin
Result := ''; Result := '';
n := 1; n := 1;