131387Scharnier/* @(#)sm_inter.x	2.2 88/08/01 4.0 RPCSRC */
231387Scharnier/* @(#)sm_inter.x 1.7 87/06/24 Copyr 1987 Sun Micro */
331387Scharnier
4272850Shrs/*-
5272850Shrs * Copyright (c) 2010, Oracle America, Inc.
6272850Shrs *
7272850Shrs * Redistribution and use in source and binary forms, with or without
8272850Shrs * modification, are permitted provided that the following conditions are
9272850Shrs * met:
10272850Shrs *
11272850Shrs *     * Redistributions of source code must retain the above copyright
12272850Shrs *       notice, this list of conditions and the following disclaimer.
13272850Shrs *     * Redistributions in binary form must reproduce the above
14272850Shrs *       copyright notice, this list of conditions and the following
15272850Shrs *       disclaimer in the documentation and/or other materials
16272850Shrs *       provided with the distribution.
17272850Shrs *     * Neither the name of the "Oracle America, Inc." nor the names of its
18272850Shrs *       contributors may be used to endorse or promote products derived
19272850Shrs *       from this software without specific prior written permission.
20272850Shrs *
21272850Shrs *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22272850Shrs *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23272850Shrs *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24272850Shrs *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25272850Shrs *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
26272850Shrs *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27272850Shrs *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
28272850Shrs *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29272850Shrs *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30272850Shrs *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31272850Shrs *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32272850Shrs *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
331832Swollman */
341832Swollman
351832Swollman/*
361832Swollman * Status monitor protocol specification
371832Swollman * Copyright (C) 1986 Sun Microsystems, Inc.
381832Swollman *
391832Swollman */
401832Swollman
411832Swollman#ifndef RPC_HDR
42114629Sobrien%#include <sys/cdefs.h>
43114629Sobrien%__FBSDID("$FreeBSD: releng/10.2/include/rpcsvc/sm_inter.x 272850 2014-10-09 23:05:32Z hrs $");
441832Swollman#endif
451832Swollman
461832Swollmanprogram SM_PROG {
471832Swollman	version SM_VERS  {
481832Swollman		/* res_stat = stat_succ if status monitor agrees to monitor */
491832Swollman		/* res_stat = stat_fail if status monitor cannot monitor */
501832Swollman		/* if res_stat == stat_succ, state = state number of site sm_name */
511832Swollman		struct sm_stat_res			 SM_STAT(struct sm_name) = 1;
521832Swollman
531832Swollman		/* res_stat = stat_succ if status monitor agrees to monitor */
541832Swollman		/* res_stat = stat_fail if status monitor cannot monitor */
551832Swollman		/* stat consists of state number of local site */
561832Swollman		struct sm_stat_res			 SM_MON(struct mon) = 2;
571832Swollman
581832Swollman		/* stat consists of state number of local site */
591832Swollman		struct sm_stat				 SM_UNMON(struct mon_id) = 3;
601832Swollman
611832Swollman		/* stat consists of state number of local site */
621832Swollman		struct sm_stat				 SM_UNMON_ALL(struct my_id) = 4;
631832Swollman
641832Swollman		void					 SM_SIMU_CRASH(void) = 5;
6574462Salfred		void					 SM_NOTIFY(struct stat_chge) = 6;
661832Swollman
671832Swollman	} = 1;
681832Swollman} = 100024;
691832Swollman
701832Swollmanconst	SM_MAXSTRLEN = 1024;
711832Swollman
721832Swollmanstruct sm_name {
731832Swollman	string mon_name<SM_MAXSTRLEN>;
741832Swollman};
751832Swollman
761832Swollmanstruct my_id {
771832Swollman	string	 my_name<SM_MAXSTRLEN>;		/* name of the site iniates the monitoring request*/
781832Swollman	int	my_prog;			/* rpc program # of the requesting process */
791832Swollman	int	my_vers;			/* rpc version # of the requesting process */
801832Swollman	int	my_proc;			/* rpc procedure # of the requesting process */
811832Swollman};
821832Swollman
831832Swollmanstruct mon_id {
841832Swollman	string	mon_name<SM_MAXSTRLEN>;		/* name of the site to be monitored */
851832Swollman	struct my_id my_id;
861832Swollman};
871832Swollman
881832Swollman
891832Swollmanstruct mon{
901832Swollman	struct mon_id mon_id;
911832Swollman	opaque priv[16]; 		/* private information to store at monitor for requesting process */
921832Swollman};
931832Swollman
9474462Salfredstruct stat_chge {
9574462Salfred	string  mon_name<SM_MAXSTRLEN>;         /* name of the site that had the state change */
9674462Salfred	int state;
9774462Salfred};
981832Swollman
991832Swollman/*
1001832Swollman * state # of status monitor monitonically increases each time
1011832Swollman * status of the site changes:
1021832Swollman * an even number (>= 0) indicates the site is down and
1031832Swollman * an odd number (> 0) indicates the site is up;
1041832Swollman */
1051832Swollmanstruct sm_stat {
1061832Swollman	int state;		/* state # of status monitor */
1071832Swollman};
1081832Swollman
10992970Salfredenum sm_res {
1101832Swollman	stat_succ = 0,		/* status monitor agrees to monitor */
1111832Swollman	stat_fail = 1		/* status monitor cannot monitor */
1121832Swollman};
1131832Swollman
1141832Swollmanstruct sm_stat_res {
11592970Salfred	sm_res res_stat;
1161832Swollman	int state;
1171832Swollman};
1181832Swollman
1191832Swollman/*
1201832Swollman * structure of the status message sent back by the status monitor
1211832Swollman * when monitor site status changes
1221832Swollman */
12392970Salfredstruct sm_status {
1241832Swollman	string mon_name<SM_MAXSTRLEN>;
1251832Swollman	int state;
1261832Swollman	opaque priv[16];		/* stored private information */
1271832Swollman};
128