2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * Formats local time into a string for debugging messages. 2N/A * Sets the property name in the ASR handle with the given value. 2N/A "Unable to set property %s to %s",
2N/A * Sets the property name in the ASR handle with the given value. 2N/A * If value isn't set because it is NULL then the default_value will be used. 2N/A * Gets a property from the ASR handle. If the property doesn't exist, 2N/A * its value is an empty string or there is an error then the default value is 2N/A * If there is an error during the operation then asr_errno is set. 2N/A * Gets a property from the ASR handle. If the property doesn't exist, its 2N/A * value is empty or there was an error then NULL is returned. 2N/A * Gets a boolean property from the ASR handle. If the property doesn't 2N/A * exist then the default value is returned. 2N/A * Gets a number property from the ASR handle. If the property doesn't 2N/A * exist or can't be parsed then the default value is returned. 2N/A * Get the path value for the given property name. The root directory will 2N/A * be appended to the path. It is the responsibility of the caller to 2N/A * free the resulting string when done. 2N/A * If the property isn't set then the default_value will be returned. 2N/A * If there is an error then NULL will be returned. 2N/A * Checks if string contains all the same chars as value c 2N/A * Checks if a string property is set to a valid value. An invalid or unset 2N/A * value can be NULL, an empty string, all zeros, all spaces or 'unknown' 2N/A * Checks that a system id is valid and the proper length 2N/A * Gets the registered asset id of the Solaris host. If one doesn't exist 2N/A * a new uuid is generated. 2N/A * Finds system authority information used to populate ASR properties such as 2N/A * system-id and product-name from fm libtopo. The FMA authority fields will be 2N/A * searched in the following order: 2N/A * "system-id" = ("system-serial", "sys-comp-serial", "chassis-serial") 2N/A * "product-name" = ("system-name", "sys-comp-name", "chassis-name") 2N/A * Stores the FMA authority properties in a cache so that they are available 2N/A * Gets the system id which should be the 10 digit ASR system identity used 2N/A * for asset validation. 2N/A * If not found then the system won't be able to be activated with the ASR 2N/A * backend service but the generated asset id will be used as the system ID to 2N/A * support advanced telemetry. This can happen on older unsupported platforms, 2N/A * non Sun hardware and virtual machines. 2N/A * Gets the product name of the computer system if available. 2N/A * Gets the product id of the computer system if available. 2N/A * Gets the site id which is usually the same as the systemid. In the case 2N/A * of an appliance the appliance serial number will be used. 2N/A * Gets the registered ASR client registration id 2N/A * Gets the message signing key length to be used when generating new 2N/A "Error parsing keylen (%s). Using default value %i",
2N/A * Gets the timeout to be used for http requests. 2N/A "Error parsing http timeout (%s). Using default value %i",
2N/A * Gets the directory that the phone home service can use for writing 2N/A * log files, saving state and temporary data. 2N/A * Gets the registered message signing keys. 2N/A * Gets the current phone-home configuration properties. If the properties 2N/A * or handle haven't been initialized then NULL is returned. 2N/A * Gets the log file handle used for debugging 2N/A * Sets the log file used for debugging 2N/A * Sets the configuration name used to save the configuration. The name 2N/A * can either be a filename (for debugging) or a service FMRI. 2N/A * Prints the ASR Phone Home configuration properties to the given stream. 2N/A * None zero is returned if there is an error. 2N/A * Determines if the config is a service FMRI (true) or a file name. 2N/A for (i = 0;
svc[i] !=
'\0'; i++) {
2N/A * Saves the ASR configuration properties. 2N/A * Initializes the ASR handle with the given configuration. If there is an 2N/A * error then NULL is returned and asr_errno is set. 2N/A * Creates an ASR handle from either a file path name or a service 2N/A * FMRI that has ASR properties defined. 2N/A * NULL is returned and asr_errno is set if there is an error. 2N/A * Creates an empty registration request structure used for registering a 2N/A * Sets the registration transport endpoint which is an optional field. 2N/A * Sets the registration user name which is a required field. 2N/A * Sets the registration users credential which is a required field. 2N/A * Sets the registration proxy host:port with optional credentials 2N/A * Gets the transport URL endpoint for an ASR registration request. 2N/A * Gets the name of the user requesting an ASR registration. 2N/A * Gets the password of the user requesting an ASR registration. 2N/A * Frees up all resources used for a registration request. 2N/A * Initializes the transport functions needed to transmit ASR messages. 2N/A * Cleans up the ASR handle when done. 2N/A * Cleans up all cached data inside the ASR library. 2N/A * Cleans up an ASR message and its contents. 2N/A * Converts a new ASR message from a buffer and the given type. 2N/A * Returns NULL and frees data if there is an error. 2N/A * Saves the registration properties into the ASR handle for all future 2N/A * message transmission on that handle. 2N/A * The name value properties are from a previous call to asr_reg 2N/A * Returns non-zero on error. 2N/A * Fills in the registration response properties taken from the users 2N/A * registration request structure and system information. 2N/A * Returns ASR_FAILURE if there is an error or ASR_OK if successful. 2N/A * Registers the ASR client and saves the configuration if successful 2N/A * to the ASR handle properties. 2N/A * Returns non-zero if there is an error. 2N/A * Resets all ASR registration properties 2N/A * Deactivates and unregisters ASR for this system. 2N/A return (0);
/* Already unreg'ed */ 2N/A * Sends the given telemetry data. If the message isn't already signed 2N/A * then the signature will be created. 2N/A * The output nvlist will have to be freed by the caller even if an error is 2N/A * returned since error properties can be returned in out_rsp. 2N/A * Creates an name value list containing ASR common message header properties. 2N/A * Creates an name value list containing ASR common message header properties 2N/A * and sets the time of the message in the supplied time buffer. 2N/A "failed to get system serial number"));
2N/A "failed to get product information"));
2N/A "<?xml version='1.0' encoding='UTF-8'?>\n");
2N/A " xsi:noNamespaceSchemaLocation='message_21.xsd'>\n");
2N/A " xsi:noNamespaceSchemaLocation='message_20.xsd'>\n");
2N/A * Creates an ASR activation message. 2N/A * Creates an ASR deactivation message. This message gets sent if registration 2N/A * is cleared and ASR should be turned off for the system. 2N/A * Creates and ASR heartbeat message. 2N/A * Creates an ASR test message that simulates a fault on the back end and 2N/A * sends an email to the given address. 2N/A "timezone",
"UTC",
"event-time",
time);
2N/A "Test Message Used for Testing End to End Connection");
2N/A * Creates a message that can get the activation status of the devices for 2N/A * ASR monitoring validation 2N/A * Creates a message that identifies a proactive change to the device state. 2N/A * This may have an impact on how Sun views the device. 2N/A * This is used for putting a device into maintenance mode and telling Sun that 2N/A * a device will go offline (implying it will not send heartbeats for the time 2N/A * Internal ASR logging. Logs debug messages, warnings and errors to the 2N/A * configured ASR log file. 2N/A * Variable arg version of the internal ASR logger. 2N/A * Logs the ASR error. If there is no internal error state this function 2N/A * Sets the ASR errno and log the error. 2N/A * Logs the ASR error with the given errno and message. 2N/A * Logs a warning to the ASR log. 2N/A * Logs an informational message to the ASR log. 2N/A * Logs a debug message to the ASR log. 2N/A * Gets the current ASR debug level. 2N/A * Sets the current ASR debug level.