ConnectionParameters.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* Copyright (C) 2012-2016 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
  2. *
  3. * You can redistribute this program and/or modify it under the terms of
  4. * the GNU Lesser Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. */
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Text;
  10. using Utilities;
  11. namespace ISCSI.Server
  12. {
  13. public class ConnectionParameters
  14. {
  15. /// <summary>
  16. /// The default MaxRecvDataSegmentLength is used during Login
  17. /// </summary>
  18. public const int DefaultMaxRecvDataSegmentLength = 8192;
  19. public static int DeclaredMaxRecvDataSegmentLength = 262144;
  20. public ushort CID; // connection ID, generated by the initiator
  21. /// <summary>
  22. /// per direction parameter that the target or initator declares.
  23. /// maximum data segment length that the target (or initator) can receive in a single iSCSI PDU.
  24. /// </summary>
  25. public int InitiatorMaxRecvDataSegmentLength = DefaultMaxRecvDataSegmentLength;
  26. public int TargetMaxRecvDataSegmentLength = DeclaredMaxRecvDataSegmentLength;
  27. public uint StatSN = 0; // Initial StatSN, any number will do
  28. // Dictionary of current transfers: <transfer-tag, <command-bytes, length>>
  29. // offset - logical block address (sector)
  30. // length - data transfer length in bytes
  31. // Note: here incoming means data write operations to the target
  32. public Dictionary<uint, KeyValuePair<byte[], uint>> Transfers = new Dictionary<uint, KeyValuePair<byte[], uint>>();
  33. // Dictionary of transfer data: <transfer-tag, command-data>
  34. public Dictionary<uint, byte[]> TransferData = new Dictionary<uint, byte[]>();
  35. }
  36. }