2019-10-12 19:26:28 +01:00
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
namespace DiscImageChef.Devices.Remote
|
|
|
|
|
{
|
2019-10-12 22:34:27 +01:00
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
2019-10-12 19:53:12 +01:00
|
|
|
public struct DicPacketHeader
|
2019-10-12 19:26:28 +01:00
|
|
|
{
|
2019-10-12 22:13:33 +01:00
|
|
|
public ulong id;
|
2019-10-12 19:26:28 +01:00
|
|
|
|
|
|
|
|
public uint len;
|
|
|
|
|
public byte version;
|
|
|
|
|
public DicPacketType packetType;
|
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
2019-10-12 22:34:27 +01:00
|
|
|
public readonly byte[] spare;
|
2019-10-12 19:26:28 +01:00
|
|
|
}
|
|
|
|
|
|
2019-10-12 22:34:27 +01:00
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
2019-10-12 19:53:12 +01:00
|
|
|
public struct DicPacketHello
|
2019-10-12 19:26:28 +01:00
|
|
|
{
|
|
|
|
|
public DicPacketHeader hdr;
|
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
|
|
|
|
|
public string application;
|
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
|
|
|
|
|
public string version;
|
|
|
|
|
|
|
|
|
|
public byte maxProtocol;
|
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
2019-10-12 22:34:27 +01:00
|
|
|
public readonly byte[] spare;
|
2019-10-12 19:26:28 +01:00
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
|
|
|
|
public string sysname;
|
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
|
|
|
|
public string release;
|
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
|
|
|
|
public string machine;
|
|
|
|
|
}
|
2019-10-12 22:34:27 +01:00
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
|
|
|
|
public struct DicPacketCommandListDevices
|
|
|
|
|
{
|
|
|
|
|
public DicPacketHeader hdr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
|
|
|
|
public struct DicPacketResponseListDevices
|
|
|
|
|
{
|
|
|
|
|
public readonly DicPacketHeader hdr;
|
|
|
|
|
public readonly ushort devices;
|
|
|
|
|
}
|
2019-10-13 20:54:10 +01:00
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
|
|
|
|
public struct DicPacketNop
|
|
|
|
|
{
|
|
|
|
|
public DicPacketHeader hdr;
|
|
|
|
|
public byte reasonCode;
|
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
|
|
|
|
public readonly byte[] spare;
|
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
|
|
|
|
public string reason;
|
2019-10-13 21:19:21 +01:00
|
|
|
|
|
|
|
|
public int errno;
|
2019-10-13 20:54:10 +01:00
|
|
|
}
|
2019-10-13 21:59:19 +01:00
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
|
|
|
|
|
public struct DicPacketCommandOpenDevice
|
|
|
|
|
{
|
|
|
|
|
public DicPacketHeader hdr;
|
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
|
|
|
|
|
public string device_path;
|
|
|
|
|
}
|
2019-10-12 19:26:28 +01:00
|
|
|
}
|