smb_scfutil.c revision c8ec8eea9849cac239663c46be8a7f5d2ba7ca00
1N/A * The contents of this file are subject to the terms of the 1N/A * Common Development and Distribution License (the "License"). 1N/A * You may not use this file except in compliance with the License. 1N/A * See the License for the specific language governing permissions 1N/A * and limitations under the License. 1N/A * When distributing Covered Code, include this CDDL HEADER in each 1N/A * If applicable, add the following below this CDDL HEADER, with the 1N/A * fields enclosed by brackets "[]" replaced with your own identifying 1N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 1N/A * Use is subject to license terms. 1N/A/* helper functions for using libscf with CIFS */ 1N/A * smb_smf_scf_log_error(msg) 1N/A * Logs error messages from scf API's 1N/A }
else {
/*LINTED E_SEC_PRINTF_E_VAR_FMT*/ 1N/A * smb_smf_create_service_pgroup(handle, pgroup) 1N/A * create a new property group at service level. 1N/A * only create a handle if it doesn't exist. It is ok to exist 1N/A * since the pg handle will be set as a side effect. 1N/A * if the pgroup exists, we are done. If it doesn't, then we 1N/A * need to actually add one to the service instance. 1N/A /* doesn't exist so create one */ 1N/A * Start transaction on current pg in handle. 1N/A * The pg could be service or instance level. 1N/A * Must be called after pg handle is obtained 1N/A * from create or get. 1N/A * lookup the property group and create it if it doesn't already 1N/A * smb_smf_end_transaction(handle) 1N/A * Commit the changes that were added to the transaction in the 1N/A * handle. Do all necessary cleanup. 1N/A * Sets string property in current pg 1N/A * properties must be set in transactions and don't take 1N/A /* the value is in the transaction */ 1N/A /* value couldn't be constructed */ 1N/A /* the entry is in the transaction */ 1N/A * cleanup if there were any errors that didn't leave these 1N/A * values where they would be cleaned up later. 1N/A * Gets string property value.upto sz size. 1N/A * Caller is responsible to have enough memory allocated. 1N/A * Set integer value of property. 1N/A * The value is returned as int64_t value 1N/A * Caller ensures appropriate translation. 1N/A * properties must be set in transactions and don't take 1N/A /* the value is in the transaction */ 1N/A /* the entry is in the transaction */ 1N/A * cleanup if there were any errors that didn't leave these 1N/A * values where they would be cleaned up later. 1N/A * Gets integer property value. 1N/A * Caller is responsible to have enough memory allocated. 1N/A * Set boolean value of property. 1N/A * The value is returned as int64_t value 1N/A * Caller ensures appropriate translation. 1N/A * properties must be set in transactions and don't take 1N/A /* the value is in the transaction */ 1N/A /* the entry is in the transaction */ 1N/A * cleanup if there were any errors that didn't leave these 1N/A * values where they would be cleaned up later. 1N/A * Gets boolean property value. 1N/A * Caller is responsible to have enough memory allocated. 1N/A * Sets a blob property value. 1N/A * properties must be set in transactions and don't take 1N/A /* the value is in the transaction */ 1N/A /* value couldn't be constructed */ 1N/A /* the entry is in the transaction */ 1N/A * cleanup if there were any errors that didn't leave these 1N/A * values where they would be cleaned up later. 1N/A * Gets a blob property value. 1N/A * Caller is responsible to have enough memory allocated. 1N/A * smb_smf_restart_service() 1N/A * Restarts SMB SMF service. 1N/A * smb_smf_scf_init() 1N/A * must be called before using any of the SCF functions. 1N/A * Returns smb_scfhandle_t pointer if success. * smb_smf_scf_fini(handle) * must be called when done. Called with the handle allocated in * smb_smf_scf_init(), it cleans up the state and frees any SCF resources