Blame sunrpc/rpcsvc/sm_inter.x

Packit 6c4009
/*
Packit 6c4009
 * Status monitor protocol specification
Packit 6c4009
 * Copyright (c) 2010, Oracle America, Inc.
Packit 6c4009
 *
Packit 6c4009
 * Redistribution and use in source and binary forms, with or without
Packit 6c4009
 * modification, are permitted provided that the following conditions are
Packit 6c4009
 * met:
Packit 6c4009
 *
Packit 6c4009
 *     * Redistributions of source code must retain the above copyright
Packit 6c4009
 *       notice, this list of conditions and the following disclaimer.
Packit 6c4009
 *     * Redistributions in binary form must reproduce the above
Packit 6c4009
 *       copyright notice, this list of conditions and the following
Packit 6c4009
 *       disclaimer in the documentation and/or other materials
Packit 6c4009
 *       provided with the distribution.
Packit 6c4009
 *     * Neither the name of the "Oracle America, Inc." nor the names of its
Packit 6c4009
 *       contributors may be used to endorse or promote products derived
Packit 6c4009
 *       from this software without specific prior written permission.
Packit 6c4009
 *
Packit 6c4009
 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Packit 6c4009
 *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Packit 6c4009
 *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
Packit 6c4009
 *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
Packit 6c4009
 *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
Packit 6c4009
 *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 6c4009
 *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
Packit 6c4009
 *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Packit 6c4009
 *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
Packit 6c4009
 *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
Packit 6c4009
 *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit 6c4009
 *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
Packit 6c4009
program SM_PROG {
Packit 6c4009
	version SM_VERS  {
Packit 6c4009
		/* res_stat = stat_succ if status monitor agrees to monitor */
Packit 6c4009
		/* res_stat = stat_fail if status monitor cannot monitor */
Packit 6c4009
		/* if res_stat == stat_succ, state = state number of site sm_name */
Packit 6c4009
		struct sm_stat_res			 SM_STAT(struct sm_name) = 1;
Packit 6c4009
Packit 6c4009
		/* res_stat = stat_succ if status monitor agrees to monitor */
Packit 6c4009
		/* res_stat = stat_fail if status monitor cannot monitor */
Packit 6c4009
		/* stat consists of state number of local site */
Packit 6c4009
		struct sm_stat_res			 SM_MON(struct mon) = 2;
Packit 6c4009
Packit 6c4009
		/* stat consists of state number of local site */
Packit 6c4009
		struct sm_stat				 SM_UNMON(struct mon_id) = 3;
Packit 6c4009
Packit 6c4009
		/* stat consists of state number of local site */
Packit 6c4009
		struct sm_stat				 SM_UNMON_ALL(struct my_id) = 4;
Packit 6c4009
Packit 6c4009
		void					 SM_SIMU_CRASH(void) = 5;
Packit 6c4009
Packit 6c4009
	} = 1;
Packit 6c4009
} = 100024;
Packit 6c4009
Packit 6c4009
const	SM_MAXSTRLEN = 1024;
Packit 6c4009
Packit 6c4009
struct sm_name {
Packit 6c4009
	string mon_name<SM_MAXSTRLEN>;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct my_id {
Packit 6c4009
	string	 my_name<SM_MAXSTRLEN>;		/* name of the site initiating the monitoring request*/
Packit 6c4009
	int	my_prog;			/* rpc program # of the requesting process */
Packit 6c4009
	int	my_vers;			/* rpc version # of the requesting process */
Packit 6c4009
	int	my_proc;			/* rpc procedure # of the requesting process */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct mon_id {
Packit 6c4009
	string	mon_name<SM_MAXSTRLEN>;		/* name of the site to be monitored */
Packit 6c4009
	struct my_id my_id;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
Packit 6c4009
struct mon{
Packit 6c4009
	struct mon_id mon_id;
Packit 6c4009
	opaque priv[16]; 		/* private information to store at monitor for requesting process */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * state # of status monitor monotonically increases each time
Packit 6c4009
 * status of the site changes:
Packit 6c4009
 * an even number (>= 0) indicates the site is down and
Packit 6c4009
 * an odd number (> 0) indicates the site is up;
Packit 6c4009
 */
Packit 6c4009
struct sm_stat {
Packit 6c4009
	int state;		/* state # of status monitor */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
enum res {
Packit 6c4009
	stat_succ = 0,		/* status monitor agrees to monitor */
Packit 6c4009
	stat_fail = 1		/* status monitor cannot monitor */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct sm_stat_res {
Packit 6c4009
	res res_stat;
Packit 6c4009
	int state;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * structure of the status message sent back by the status monitor
Packit 6c4009
 * when monitor site status changes
Packit 6c4009
 */
Packit 6c4009
struct status {
Packit 6c4009
	string mon_name<SM_MAXSTRLEN>;
Packit 6c4009
	int state;
Packit 6c4009
	opaque priv[16];		/* stored private information */
Packit 6c4009
};