fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _ISNS_PROTOCOL_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _ISNS_PROTOCOL_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <netinet/in.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/socket.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/types.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNSP_VERSION (0x01)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DEFAULT_SERVER_PORT (3205)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNSP_HEADER_SIZE (12)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNSP_RSP_CODE_SIZE (4)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNSP_MAX_PAYLOAD_SIZE (65532)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNSP_MAX_PDU_SIZE (ISNSP_HEADER_SIZE + \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ISNSP_MAX_PAYLOAD_SIZE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_TLV_ATTR_ID_LEN (4)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_TLV_ATTR_LEN_LEN (4)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define MAX_ISNS_MESG_ATTR_ENTRIES (8)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define MAX_ISNS_OPER_ATTR_ENTRIES (32)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* iSNS Entity Protocol, iSNS Draft - section 6.2.2. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_PROTOCOL_NO (1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_PROTOCOL_ISCSI (2)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_PROTOCOL_FCP (3)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* iSNS Function IDs, iSNS Draft - section 4.1.3. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DEV_ATTR_REG (0x0001)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DEV_ATTR_QRY (0x0002)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DEV_GET_NEXT (0x0003)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DEV_DEREG (0x0004)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_SCN_REG (0x0005)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_SCN_DEREG (0x0006)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_SCN_EVENT (0x0007)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_SCN (0x0008)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_REG (0x0009)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_DEREG (0x000A)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DDS_REG (0x000B)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DDS_DEREG (0x000C)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ESI (0x000D)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_HEARTBEAT (0x000E)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DEV_ATTR_REG_RSP (0x8001)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DEV_ATTR_QRY_RSP (0x8002)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DEV_GET_NEXT_RSP (0x8003)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DEV_DEREG_RSP (0x8004)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_SCN_REG_RSP (0x8005)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_SCN_DEREG_RSP (0x8006)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_SCN_EVENT_RSP (0x8007)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_SCN_RSP (0x8008)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_REG_RSP (0x8009)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_DEREG_RSP (0x800A)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DDS_REG_RSP (0x800B)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DDS_DEREG_RSP (0x800C)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ESI_RSP (0x800D)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* iSNS Flags, iSNS Draft - section 5.1.4. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_FLAG_FIRST_PDU (0x0400)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_FLAG_LAST_PDU (0x0800)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_FLAG_REPLACE_REG (0x1000)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_FLAG_AUTH_BLK_PRESENTED (0x2000)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_FLAG_SERVER (0x4000)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_FLAG_CLIENT (0x8000)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* iSNS Response Status, iSNS Draft - section 5.4 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_SUCCESSFUL (0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_UNKNOWN_ERROR (1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_MSG_FORMAT_ERROR (2)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_INVALID_REGIS (3)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_INVALID_QRY (5)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_SRC_UNKNOWN (6)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_SRC_ABSENT (7)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_SRC_UNAUTHORIZED (8)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_NO_SUCH_ENTRY (9)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_VER_NOT_SUPPORTED (10)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_INTERNAL_ERROR (11)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_BUSY (12)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_OPTION_NOT_UNDERSTOOD (13)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_INVALID_UPDATE (14)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_MSG_NOT_SUPPORTED (15)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_SCN_EVENT_REJECTED (16)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_SCN_REGIS_REJECTED (17)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_ATTR_NOT_IMPL (18)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_ESI_NOT_AVAILABLE (21)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_INVALID_DEREGIS (22)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_RSP_REGIS_NOT_SUPPORTED (23)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* iSNS Attribute IDs, iSNS Draft - section 6.1. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DELIMITER_ATTR_ID (0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_EID_ATTR_ID (1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_PROTOCOL_ATTR_ID (2)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_MGMT_IP_ADDR_ATTR_ID (3)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_TIMESTAMP_ATTR_ID (4)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_VERSION_RANGE_ATTR_ID (5)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_REG_PERIOD_ATTR_ID (6)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_INDEX_ATTR_ID (7)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_NEXT_INDEX_ATTR_ID (8)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_ISAKMP_P1_ATTR_ID (11)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_CERT_ATTR_ID (12)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PORTAL_IP_ADDR_ATTR_ID (16)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PORTAL_PORT_ATTR_ID (17)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PORTAL_NAME_ATTR_ID (18)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ESI_INTERVAL_ATTR_ID (19)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ESI_PORT_ATTR_ID (20)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PORTAL_INDEX_ATTR_ID (22)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_SCN_PORT_ATTR_ID (23)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PORTAL_NEXT_INDEX_ATTR_ID (24)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PORTAL_SEC_BMP_ATTR_ID (27)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PORTAL_ISAKMP_P1_ATTR_ID (28)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PORTAL_ISAKMP_P2_ATTR_ID (29)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PORTAL_CERT_ATTR_ID (31)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ISCSI_NAME_ATTR_ID (32)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ISCSI_NODE_TYPE_ATTR_ID (33)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ISCSI_ALIAS_ATTR_ID (34)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ISCSI_SCN_BITMAP_ATTR_ID (35)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ISCSI_NODE_INDEX_ATTR_ID (36)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_WWNN_TOKEN_ATTR_ID (37)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_NODE_NEXT_INDEX_ATTR_ID (38)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ISCSI_AUTH_METHOD_ATTR_ID (42)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PG_ISCSI_NAME_ATTR_ID (48)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PG_PORTAL_IP_ADDR_ATTR_ID (49)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PG_PORTAL_PORT_ATTR_ID (50)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PG_TAG_ATTR_ID (51)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PG_INDEX_ATTR_ID (52)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PG_NEXT_ID_ATTR_ID (53)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_SET_ID_ATTR_ID (2049)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_SET_NAME_ATTR_ID (2050)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_SET_STATUS_ATTR_ID (2051)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_ID_ATTR_ID (2065)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_NAME_ATTR_ID (2066)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_ISCSI_INDEX_ATTR_ID (2067)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_ISCSI_NAME_ATTR_ID (2068)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_FC_PORT_NAME_ATTR_ID (2069)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_PORTAL_INDEX_ATTR_ID (2070)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_PORTAL_IP_ADDR_ATTR_ID (2071)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_PORTAL_PORT_ATTR_ID (2072)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_FEATURES_ATTR_ID (2078)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Entity Protocol, RFC 4171 - section 6.2.2. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_NO_PROTOCOL (1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_ISCSI (2)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_IFCP (3)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Protocol Version Range, RFC 4171 - section 6.2.5. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_VER_SHIFT (16)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_VERSION (0x0000FFFF)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Portal Port, RFC 4171 - section 6.3.2. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PORT_BITS (0x0000FFFF) /* Bits 16 - 31 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PORT_TYPE (0x00010000) /* Bit 15 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Portal Security Bitmap, RFC 4171 - section 6.3.9. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_TUNNEL_MODE_PREFERRED (0x0040) /* Bit 25 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_TRANS_MODE_PREFERRED (0x0020) /* Bit 26 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PFS_ENABLED (0x0010) /* Bit 27 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_AGGR_MODE_ENABLED (0x0008) /* Bit 28 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_MAIN_MODE_ENABLED (0x0004) /* Bit 29 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_IKE_IPSEC_ENABLED (0x0002) /* Bit 30 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_BITMAP_VALID (0x0001) /* Bit 31 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* iSCSI Node Type, RFC 4171 - section 6.4.2. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_TARGET_NODE_TYPE (0x0001)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_INITIATOR_NODE_TYPE (0x0002)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_CONTROL_NODE_TYPE (0x0004)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* iSCSI Node SCN Bitmap, RFC 4171 - section 6.4.4. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_INIT_SELF_INFO_ONLY (0x0080) /* Bit 24 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_TARGET_SELF_INFO_ONLY (0x0040) /* Bit 25 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_MGMT_REG (0x0020) /* Bit 26 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_OBJECT_REMOVED (0x0010) /* Bit 27 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_OBJECT_ADDED (0x0008) /* Bit 28 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_OBJECT_UPDATED (0x0004) /* Bit 29 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_MEMBER_REMOVED (0x0002) /* Bit 30 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_MEMBER_ADDED (0x0001) /* Bit 31 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Portal Group Tag, RFC 4171 - section 6.5.4. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_PG_TAG (0x0000FFFF) /* Bits 16 - 31 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* DDS Status, RFC 4171 - section 6.11.1.3. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DDS_STATUS (0x0001) /* Bit 31 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* DD Feature, RFC 4171 - section 6.11.2.9. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_BOOTLIST (0x0001) /* Bit 31 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* iSNS Defaults */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DEFAULT_PGT (0x00000001)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DEFAULT_DD_SET_ID (1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DEFAULT_DD_ID (1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Min/Max length of names */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DDS_MAX_NAME_LEN (256)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_DD_MAX_NAME_LEN (256)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ISCSI_MAX_NAME_LEN (224)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ISCSI_MAX_ALIAS_LEN (256)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_MIN_EID_LEN (3)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_ENTITY_MAX_EID_LEN (255)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_tlv {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t attr_id;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t attr_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t attr_value[1];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} isns_tlv_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_packet_data {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t version;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t func_id;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t payload_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t flags;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t xid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t seq;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int num_of_tlvs;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_tlv_t tlvs[MAX_ISNS_OPER_ATTR_ENTRIES];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} isns_packet_data_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_reg_mesg {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_tlv_t src_attr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int num_of_mesg_attrs;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_tlv_t *mesg_attrs[MAX_ISNS_MESG_ATTR_ENTRIES];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_tlv_t delimiter_attr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_tlv_t *operating_attrs[MAX_ISNS_OPER_ATTR_ENTRIES];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} isns_reg_mesg_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_resp_mesg {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t status[4];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_tlv_t messages_attrs[MAX_ISNS_MESG_ATTR_ENTRIES];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_tlv_t delimiter_attr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte isns_tlv_t operating_attrs[MAX_ISNS_OPER_ATTR_ENTRIES];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} isns_resp_mesg_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_pdu {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t version;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t func_id;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t payload_len;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t flags;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t xid;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint16_t seq;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t payload[1];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} isns_pdu_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_resp {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t status;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t data[1];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte} isns_resp_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _ISNS_PROTOCOL_H */