mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-06-13 14:38:43 +00:00
Protocol Phase 1 (Auth)
This commit is contained in:
@@ -145,6 +145,8 @@ public class EpAuthPacket : Packet
|
||||
|
||||
public override long Parse(byte[] data, uint offset, uint ends)
|
||||
{
|
||||
Tdu = null;
|
||||
|
||||
var oOffset = offset;
|
||||
|
||||
if (NotEnough(offset, ends, 1))
|
||||
@@ -155,7 +157,7 @@ public class EpAuthPacket : Packet
|
||||
|
||||
if (Command == EpAuthPacketCommand.Initialize)
|
||||
{
|
||||
AuthMode = (AuthenticationMode)(data[offset] >> 2 & 0x4);
|
||||
AuthMode = (AuthenticationMode)(data[offset] >> 2 & 0x3);
|
||||
EncryptionMode = (EncryptionMode)(data[offset++] & 0x7);
|
||||
}
|
||||
else if (Command == EpAuthPacketCommand.Acknowledge)
|
||||
@@ -185,6 +187,8 @@ public class EpAuthPacket : Packet
|
||||
|
||||
Tdu = PlainTdu.Parse(data, offset, ends);//, _warehouse);
|
||||
|
||||
Console.WriteLine("Auth TDU " + Tdu.Value.PayloadLength);
|
||||
|
||||
if (Tdu.Value.Class == TduClass.Invalid)
|
||||
return -(int)Tdu.Value.TotalLength;
|
||||
|
||||
|
||||
@@ -27,9 +27,10 @@ namespace Esiur.Net.Packets
|
||||
SessionEstablished = 0x47, // session established, session Id provided, switch to session mode, connection is still open
|
||||
|
||||
// Events
|
||||
ErrorTerminate = 0xC0,
|
||||
ErrorMustEncrypt = 0xC1,
|
||||
ErrorRetry = 0xC2,
|
||||
Established = 0xC0,
|
||||
ErrorTerminate = 0xC1,
|
||||
ErrorMustEncrypt = 0xC2,
|
||||
ErrorRetry = 0xC3,
|
||||
|
||||
IndicationEstablished = 0xC8,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user