Solaris_DiskDrive.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <unistd.h>
#include <netdb.h>
#include <errno.h>
#include "util.h"
#include "methods.h"
#include "cimKeys.h"
#include "drive_descriptors.h"
#include "providerNames.h"
#include "messageStrings.h"
#define DISK_GETINSTANCE "DISK_DRIVE,GET_INSTANCE"
#define DISK_ENUMINSTANCES "DISK_DRIVE,ENUM_INSTANCES"
#define DISK_ENUMINSTANCENAMES "DISK_DRIVE,ENUM_INSTANCENAMES"
#define DISK_CREATEINSTANCE "DISK_DRIVE,CREATE_INSTANCE"
#define DISK_DELETEINSTANCE "DISK_DRIVE,DELETE_INSTANCE"
#define DISK_SETINSTANCE "DISK_DRIVE,SET_INSTANCE"
#define DISK_GETPROPERTY "DISK_DRIVE,GET_PROPERTY"
#define DISK_SETPROPERTY "DISK_DRIVE,SET_PROPERTY"
#define DISK_INVOKEMETHOD "DISK_DRIVE,INVOKE_METHOD"
#define DISK_EXECQUERY "DISK_DRIVE,EXEC_QUERY"
/*
* Solaris_DiskDrive provider
*
* It is important to note that all memory allocated by these functions
* and passed to the CIMOM, is freed by the CIMOM as the caller.
*/
/*
* Name: cp_getInstance_Solaris_DiskDrive
*
* Description: Returns an instance which matches the passed in object path
* if found.
*
* Parameters:
* pOP - An CCIMObjectPath * which contains the information on
* the class for which to find the instance.
* Returns:
* CCIMInstance * if matched instance is found. Otherwise, NULL.
*/
/* ARGSUSED */
{
char *name;
int error;
return ((CCIMInstance *)NULL);
}
&error);
return ((CCIMInstance*)NULL);
}
/*
* Not found. Return a null instance.
*/
return ((CCIMInstance *)NULL);
}
if (error != 0) {
return ((CCIMInstance*)NULL);
}
/* Turn this descriptor in to a disk drive instance */
if (error != 0) {
return ((CCIMInstance*)NULL);
}
return (inst);
}
/*
* Name: cp_enumInstances_Solaris_DiskDrive
*
* Description: Returns a list of instances if found.
*
* Parameters:
* pOP - An CCIMObjectPath * which contains the information on
* the class for which to find the instance.
* Returns:
* CCIMInstanceList * if found. Otherwise, NULL.
*/
/* ARGSUSED */
{
int error;
int filter[5];
/*
* Get all disk drives, fixed or removable, but not CD-ROMs, floppy,
* etc., since those are in a different branch of the CIM model.
*/
filter[0] = DM_DT_UNKNOWN;
if (ddrive_descriptorp == NULL) {
return ((CCIMInstanceList *)NULL);
}
if (ddrive_descriptorp[0] == NULL) {
return ((CCIMInstanceList *)NULL);
}
if (error != 0) {
return ((CCIMInstanceList *)NULL);
}
/* convert drive descriptors to CCIMInstanceList */
if (error != 0) {
return ((CCIMInstanceList *)NULL);
}
return (instList);
}
/*
* Name: cp_enumInstances_Solaris_DiskDrive
*
* Description: Returns a list of instances if found.
*
* Parameters:
* pOP - An CCIMObjectPath * which contains the information on
* the class for which to find the instance.
* Returns:
* CCIMInstanceList * if found. Otherwise, NULL.
*/
/* ARGSUSED */
int error;
return ((CCIMObjectPathList *)NULL);
}
/*
* Call in to enumInstances and then convert the instance list in
* to an object list.
*/
}
return (objList);
}
/*
* Creating an instance of a Solaris_DiskDrive is not supported.
*/
/* ARGSUSED */
{
int error;
return ((CCIMObjectPath*)NULL);
}
/* deletes an instance */
/* ARGSUSED */
{
int error;
return (cim_false);
}
/*
* Name: cp_getProperty_Solaris_DiskDrive
*
* Description: Returns the property requested, if found.
*
* Parameters:
* pOP - An CCIMObjectPath * which contains the information on
* the class for which to find the instances.
* Returns:
* CCIMProperty * if found.
*/
/* ARGSUSED */
char *pPropName)
{
int error = 0;
return ((CCIMProperty *)NULL);
}
return ((CCIMProperty *)NULL);
}
return (prop);
}
/* This provider cannot set an instance of a Solaris_DiskDrive object. */
/* ARGSUSED */
{
int error;
return (cim_false);
}
/*
* Sets the property in the passed in instance to the new values of the passed
* in property
* params:
* CCIMInstance* - the instance in which teh property should be changed
* CCIMProperty* - a property structure which contains the new values
* return:
* cim_true if property was updated otherwise cim_false
* NOTE: This provider cannot set a property on a Solaris_DiskDrive object.
*/
/* ARGSUSED */
{
int error;
return (cim_false);
}
/* invokeMethod function dispatches to the various method implementations */
{
int error;
/* dispatch code for various methods */
return (retVal);
} else if (strcasecmp(
"CreateDefaultFdiskPartition", methodName) == 0) {
return (retVal);
return (retVal);
return (retVal);
}
/*
* We fell through the dispatch logic. There is no function
* that matches 'methodName'.
*/
return (retVal);
}
/*
* Name: cp_execQuery_Solaris_DiskDrive
*
* Description:
* Returns an instance list which matches the query if any are found.
*
* Parameters:
* CCIMObjectPath *op - An CCIMObjectPath * which contains the
* information on the class for which to find the instances.
*
* selectList - Not used
* nonJoinExp - Not used
*
* Returns:
* CCIMInstanceList * if found. Otherwise, NULL.
*/
/*
* Currently, there is no WQL parser for the C providers. As a result,
* what is returned to the CIMOM is a list of instances with
* a NULL value at the beginning of the list. This NULL value indicates
* to the CIMOM that it must do the filtering for the client.
*/
/* ARGSUSED */
{
int error;
return ((CCIMInstanceList *)NULL);
}
return ((CCIMInstanceList *)NULL);
}
/*
* Create a null instance and add it to the beginning
* of the list to indicate to the CIMOM that no filtering
* was done.
*/
ex = cim_getLastError();
return ((CCIMInstanceList *)NULL);
}
ex = cim_getLastError();
return ((CCIMInstanceList *)NULL);
}
ex = cim_getLastError();
return ((CCIMInstanceList *)NULL);
}
/*
* Since copying the original list to the new list will
* leave no way to free the original list, manually
* concatenate the original list to the new one.
*/
return (result);
}