createprop_methods.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 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <string.h>
#include "createprop_methods.h"
#include "messageStrings.h"
#include "nfs_providers_msgstrings.h"
#include "nfs_provider_names.h"
#include "nfs_keys.h"
#include "libfsmgt.h"
#include "util.h"
#define MAXSIZE 256
/*
* Method: add_property_to_instance
*
* Description: Creates a property corresponding to the input parameters and
* adds it to the instance passed in.
*
* Parameters:
* - cimchar *pName - The name of the property to be created.
* - CIMType pType - The type of the property.
* - cimchar *pValue - The value of the property if it is NOT to be a
* reference property.
* - CCIMObjectPath *pOP - The value of the property if it is to be a
* reference property.
* - CIMBool pIsKey - A boolean value representing whether or not the
* property is a key.
* - CCIMInstance *pInst - The instance that the property is added to.
*
* Returns:
* - A CIMBool which is true if the property was added to the instance and
* false if it was not.
*/
int err = 0;
} else {
}
ex = cim_getLastError();
return (cim_false);
}
ex = cim_getLastError();
return (cim_false);
}
return (cim_true);
} /* add_property_to_instance */
/*
* Method: add_property_to_list
*
* Description: Creates a property corresponding to the input parameters and
* adds it to the property list passed in.
*
* Parameters:
* - cimchar *pName - The name of the property to be created.
* - CIMType pType - The type of the property.
* - cimchar *pValue - The value of the property if it is NOT to be a
* reference property.
* - CCIMObjectPath *pOP - The value of the property if it is to be a
* reference property.
* - CIMBool pIsKey - A boolean value representing whether or not the
* property is a key.
* - CCIMPropertyList *pPropList - The property list that the property is
* added to.
*
* Returns:
* - A pointer to the property list that the property was added to.
* - NULL if an error occurred.
*
* NOTE: Upon error, the passed in CCIMPropertyList*, pPropList, is freed.
* Since this is a wrapper for the cim_addPropertyToPropertyList function
* this is done to be consistent with the way that the CIM C API works.
* Upon error, the CCIMPropertyList passed into cim_addPropertyToPropertyList
* is freed.
*/
int err = 0;
} else {
}
/*
* If NULL, an error was encountered.
*/
ex = cim_getLastError();
return ((CCIMPropertyList *)NULL);
}
ex = cim_getLastError();
return ((CCIMPropertyList *)NULL);
}
/*
* Debugging...
*/
}
return (pPropList);
} /* add_property_to_list */
/*
* Method: get_property_from_opt_string
*
* Description: Determines if a property exists in the mount option string and
* returns a value of the property to be used in creating a CCIMProperty.
*
* Parameters:
* - char *mntopts - The mount option string to search.
* - char *option - The option to search for.
* - boolean_t optHasEquals - A boolean telling the method whether or not
* the option being searched for contains the "=" character.
* - int defaultValue - The value of the property if it is not found in
* the option string.
*
* Returns:
* - The string value of the property found.
* - NULL if an error occurred.
*
* NOTE: The caller must free space allocated for return value.
*/
cimchar *
char *optionString = NULL;
char *optionFound;
int err = 0;
if (optionString == NULL) {
return (NULL);
} else {
/*
* Was the option found in the option string?
* If it was, propValue = true or propValue = optionFound.
*/
if (optionFound != NULL) {
if (optHasEquals) {
} else {
B_TRUE);
}
} else {
/*
* Since the option was not found we know that
* propValue = false or the default value.
*/
if (optHasEquals) {
} else {
B_FALSE);
}
}
}
return (NULL);
}
return (retVal);
} /* get_property_from_opt_string */
/*
* Method set_dir_keyProperties_to_true
*
* Helper function to work around cimom bug 4649100 which causes
* cimom_getInstance to return the instance with the value of
* keyProperty set to cim_false instead of cim_true.
*/
== 0) {
}
}
return (return_value);
} /* set_dir_keyProperties_to_true */
/*
* Method set_share_keyProperties_to_true
*
* Helper function to work around cimom bug 4649100 which causes
* cimom_getInstance to return the instance with the value of
* keyProperty set to cim_false instead of cim_true.
*/
== 0) {
}
}
return (return_value);
} /* set_share_keyProperties_to_true */
/*
* Method set_shareSec_keyProperties_to_true
*
* Helper function to work around cimom bug 4649100 which causes
* cimom_getInstance to return the instance with the value of
* keyProperty set to cim_false instead of cim_true.
*/
}
}
return (return_value);
} /* set_shareSec_keyProperties_to_true */