2N/A * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * BSD 3 Clause License 2N/A * Copyright (c) 2007, The Storage Networking Industry Association. 2N/A * Redistribution and use in source and binary forms, with or without 2N/A * modification, are permitted provided that the following conditions 2N/A * - Redistributions of source code must retain the above copyright 2N/A * notice, this list of conditions and the following disclaimer. 2N/A * - Redistributions in binary form must reproduce the above copyright 2N/A * notice, this list of conditions and the following disclaimer in 2N/A * the documentation and/or other materials provided with the 2N/A * - Neither the name of The Storage Networking Industry Association (SNIA) 2N/A * nor the names of its contributors may be used to endorse or promote 2N/A * products derived from this software without specific prior written 2N/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 2N/A * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2N/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2N/A * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 2N/A * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2N/A * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2N/A * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2N/A * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2N/A * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2N/A * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2N/A * POSSIBILITY OF SUCH DAMAGE. 2N/A * NDMP configuration management 2N/A/* NDMP properties configuration */ 2N/A/* Handle Init states */ 2N/A/* NDMP scf handle structure */ 2N/Astatic const struct {
2N/A {
"token-maxseq", 0,
64 },
2N/A {
"version",
2,
4 },
2N/A {
"tcp-port",
1,
65535 }
2N/A * This routine send a refresh signal to ndmpd service which cause ndmpd 2N/A * property table to be refeshed with current ndmpd properties value from SMF. 2N/A * Scan list of current supported values. 2N/A * Given a property and an associated value, verify whether 2N/A * or not a.) it's a valid property and b.) if so, whether or not 2N/A * the respective value passed in is valid. 2N/A * Check to see if we are enabling authorization 2N/A * Scan the table for a matching ndmp property 2N/A * The given property is not a valid ndmp property 2N/A * Invalid BOOL property value 2N/A * The path given does not exist 2N/A * Invalid drive type 2N/A * Invalid numeric value 2N/A * Invalid backup type specified. Default 2N/A * course of action is to set backup type 2N/A * For property values that are numeric do a little more fine grained 2N/A * validation to make sure that the number is within range. 2N/A * Scan the string for any non-numeric chars 2N/A * Check for integer overflow 2N/A * Scan our prop limit table for the property we passed in. Once 2N/A * we find it, check to make sure it's within an acceptable range. 2N/A * If we don't find the property here in this table, it means that we 2N/A * are not imposing any range restrictions and will return success. 2N/A * string pointer to the locally allocated memory if the config param is 2N/A * defined otherwise it would be NULL. 2N/A * Validate property values here. If either the property 2N/A * or the value itself is invalid, then return. 2N/A * This will fail if property does not exist in the property 2N/A * group. Check the next property group in case of failure. 2N/A * Basically commit the transaction. 2N/A * Must be called when done. Called with the handle allocated in 2N/A * ndmp_smf_scf_init(), it cleans up the state and frees any SCF resources 2N/A * Must be called before using any of the SCF functions. Returns 2N/A * ndmp_scfhandle_t pointer if success. 2N/A * Create a new property group at service level. 2N/A * Only create a handle if it doesn't exist. It is ok to exist since 2N/A * the pg handle will be set as a side effect. 2N/A * If the pgroup exists, we are done. If it doesn't, then we need to 2N/A * actually add one to the service instance. 2N/A /* Doesn't exist so create one */ 2N/A * Start transaction on current pg in handle. The pg could be service or 2N/A * instance level. Must be called after pg handle is obtained from create or 2N/A * Lookup the property group and create it if it doesn't already 2N/A * Commit the changes that were added to the transaction in the handle. Do all 2N/A * necessary cleanup. 2N/A * Deletes property in current pg 2N/A * Properties must be set in transactions and don't take effect until 2N/A * Sets property in current pg 2N/A * Properties must be set in transactions and don't take effect until 2N/A /* The value is in the transaction */ 2N/A /* The entry is in the transaction */ 2N/A * Gets a property value.upto sz size. Caller is responsible to have enough