isns_server.h revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
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 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
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 * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * definitions for SMF.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISNS_SERVER_SVC_NAME "network/isns_server"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CONFIG_ESI_THRESHOLD "ESI_retry_threshold_count"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define CONFIG_CONTROL_NODES "Authorized_Control_Nodes"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FIRST_TAG_PORTAL ISNS_PORTAL_IP_ADDR_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FIRST_TAG_ASSOC_ISCSI ISNS_DD_ISCSI_INDEX_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define LAST_TAG_ISCSI ISNS_ISCSI_AUTH_METHOD_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define LAST_TAG_ASSOC_ISCSI ISNS_DD_ISCSI_NAME_ATTR_ID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (LAST_TAG_ASSOC_ISCSI - FIRST_TAG_ASSOC_ISCSI + 1)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ATTR_INDEX_ENTITY(TAG) ((TAG) - FIRST_TAG_ENTITY)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ATTR_INDEX_ISCSI(TAG) ((TAG) - FIRST_TAG_ISCSI)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ATTR_INDEX_PORTAL(TAG) ((TAG) - FIRST_TAG_PORTAL)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ATTR_INDEX_DDS(TAG) ((TAG) - FIRST_TAG_DDS)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ATTR_INDEX_ASSOC_ISCSI(TAG) ((TAG) - FIRST_TAG_ASSOC_ISCSI)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ATTR_INDEX_ASSOC_DD(TAG) ((TAG) - FIRST_TAG_ASSOC_DD)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ATTR_INDEX(TAG, TYPE) ((TAG) - TAG_RANGE[TYPE][0])
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ISCSI_ATTR(ISCSI, TAG) ((ISCSI)->attrs[ATTR_INDEX_ISCSI(TAG)].value)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * isns object type.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef enum isns_otype {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * iSNS objects as they are defined in RFC 4171.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * dummy object types for future extension.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * madeup object for internal implementation.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * lookup operation.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef enum {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * lookup control data.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct lookup_ctrl {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * isns object attribute
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_attr {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * isns generic object.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_obj {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * iSNS objects.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_dds {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_assoc_dd {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* parent object uid */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DDS_ENABLED(UI) ((UI) & (ISNS_DDS_STATUS))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define ENABLE_DDS(DDS) (((DDS)->status) |= (ISNS_DDS_STATUS))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DISABLE_DDS(DDS) (((DDS)->status) &= ~(ISNS_DDS_STATUS))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DD_BOOTLIST_ENABLED(UI) ((UI) & (ISNS_DD_BOOTLIST))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_dd {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_assoc_iscsi {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* parent object uid */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_iscsi {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* parent object uid */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* subordinate object uid(s) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if defined(MAX_ISCSI_CHILD) && (MAX_ISCSI_CHILD > 0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_ISCSI_TARGET(NODE) (((NODE)->type) & ISNS_TARGET_NODE_TYPE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_ISCSI_INITIATOR(NODE) (((NODE)->type) & ISNS_INITIATOR_NODE_TYPE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_ISCSI_CONTROL(NODE) (((NODE)->type) & ISNS_CONTROL_NODE_TYPE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_TYPE_TARGET(TYPE) ((TYPE) & ISNS_TARGET_NODE_TYPE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_TYPE_INITIATOR(TYPE) ((TYPE) & ISNS_INITIATOR_NODE_TYPE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_TYPE_CONTROL(TYPE) ((TYPE) & ISNS_CONTROL_NODE_TYPE)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_TYPE_UNKNOWN(TYPE) (!IS_TYPE_TARGET(TYPE) && \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_SCN_INIT_SELF_INFO_ONLY(UI) ((UI) & ISNS_INIT_SELF_INFO_ONLY)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_SCN_TARGET_SELF_INFO_ONLY(UI) ((UI) & ISNS_TARGET_SELF_INFO_ONLY)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_SCN_MGMT_REG(UI) ((UI) & ISNS_MGMT_REG)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_SCN_OBJ_REMOVED(UI) ((UI) & ISNS_OBJECT_REMOVED)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_SCN_OBJ_ADDED(UI) ((UI) & ISNS_OBJECT_ADDED)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_SCN_OBJ_UPDATED(UI) ((UI) & ISNS_OBJECT_UPDATED)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_SCN_MEMBER_REMOVED(UI) ((UI) & ISNS_MEMBER_REMOVED)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define IS_SCN_MEMBER_ADDED(UI) ((UI) & ISNS_MEMBER_ADDED)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_portal {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* parent object uid */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* subordinate object uid(s) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if defined(MAX_PORTAL_CHILD) && (MAX_PORTAL_CHILD > 0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_pg {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* parent object uid */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* subordinate object uid(s) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* ref count */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct isns_entity {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* parent object uid */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* subordinate object uid(s) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if defined(MAX_ENTITY_CHILD) && (MAX_ENTITY_CHILD > 0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PROTOCOL_MAX_VER(ENTITY) ((((ENTITY)->versions) >> \
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PROTOCOL_MIN_VER(ENTITY) (((ENTITY)->versions) & ISNS_VERSION)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define DEFAULT_ESI_INTVAL (3 * 60) /* 3 mintues */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define INFINITY (4294967295UL) /* >136 years, max # of uint32_t */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * function prototype.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _ISNS_SERVER_H */