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
5fbbe9c6367b156920d72becff64235e6274db32wl * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern const int UID_ATTR_INDEX[MAX_OBJ_TYPE_FOR_SIZE];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cb_get_node_info: callback for get_node_op
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine process matching node and add a Node object elements
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to the response doc.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - matching node object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for node look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * returns parent index(newtork entity) in look up control.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewNode(NULL, (xmlChar *)NODEOBJECT);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get node name, alias, type and generate xml info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_ISCSI(ISNS_ISCSI_NAME_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_ISCSI(ISNS_ISCSI_NODE_TYPE_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_CONTROL_NODE_TYPE | ISNS_INITIATOR_NODE_TYPE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_CONTROL_NODE_TYPE | ISNS_TARGET_NODE_TYPE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_ISCSI(ISNS_ISCSI_ALIAS_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)ALIASATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * A node can have all or no SCN subsribtion.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * May avoid redundant code with scsusrciption table.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_ISCSI(ISNS_ISCSI_SCN_BITMAP_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (IS_SCN_INIT_SELF_INFO_ONLY(attr->value.ui)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)SCNSUBSCRIPTION,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (IS_SCN_TARGET_SELF_INFO_ONLY(attr->value.ui)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)SCNSUBSCRIPTION,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)SCNSUBSCRIPTION,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)SCNSUBSCRIPTION,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)SCNSUBSCRIPTION,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)SCNSUBSCRIPTION,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)SCNSUBSCRIPTION,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)SCNSUBSCRIPTION,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* set the parent object id, i.e. the network entity object id */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* pass back the node object element to add entity, portal info to it */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* successful */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cb_get_entity_info: callback for get_node_op
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine process matching network entity and add children elements
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to a Node object for given entity.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - matching entity object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for node look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * returns parent index(newtork entity) in look up control.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte xmlNodePtr n_node = (xmlNodePtr)lcp->data[2].ptr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte xmlNodePtr sub_node, subchild_node, subgrandchild_node;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)NETWORKENTITY, NULL);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_ENTITY(ISNS_EID_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)ENTITYID, (xmlChar *)attr->value.ptr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_ENTITY(ISNS_ENTITY_PROTOCOL_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_ENTITY(ISNS_MGMT_IP_ADDR_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* convert the ipv6 to ipv4 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_ENTITY(ISNS_TIMESTAMP_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)ENTITYREGTIMESTAMP, (xmlChar *)numbuf);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_ENTITY(ISNS_VERSION_RANGE_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte subchild_node = xmlAddChild(sub_node, subchild_node);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (attr->value.ui >> ISNS_VER_SHIFT) & ISNS_VERSION);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte subgrandchild_node = xmlNewChild(subchild_node, NULL,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)PROTOCOLMAXVERSION, (xmlChar *)numbuf);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(numbuf, "%u", attr->value.ui & ISNS_VERSION);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte subgrandchild_node = xmlNewChild(subchild_node, NULL,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)PROTOCOLMINVERSION, (xmlChar *)numbuf);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte &obj->attrs[ATTR_INDEX_ENTITY(ISNS_ENTITY_REG_PERIOD_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)REGISTRATIONPERIOD, (xmlChar *)numbuf);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* successful */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cb_get_pg_info: callback for get_node_op
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine process matching portal group and returns ip address
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and port number for further portal processing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - matching portal group object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for portal group look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * returns portal ip address, port and group tag in look up control.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get pg portal ip address and port attributes */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_PG(ISNS_PG_PORTAL_IP_ADDR_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) memcpy(lcp->data[1].ip, attr->value.ip, sizeof (in6_addr_t));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_PG(ISNS_PG_PORTAL_PORT_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_PG(ISNS_PG_TAG_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* successful */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cb_get_portal_info: callback for get_node_op
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine process matching portal and add portal object info to
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the node object.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - matching portal object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for portal look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte xmlNodePtr n_node = (xmlNodePtr)lcp->data[2].ptr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte xmlNodePtr sub_node, subchild_node, subgrandchild_node;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)PORTAL, NULL);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get portal object attributes. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_PORTAL(ISNS_PORTAL_IP_ADDR_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* convert the ipv6 to ipv4 */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte subchild_node = xmlNewChild(sub_node, NULL, (xmlChar *)UDPTCPPORT,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_PORTAL(ISNS_PORTAL_PORT_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte subgrandchild_node = xmlNewChild(subchild_node, NULL,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)PORTTYPE, IS_PORT_UDP(attr->value.ui) ?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(numbuf, "%u", PORT_NUMBER(attr->value.ui));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte subgrandchild_node = xmlNewChild(subchild_node, NULL,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte subchild_node = xmlNewChild(sub_node, NULL, (xmlChar *)GROUPTAG,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_PORTAL(ISNS_PORTAL_NAME_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)SYMBOLICNAME, (xmlChar *)attr->value.ptr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_PORTAL(ISNS_ESI_INTERVAL_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_PORTAL(ISNS_ESI_PORT_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte subgrandchild_node = xmlNewChild(subchild_node, NULL,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)PORTTYPE, IS_PORT_UDP(attr->value.ui) ?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(numbuf, "%u", PORT_NUMBER(attr->value.ui));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte subgrandchild_node = xmlNewChild(subchild_node, NULL,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_PORTAL(ISNS_SCN_PORT_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte subgrandchild_node = xmlNewChild(subchild_node, NULL,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)PORTTYPE, IS_PORT_UDP(attr->value.ui) ?
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(numbuf, "%u", PORT_NUMBER(attr->value.ui));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte subgrandchild_node = xmlNewChild(subchild_node, NULL,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* successful */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cb_get_dd_info: callback for get_dd_op
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine process matching dd object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - matching dd object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for dd look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DD(ISNS_DD_NAME_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DD(ISNS_DD_ID_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DD(ISNS_DD_FEATURES_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)BOOTLISTENABLEDELEM,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)BOOTLISTENABLEDELEM,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* successful */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cb_get_ddset_info: callback for get_ddset_op
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine process matching dd object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - matching dds object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for dd set look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewNode(NULL, (xmlChar *)DDSETOBJECT);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get node name, alias, type and generate xml info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DDS(ISNS_DD_SET_NAME_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DDS(ISNS_DD_SET_ID_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DDS(ISNS_DD_SET_STATUS_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)ENABLEDELEM,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte sub_node = xmlNewChild(n_node, NULL, (xmlChar *)ENABLEDELEM,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* successful */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cb_enumerate_node_info: callback for enumerate_node_op
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine is invoked for each node object.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - node object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for node look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewNode(NULL, (xmlChar *)NODEOBJECT);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get node name, alias, type and generate xml info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_ISCSI(ISNS_ISCSI_NAME_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_ISCSI(ISNS_ISCSI_NODE_TYPE_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_CONTROL_NODE_TYPE | ISNS_INITIATOR_NODE_TYPE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte case ISNS_CONTROL_NODE_TYPE | ISNS_TARGET_NODE_TYPE:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_ISCSI(ISNS_ISCSI_ALIAS_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)ALIASATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* successful */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * i_enumerate_dd_dds_info:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine is implemnetation for enumerate dd and enumerate dds.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - dd or dd set object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for dd and dd set look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewNode(NULL, (xmlChar *)DDSETOBJECT);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get name, id, feaure and generate xml info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DD(ISNS_DD_NAME_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DD(ISNS_DD_ID_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DD(ISNS_DD_FEATURES_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)BOOTLISTENABLEDELEM, (xmlChar *)XMLTRUE);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)BOOTLISTENABLEDELEM, (xmlChar *)XMLFALSE);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get name, id, status and generate xml info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DDS(ISNS_DD_SET_NAME_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DDS(ISNS_DD_SET_ID_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DDS(ISNS_DD_SET_STATUS_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* successful */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cb_enumerate_dd_info: callback for enumerate_dd_op
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine is invoked for each dd object.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - dd object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for dd look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (i_enumerate_dd_dds_info(p1, p2, OBJ_DD));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cb_enumerate_ddset_info: callback for enumerate_dd_op
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine is invoked for each dd object.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - dd object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for dd set look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (i_enumerate_dd_dds_info(p1, p2, OBJ_DDS));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cb_getAssociated_node_info:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine is implemnetation for enumerate dd and enumerate dds.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - dd or dd set object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for dd and dd set look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_obj = xmlNewNode(NULL, (xmlChar *)ASSOCIATION);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewNode(NULL, (xmlChar *)DDOBJECTMEMBER);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get node name, alias, type and generate xml info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_ISCSI(ISNS_ISCSI_NAME_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)NODENAMEATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)DDNAMEATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* successful */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cb_getAssociated_node_to_dd_info:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine is implemnetation for enumerate dd and enumerate dds.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - dd or dd set object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for dd and dd set look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_obj = xmlNewNode(NULL, (xmlChar *)ASSOCIATION);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewNode(NULL, (xmlChar *)DDOBJECTMEMBER);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get node name, alias, type and generate xml info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)NODENAMEATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DD(ISNS_DD_NAME_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)DDNAMEATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* successful */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cb_getAssociated_dd_info:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine is implemnetation for getting dds membership.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - dd or dd set object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for dd and dd set look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_obj = xmlNewNode(NULL, (xmlChar *)ASSOCIATION);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewNode(NULL, (xmlChar *)DDSETOBJECTMEMBER);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get node name, alias, type and generate xml info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DD(ISNS_DD_NAME_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)DDNAMEATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)DDSETNAMEATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* successful */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cb_getAssociated_dd_to_ddset_info:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine is implemnetation for enumerate dd and enumerate dds.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p1 - dd or dd set object
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * p2 - lookup control data that was used for dd and dd set look up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * return - error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_obj = xmlNewNode(NULL, (xmlChar *)ASSOCIATION);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewNode(NULL, (xmlChar *)DDSETOBJECTMEMBER);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get node name, alias, type and generate xml info */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)DDNAMEATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte attr = &obj->attrs[ATTR_INDEX_DDS(ISNS_DD_SET_NAME_ATTR_ID)];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)DDSETNAMEATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* successful */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * handle_partial_success:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ret - return code from the caller.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_obj = xmlNewNode(NULL, (xmlChar *)RESULTELEMENT);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_obj = xmlAddPrevSibling(root->children, n_obj);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(numbuf, "%d", (ret != 0) ? PARTIAL_SUCCESS : 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewChild(n_obj, NULL, (xmlChar *)STATUSELEMENT,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewChild(n_obj, NULL, (xmlChar *)MESSAGEELEMENT,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewChild(n_obj, NULL, (xmlChar *)STATUSELEMENT,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewChild(n_obj, NULL, (xmlChar *)MESSAGEELEMENT,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * handle_partial_failure:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ret - return code from the caller.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_obj = xmlNewNode(NULL, (xmlChar *)RESULTELEMENT);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* some or all associations failed to create */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_obj = xmlAddPrevSibling(root->children, n_obj);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* capture last error. should come up with all failed?? */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewChild(n_obj, NULL, (xmlChar *)STATUSELEMENT,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewChild(n_obj, NULL, (xmlChar *)MESSAGEELEMENT,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) sprintf(numbuf, "%d", (ret != 0) ? ret : 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewChild(n_obj, NULL, (xmlChar *)STATUSELEMENT,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_node = xmlNewChild(n_obj, NULL, (xmlChar *)MESSAGEELEMENT,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)result_code_to_str((ret != 0) ? ret : 0));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * get_serverconfig_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The routine process server administrative setting.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (xmlNewChild(n_obj, NULL, (xmlChar *)DATASTORELOCATION,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (xmlNewChild(n_obj, NULL, (xmlChar *)ESIRETRYTHRESHOLD,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (xmlNewChild(n_obj, NULL, (xmlChar *)MANAGEMENTSCNENABLED,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (mgmt_scn) ? (uchar_t *)XMLTRUE : (uchar_t *)XMLFALSE) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (xmlNewChild(n_obj, NULL, (xmlChar *)CONTROLNODENAME,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (xmlNewChild(n_obj, NULL, (xmlChar *)CONTROLNODENAME,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * get_node_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * service get operation on a given node.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains all info for a request.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for the node object */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[1].ptr = (uchar_t *)doc; /* xml writer descriptor */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[0].ptr = (uchar_t *)req->req_data.data[i];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* generate network entity object information */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * !!! there might be no entity and portal info for
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * !!! the node if it is not a registered node
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for entity */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* cb_get_node_info callback returned Node object. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = cache_lookup(&lc2, &uid, cb_get_entity_info);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* generate portal information */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for pg */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc2.id[0] = ATTR_INDEX_PG(ISNS_PG_ISCSI_NAME_ATTR_ID);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* lc.data[0].ptr contains node name */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for portal */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* cb_get_node_info callback returned Node object. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* we found a portal group */
5fbbe9c6367b156920d72becff64235e6274db32wl /* it is a null pg if pgt is zero. */
5fbbe9c6367b156920d72becff64235e6274db32wl /* pass ip addr */
5fbbe9c6367b156920d72becff64235e6274db32wl /* pass port num */
5fbbe9c6367b156920d72becff64235e6274db32wl /* pass pgt */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * no more portal group which is
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * tied to this stroage node object.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* save error for this iteration */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * i_get_dd_dds_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * serves get operatrion on dd or dds.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains all info for a request.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * obj_type - object type(either dd or dd set)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((obj_type != OBJ_DD) && (obj_type != OBJ_DDS)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for the node object */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[1].ptr = (uchar_t *)doc; /* xml writer descriptor */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[0].ptr = (uchar_t *)req->req_data.data[i];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* set an error and continue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[0].ptr = (uchar_t *)req->req_data.data[i];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = cache_lookup(&lc, &uid, cb_get_ddset_info);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* set an error and continue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* save error for this iteration */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * i_delete_ddmember_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * serves delete member operatrion on dd.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * container - dd name
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * member - node name
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for the dd object */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * i_delete_ddsetmember_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * serves delete member operatrion on dd set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * container - dd set name
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * member - dd name
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for the dd-set object */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.id[0] = ATTR_INDEX_DDS(ISNS_DD_SET_NAME_ATTR_ID);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for the dd object */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = remove_dds_member(container_id, member_id);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * get_dd_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * service get operation on given dd(s).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains all info for a request.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * get_ddset_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * service get operation on given dd set(s).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains all info for a request.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * enumerate_node_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * services enumerate node op.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains enumerate request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = cache_lookup(&lc, NULL, cb_enumerate_node_info);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * enumerate_dd_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * services enumerate discovery domain op.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains enumerate request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = cache_lookup(&lc, NULL, cb_enumerate_dd_info);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * enumerate_ddset_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * services enumerate discovery domain set op.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains enumerate request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = cache_lookup(&lc, NULL, cb_enumerate_ddset_info);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * getassociated_dd_to_node_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * construct a list of node that is associated with a given Discovery
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains getAssociated request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[0].ptr = (uchar_t *)req->req_data.data[i];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc2.data[2].ptr = (uchar_t *)req->req_data.data[i];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* save error for this iteration */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * getassociated_node_to_dd_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * construct a list of Discovery Doamins that is associated with a given
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains getAssociated request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.id[0] = ATTR_INDEX_ISCSI(ISNS_ISCSI_NAME_ATTR_ID);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[0].ptr = (uchar_t *)req->req_data.data[i];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc2.data[2].ptr = (uchar_t *)req->req_data.data[i];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } while (dd_id != 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* save error for this iteration */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * getassociated_ddset_to_dd_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * construct a list of Discovery Doamins that is associated with a given
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Discover Domain set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains getAssociated request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.id[0] = ATTR_INDEX_DDS(ISNS_DD_SET_NAME_ATTR_ID);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[0].ptr = (uchar_t *)req->req_data.data[i];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc2.data[2].ptr = (uchar_t *)req->req_data.data[i];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* save error for this iteration */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * getassociated_dd_to_ddset_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * construct a list of Discovery Doamin sets that is associated with a
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * given Discovery Domain.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains getAssociated request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[0].ptr = (uchar_t *)req->req_data.data[i];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc2.data[2].ptr = (uchar_t *)req->req_data.data[i];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } while (ddset_id != 0);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * delete_dd_ddset_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * removes a list of dd or dd set.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains delete request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * obj_type - object type(either dd or dd set)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((lc_type != OBJ_DD) && (lc_type != OBJ_DDS)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for the node object */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[1].ptr = (uchar_t *)doc; /* xml writer descriptor */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[0].ptr = (uchar_t *)req->req_data.data[i];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* lock the cache for writing */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* remove the dd/ddset */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* unlock the cache and sync the data */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* unlock the cache and no need to sync data */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* set an error and continue. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* keep track if there are different errors encountered. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((n_obj = xmlAddChild(root, n_obj)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((n_node = xmlAddChild(n_obj, n_node)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (req->count == err_count && !different_err) ? B_TRUE : B_FALSE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * delete_ddmember_ddsetmember_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * removes a list of dd memeber or dd seti member.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains delete request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * type - object type(either dd or dd set)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((lc_type != OBJ_DD) && (lc_type != OBJ_DDS)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for the node object */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc2.id[0] = ATTR_INDEX_ISCSI(ISNS_ISCSI_NAME_ATTR_ID);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[0].ptr = (uchar_t *)req->req_data.pair[i]->container;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get the dd_id/dds_id */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc2.data[0].ptr = (uchar_t *)req->req_data.pair[i]->member;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* delete the dd member */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* unlock the cache and sync the data */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* unlock the cache and no need to sync */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* unlock the cache and no need to sync */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = (lc_type == OBJ_DD) ? ERR_MATCHING_DD_NOT_FOUND :
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* keep track if there are different errors encountered. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_obj = xmlNewNode(NULL, (xmlChar *)ASSOCIATION);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)NODENAMEATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)DDNAMEATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)DDNAMEATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_attr = xmlSetProp(n_node, (xmlChar *)DDSETNAMEATTR,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (req->count == err_count && !different_err) ? B_TRUE : B_FALSE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * create_ddmember_ddsetmember_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * removes a list of dd memeber or dd seti member.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains delete request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * type - object type(either dd or dd set)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((lc_type != OBJ_DD) && (lc_type != OBJ_DDS)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for the node object */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc2.id[0] = ATTR_INDEX_ISCSI(ISNS_ISCSI_NAME_ATTR_ID);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[0].ptr = (uchar_t *)req->req_data.pair[i]->container;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get the dd_id/dds_id */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* add the dd member */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* unlock the cache and sync the data */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* add the dd-set member */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* unlock the cache and sync the data */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* unlock the cache and no need to sync */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* unlock the cache and no need to sync */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = (lc_type == OBJ_DD) ? ERR_MATCHING_DD_NOT_FOUND :
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* keep track if there are different errors encountered. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte n_obj = xmlNewNode(NULL, (xmlChar *)ASSOCIATION);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)req->req_data.pair[i]->member) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (xmlChar *)req->req_data.pair[i]->member) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (req->count == err_count && !different_err) ? B_TRUE : B_FALSE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * rename_dd_ddset_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * removes a list of dd memeber or dd seti member.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains delete request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * type - object type(either dd or dd set)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((lc_type != OBJ_DD) && (lc_type != OBJ_DDS)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for the node object */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* id is checked to be not NULL before calling this routine. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[0].ui = *(req->req_data.attrlist[i]->id);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* get the dd_id/dds_id */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte name = (uchar_t *)req->req_data.attrlist[i]->name;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* the length of the name need to include the */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* null terminator and be on 4 bytes aligned */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* rename the dd/dds */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* release the lock and sync the data */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* release the lock and no need to sync */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = (lc_type == OBJ_DD) ? ERR_MATCHING_DD_NOT_FOUND :
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* keep track if there are different errors encountered. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((n_obj = xmlAddChild(root, n_obj)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((n_node = xmlAddChild(n_obj, n_node)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (req->count == err_count && !different_err) ? B_TRUE : B_FALSE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * update_dd_ddset_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * removes a list of dd memeber or dd seti member.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains delete request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * type - object type(either dd or dd set)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((lc_type != OBJ_DD) && (lc_type != OBJ_DDS)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for the node object */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[0].ptr = req->req_data.attrlist[i]->name;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* lock the cache for writing */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* enabled is checked to be not NULL before calling. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* unlock the cache and sync the data */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = (lc_type == OBJ_DD) ? ERR_MATCHING_DD_NOT_FOUND :
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* keep track if there are different errors encountered. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((n_obj = xmlAddChild(root, n_obj)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((n_node = xmlAddChild(n_obj, n_node)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (req->count == err_count && !different_err) ? B_TRUE : B_FALSE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * createModify_dd_ddset_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * removes a list of dd memeber or dd seti member.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains delete request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((lc_type != OBJ_DD) && (lc_type != OBJ_DDS)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((lc_type != OBJ_DD) && (lc_type != OBJ_DDS)) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* prepare lookup ctrl data for looking for the node object */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[1].ptr = (uchar_t *)doc; /* xml writer descriptor */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte lc.data[0].ptr = req->req_data.attrlist[i]->name,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* grab the write lock */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte adm_create_dd(&obj, req->req_data.attrlist[i]->name,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte adm_create_dds(&obj, req->req_data.attrlist[i]->name,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* release the lock and sync the cache and data store */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* release the lock and no need to sync the data */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* keep track if there are different errors encountered. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((n_obj = xmlAddChild(root, n_obj)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if ((n_node = xmlAddChild(n_obj, n_node)) == NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (req->count == err_count && !different_err) ? B_TRUE : B_FALSE));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * createModify_dd_ddset_op:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * removes a list of dd memeber or dd seti member.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * req - contains delete request info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * doc - response doc to fill up
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ****************************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* any additional arguments go here */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = rename_dd_ddset_op(req, doc, req->op_info.obj);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } else if (req->req_data.attrlist[0]->enabled != NULL) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ret = update_dd_ddset_op(req, doc, req->op_info.obj);