libDispatch.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 <pthread.h>
#include "master.h"
#include "util.h"
#include "providerNames.h"
#include "messageStrings.h"
/* local function declarations */
static int FindClassEntry(char *className);
static int FindAssocClassEntry(char *className);
/*
* Encodes the CIM schema and provider version
* into an unsigned long, use
* getProviderVersion & getCimVersion to decode
*/
unsigned long
{
}
/*
* The function will take CCIMObjectPath
* and search the classNameTable[]
* for a className match, and then
* call the corresponding cp_enumInstance
* for that provider
*/
{
int index = 0;
int error;
/* Check if ObjectPath is NULL before continuing */
/* Set error exception with localized message */
return (NULL);
}
/* Object path is NOT NULL, so find the entry in the table */
/* check for error (-1) */
if (index < 0) {
return (NULL);
}
/* OK, Find enumInstance */
return ((CCIMInstanceList*)instList);
} /* cp_enumInstances */
/* creates an instance */
/*
* The function will take CCIMObjectPath & CCIMInstance
* and search the classNameTable[]
* for a className match, and then
* call the corresponding cp_createInstance
* for that provider
*/
{
int index = 0;
int error;
/* check if NULL before finding the Instance to create */
return (NULL);
}
/* find entry in the table */
/* check for error (-1) */
if (index < 0) {
return (NULL);
}
return ((CCIMObjectPath*) objPath);
} /* cp_createInstances */
/*
* returns an array of CCIMObjectPaths for the class
* params:
* char* - the classname to enum
*/
{
int error = 0;
/*
* create an instance list which contains all of the
* instances this provider will produce First check
* for valid ObjectPath
*/
return (NULL);
}
return ((CCIMObjectPathList *)NULL);
}
/*
* we no longer need the instList so free
* the memory allocated for it
*/
return (objList);
}
/* get an instance */
{
int index = 0;
int error;
/* Check if ObjectPath is NULL before continuing */
return (NULL);
}
/* Object path is NOT NULL, so find the entry in the table */
/* check for error (-1) */
if (index < 0) {
return (NULL);
}
return ((CCIMInstance *)inst);
}
/*
* returns the specified property,
* should return NULL if not found
*
* params:
* CCIMObjectPath* - ObjectPath to get the property from
* char* - The property name to get
*
*/
{
int error;
/* See if ObjectPath is OK */
return (NULL);
}
/* Make sure property name isn't NULL */
return (NULL);
}
/* see if we have any instances which match the obj path */
/* check for valid instance */
return (NULL);
}
/* see if it has the specified property */
/* free memory allocated for the instance */
/* return the property */
return ((CCIMProperty *)prop);
}
/*
* Sets the property in the passed in
* instance to the new values of the
* passed in property
*
* params:
* CCIMObjectPath* - the Object Path in which the property should be changed
* CCIMProperty* - a property structure which contains the new values
*
* return:
* cim_true if property was updated otherwise cim_false
*
*
* The function will take CCIMObjectPath & CCIMProperty
* and search the classNameTable[]
* for a className match, and then
* call the corresponding setProperty
* for that provider
*/
{
int index = 0;
int error;
return (NULL);
}
/* check for error (-1) */
if (index < 0) {
return (NULL);
}
}
/* sets an instance */
/*
* The function will take CCIMObjectPath & CCIMInstance
* and search the classNameTable[]
* for a className match, and then
* call the corresponding cp_setInstance
* for that provider
*/
{
int index = 0;
int error;
return (NULL);
}
return (NULL);
}
/* get the index into the table */
/* check for error (-1) */
if (index < 0) {
return (NULL);
}
}
/*
* deletes an instance
*
* The function will take CCIMObjectPath
* and search the classNameTable[]
* for a className match, and then
* call the corresponding cp_deleteInstance
* for that provider
*/
{
int index = 0;
int error;
/* Verify ObjectPath is NOT NULL */
return (NULL);
}
/* find Entry in table */
/* check for error (-1) */
if (index < 0) {
return (NULL);
}
}
/*
* Invokes the method and returns the results
* The caller is responsible for freeing the
* memory allocated for the returned object
*
* params:
* CCIMObjectPath* - An object path of the instance
* to invoke the function on
* char* - name of the method to invoke
* CCIMPropertyList* - input parameters to the function
*
* returns:
* NULL if it failed otherwise a CCIMProperty*
* which represents the return value of the function
*/
{
int index = 0;
int error;
/* First check for valid ObjectPath */
return (NULL);
}
/* find entry in the table */
/* check for error (-1) */
if (index < 0) {
return (NULL);
}
return ((CCIMProperty*)prop);
}
/*
* cp_execQuery
*/
{
int index = 0;
int error = 0;
/* First check for valid ObjectPath */
&error);
return ((CCIMInstanceList *)NULL);
}
/* find entry in the table */
/* check for error (-1) */
if (index < 0) {
/* Set error exception with localized message */
return ((CCIMInstanceList *)NULL);
}
return (instList);
}
/*
* cp_associators
*/
{
int index = 0;
int error = 0;
/* First check for valid ObjectPath */
if (pAssocName == NULL) {
/* Set error exception with localized message */
return ((CCIMInstanceList *)NULL);
}
/* find entry in the table */
/* check for error (-1) */
if (index < 0) {
/* Set error exception with localized message */
return ((CCIMInstanceList *)NULL);
}
/*
* Call the appropriate associator function. Let the specific function
* in the c provider handle the checking for correctness of the
* other parameters.
*/
return ((CCIMInstanceList *)instList);
}
/*
* cp_associatorNames
*/
{
int index = 0;
int error = 0;
/* First check for valid ObjectPath */
if (pAssocName == NULL) {
/* Set error exception with localized message */
return ((CCIMObjectPathList *)NULL);
}
/* find entry in the table */
/* check for error (-1) */
if (index < 0) {
/* Set error exception with localized message */
return ((CCIMObjectPathList *)NULL);
}
/*
* Call the appropriate associatorName function. Let the specific
* function in the c provider handle the checking for correctness of
* the other parameters.
*/
return ((CCIMObjectPathList *)objList);
}
/*
* cp_references
*/
char *pRole)
{
int index = 0;
int error = 0;
/* First check for valid ObjectPath */
if (pAssocName == NULL) {
/* Set error exception with localized message */
return ((CCIMInstanceList *)NULL);
}
/* find entry in the table */
/* check for error (-1) */
if (index < 0) {
/* Set error exception with localized message */
return ((CCIMInstanceList *)NULL);
}
/*
* Call the appropriate references function. Let the specific function
* in the c provider handle the checking for correctness of the
* other parameters.
*/
return ((CCIMInstanceList *)instList);
}
/*
* InParam: Class Name
* Returns: Index into Name Table
* If it hit libWBEMdisk, then we
* have hit bottom, return err (-1)
*/
static int
FindClassEntry(char *className)
{
int i = 0;
i = -1;
break;
}
i++;
}
return (i);
}
/*
* InParam: Class Name
* Returns: Index into Name Table
* If it hit libWBEMdisk, then we
* have hit bottom, return err (-1)
*/
static int
FindAssocClassEntry(char *className)
{
int i = 0;
i = -1;
break;
}
i++;
}
return (i);
}
/*
* cp_referenceNames
*/
char *pRole)
{
int index = 0;
int error = 0;
/* First check for valid ObjectPath */
if (pAssocName == NULL) {
/* Set error exception with localized message */
return ((CCIMObjectPathList *)NULL);
}
/* find entry in the table */
/* check for error (-1) */
if (index < 0) {
/* Set error exception with localized message */
return ((CCIMObjectPathList *)NULL);
}
/*
* Call the appropriate referenceName function. Let the specific
* function in the c provider handle the checking for correctness of
* the other parameters.
*/
return ((CCIMObjectPathList *)objList);
}
{
int index = 0;
int error = 0;
/*
* If the object path coming in matches any in the associator table,
* return true, otherwise, return false.
*/
/* First check for valid ObjectPath */
/* Set error exception with localized message */
return (cim_false);
}
/* find entry in the table */
if (index < 0) {
return (cim_false);
}
return (cim_true);
}