|
Packit Service |
646995 |
/*
|
|
Packit Service |
646995 |
* Copyright (C) 2011 Aastha Mehta
|
|
Packit Service |
646995 |
* Copyright (C) 2011 Mike Christie
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* maintained by open-iscsi@googlegroups.com
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* This program is free software; you can redistribute it and/or modify
|
|
Packit Service |
646995 |
* it under the terms of the GNU General Public License as published
|
|
Packit Service |
646995 |
* by the Free Software Foundation; either version 2 of the License, or
|
|
Packit Service |
646995 |
* (at your option) any later version.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* This program is distributed in the hope that it will be useful, but
|
|
Packit Service |
646995 |
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
646995 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
646995 |
* General Public License for more details.
|
|
Packit Service |
646995 |
*
|
|
Packit Service |
646995 |
* See the file COPYING included with this distribution for more details.
|
|
Packit Service |
646995 |
*/
|
|
Packit Service |
646995 |
#include <stdio.h>
|
|
Packit Service |
646995 |
#include <stdlib.h>
|
|
Packit Service |
646995 |
#include <string.h>
|
|
Packit Service |
646995 |
#include "iscsi_if.h"
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
#include "kern_err_table.h"
|
|
Packit Service |
646995 |
|
|
Packit Service |
646995 |
const char *kern_err_code_to_string(int err)
|
|
Packit Service |
646995 |
{
|
|
Packit Service |
646995 |
switch (err){
|
|
Packit Service |
646995 |
case ISCSI_OK:
|
|
Packit Service |
646995 |
return "ISCSI_OK: operation successful";
|
|
Packit Service |
646995 |
case ISCSI_ERR_DATASN:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_DATASN: Received invalid data sequence "
|
|
Packit Service |
646995 |
"number from target";
|
|
Packit Service |
646995 |
case ISCSI_ERR_DATA_OFFSET:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_DATA_OFFSET: Seeking offset beyond the size "
|
|
Packit Service |
646995 |
"of the iSCSI segment";
|
|
Packit Service |
646995 |
case ISCSI_ERR_MAX_CMDSN:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_MAX_CMDSN: Received invalid command sequence "
|
|
Packit Service |
646995 |
"number from target";
|
|
Packit Service |
646995 |
case ISCSI_ERR_EXP_CMDSN:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_EXP_CMDSN: Received invalid expected command " "sequence number from target";
|
|
Packit Service |
646995 |
case ISCSI_ERR_BAD_OPCODE:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_BAD_OPCODE: Received an invalid iSCSI opcode";
|
|
Packit Service |
646995 |
case ISCSI_ERR_DATALEN:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_DATALEN: Invalid data length value";
|
|
Packit Service |
646995 |
case ISCSI_ERR_AHSLEN:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_AHSLEN: Received an invalid AHS length";
|
|
Packit Service |
646995 |
case ISCSI_ERR_PROTO:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_PROTO: iSCSI protocol violation";
|
|
Packit Service |
646995 |
case ISCSI_ERR_LUN:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_LUN: LUN mismatch";
|
|
Packit Service |
646995 |
case ISCSI_ERR_BAD_ITT:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_BAD_ITT: Received invalid initiator task tag " "from target";
|
|
Packit Service |
646995 |
case ISCSI_ERR_CONN_FAILED:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_CONN_FAILED: iSCSI connection failed";
|
|
Packit Service |
646995 |
case ISCSI_ERR_R2TSN:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_R2TSN: Received invalid R2T (Ready to "
|
|
Packit Service |
646995 |
"Transfer) data sequence number from target";
|
|
Packit Service |
646995 |
case ISCSI_ERR_SESSION_FAILED:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_SESSION_FAILED: iSCSI session failed";
|
|
Packit Service |
646995 |
case ISCSI_ERR_HDR_DGST:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_HDR_DGST: Header digest mismatch";
|
|
Packit Service |
646995 |
case ISCSI_ERR_DATA_DGST:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_DATA_DGST: Data digest mismatch";
|
|
Packit Service |
646995 |
case ISCSI_ERR_PARAM_NOT_FOUND:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_PARAM_NOT_FOUND: Parameter not found";
|
|
Packit Service |
646995 |
case ISCSI_ERR_NO_SCSI_CMD:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_NO_SCSI_CMD: Could not look up SCSI command";
|
|
Packit Service |
646995 |
case ISCSI_ERR_INVALID_HOST:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_INVALID_HOST: iSCSI host is in an invalid "
|
|
Packit Service |
646995 |
"state";
|
|
Packit Service |
646995 |
case ISCSI_ERR_XMIT_FAILED:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_XMIT_FAILED: Transmission of iSCSI packet "
|
|
Packit Service |
646995 |
"failed";
|
|
Packit Service |
646995 |
case ISCSI_ERR_TCP_CONN_CLOSE:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_TCP_CONN_CLOSE: TCP connection closed";
|
|
Packit Service |
646995 |
case ISCSI_ERR_SCSI_EH_SESSION_RST:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_SCSI_EH_SESSION_RST: Session was dropped as "
|
|
Packit Service |
646995 |
"a result of SCSI error recovery";
|
|
Packit Service |
646995 |
case ISCSI_ERR_NOP_TIMEDOUT:
|
|
Packit Service |
646995 |
return "ISCSI_ERR_NOP_TIMEDOUT: A NOP has timed out";
|
|
Packit Service |
646995 |
default:
|
|
Packit Service |
646995 |
return "Invalid or unknown error code";
|
|
Packit Service |
646995 |
}
|
|
Packit Service |
646995 |
}
|