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