/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* isnsadm.c : isnsadm CL
*
*/
#include <unistd.h>
#include <stdlib.h>
#include <devid.h>
#include <fcntl.h>
#include <door.h>
#include <errno.h>
#include <strings.h>
#include <libscf.h>
#include <libxml/xmlreader.h>
#include <libxml/xmlwriter.h>
#include <wchar.h>
#include <locale.h>
#include "isns_mgmt.h"
#include "isns_utils.h"
#include "isns_protocol.h"
#include "cmdparse.h"
#include "isnsadm.h"
/* object functions per subcommand */
static int list_node_func(int, char **, cmdOptions_t *, void *);
static int list_dd_func(int, char **, cmdOptions_t *, void *);
static int list_ddset_func(int, char **, cmdOptions_t *, void *);
static int add_node_func(int, char **, cmdOptions_t *, void *);
static int add_dd_func(int, char **, cmdOptions_t *, void *);
static int delete_dd_func(int, char **, cmdOptions_t *, void *);
static int delete_ddset_func(int, char **, cmdOptions_t *, void *);
static int create_dd_func(int, char **, cmdOptions_t *, void *);
static int create_ddset_func(int, char **, cmdOptions_t *, void *);
static int remove_node_func(int, char **, cmdOptions_t *, void *);
static int remove_dd_func(int, char **, cmdOptions_t *, void *);
static int modify_dd_func(int, char **, cmdOptions_t *, void *);
static int modify_ddset_func(int, char **, cmdOptions_t *, void *);
static int enable_ddset_func(int, char **, cmdOptions_t *, void *);
static int disable_ddset_func(int, char **, cmdOptions_t *, void *);
static int show_config_func(int, char **, cmdOptions_t *, void *);
static int i_enableddset(int, char **, boolean_t);
const char *, const char *);
uint32_t);
xmlChar **);
(unsigned)(n+2) * sizeof (xmlChar *))
#if LIBXML_VERSION >= 20904
#define XMLSTRING_CAST (const char *)
#else
#endif
/* object table based on definitions in isns_mgmt.h. */
{NODEOBJECT, Node},
{NULL, 0}
};
/*
* MAJOR - This should only change when there is an incompatible change made
* to the interfaces or the output.
*
* MINOR - This should change whenever there is a new command or new feature
* with no incompatible change.
*/
/*
* Add new options here
*/
/* tables set up based on cmdparse instructions */
{NULL, 0, 0, 0}
};
/*
* Add new subcommands here
*/
OPERAND_OPTIONAL_MULTIPLE, "node-name"},
OPERAND_MANDATORY_MULTIPLE, "node-name"},
OPERAND_MANDATORY_MULTIPLE, "node-name"},
OPERAND_NONE, NULL},
};
/*
* ****************************************************************************
*
* check_door_error
*
* input:
* errno from the door call.
*
* Returns:
* either door error or smf service error.
*
* ****************************************************************************
*/
static int
{
int ret;
} else {
(door_err == ERROR_DOOR_CALL_FAILED) ?
}
return (ret);
}
/*
* ****************************************************************************
*
* lookup an element based on the element name.
*
* reader - current xmlReaderReadPtr
* m_falg - indicate lookup result
* elem - name of element to look up.
* endelem - name of end element to look up.
*
* ****************************************************************************
*/
static xmlTextReaderPtr
{
return (NULL);
}
do {
/*
* if (xmlTextReaderName(reader) != NULL) {
* printf("%s ", xmlTextReaderName(reader));
* }
* printf("%d %d %d\n",
* xmlTextReaderDepth(reader),
* xmlTextReaderNodeType(reader),
* xmlTextReaderIsEmptyElement(reader));
*/
/*
* if match with elem, return the reader with READER_MATCH flag.
* if match with end elem, return the reader wtih
* END_READER_MATCH flag.
*/
*m_flag = READER_MATCH;
return (reader);
}
} else if (xmlTextReaderNodeType(reader) ==
return (reader);
}
}
return (NULL);
}
/*
* ****************************************************************************
*
* Routine for getAssociated operation
* Construct association request based on the name and calls door
* interface.
*
* name - name attributes of an object for getting an association
* assoc - association type
*
* ****************************************************************************
*/
static int
{
int fd;
return (ret);
}
return (ret);
}
return (ret);
}
assoc)) != 0) {
/*
* door frame work allocated a buffer when the date lager
* that rbuf. indicate if munmap is required on rbuf.
*/
return (ret);
}
return (0);
}
/*
* ****************************************************************************
*
* process_error_status
* The routine process non 0 status and print out error message.
*
* status - status code
* reader - reader that points to the message element.
*
* ****************************************************************************
*/
static void
{
int m_flag = 0;
switch (status) {
case ISNS_RSP_BUSY:
break;
case ISNS_RSP_INTERNAL_ERROR:
break;
if ((obj == DiscoveryDomain) ||
(obj == DiscoveryDomainMember)) {
} else {
}
break;
case PARTIAL_FAILURE:
break;
case ERR_NO_SUCH_ASSOCIATION:
if ((obj == DiscoveryDomain) ||
(obj == DiscoveryDomainMember)) {
} else {
}
break;
case ERR_ALREADY_ASSOCIATED:
if ((obj == DiscoveryDomain) ||
(obj == DiscoveryDomainMember)) {
} else {
}
break;
case ERR_NAME_IN_USE:
if ((obj == DiscoveryDomain) ||
(obj == DiscoveryDomainMember)) {
} else {
}
break;
default:
if (m_flag == READER_MATCH) {
(void) xmlTextReaderRead(reader);
(const char *) xmlTextReaderConstValue(reader));
} else {
}
}
}
/*
* ****************************************************************************
*
* print_partial_failure_info
* The routine prints partial failure info.
*
* status - status code
* reader - reader that points to the message element.
*
* ****************************************************************************
*/
static void
{
NULL) {
}
}
break;
}
}
if (obj == 0) {
}
switch (obj) {
case DiscoveryDomainMember:
for (i = 0; i < cnt; i++) {
}
}
}
}
break;
case DiscoveryDomainSetMember:
for (i = 0; i < cnt; i++) {
}
}
}
}
break;
case Node:
case DiscoveryDomain:
case DiscoveryDomainSet:
for (i = 0; i < cnt; i++) {
}
}
}
break;
}
}
/*
* ****************************************************************************
*
* process_result_response
* The routine process association data based on the association type.
*
* doc - result
* obj - associated object type
*
* ****************************************************************************
*/
static int
{
return (ERROR_XML_READER_NULL);
}
/* if status is 0, continue on. Otherwise return an error. */
RESULTELEMENT)) {
if (m_flag == READER_MATCH) {
status =
if (status != 0) {
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
if (status == PARTIAL_FAILURE) {
}
return (status);
}
} else {
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (ERROR_XML_STATUS_ELEM_NOT_FOUND);
}
} else {
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (ERROR_XML_STATUS_ELEM_NOT_FOUND);
}
} else {
return (ERROR_XML_READER_NULL);
}
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (0);
}
/*
* ****************************************************************************
*
* process_get_assoc_response
* The routine process association data based on the association type.
*
* doc - association data
* assoc - associatiion type
*
* ****************************************************************************
*/
static int
{
return (ERROR_XML_READER_NULL);
}
/* if status is 0, continue on. Otherwise return an error. */
RESULTELEMENT)) {
if (m_flag == READER_MATCH) {
status =
/* not an error */
if ((status != ERR_NO_SUCH_ASSOCIATION) &&
(status != ERR_NO_ASSOCIATED_DD_FOUND) &&
(status != ERR_NO_ASSOCIATED_DDSET_FOUND)) {
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (0);
} else {
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (status);
}
}
} else {
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (ERROR_XML_STATUS_ELEM_NOT_FOUND);
}
} else {
return (ERROR_XML_STATUS_ELEM_NOT_FOUND);
}
} else {
return (ERROR_XML_READER_NULL);
}
m_flag = 0;
switch (assoc) {
case node_to_dd:
/* process DD elements */
if (m_flag == END_READER_MATCH) {
(void) xmlTextReaderNext(reader);
break;
} else if (m_flag == READER_MATCH) {
}
if (h_printed) {
} else {
h_printed = 1;
}
} else {
if (h_printed) {
} else {
h_printed = 1;
}
}
}
m_flag = 0;
(void) xmlTextReaderRead(reader);
}
break;
case dd_to_node:
/* process the DiscoveryDoamin elements */
if (m_flag == END_READER_MATCH) {
(void) xmlTextReaderNext(reader);
break;
} else if (m_flag == READER_MATCH) {
}
} else {
}
}
m_flag = 0;
(void) xmlTextReaderRead(reader);
}
break;
case dd_to_ddset:
/* process the DiscoveryDoaminSet elements */
if (m_flag == END_READER_MATCH) {
(void) xmlTextReaderNext(reader);
break;
} else if (m_flag == READER_MATCH) {
}
if (h_printed) {
} else {
h_printed = 1;
}
} else {
}
}
m_flag = 0;
(void) xmlTextReaderRead(reader);
}
break;
case ddset_to_dd:
/* process the DiscoveryDoaminSet elements */
if (m_flag == END_READER_MATCH) {
(void) xmlTextReaderNext(reader);
break;
} else if (m_flag == READER_MATCH) {
}
} else {
}
}
m_flag = 0;
(void) xmlTextReaderRead(reader);
}
break;
default:
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (UNKNOWN);
}
if (status == PARTIAL_SUCCESS) {
}
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (status);
}
/*
* ****************************************************************************
*
* process_get_response :
* display data from the get response doc based on flag.
*
* obj - object type
* doc - docuemet to process
* flag - options from the subcommand
*
* ****************************************************************************
*/
static int
{
int tag_printed = 0;
return (ERROR_XML_READER_NULL);
}
/* if status is 0, continue on. Otherwise return an error. */
RESULTELEMENT)) {
if (m_flag == READER_MATCH) {
status =
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (status);
}
} else {
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (ERROR_XML_STATUS_ELEM_NOT_FOUND);
}
} else {
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (ERROR_XML_STATUS_ELEM_NOT_FOUND);
}
} else {
return (ERROR_XML_READER_NULL);
}
m_flag = 0;
switch (obj) {
case Node:
/* process the node elements */
NODEOBJECT, ISNSRESPONSE)) {
if (m_flag == END_READER_MATCH) {
break;
}
/* check the type */
/* move to next node object. */
(void) xmlTextReaderMoveToElement(reader);
(void) xmlTextReaderNext(reader);
continue;
}
/* move to next node object. */
(void) xmlTextReaderMoveToElement(reader);
(void) xmlTextReaderNext(reader);
continue;
}
} else {
goto out;
}
(const char *)xmlTextReaderConstValue(reader)) {
(const char *)xmlTextReaderConstValue(reader),
}
} else {
}
} else {
goto out;
}
(xmlChar *)"") == 0) {
} else {
(const char *)xmlTextReaderConstValue(reader),
}
}
}
/* type attribute exist based on the previous checking. */
(void) xmlTextReaderMoveToAttribute(reader,
(void) printf("\tType: %s\n",
(const char *)xmlTextReaderConstValue(reader) ?
/* print more details */
m_flag = 0;
/*
* No details for deregistered node.
* skip to next isns object.
*/
if (m_flag == READER_MATCH) {
/* move to entity id value. */
(const char *)
L"-");
}
(void) printf("\tNetwork Entity: %ws\n",
wc_name);
} else {
(void) printf("\tNework Entity: -\n");
}
} else if (m_flag == END_READER_MATCH) {
(void) xmlTextReaderRead(reader);
continue;
}
}
/* print portal info */
m_flag = 0;
if (m_flag == END_READER_MATCH) {
(void) xmlTextReaderRead(reader);
break;
}
/* move to the value of IP addr. */
(void) printf("\tPortal: %s",
/* get port number */
m_flag = 0;
(void) printf(":%d\n",
atoi((const char *)
} else {
(void) printf(":-\n");
}
}
m_flag = 0;
(void) printf("\t\tPortal Group: %s\n",
} else {
(void) printf(":-\n");
}
}
}
} /* Portal end */
node_to_dd)) != 0) {
goto out;
}
} /* verbose end */
(void) xmlTextReaderRead(reader);
m_flag = 0;
} /* end for node while */
break;
case DiscoveryDomain:
/* process the DiscoveryDoamin elements */
DDOBJECT, ISNSRESPONSE)) {
if (m_flag == END_READER_MATCH) {
(void) xmlTextReaderNext(reader);
break;
}
}
} else {
goto out;
}
0) {
goto out;
}
/* handle verbose */
dd_to_node)) != 0) {
goto out;
}
}
m_flag = 0;
}
break;
case DiscoveryDomainSet:
/* process the DiscoveryDoaminSet elements */
DDSETOBJECT, ISNSRESPONSE)) {
if (m_flag == END_READER_MATCH) {
(void) xmlTextReaderNext(reader);
break;
}
(const char *)xmlTextReaderConstValue(reader)) {
(const char *)xmlTextReaderConstValue(reader),
}
} else {
}
} else {
goto out;
}
m_flag = 0;
if (m_flag == READER_MATCH) {
/* move to entity id value. */
(void) printf("\tState: Enabled\n");
} else {
(void) printf("\tState: Disabled\n");
}
} else if (m_flag == END_READER_MATCH) {
(void) xmlTextReaderRead(reader);
}
}
/* handle verbose */
ddset_to_dd)) != 0) {
goto out;
}
}
m_flag = 0;
}
break;
case ServerConfig:
/* process the DiscoveryDoaminSet elements */
m_flag = 0;
if (m_flag == END_READER_MATCH) {
goto out;
}
m_flag = 0;
if (m_flag == READER_MATCH) {
(void) xmlTextReaderRead(reader);
(void) printf("\tData Store Location: %s\n",
(const char *)xmlTextReaderConstValue(reader) ?
}
}
m_flag = 0;
if (m_flag == READER_MATCH) {
(void) xmlTextReaderRead(reader);
(void) printf("\tEntity Status Inquiry Non-Response ");
(void) printf("Threshold: %d\n",
: 0);
}
}
m_flag = 0;
if (m_flag == READER_MATCH) {
(void) xmlTextReaderRead(reader);
(void) printf("\tManagement SCN Enabled: %s\n",
"yes" : "no");
}
}
m_flag = 0;
if (m_flag == READER_MATCH) {
if (!xmlTextReaderIsEmptyElement(reader)) {
(void) xmlTextReaderRead(reader);
(const char *)xmlTextReaderConstValue(reader),
}
if (tag_printed) {
if (xmlTextReaderConstValue(reader)) {
(const char *)
}
(void) printf(
"\t %ws\n",
wc_name);
} else {
(void) printf(
"\t %s\n",
"-");
}
} else {
if (xmlTextReaderConstValue(reader)) {
(const char *)
}
(void) printf(
"\tAuthorized Control Node Names: %ws\n",
wc_name);
} else {
(void) printf(
"\tAuthorized Control Node Names: %s\n",
"-");
}
tag_printed = 1;
}
} else {
(void) printf(
"\tAuthorized Control Node Names: %s\n", "-");
break;
}
} else {
break;
}
}
break;
default:
}
out:
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
if (status == PARTIAL_SUCCESS) {
}
return (ret);
}
/*
* ****************************************************************************
*
* cvt_enumerate_rsp_to_get_req:
* pull out object info from enumerate response and calls
* build_get_xml_doc based on object type.
*
* doc - enumerate resonse from the server.
* req_do - pointer to get request doc.
* object_type - isns object type.
* flag - user options
*
* ****************************************************************************
*/
static int
{
return (ERROR_XML_READER_NULL);
}
/* if status is 0, continue on. Otherwise return an error. */
RESULTELEMENT)) {
if (m_flag == READER_MATCH) {
status =
if (status != 0) {
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (status);
}
} else {
(void) xmlTextReaderClose(reader);
return (ERROR_XML_STATUS_ELEM_NOT_FOUND);
}
} else {
return (ERROR_XML_STATUS_ELEM_NOT_FOUND);
}
} else {
return (ERROR_XML_READER_NULL);
}
m_flag = 0;
/* XXX - validate isnsResponse element from response doc. */
switch (obj) {
case Node:
/* process the node elements */
NODEOBJECT, ISNSRESPONSE)) {
if (m_flag == END_READER_MATCH) {
(void) xmlTextReaderNext(reader);
break;
}
/* check the type */
/* move to next node object. */
(void) xmlTextReaderMoveToElement(reader);
(void) xmlTextReaderNext(reader);
continue;
}
/* move to next node object. */
(void) xmlTextReaderMoveToElement(reader);
(void) xmlTextReaderNext(reader);
continue;
}
} else {
goto out;
}
goto out;
}
} else {
goto out;
}
(void) xmlTextReaderRead(reader);
m_flag = 0;
} /* end for node while */
break;
case DiscoveryDomain:
/* process the DiscoveryDoamin elements */
DDOBJECT, ISNSRESPONSE)) {
if (m_flag == END_READER_MATCH) {
(void) xmlTextReaderNext(reader);
break;
}
goto out;
}
} else {
goto out;
}
m_flag = 0;
(void) xmlTextReaderRead(reader);
}
break;
case DiscoveryDomainSet:
/* process the DiscoveryDoaminSet elements */
DDSETOBJECT, ISNSRESPONSE)) {
if (m_flag == END_READER_MATCH) {
(void) xmlTextReaderNext(reader);
break;
}
(const char *)xmlTextReaderConstValue(reader)) {
goto out;
}
} else {
goto out;
}
m_flag = 0;
(void) xmlTextReaderRead(reader);
}
break;
default:
goto out;
}
/* if no object found, stop here. The status can be still 0. */
if (argxmlc != 0) {
req_doc)) != 0) {
return (ret);
}
} else {
if (ret == 0) {
/* indicate there is no error but not object is found. */
}
}
out:
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
if (argxmlc != 0) {
for (i = 0; i < argxmlc; i++) {
}
}
return (ret);
}
/*
* ****************************************************************************
*
* build_delete_xml_doc -
* build remove request doc based the name.
* the resulted doc is passed in the doc ptr.
*
* name - object type
* assoc - association type
* doc - ptr to the resulted doc
*
* ****************************************************************************
*/
static int
{
int i, len;
return (ERROR_XML_CREATE_BUFFER_FAILED);
}
return (ERROR_XML_CREATE_WRITER_FAILED);
}
return (ERROR_XML_START_DOC_FAILED);
}
/* Start element "isnsRequest". */
return (ERROR_XML_START_ELEMENT_FAILED);
}
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* request delete operation to get the entire list of obejct. */
return (ERROR_XML_START_ELEMENT_FAILED);
}
switch (obj) {
case DiscoveryDomain:
for (i = 0; i < operandLen; i++) {
/* start Discovery Domain element. */
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomain". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
}
break;
case DiscoveryDomainSet:
for (i = 0; i < operandLen; i++) {
/* start Discovery DomainSet element. */
(xmlChar *)DDSETOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomainSet". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
}
break;
case DiscoveryDomainMember:
for (i = 0; i < operandLen; i++) {
/* start Discovery Domain Member element. */
(xmlChar *)DDOBJECTMEMBER) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "DD Name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* Start attr "Node Name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomainMember. */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
}
break;
case DiscoveryDomainSetMember:
for (i = 0; i < operandLen; i++) {
/* start Discovery Domain Member element. */
(xmlChar *)DDSETOBJECTMEMBER) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "DD Set Name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* Start attr "DD Name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomainSetMember. */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
}
break;
default:
return (UNKNOWN);
}
/* end createModify */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsRequest". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
if (xmlTextWriterEndDocument(writer) < 0) {
return (ERROR_XML_END_DOC_FAILED);
}
/* XXX - copy NULL at the end by having one more extra byte */
return (ERROR_XML_STRDUP_FAILED);
}
return (0);
}
/*
* ****************************************************************************
*
* build_modify_xml_doc -
* build create request doc based the name.
* the resulted doc is passed in the doc ptr.
*
* operannLen - number of objects
* operand - object list
* enabled - indication of enable and disable boolean type element.
* doc - ptr to the resulted doc
*
* ****************************************************************************
*/
static int
{
int i, len;
return (ERROR_XML_CREATE_BUFFER_FAILED);
}
return (ERROR_XML_CREATE_WRITER_FAILED);
}
return (ERROR_XML_START_DOC_FAILED);
}
/* Start element "isnsRequest". */
return (ERROR_XML_START_ELEMENT_FAILED);
}
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* request createModify operation to get the entire list of obejct. */
return (ERROR_XML_START_ELEMENT_FAILED);
}
switch (obj) {
case DiscoveryDomain:
for (i = 0; i < operandLen; i++) {
/* start Discovery Domain element. */
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* write attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* write bootlist_enabled elem */
return (ERROR_XML_WRITE_ELEMENT_FAILED);
}
/* End element "DiscoveryDomain". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
}
break;
case DiscoveryDomainSet:
for (i = 0; i < operandLen; i++) {
/* start Discovery DomainSet element. */
(xmlChar *)DDSETOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* write enabled elem */
return (ERROR_XML_WRITE_ELEMENT_FAILED);
}
/* End element "DiscoveryDomainSet". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
}
break;
default:
return (UNKNOWN);
}
/* end createModify */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsRequest". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
if (xmlTextWriterEndDocument(writer) < 0) {
return (ERROR_XML_END_DOC_FAILED);
}
/* XXX - copy NULL at the end by having one more extra byte */
return (ERROR_XML_STRDUP_FAILED);
}
return (0);
}
/*
* ****************************************************************************
*
* build_rename_xml_doc -
* build create request doc based the name.
* the resulted doc is passed in the doc ptr.
*
* assoc - a new name
* id - index of the object of which name to be changed
* doc - ptr to the resulted doc
*
* ****************************************************************************
*/
static int
{
int len;
return (ERROR_XML_CREATE_BUFFER_FAILED);
}
return (ERROR_XML_CREATE_WRITER_FAILED);
}
return (ERROR_XML_START_DOC_FAILED);
}
/* Start element "isnsRequest". */
return (ERROR_XML_START_ELEMENT_FAILED);
}
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* request createModify operation to get the entire list of obejct. */
return (ERROR_XML_START_ELEMENT_FAILED);
}
switch (obj) {
case DiscoveryDomain:
/* start Discovery Domain element. */
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* write attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* write attr "id". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomain". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
break;
case DiscoveryDomainSet:
/* start Discovery DomainSet element. */
(xmlChar *)DDSETOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* write attr "id". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomainSet". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
break;
default:
return (UNKNOWN);
}
/* end createModify */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsRequest". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
if (xmlTextWriterEndDocument(writer) < 0) {
return (ERROR_XML_END_DOC_FAILED);
}
/* XXX - copy NULL at the end by having one more extra byte */
return (ERROR_XML_STRDUP_FAILED);
}
return (0);
}
/*
* ****************************************************************************
*
* build_create_xml_doc -
* build create request doc based the name.
* the resulted doc is passed in the doc ptr.
*
* name - object type
* assoc - association type
* doc - ptr to the resulted doc
*
* ****************************************************************************
*/
static int
{
int i, len;
return (ERROR_XML_CREATE_BUFFER_FAILED);
}
return (ERROR_XML_CREATE_WRITER_FAILED);
}
return (ERROR_XML_START_DOC_FAILED);
}
/* Start element "isnsRequest". */
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* request createModify operation to get the entire list of obejct. */
return (ERROR_XML_START_ELEMENT_FAILED);
}
switch (obj) {
case DiscoveryDomain:
for (i = 0; i < operandLen; i++) {
/* start Discovery Domain element. */
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomain". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
}
break;
case DiscoveryDomainSet:
for (i = 0; i < operandLen; i++) {
/* start Discovery DomainSet element. */
(xmlChar *)DDSETOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomainSet". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
}
break;
case DiscoveryDomainMember:
for (i = 0; i < operandLen; i++) {
/* start Discovery Domain Member element. */
(xmlChar *)DDOBJECTMEMBER) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "DD Name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* Start attr "Node Name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomainMember. */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
}
break;
case DiscoveryDomainSetMember:
for (i = 0; i < operandLen; i++) {
/* start Discovery Domain Member element. */
(xmlChar *)DDSETOBJECTMEMBER) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "DD Set Name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* Start attr "DD Name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomainSetMember. */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
}
break;
default:
return (UNKNOWN);
}
/* end createModify */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsRequest". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
if (xmlTextWriterEndDocument(writer) < 0) {
return (ERROR_XML_END_DOC_FAILED);
}
/* XXX - copy NULL at the end by having one more extra byte */
return (ERROR_XML_STRDUP_FAILED);
}
return (0);
}
/*
* ****************************************************************************
*
* build_assoc_xml_doc -
* build association request doc based the name.
* the resulted doc is passed in the doc ptr.
*
* name - object type
* assoc - association type
* doc - ptr to the resulted doc
*
* ****************************************************************************
*/
static int
{
int len;
return (ERROR_XML_CREATE_BUFFER_FAILED);
}
return (ERROR_XML_CREATE_WRITER_FAILED);
}
return (ERROR_XML_START_DOC_FAILED);
}
/* Start element "isnsRequest". */
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* request getAssociated operation to get the entire list of obejct. */
return (ERROR_XML_START_ELEMENT_FAILED);
}
switch (assoc) {
case (node_to_dd):
/* write association type. */
(xmlChar *)DDOBJECTMEMBER) < 0) {
return (ERROR_XML_WRITE_ELEMENT_FAILED);
}
(xmlChar *)ISNSOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
(xmlChar *)NODEOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "Node". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsObject". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
break;
case (dd_to_node):
/* write association type. */
(xmlChar *)DDOBJECTMEMBER) < 0) {
return (ERROR_XML_WRITE_ELEMENT_FAILED);
}
/* start isnsObject */
(xmlChar *)ISNSOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* start DiscoveryDomain */
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomain". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsObject". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
break;
case (ddset_to_dd):
/* write association type. */
(xmlChar *)DDSETOBJECTMEMBER) < 0) {
return (ERROR_XML_WRITE_ELEMENT_FAILED);
}
/* start isnsObject */
(xmlChar *)ISNSOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* start DiscoveryDomainSet */
(xmlChar *)DDSETOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomain". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsObject". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
break;
case (dd_to_ddset):
/* write association type. */
(xmlChar *)DDSETOBJECTMEMBER) < 0) {
return (ERROR_XML_WRITE_ELEMENT_FAILED);
}
/* start isnsObject */
(xmlChar *)ISNSOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* start DiscoveryDomain */
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomain". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsObject". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
break;
default:
return (UNKNOWN);
}
/* end getAssociated */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsRequest". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
if (xmlTextWriterEndDocument(writer) < 0) {
return (ERROR_XML_END_DOC_FAILED);
}
/* XXX - copy NULL at the end by having one more extra byte */
return (ERROR_XML_STRDUP_FAILED);
}
return (0);
}
/*
* ****************************************************************************
*
* build_enumerate_xml_doc -
* build association request doc based the name.
* the resulted doc is passed in the doc ptr.
*
* name - object type
* doc - ptr to the resulted doc
*
* ****************************************************************************
*/
static int
{
int len;
return (ERROR_XML_CREATE_BUFFER_FAILED);
}
return (ERROR_XML_CREATE_WRITER_FAILED);
}
return (ERROR_XML_START_DOC_FAILED);
}
/* Start element "isnsRequest". */
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "xmlns". */
(xmlChar *)"xmlns",
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* request enumerate operation to get the entire list of obejct. */
return (ERROR_XML_START_ELEMENT_FAILED);
}
switch (obj) {
case (Node):
return (ERROR_XML_WRITE_ELEMENT_FAILED);
}
break;
case (DiscoveryDomain):
return (ERROR_XML_WRITE_ELEMENT_FAILED);
}
break;
case (DiscoveryDomainSet):
(xmlChar *)DDSETOBJECT) < 0) {
return (ERROR_XML_WRITE_ELEMENT_FAILED);
}
break;
default:
return (UNKNOWN);
}
/* end isns object type */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsRequest". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
if (xmlTextWriterEndDocument(writer) < 0) {
return (ERROR_XML_END_DOC_FAILED);
}
/* XXX - copy NULL at the end by having one more extra byte */
return (ERROR_XML_STRDUP_FAILED);
}
return (0);
}
/*
* ****************************************************************************
*
* build_get_xml_doc -
* build association request doc based the name.
* the resulted doc is passed in the doc ptr.
*
* name - object type
* assoc - association type
* doc - ptr to the resulted doc
*
* ****************************************************************************
*/
static int
{
int i, len;
return (ERROR_XML_CREATE_BUFFER_FAILED);
}
return (ERROR_XML_CREATE_WRITER_FAILED);
}
return (ERROR_XML_START_DOC_FAILED);
}
/* Start element "isnsRequest". */
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "xmlns". */
(xmlChar *)"xmlns",
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* Start element "get". */
return (ERROR_XML_START_ELEMENT_FAILED);
}
switch (obj) {
case (Node):
for (i = 0; i < operandLen; i++) {
/* Start element "isnsObject". */
(xmlChar *)ISNSOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start element Node. */
(xmlChar *)NODEOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "Node". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsObject". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
}
break;
case (DiscoveryDomain):
for (i = 0; i < operandLen; i++) {
/* Start element "isnsObject". */
(xmlChar *)ISNSOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomain". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsObject". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
}
break;
case (DiscoveryDomainSet):
for (i = 0; i < operandLen; i++) {
/* Start element "isnsObject". */
(xmlChar *)ISNSOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
(xmlChar *)DDSETOBJECT) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
/* Start attr "name". */
return (ERROR_XML_WRITE_ATTRIBUTE_FAILED);
}
/* End element "DiscoveryDomain". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsObject". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
}
break;
case (ServerConfig):
(xmlChar *)ISNSSERVER) < 0) {
return (ERROR_XML_START_ELEMENT_FAILED);
}
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
break;
default:
return (UNKNOWN);
}
/* End element "get". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
/* End element "isnsRequest". */
if (xmlTextWriterEndElement(writer) < 0) {
return (ERROR_XML_END_ELEMENT_FAILED);
}
if (xmlTextWriterEndDocument(writer) < 0) {
return (ERROR_XML_END_DOC_FAILED);
}
/* XXX - copy NULL at the end by having one more extra byte */
return (ERROR_XML_STRDUP_FAILED);
}
return (0);
}
/*
* ****************************************************************************
*
* list_node_func -
* isnsadm list-node [options] [<node name>, ...]
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
int ret;
switch (optionList->optval) {
case 'i':
flag |= INITIATOR_ONLY;
break;
case 't':
flag |= TARGET_ONLY;
break;
case 'v':
break;
default:
return (UNKNOWN);
}
}
return (ret);
}
/* No operand specified. Issue enumerate. */
if (operandLen == 0) {
if (ret != 0) {
return (ret);
}
return (ret);
}
if (ret != SUCCESS_WITH_NO_OBJECT) {
} else {
}
return (ret);
} else {
}
}
} else {
0) {
} else {
return (ret);
}
}
return (ret);
}
0) {
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* list_dd_func -
* isnsadm list-dd [options] [<dd name>, ...]
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
int ret;
switch (optionList->optval) {
case 'v':
break;
}
}
return (ret);
}
/* No operand specified. Issue enumerate. */
if (operandLen == 0) {
if (ret != 0) {
return (ret);
}
/* get the enumerate resposne first. */
return (ret);
}
if (ret != SUCCESS_WITH_NO_OBJECT) {
} else {
}
return (ret);
} else {
}
} else {
DiscoveryDomain, &doc)) != 0) {
return (ret);
}
}
return (ret);
}
flag)) != 0) {
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* list_ddset_func -
* isnsadm list-dd-set [options] [<dd set name>, ...]
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
switch (optionList->optval) {
case 'v':
break;
}
}
return (ret);
}
/* No operand specified. Issue enumerate. */
if (operandLen == 0) {
if (ret != 0) {
return (ret);
}
/* get the enumerate resposne. */
return (ret);
}
if (ret != SUCCESS_WITH_NO_OBJECT) {
} else {
}
return (ret);
} else {
}
} else {
DiscoveryDomainSet, &doc)) == 0) {
} else {
}
}
return (ret);
}
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* create_dd_func -
* create a DiscoveryDomain create-dd <dd name>, ...
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
int fd;
return (ret);
}
} else {
return (ret);
}
return (ret);
}
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
DiscoveryDomain)) != 0) {
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* create_ddset_func -
* create a DiscoveryDomainSet create-dd-set <dd set name>, ...
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
int fd;
return (ret);
}
} else {
return (ret);
}
return (ret);
}
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
DiscoveryDomainSet)) != 0) {
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* modify_dd_func -
* Modify a dd attr. currently rename function is supported
* modify-dd -n name <dd name>
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
return (ret);
}
DiscoveryDomain, &doc)) == 0) {
} else {
return (ret);
}
return (ret);
}
/* Free the request that is created by xmlStrnDup. */
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
DiscoveryDomain)) != 0) {
return (ret);
}
/* setup xml parser on the response. */
return (ERROR_XML_READER_NULL);
}
ISNSRESPONSE)) {
if (m_flag == READER_MATCH) {
} else {
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (ERROR_XML_ID_ATTR_NOT_FOUND);
}
} else {
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (ERROR_XML_DD_OBJECT_NOT_FOUND);
}
} else {
return (ERROR_XML_READER_NULL);
}
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
} else {
return (ret);
}
return (ret);
}
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
DiscoveryDomain)) != 0) {
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* modify_ddset_func -
* Modify a dd attr. currently rename function is supported
* modify-dd-set -n name <dd name>
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
return (ret);
}
DiscoveryDomainSet, &doc)) == 0) {
} else {
return (ret);
}
return (ret);
}
/* Free the request that is created by xmlStrnDup. */
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
DiscoveryDomainSet)) != 0) {
return (ret);
}
/* setup xml parser on the response. */
return (ERROR_XML_READER_NULL);
}
ISNSRESPONSE)) {
if (m_flag == READER_MATCH) {
} else {
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (ERROR_XML_ID_ATTR_NOT_FOUND);
}
} else {
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
return (ERROR_XML_DD_SET_OBJECT_NOT_FOUND);
}
}
(void) xmlTextReaderClose(reader);
(void) xmlFreeTextReader(reader);
} else {
return (ret);
}
return (ret);
}
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
DiscoveryDomainSet)) != 0) {
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* add_node_func -
* Add a node to a DiscoveryDomain add-node -d dd-name <node name>, ...
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
int fd;
return (ret);
}
} else {
return (ret);
}
return (ret);
}
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
DiscoveryDomainMember)) != 0) {
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* add_dd_func -
* Add a dd to a DiscoveryDomainSet add-dd -s dd-set name <dd name>, ...
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
int fd;
return (ret);
}
} else {
return (ret);
}
return (ret);
}
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
DiscoveryDomainSetMember)) != 0) {
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* remove_node_func -
* Remove a node from DiscoveryDomain
* remov-node -d dd-name <node name>, ...
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
int fd;
return (ret);
}
} else {
return (ret);
}
return (ret);
}
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
DiscoveryDomainMember)) != 0) {
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* remove_dd_func -
* Remove a dd from DiscoveryDomainSet
* remove-dd -s dd-set name <dd name>, ...
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
int fd;
return (ret);
}
} else {
return (ret);
}
return (ret);
}
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
DiscoveryDomainSetMember)) != 0) {
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* delete_dd_func -
* remove a DiscoveryDomain remove-dd <dd name>, ...
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
int fd;
return (ret);
}
} else {
return (ret);
}
return (ret);
}
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
DiscoveryDomain)) != 0) {
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* delete_ddset_func -
* delete DiscoveryDomainSet(s) delete-dd-set <dd set name>, ...
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
int fd;
return (ret);
}
} else {
return (ret);
}
return (ret);
}
/*
* door frame work allocated a buffer when the date lager that rbuf.
* indicate if munmap is required on rbuf.
*/
DiscoveryDomainSet)) != 0) {
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* i_enableddset
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
*
* ****************************************************************************
*/
static int
{
return (ret);
}
} else {
return (ret);
}
return (ret);
}
DiscoveryDomainSet)) != 0) {
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* ****************************************************************************
*
* enable_ddset_func -
* enables DiscoveryDomainSet(s) enable-dd-set <dd set name>, ...
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
}
/*
* ****************************************************************************
*
* disabledsetFunc -
* disable DiscoveryDomainSet(s) disable-dd-set <dd set name>, ...
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
}
/*
* ****************************************************************************
*
* show_config_func -
* isnsadm show-config
*
* operandLen - number of operands user passed into the cli
* operand - pointer to operand list from user
* options - pointer to option list from user
*
* ****************************************************************************
*/
/*ARGSUSED*/
static int
void *addarg)
{
int ret;
return (ret);
}
ServerConfig, &doc)) == 0) {
} else {
return (ret);
}
return (ret);
}
flag)) != 0) {
return (ret);
}
return (SUBCOMMAND_SUCCESS);
}
/*
* *************************************************************************
*
* main
*
* *************************************************************************
*/
int
{
int ret;
int funcRet;
if (ret == 1) {
return (COMMAND_SYNTAX_FAILED);
} else if (ret == -1) {
return (1);
} else if (ret == 0) {
/*
* strawman way to sort out the error code.
* isnsi server protocol error range 0 - 99
* isns server maangement op error range 100 -199
* isnsadm error range 200 -299
*/
if (funcRet == SUBCOMMAND_SUCCESS) {
return (0);
} else if (funcRet > SUBCOMMAND_SUCCESS) {
if (funcRet != ERROR_DOOR_CALL_FAILED &&
}
return (1);
} else {
return (1);
}
}
return (0);
} /* end main */