support iscsi task function

This commit is contained in:
Lei Xue
2017-06-12 21:06:57 +08:00
parent 8ca6860460
commit 7a2b08ff80
9 changed files with 206 additions and 40 deletions

View File

@@ -25,6 +25,8 @@ import (
"github.com/gostor/gotgt/pkg/api"
)
const iSCSIDriverName = "iscsi"
const (
IOSTATE_FREE = iota
@@ -53,7 +55,7 @@ const (
IOSTATE_TX_END
)
var ISCSI_OPCODE_MASK = 0x3F
var ISCSI_OPCODE_MASK byte = 0x3F
type ISCSIDiscoveryMethod string
@@ -95,7 +97,7 @@ type ISCSITarget struct {
/*
* RFC 3720 iSCSI SSID = ISID , TPGT
* ISID is an 6 bytes number, TPGT is an 2 bytes number
* We combime ISID and TPGT together to be SSID
* We combine ISID and TPGT together to be SSID
*/
func MakeSSID(ISID uint64, TPGT uint16) uint64 {
SSID := ISID<<16 | uint64(TPGT)