123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Utilities;
- namespace ISCSI.Server
- {
- public class TransferEntry
- {
- public SCSICommandPDU Command;
- public uint NextR2NSN;
- public TransferEntry(SCSICommandPDU command, uint nextR2NSN)
- {
- Command = command;
- NextR2NSN = nextR2NSN;
- }
- }
- public class ConnectionParameters
- {
-
-
-
- public const int DefaultMaxRecvDataSegmentLength = 8192;
- public static int DeclaredMaxRecvDataSegmentLength = 262144;
- public ushort CID;
-
-
-
-
- public int InitiatorMaxRecvDataSegmentLength = DefaultMaxRecvDataSegmentLength;
- public int TargetMaxRecvDataSegmentLength = DeclaredMaxRecvDataSegmentLength;
- public uint StatSN = 0;
-
- private Dictionary<uint, TransferEntry> n_transfers = new Dictionary<uint, TransferEntry>();
- public TransferEntry AddTransfer(uint transferTag, SCSICommandPDU command, uint nextR2NSN)
- {
- TransferEntry entry = new TransferEntry(command, nextR2NSN);
- n_transfers.Add(transferTag, entry);
- return entry;
- }
- public TransferEntry GetTransferEntry(uint transferTag)
- {
- TransferEntry result;
- n_transfers.TryGetValue(transferTag, out result);
- return result;
- }
- public void RemoveTransfer(uint transferTag)
- {
- n_transfers.Remove(transferTag);
- }
- }
- }
|