DefaultParameters.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* Copyright (C) 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. namespace ISCSI
  8. {
  9. /// <summary>
  10. /// Default operational parameters for iSCSI session / connection, as specified in RFC 3720.
  11. /// </summary>
  12. public class DefaultParameters
  13. {
  14. public class Session
  15. {
  16. /// <summary>
  17. /// The maximum number of connections per session.
  18. /// </summary>
  19. public const int MaxConnections = 1;
  20. /// <summary>
  21. /// Allow the initiator to start sending data to a target as if it has received an initial R2T
  22. /// </summary>
  23. public const bool InitialR2T = true;
  24. public const bool ImmediateData = true;
  25. /// <summary>
  26. /// The total of all the DataSegmentLength of all PDUs in a sequence MUST not exceed MaxBurstLength.
  27. /// Maximum SCSI data payload in bytes in a Data-In or a solicited Data-Out iSCSI sequence (i.e. that belongs to a single command).
  28. /// Irrelevant to the target in general, the initiator instructs us using ExpectedDataTransferLength.
  29. /// </summary>
  30. public const int MaxBurstLength = 262144;
  31. /// <summary>
  32. /// The total of all the DataSegmentLength of all PDUs in a sequence MUST not exceed FirstBurstLength for unsolicited data.
  33. /// Maximum amount in bytes of unsolicited [SCSI] data an iSCSI initiator may send to the target during the execution of a single SCSI command.
  34. /// Irrelevant to the target in general, irrelevant when (InitialR2T = Yes and) ImmediateData = No.
  35. /// </summary>
  36. public const int FirstBurstLength = 65536;
  37. /// <summary>
  38. /// Minimum time, in seconds, to wait before attempting an explicit/implicit logout after connection termination / reset.
  39. /// </summary>
  40. public const int DefaultTime2Wait = 2;
  41. /// <summary>
  42. /// Maximum time, in seconds after an initial wait (Time2Wait), before which an active task reassignment
  43. /// is still possible after an unexpected connection termination or a connection reset.
  44. /// </summary>
  45. public const int DefaultTime2Retain = 20;
  46. public const int MaxOutstandingR2T = 1;
  47. public const bool DataPDUInOrder = true;
  48. public const bool DataSequenceInOrder = true;
  49. public const int ErrorRecoveryLevel = 0;
  50. }
  51. public class Connection
  52. {
  53. /// <summary>
  54. /// Maximum data segment length that the target or initator can receive in an iSCSI PDU.
  55. /// Per direction parameter that the target or initator declares.
  56. /// The default MaxRecvDataSegmentLength is used during Login.
  57. /// </summary>
  58. public const int MaxRecvDataSegmentLength = 8192;
  59. }
  60. }
  61. }