mirror of
https://github.com/esiur/esiur-dart.git
synced 2025-09-30 19:13:19 +00:00
1.3
This commit is contained in:
@@ -235,11 +235,14 @@ class IIPAuthPacket
|
||||
localMethod = AuthenticationMethod.values[ ((data[offset] >> 2) & 0x3)];
|
||||
var encrypt = ((data[offset++] & 0x2) == 0x2);
|
||||
|
||||
if (_notEnough(offset, ends, 1))
|
||||
return -_dataLengthNeeded;
|
||||
|
||||
|
||||
if (remoteMethod == AuthenticationMethod.Credentials
|
||||
if (remoteMethod == AuthenticationMethod.None)
|
||||
{
|
||||
if (localMethod == AuthenticationMethod.None)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
else if (remoteMethod == AuthenticationMethod.Credentials
|
||||
|| remoteMethod == AuthenticationMethod.Token)
|
||||
{
|
||||
if (localMethod == AuthenticationMethod.None)
|
||||
|
@@ -361,7 +361,8 @@ class IIPPacket
|
||||
resourceId = data.getUint32(offset);
|
||||
offset += 4;
|
||||
}
|
||||
else if (action == IIPPacketAction.QueryLink)
|
||||
else if (action == IIPPacketAction.QueryLink
|
||||
|| action == IIPPacketAction.LinkTemplates)
|
||||
{
|
||||
if (_notEnough(offset, ends, 2))
|
||||
return -_dataLengthNeeded;
|
||||
@@ -420,7 +421,8 @@ class IIPPacket
|
||||
offset += cl;
|
||||
|
||||
}
|
||||
else if (action == IIPPacketAction.GetProperty)
|
||||
else if (action == IIPPacketAction.Listen
|
||||
|| action == IIPPacketAction.Unlisten)
|
||||
{
|
||||
if (_notEnough(offset, ends, 5))
|
||||
return -_dataLengthNeeded;
|
||||
@@ -429,22 +431,32 @@ class IIPPacket
|
||||
offset += 4;
|
||||
|
||||
methodIndex = data[offset++];
|
||||
|
||||
}
|
||||
else if (action == IIPPacketAction.GetPropertyIfModified)
|
||||
{
|
||||
if (_notEnough(offset, ends, 9))
|
||||
return -_dataLengthNeeded;
|
||||
// else if (action == IIPPacketAction.GetProperty)
|
||||
// {
|
||||
// if (_notEnough(offset, ends, 5))
|
||||
// return -_dataLengthNeeded;
|
||||
|
||||
resourceId = data.getUint32(offset);
|
||||
offset += 4;
|
||||
// resourceId = data.getUint32(offset);
|
||||
// offset += 4;
|
||||
|
||||
methodIndex = data[offset++];
|
||||
// methodIndex = data[offset++];
|
||||
|
||||
resourceAge = data.getUint64(offset);
|
||||
offset += 8;
|
||||
// }
|
||||
// else if (action == IIPPacketAction.GetPropertyIfModified)
|
||||
// {
|
||||
// if (_notEnough(offset, ends, 9))
|
||||
// return -_dataLengthNeeded;
|
||||
|
||||
}
|
||||
// resourceId = data.getUint32(offset);
|
||||
// offset += 4;
|
||||
|
||||
// methodIndex = data[offset++];
|
||||
|
||||
// resourceAge = data.getUint64(offset);
|
||||
// offset += 8;
|
||||
|
||||
// }
|
||||
else if (action == IIPPacketAction.SetProperty)
|
||||
{
|
||||
if (_notEnough(offset, ends, 6))
|
||||
@@ -567,6 +579,7 @@ class IIPPacket
|
||||
|| action == IIPPacketAction.ResourceChildren
|
||||
|| action == IIPPacketAction.ResourceParents
|
||||
|| action == IIPPacketAction.ResourceHistory
|
||||
|| action == IIPPacketAction.LinkTemplates
|
||||
// Attribute
|
||||
|| action == IIPPacketAction.GetAllAttributes
|
||||
|| action == IIPPacketAction.GetAttributes)
|
||||
@@ -584,9 +597,9 @@ class IIPPacket
|
||||
offset += cl;
|
||||
}
|
||||
else if (action == IIPPacketAction.InvokeFunctionArrayArguments
|
||||
|| action == IIPPacketAction.InvokeFunctionNamedArguments
|
||||
|| action == IIPPacketAction.GetProperty
|
||||
|| action == IIPPacketAction.GetPropertyIfModified)
|
||||
|| action == IIPPacketAction.InvokeFunctionNamedArguments)
|
||||
//|| action == IIPPacketAction.GetProperty
|
||||
//|| action == IIPPacketAction.GetPropertyIfModified)
|
||||
{
|
||||
if (_notEnough(offset, ends, 1))
|
||||
return -_dataLengthNeeded;
|
||||
@@ -617,7 +630,9 @@ class IIPPacket
|
||||
offset += size;
|
||||
}
|
||||
}
|
||||
else if (action == IIPPacketAction.SetProperty)
|
||||
else if (action == IIPPacketAction.SetProperty
|
||||
|| action == IIPPacketAction.Listen
|
||||
|| action == IIPPacketAction.Unlisten)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
@@ -1,36 +1,36 @@
|
||||
class IIPPacketAction
|
||||
{
|
||||
// Request Manage
|
||||
static const int AttachResource = 0x0;
|
||||
static const int ReattachResource = 0x1;
|
||||
static const int DetachResource = 0x2;
|
||||
static const int CreateResource = 0x3;
|
||||
static const int DeleteResource = 0x4;
|
||||
static const int AddChild = 0x5;
|
||||
static const int RemoveChild = 0x6;
|
||||
static const int RenameResource = 0x7;
|
||||
class IIPPacketAction {
|
||||
// Request Manage
|
||||
static const int AttachResource = 0x0;
|
||||
static const int ReattachResource = 0x1;
|
||||
static const int DetachResource = 0x2;
|
||||
static const int CreateResource = 0x3;
|
||||
static const int DeleteResource = 0x4;
|
||||
static const int AddChild = 0x5;
|
||||
static const int RemoveChild = 0x6;
|
||||
static const int RenameResource = 0x7;
|
||||
|
||||
// Request Inquire
|
||||
static const int TemplateFromClassName = 0x8;
|
||||
static const int TemplateFromClassId = 0x9;
|
||||
static const int TemplateFromResourceId = 0xA;
|
||||
static const int QueryLink = 0xB;
|
||||
static const int ResourceHistory = 0xC;
|
||||
static const int ResourceChildren = 0xD;
|
||||
static const int ResourceParents = 0xE;
|
||||
// Request Inquire
|
||||
static const int TemplateFromClassName = 0x8;
|
||||
static const int TemplateFromClassId = 0x9;
|
||||
static const int TemplateFromResourceId = 0xA;
|
||||
static const int QueryLink = 0xB;
|
||||
static const int ResourceHistory = 0xC;
|
||||
static const int ResourceChildren = 0xD;
|
||||
static const int ResourceParents = 0xE;
|
||||
static const int LinkTemplates = 0xF;
|
||||
|
||||
// Request Invoke
|
||||
static const int InvokeFunctionArrayArguments = 0x10;
|
||||
static const int GetProperty = 0x11;
|
||||
static const int GetPropertyIfModified = 0x12;
|
||||
static const int SetProperty = 0x13;
|
||||
static const int InvokeFunctionNamedArguments = 0x14;
|
||||
// Request Invoke
|
||||
static const int InvokeFunctionArrayArguments = 0x10;
|
||||
static const int InvokeFunctionNamedArguments = 0x11;
|
||||
static const int Listen = 0x12;
|
||||
static const int Unlisten = 0x13;
|
||||
static const int SetProperty = 0x14;
|
||||
|
||||
// Request Attribute
|
||||
static const int GetAllAttributes = 0x18;
|
||||
static const int UpdateAllAttributes = 0x19;
|
||||
static const int ClearAllAttributes = 0x1A;
|
||||
static const int GetAttributes = 0x1B;
|
||||
static const int UpdateAttributes = 0x1C;
|
||||
static const int ClearAttributes = 0x1D;
|
||||
}
|
||||
// Request Attribute
|
||||
static const int GetAllAttributes = 0x18;
|
||||
static const int UpdateAllAttributes = 0x19;
|
||||
static const int ClearAllAttributes = 0x1A;
|
||||
static const int GetAttributes = 0x1B;
|
||||
static const int UpdateAttributes = 0x1C;
|
||||
static const int ClearAttributes = 0x1D;
|
||||
}
|
||||
|
Reference in New Issue
Block a user