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) 1994, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A * Just in case we're not in a build environment, make sure that 2N/A * TEXT_DOMAIN gets set to something. 2N/A * This structure is used to pass data from meta_client_create to 2N/A * client_create_helper via meta_client_create_retry. 2N/A * Set the timeout value for this client handle. 2N/A * client_create_vers_retry is the helper function to be passed to 2N/A * meta_client_create_retry to do the actual work of creating the client 2N/A * when version selection is necessary. 2N/A * client_create_helper is the helper function to be passed to 2N/A * meta_client_create_retry when plain vanilla client create is desired. 2N/A * meta_client_create_retry is a general function to assist in creating RPC 2N/A * clients. This function handles retrying if the attempt to create a 2N/A * client fails. meta_client_create_retry itself does not actually create 2N/A * the client. Instead it calls the helper function, func, to do that job. 2N/A * With the help of func, meta_client_create_retry will create an RPC 2N/A * connection allowing up to tout seconds to complete the task. If the 2N/A * connection creation fails for RPC_RPCBFAILURE, RPC_CANTRECV or 2N/A * RPC_PROGNOTREGISTERED and tout seconds have not passed, 2N/A * meta_client_create_retry will try again. The reason retries are 2N/A * important is that when the inet daemon is being refreshed, it can take 2N/A * 15-20 seconds for it to start responding again. 2N/A * hostname - Name of remote host 2N/A * func - Pointer to the helper function, that will 2N/A * actually try to create the client. 2N/A * data - Private data to be passed on to func. 2N/A * meta_client_create_retry treats this as an opaque 2N/A * tout - Number of seconds to allow for the connection 2N/A * ep - Standard SVM error pointer. May be NULL. 2N/A static int debug;
/* print debugging info */ 2N/A /* Use remaining time as the timeout value. */ 2N/A /* If error might be fixed in time, sleep & try again */ 2N/A /* Not a recoverable error. */ 2N/A "meta_client_create_retry");
2N/A * meta_client_create is intended to be used within SVM as a replacement 2N/A * for calls to clnt_create. meta_client_create invokes the retry 2N/A * mechanism of meta_client_create_retry. 2N/A * create and return RPC connection 2N/A * Before trying to create the client, make sure that the core SVM 2N/A * services are enabled by the Service Management Facility. We 2N/A * don't want to suffer the 60 second timeout if the services are 2N/A * not even enabled. This call actually only verifies that they 2N/A * are enabled on this host no matter which host the caller wants 2N/A * to connect to. Nonetheless, if the services are not enabled on 2N/A * the local host, our RPC stuff is not going to work as expected. 2N/A * Copy at most MD_MAX_MNNODENAME octets from the passed hostname. 2N/A * This is limited by RFC1035. We truncate at this amount. 2N/A * If we are in cluster mode, lets use the private interconnect 2N/A * hostnames to establish the rpc connections. 2N/A * inet_ntoa() returns pointer to a string in the 2N/A * base 256 notation d.d.d.d (IPv4) and so 2N/A * host_priv[18] should be sufficient enough to 2N/A * Try to create a version 2 client handle by default. 2N/A * If this fails (i.e. client is version 1), try to 2N/A * create a version 1 client handle. 2N/A /* open connection */ 2N/A * metarpcclose - is a place holder so that when using 2N/A * metarpcopen, it does not appear that 2N/A * we have dangling opens. We can at some 2N/A * later decrement open counts here too, if needed.