1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22/* 23 * Copyright 2003 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27#pragma ident "%Z%%M% %I% %E% SMI" 28 29#include "util.h" 30#include "nfs_providers_msgstrings.h" 31#include "messageStrings.h" 32#include "nfs_provider_names.h" 33#include "nfsprov_methods.h" 34#include <cimapi.h> 35#include <cp_method.h> 36 37 38/* 39 * Constants 40 */ 41#define MOUNTALL "mountall" 42#define UMOUNTALL "unmountall" 43 44/* 45 * Instance provider methods 46 */ 47 48/* ARGSUSED */ 49CCIMObjectPath * 50cp_createInstance_Solaris_MountService(CCIMObjectPath *pOP, 51 CCIMInstance *pInst) { 52 53 int err = 0; 54 55 util_handleError("SOLARIS_MNTSERV::CREATE_INSTANCE", 56 CIM_ERR_NOT_SUPPORTED, NULL, NULL, &err); 57 58 return ((CCIMObjectPath *)NULL); 59} /* cp_createInstance_Solaris_MountService */ 60 61/* ARGSUSED */ 62CIMBool 63cp_deleteInstance_Solaris_MountService(CCIMObjectPath *pOP) { 64 int err = 0; 65 66 util_handleError("SOLARIS_MNTSERV::DELETE_INSTANCE", 67 CIM_ERR_NOT_SUPPORTED, NULL, NULL, &err); 68 69 return (cim_false); 70} /* cp_deleteInstance_Solaris_MountService */ 71 72/* ARGSUSED */ 73CCIMInstanceList * 74cp_enumInstances_Solaris_MountService(CCIMObjectPath *pOP) { 75 int err = 0; 76 77 util_handleError("SOLARIS_MNTSERV::ENUM_INSTANCES", 78 CIM_ERR_NOT_SUPPORTED, NULL, NULL, &err); 79 80 return ((CCIMInstanceList *)NULL); 81} /* cp_enumInstances_Solaris_MountService */ 82 83/* ARGSUSED */ 84CCIMObjectPathList * 85cp_enumInstanceNames_Solaris_MountService(CCIMObjectPath *pOP) { 86 int err = 0; 87 88 util_handleError("SOLARIS_MNTSERV::ENUM_INSTANCENAMES", 89 CIM_ERR_NOT_SUPPORTED, NULL, NULL, &err); 90 91 return ((CCIMObjectPathList *)NULL); 92} /* cp_enumInstanceNames_Solaris_MountService */ 93 94/* ARGSUSED */ 95CCIMInstanceList * 96cp_execQuery_Solaris_MountService(CCIMObjectPath *pOP, char *selectClause, 97 char *nonJoinExp, char *queryExp, char *queryLang) { 98 99 int err = 0; 100 101 util_handleError("SOLARIS_MNTSERV::EXEC_QUERY", 102 CIM_ERR_NOT_SUPPORTED, NULL, NULL, &err); 103 104 return ((CCIMInstanceList *)NULL); 105} /* cp_execQuery_Solaris_MountService */ 106 107/* ARGSUSED */ 108CCIMInstance * 109cp_getInstance_Solaris_MountService(CCIMObjectPath *pOP) { 110 int err = 0; 111 112 util_handleError("SOLARIS_MNTSERV::GET_INSTANCE", 113 CIM_ERR_NOT_SUPPORTED, NULL, NULL, &err); 114 115 return ((CCIMInstance *)NULL); 116} /* cp_getInstance_Solaris_MountService */ 117 118/* ARGSUSED */ 119CIMBool 120cp_setInstance_Solaris_MountService(CCIMObjectPath *pOP, CCIMInstance *pInst) { 121 int err = 0; 122 123 util_handleError("SOLARIS_MNTSERV::SET_INSTANCE", 124 CIM_ERR_NOT_SUPPORTED, NULL, NULL, &err); 125 126 return (cim_false); 127} /* cp_setInstance_Solaris_MountService */ 128 129/* ARGSUSED */ 130CIMBool 131cp_setInstanceWithList_Solaris_MountService(CCIMObjectPath *pOP, 132 CCIMInstance *pInst, char **props, int num_props) { 133 134 int err = 0; 135 136 util_handleError("SOLARIS_MNTSERV::SET_INSTANCE", 137 CIM_ERR_NOT_SUPPORTED, NULL, NULL, &err); 138 139 return (cim_false); 140} /* cp_setInstanceWithList_Solaris_MountService */ 141 142/* 143 * Property provider methods 144 */ 145/* ARGSUSED */ 146CCIMProperty * 147cp_getProperty_Solaris_MountService(CCIMObjectPath *pOP, cimchar *pPropName) { 148 int err = 0; 149 150 util_handleError("SOLARIS_MNTSERV::GET_PROPERTY", 151 CIM_ERR_NOT_SUPPORTED, NULL, NULL, &err); 152 153 return ((CCIMProperty *)NULL); 154} /* cp_getProperty_Solaris_MountService */ 155 156/* ARGSUSED */ 157CIMBool 158cp_setProperty_Solaris_MountService(CCIMObjectPath *pOP, CCIMProperty *pProp) { 159 int err = 0; 160 161 util_handleError("SOLARIS_MNTSERV::SET_PROPERTY", 162 CIM_ERR_NOT_SUPPORTED, NULL, NULL, &err); 163 164 return (cim_false); 165} /* cp_setProperty_Solaris_MountService */ 166 167 168/* 169 * Method provider methods 170 */ 171/* 172 * Method: cp_invokeMethod_Solaris_MountService 173 * 174 * Description: Routes the cp_invokeMethod_Solaris_MountService calls to the 175 * correct Solaris_MountService methods. 176 * 177 * Parameters: 178 * - CCIMObjectPath *pOP - The object path containing needed information 179 * about the class that is to getting methods invoked. 180 * - cimchar *functionName - The name of the function to be invoked. 181 * - CCIMPropertyList *inParams - The input parameters to the function. 182 * - CCIMPropertyList *outParams - The output parameters from the function. 183 * 184 * Returns: 185 * - A pointer to a property which indicates success or failure of the 186 * function. 1 for success, 0 for failure. 187 * - Upon error, NULL is returned and the error is logged. 188 */ 189/* ARGSUSED */ 190CCIMProperty * 191cp_invokeMethod_Solaris_MountService(CCIMObjectPath *pOP, cimchar *functionName, 192 CCIMPropertyList *inParams, CCIMPropertyList *outParams) { 193 194 CCIMProperty *retVal; 195 int err = 0; 196 197 if (pOP == NULL) { 198 util_handleError("SOLARIS_MNTSERV::INVOKE_METHOD", 199 CIM_ERR_INVALID_PARAMETER, NULL, NULL, &err); 200 return ((CCIMProperty *)NULL); 201 } 202 203 /* 204 * Determine what method is being called. 205 */ 206 if (strcasecmp(functionName, MOUNTALL) == 0) { 207 retVal = mountall(inParams); 208 } else if (strcasecmp(functionName, UMOUNTALL) == 0) { 209 retVal = unmountall(inParams); 210 } else { 211 /* 212 * No such method name. 213 */ 214 util_handleError("SOLARIS_MNTSERV::INVOKE_METHOD", 215 CIM_ERR_FAILED, NO_SUCH_METHOD, NULL, &err); 216 return ((CCIMProperty *)NULL); 217 } 218 219 return (retVal); 220} /* cp_invokeMethod_Solaris_MountService */ 221