admintf.c revision 5fbbe9c6367b156920d72becff64235e6274db32
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libxml/xmlreader.h>
#include <libxml/xmlwriter.h>
#include <pthread.h>
#include "isns_server.h"
#include "isns_cfg.h"
#include "isns_htab.h"
#include "isns_cache.h"
#include "isns_obj.h"
#include "isns_dd.h"
#include "isns_utils.h"
#include "isns_mgmt.h"
#include "isns_protocol.h"
#include "admintf.h"
extern const int UID_ATTR_INDEX[MAX_OBJ_TYPE_FOR_SIZE];
static isns_type_t
)
{
switch (obj) {
case Node:
break;
case DiscoveryDomain:
case DiscoveryDomainMember:
break;
case DiscoveryDomainSet:
case DiscoveryDomainSetMember:
break;
default:
ASSERT(0);
break;
}
return (type);
}
static uint32_t
)
{
switch (obj) {
case Node:
break;
case DiscoveryDomain:
case DiscoveryDomainMember:
break;
case DiscoveryDomainSet:
case DiscoveryDomainSetMember:
break;
default:
ASSERT(0);
break;
}
return (id);
}
/*
* ****************************************************************************
*
* cb_get_node_info: callback for get_node_op
* The routine process matching node and add a Node object elements
* to the response doc.
*
* p1 - matching node object
* p2 - lookup control data that was used for node look up
* returns parent index(newtork entity) in look up control.
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2
)
{
return (ERR_XML_ADDCHILD_FAILED);
}
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_ADDCHILD_FAILED);
}
if (n_node) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_ADDCHILD_FAILED);
}
/* get node name, alias, type and generate xml info */
return (ERR_XML_SETPROP_FAILED);
}
break;
break;
case ISNS_TARGET_NODE_TYPE:
(xmlChar *)TARGETTYPE);
break;
case ISNS_INITIATOR_NODE_TYPE:
(xmlChar *)INITIATORTYPE);
break;
case ISNS_CONTROL_NODE_TYPE:
(xmlChar *)CONTROLNODETYPE);
break;
default:
(xmlChar *)UNKNOWNTYPE);
}
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
/*
* A node can have all or no SCN subsribtion.
* May avoid redundant code with scsusrciption table.
*/
(xmlChar *)SCNINITSELFONLY);
return (ERR_XML_NEWCHILD_FAILED);
}
}
(xmlChar *)SCNTARGETSELFONLY);
return (ERR_XML_NEWCHILD_FAILED);
}
}
(xmlChar *)SCNTARGETSELFONLY);
return (ERR_XML_NEWCHILD_FAILED);
}
}
(xmlChar *)SCNOBJECTREMOVED);
return (ERR_XML_NEWCHILD_FAILED);
}
}
(xmlChar *)SCNOBJECTADDED);
return (ERR_XML_NEWCHILD_FAILED);
}
}
(xmlChar *)SCNOBJECTUPDATED);
return (ERR_XML_NEWCHILD_FAILED);
}
}
(xmlChar *)SCNMEMBERREMOVED);
return (ERR_XML_NEWCHILD_FAILED);
}
}
(xmlChar *)SCNMEMBERADDED);
return (ERR_XML_NEWCHILD_FAILED);
}
}
/* set the parent object id, i.e. the network entity object id */
/* pass back the node object element to add entity, portal info to it */
/* successful */
return (0);
}
/*
* ****************************************************************************
*
* cb_get_entity_info: callback for get_node_op
* The routine process matching network entity and add children elements
* to a Node object for given entity.
*
* p1 - matching entity object
* p2 - lookup control data that was used for node look up
* returns parent index(newtork entity) in look up control.
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2
)
{
char numbuf[32];
if (sub_node) {
if (subchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
if (subchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
/* convert the ipv6 to ipv4 */
} else {
}
if (subchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
}
if (subchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
}
if (subchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
if (subgrandchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
if (subgrandchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
}
attr =
if (subchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
}
} else {
return (ERR_XML_NEWCHILD_FAILED);
}
/* successful */
return (0);
}
/*
* ****************************************************************************
*
* cb_get_pg_info: callback for get_node_op
* The routine process matching portal group and returns ip address
* and port number for further portal processing.
*
* p1 - matching portal group object
* p2 - lookup control data that was used for portal group look up
* returns portal ip address, port and group tag in look up control.
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2
)
{
/* get pg portal ip address and port attributes */
/* successful */
return (0);
}
/*
* ****************************************************************************
*
* cb_get_portal_info: callback for get_node_op
* The routine process matching portal and add portal object info to
* the node object.
*
* p1 - matching portal object
* p2 - lookup control data that was used for portal look up
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2
)
{
char numbuf[32];
/* get portal object attributes. */
if (sub_node) {
/* convert the ipv6 to ipv4 */
} else {
}
if (subchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
}
NULL);
if (subchild_node) {
if (subgrandchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
if (subgrandchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
} else {
return (ERR_XML_NEWCHILD_FAILED);
}
if (subchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
if (subchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
}
if (subchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
}
if (subchild_node) {
if (subgrandchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
if (subgrandchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
} else {
return (ERR_XML_NEWCHILD_FAILED);
}
}
if (subchild_node) {
if (subgrandchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
if (subgrandchild_node == NULL) {
return (ERR_XML_NEWCHILD_FAILED);
}
} else {
return (ERR_XML_NEWCHILD_FAILED);
}
}
return (ERR_XML_NEWCHILD_FAILED);
}
/* successful */
return (0);
}
/*
* ****************************************************************************
*
* cb_get_dd_info: callback for get_dd_op
* The routine process matching dd object
*
* p1 - matching dd object
* p2 - lookup control data that was used for dd look up
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2
)
{
char numbuf[32];
return (ERR_SYNTAX_MISSING_ROOT);
}
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_ADDCHILD_FAILED);
}
if (n_node) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_ADDCHILD_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_NEWCHILD_FAILED);
}
} else {
return (ERR_XML_NEWCHILD_FAILED);
}
}
/* successful */
return (0);
}
/*
* ****************************************************************************
*
* cb_get_ddset_info: callback for get_ddset_op
* The routine process matching dd object
*
* p1 - matching dds object
* p2 - lookup control data that was used for dd set look up
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2
)
{
char numbuf[32];
return (ERR_SYNTAX_MISSING_ROOT);
}
if (n_obj) {
return (ERR_XML_NEWCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
if (n_node) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
/* get node name, alias, type and generate xml info */
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_NEWCHILD_FAILED);
}
} else {
return (ERR_XML_NEWCHILD_FAILED);
}
}
/* successful */
return (0);
}
/*
* ****************************************************************************
*
* cb_enumerate_node_info: callback for enumerate_node_op
* The routine is invoked for each node object.
*
* p1 - node object
* p2 - lookup control data that was used for node look up
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2
)
{
return (ERR_SYNTAX_MISSING_ROOT);
}
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
if (n_node) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
/* get node name, alias, type and generate xml info */
return (ERR_XML_SETPROP_FAILED);
}
break;
break;
case ISNS_TARGET_NODE_TYPE:
(xmlChar *)TARGETTYPE);
break;
case ISNS_INITIATOR_NODE_TYPE:
(xmlChar *)INITIATORTYPE);
break;
case ISNS_CONTROL_NODE_TYPE:
(xmlChar *)CONTROLNODETYPE);
break;
default:
(xmlChar *)UNKNOWNTYPE);
}
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
/* successful */
return (0);
}
/*
* ****************************************************************************
*
* i_enumerate_dd_dds_info:
* The routine is implemnetation for enumerate dd and enumerate dds.
*
* p1 - dd or dd set object
* p2 - lookup control data that was used for dd and dd set look up
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2,
)
{
char numbuf[32];
return (ERR_SYNTAX_MISSING_ROOT);
}
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
} else {
}
if (n_node) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
/* get name, id, feaure and generate xml info */
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_NEWCHILD_FAILED);
}
} else {
return (ERR_XML_NEWCHILD_FAILED);
}
}
} else {
/* get name, id, status and generate xml info */
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_NEWCHILD_FAILED);
}
} else {
return (ERR_XML_NEWCHILD_FAILED);
}
}
}
/* successful */
return (0);
}
/*
* ****************************************************************************
*
* cb_enumerate_dd_info: callback for enumerate_dd_op
* The routine is invoked for each dd object.
*
* p1 - dd object
* p2 - lookup control data that was used for dd look up
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2
)
{
}
/*
* ****************************************************************************
*
* cb_enumerate_ddset_info: callback for enumerate_dd_op
* The routine is invoked for each dd object.
*
* p1 - dd object
* p2 - lookup control data that was used for dd set look up
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2
)
{
}
/*
* ****************************************************************************
*
* cb_getAssociated_node_info:
* The routine is implemnetation for enumerate dd and enumerate dds.
*
* p1 - dd or dd set object
* p2 - lookup control data that was used for dd and dd set look up
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2
)
{
return (ERR_SYNTAX_MISSING_ROOT);
}
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
if (n_node) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
/* get node name, alias, type and generate xml info */
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
/* successful */
return (0);
}
/*
* ****************************************************************************
*
* cb_getAssociated_node_to_dd_info:
* The routine is implemnetation for enumerate dd and enumerate dds.
*
* p1 - dd or dd set object
* p2 - lookup control data that was used for dd and dd set look up
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2
)
{
return (ERR_SYNTAX_MISSING_ROOT);
}
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
if (n_node) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
/* get node name, alias, type and generate xml info */
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
/* successful */
return (0);
}
/*
* ****************************************************************************
*
* cb_getAssociated_dd_info:
* The routine is implemnetation for getting dds membership.
*
* p1 - dd or dd set object
* p2 - lookup control data that was used for dd and dd set look up
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2
)
{
return (ERR_SYNTAX_MISSING_ROOT);
}
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
if (n_node) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
/* get node name, alias, type and generate xml info */
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
/* successful */
return (0);
}
/*
* ****************************************************************************
*
* cb_getAssociated_dd_to_ddset_info:
* The routine is implemnetation for enumerate dd and enumerate dds.
*
* p1 - dd or dd set object
* p2 - lookup control data that was used for dd and dd set look up
* return - error code
*
* ****************************************************************************
*/
static int
void *p1,
void *p2
)
{
return (ERR_SYNTAX_MISSING_ROOT);
}
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
if (n_node) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
/* get node name, alias, type and generate xml info */
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
/* successful */
return (0);
}
/*
* ****************************************************************************
*
* handle_partial_success:
*
* doc - response doc to fill up
* ret - return code from the caller.
*
* ****************************************************************************
*/
static int
int ret
)
{
char numbuf[32];
return (ERR_SYNTAX_MISSING_ROOT);
}
if (n_obj) {
return (ERR_XML_NEWCHILD_FAILED);
}
PARTIAL_SUCCESS : 0));
return (ERR_XML_NEWCHILD_FAILED);
}
} else {
return (ERR_XML_ADDCHILD_FAILED);
}
return (ERR_XML_NEWCHILD_FAILED);
}
return (ERR_XML_NEWCHILD_FAILED);
}
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
return (0);
}
/*
* ****************************************************************************
*
* handle_partial_failure:
*
* doc - response doc to fill up
* ret - return code from the caller.
*
* ****************************************************************************
*/
static int
int ret,
)
{
char numbuf[32];
return (ERR_SYNTAX_MISSING_ROOT);
}
if (n_obj) {
/* some or all associations failed to create */
/* capture last error. should come up with all failed?? */
return (ERR_XML_NEWCHILD_FAILED);
}
return (ERR_XML_NEWCHILD_FAILED);
}
} else {
return (ERR_XML_ADDCHILD_FAILED);
}
return (ERR_XML_NEWCHILD_FAILED);
}
return (ERR_XML_NEWCHILD_FAILED);
}
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
return (0);
}
/*
* ****************************************************************************
*
* get_serverconfig_op:
* The routine process server administrative setting.
*
* doc - response doc to fill up.
*
* ****************************************************************************
*/
int
)
{
extern uint64_t esi_threshold;
extern ctrl_node_t *control_nodes;
extern pthread_mutex_t ctrl_node_mtx;
extern char data_store[MAXPATHLEN];
char numbuf[32];
int ret = 0;
return (ERR_SYNTAX_MISSING_ROOT);
}
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_ADDCHILD_FAILED);
}
return (ERR_XML_NEWCHILD_FAILED);
}
return (ERR_XML_NEWCHILD_FAILED);
}
return (ERR_XML_NEWCHILD_FAILED);
}
(void) pthread_mutex_lock(&ctrl_node_mtx);
if (control_nodes == NULL) {
(void) pthread_mutex_unlock(&ctrl_node_mtx);
return (ERR_XML_NEWCHILD_FAILED);
}
} else {
while (ctrl_node_p != NULL) {
(void) pthread_mutex_unlock(&ctrl_node_mtx);
return (ERR_XML_NEWCHILD_FAILED);
}
}
}
(void) pthread_mutex_unlock(&ctrl_node_mtx);
}
/*
* ****************************************************************************
*
* get_node_op:
* service get operation on a given node.
*
* req - contains all info for a request.
* doc - response doc to fill up
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
int i = 0;
char buff2[INET6_ADDRSTRLEN];
/* prepare lookup ctrl data for looking for the node object */
if (uid == 0) {
}
/* generate network entity object information */
/*
* !!! there might be no entity and portal info for
* !!! the node if it is not a registered node
*/
/* prepare lookup ctrl data for looking for entity */
/* cb_get_node_info callback returned Node object. */
if (uid == 0) {
}
}
/* generate portal information */
/* prepare lookup ctrl data for looking for pg */
/* lc.data[0].ptr contains node name */
/* prepare lookup ctrl data for looking for portal */
/* cb_get_node_info callback returned Node object. */
for (;;) {
if (uid != 0) {
/* we found a portal group */
/* it is a null pg if pgt is zero. */
/* pass ip addr */
/* pass port num */
/* pass pgt */
}
} else {
/*
* no more portal group which is
* tied to this stroage node object.
*/
break;
}
}
}
/* save error for this iteration */
if (ret != 0) {
}
ret = 0;
i++;
}
}
/*
* ****************************************************************************
*
* i_get_dd_dds_op:
* serves get operatrion on dd or dds.
*
* req - contains all info for a request.
* doc - response doc to fill up
* obj_type - object type(either dd or dd set)
*
* ****************************************************************************
*/
static int
/* any additional arguments go here */
)
{
int i = 0;
return (ERR_INVALID_MGMT_REQUEST);
}
/* prepare lookup ctrl data for looking for the node object */
if (uid == 0) {
/* set an error and continue. */
}
} else {
if (uid == 0) {
/* set an error and continue. */
}
}
/* save error for this iteration */
if (ret != 0) {
}
ret = 0;
i++;
}
}
/*
* ****************************************************************************
*
* i_delete_ddmember_op:
* serves delete member operatrion on dd.
*
* container - dd name
* member - node name
*
* ****************************************************************************
*/
static int
)
{
int ret = 0;
int len;
/* prepare lookup ctrl data for looking for the dd object */
} else {
}
return (ret);
}
/*
* ****************************************************************************
*
* i_delete_ddsetmember_op:
* serves delete member operatrion on dd set.
*
* container - dd set name
* member - dd name
*
* ****************************************************************************
*/
static int
)
{
int ret = 0;
/* prepare lookup ctrl data for looking for the dd-set object */
/* prepare lookup ctrl data for looking for the dd object */
} else {
}
} else {
}
return (ret);
}
/*
* ****************************************************************************
*
* get_dd_op:
* service get operation on given dd(s).
*
* req - contains all info for a request.
* doc - response doc to fill up
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
}
/*
* ****************************************************************************
*
* get_ddset_op:
* service get operation on given dd set(s).
*
* req - contains all info for a request.
* doc - response doc to fill up
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
}
/*
* ****************************************************************************
*
* enumerate_node_op:
* services enumerate node op.
*
* req - contains enumerate request info.
* doc - response doc to fill up
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
if (ret != 0) {
}
});
}
/*
* ****************************************************************************
*
* enumerate_dd_op:
* services enumerate discovery domain op.
*
* req - contains enumerate request info.
* doc - response doc to fill up
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
if (ret != 0) {
}
});
}
/*
* ****************************************************************************
*
* enumerate_ddset_op:
* services enumerate discovery domain set op.
*
* req - contains enumerate request info.
* doc - response doc to fill up
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
if (ret != 0) {
}
});
}
/*
* ****************************************************************************
*
* getassociated_dd_to_node_op:
* construct a list of node that is associated with a given Discovery
* Domain.
*
* req - contains getAssociated request info.
* doc - response doc to fill up
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
bmp_t *p;
FOR_EACH_MEMBER(p, n, uid, {
});
free(p);
} else {
}
/* save error for this iteration */
if (ret != 0) {
}
ret = 0;
i++;
}
}
/*
* ****************************************************************************
*
* getassociated_node_to_dd_op:
* construct a list of Discovery Doamins that is associated with a given
* node.
*
* req - contains getAssociated request info.
* doc - response doc to fill up
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
i++;
continue;
} else {
do {
} while (dd_id != 0);
};
} else {
}
/* save error for this iteration */
if (ret != 0) {
}
ret = 0;
i++;
}
}
/*
* ****************************************************************************
*
* getassociated_ddset_to_dd_op:
* construct a list of Discovery Doamins that is associated with a given
* Discover Domain set.
*
* req - contains getAssociated request info.
* doc - response doc to fill up
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
bmp_t *p;
FOR_EACH_MEMBER(p, n, uid, {
});
free(p);
} else {
}
/* save error for this iteration */
if (ret != 0) {
}
ret = 0;
i++;
}
}
/*
* ****************************************************************************
*
* getassociated_dd_to_ddset_op:
* construct a list of Discovery Doamin sets that is associated with a
* given Discovery Domain.
*
* req - contains getAssociated request info.
* doc - response doc to fill up
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
i++;
continue;
} else {
do {
} while (ddset_id != 0);
};
} else {
}
if (ret != 0) {
}
i++;
}
}
/*
* ****************************************************************************
*
* delete_dd_ddset_op:
* removes a list of dd or dd set.
*
* req - contains delete request info.
* doc - response doc to fill up
* obj_type - object type(either dd or dd set)
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
int i = 0, err_count = 0;
int different_err = 0;
return (ERR_SYNTAX_MISSING_ROOT);
}
return (ERR_INVALID_MGMT_REQUEST);
}
/* prepare lookup ctrl data for looking for the node object */
/* lock the cache for writing */
(void) cache_lock_write();
/* unlock the cache and sync the data */
} else {
/* unlock the cache and no need to sync data */
(void) cache_unlock_nosync();
/* set an error and continue. */
}
if (ret != 0) {
/* keep track if there are different errors encountered. */
}
err_count++;
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
if (n_node) {
return (ERR_XML_ADDCHILD_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
}
i ++;
}
}
/*
* ****************************************************************************
*
* delete_ddmember_ddsetmember_op:
* removes a list of dd memeber or dd seti member.
*
* req - contains delete request info.
* doc - response doc to fill up
* type - object type(either dd or dd set)
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
int i = 0, err_count = 0;
int different_err = 0;
int is_a_member;
return (ERR_INVALID_MGMT_REQUEST);
}
/* prepare lookup ctrl data for looking for the node object */
} else {
}
return (ERR_SYNTAX_MISSING_ROOT);
}
(void) cache_lock_write();
if (container_id != 0) {
if (member_id != 0) {
(container_id ==
}
if (member_id != 0 && is_a_member != 0) {
/* delete the dd member */
/* unlock the cache and sync the data */
} else {
/* unlock the cache and no need to sync */
(void) cache_unlock_nosync();
}
} else {
/* unlock the cache and no need to sync */
(void) cache_unlock_nosync();
}
if (ret != 0) {
/* keep track if there are different errors encountered. */
}
err_count++;
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
n_node =
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
} else {
n_node =
return (ERR_XML_SETPROP_FAILED);
}
return (ERR_XML_SETPROP_FAILED);
}
}
return (ERR_XML_ADDCHILD_FAILED);
}
}
i++;
}
}
/*
* ****************************************************************************
*
* create_ddmember_ddsetmember_op:
* removes a list of dd memeber or dd seti member.
*
* req - contains delete request info.
* doc - response doc to fill up
* type - object type(either dd or dd set)
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
int i = 0, err_count = 0;
isns_assoc_iscsi_t aiscsi = { 0 };
isns_assoc_dd_t add = { 0 };
int different_err = 0;
return (ERR_INVALID_MGMT_REQUEST);
}
/* prepare lookup ctrl data for looking for the node object */
} else {
}
return (ERR_SYNTAX_MISSING_ROOT);
}
(void) cache_lock_write();
if (container_id != 0) {
/* add the dd member */
/* unlock the cache and sync the data */
} else {
/* add the dd-set member */
/* unlock the cache and sync the data */
} else {
/* unlock the cache and no need to sync */
(void) cache_unlock_nosync();
}
}
} else {
/* unlock the cache and no need to sync */
(void) cache_unlock_nosync();
}
if (ret != 0) {
/* keep track if there are different errors encountered. */
}
err_count++;
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
n_node =
return (ERR_XML_SETPROP_FAILED);
}
NULL) {
return (ERR_XML_SETPROP_FAILED);
}
} else {
n_node =
return (ERR_XML_SETPROP_FAILED);
}
NULL) {
return (ERR_XML_SETPROP_FAILED);
}
}
return (ERR_XML_ADDCHILD_FAILED);
}
}
i++;
}
}
/*
* ****************************************************************************
*
* rename_dd_ddset_op:
* removes a list of dd memeber or dd seti member.
*
* req - contains delete request info.
* doc - response doc to fill up
* type - object type(either dd or dd set)
*
* ****************************************************************************
*/
static int
/* any additional arguments go here */
)
{
int i = 0, err_count = 0;
int different_err = 0;
return (ERR_INVALID_MGMT_REQUEST);
}
/* prepare lookup ctrl data for looking for the node object */
return (ERR_SYNTAX_MISSING_ROOT);
}
/* id is checked to be not NULL before calling this routine. */
(void) cache_lock_write();
/* the length of the name need to include the */
/* null terminator and be on 4 bytes aligned */
/* release the lock and sync the data */
} else {
/* release the lock and no need to sync */
(void) cache_unlock_nosync();
}
if (ret != 0) {
/* keep track if there are different errors encountered. */
}
err_count++;
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
if (n_node) {
return (ERR_XML_ADDCHILD_FAILED);
} else {
NULL) {
return (ERR_XML_SETPROP_FAILED);
}
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
}
i++;
}
}
/*
* ****************************************************************************
*
* update_dd_ddset_op:
* removes a list of dd memeber or dd seti member.
*
* req - contains delete request info.
* doc - response doc to fill up
* type - object type(either dd or dd set)
*
* ****************************************************************************
*/
static int
/* any additional arguments go here */
)
{
int i = 0, err_count = 0;
int different_err = 0;
return (ERR_INVALID_MGMT_REQUEST);
}
/* prepare lookup ctrl data for looking for the node object */
return (ERR_SYNTAX_MISSING_ROOT);
}
/* lock the cache for writing */
(void) cache_lock_write();
/* enabled is checked to be not NULL before calling. */
/* unlock the cache and sync the data */
} else {
(void) cache_unlock_nosync();
}
if (ret != 0) {
/* keep track if there are different errors encountered. */
}
err_count++;
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
if (n_node) {
return (ERR_XML_ADDCHILD_FAILED);
} else {
NULL) {
return (ERR_XML_SETPROP_FAILED);
}
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
}
i++;
}
}
/*
* ****************************************************************************
*
* createModify_dd_ddset_op:
* removes a list of dd memeber or dd seti member.
*
* req - contains delete request info.
* doc - response doc to fill up
*
* ****************************************************************************
*/
static int
/* any additional arguments go here */
)
{
int i = 0, err_count = 0;
int different_err = 0;
return (ERR_INVALID_MGMT_REQUEST);
}
return (ERR_SYNTAX_MISSING_ROOT);
}
return (ERR_INVALID_MGMT_REQUEST);
}
/* prepare lookup ctrl data for looking for the node object */
/* grab the write lock */
(void) cache_lock_write();
if (uid == 0) {
0, 0) :
0, 0);
if (ret == 0) {
if (ret != 0) {
}
/* release the lock and sync the cache and data store */
}
} else {
/* release the lock and no need to sync the data */
(void) cache_unlock_nosync();
}
if (ret != 0) {
/* keep track if there are different errors encountered. */
}
err_count++;
if (n_obj) {
return (ERR_XML_ADDCHILD_FAILED);
}
} else {
return (ERR_XML_ADDCHILD_FAILED);
}
if (n_node) {
return (ERR_XML_ADDCHILD_FAILED);
} else {
NULL) {
return (ERR_XML_SETPROP_FAILED);
}
}
} else {
return (ERR_XML_NEWNODE_FAILED);
}
}
i++;
}
}
/*
* ****************************************************************************
*
* createModify_dd_ddset_op:
* removes a list of dd memeber or dd seti member.
*
* req - contains delete request info.
* doc - response doc to fill up
*
* ****************************************************************************
*/
int
/* any additional arguments go here */
)
{
result_code_t ret = 0;
} else {
}
return (ret);
}