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
41832Swollman/*
51832Swollman * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
61832Swollman * unrestricted use provided that this legend is included on all tape
71832Swollman * media and as a part of the software program in whole or part.  Users
81832Swollman * may copy or modify Sun RPC without charge, but are not authorized
91832Swollman * to license or distribute it to anyone else except as part of a product or
101832Swollman * program developed by the user.
111832Swollman *
121832Swollman * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
131832Swollman * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
141832Swollman * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
151832Swollman *
161832Swollman * Sun RPC is provided with no support and without any obligation on the
171832Swollman * part of Sun Microsystems, Inc. to assist in its use, correction,
181832Swollman * modification or enhancement.
191832Swollman *
201832Swollman * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
211832Swollman * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
221832Swollman * OR ANY PART THEREOF.
231832Swollman *
241832Swollman * In no event will Sun Microsystems, Inc. be liable for any lost revenue
251832Swollman * or profits or other special, indirect and consequential damages, even if
261832Swollman * Sun has been advised of the possibility of such damages.
271832Swollman *
281832Swollman * Sun Microsystems, Inc.
291832Swollman * 2550 Garcia Avenue
301832Swollman * Mountain View, California  94043
311832Swollman */
321832Swollman
331832Swollman/*
341832Swollman * Status monitor protocol specification
351832Swollman * Copyright (C) 1986 Sun Microsystems, Inc.
361832Swollman *
371832Swollman */
381832Swollman
391832Swollman#ifndef RPC_HDR
40114629Sobrien%#include <sys/cdefs.h>
41114629Sobrien%__FBSDID("$FreeBSD$");
421832Swollman#endif
431832Swollman
441832Swollmanprogram SM_PROG {
451832Swollman	version SM_VERS  {
461832Swollman		/* res_stat = stat_succ if status monitor agrees to monitor */
471832Swollman		/* res_stat = stat_fail if status monitor cannot monitor */
481832Swollman		/* if res_stat == stat_succ, state = state number of site sm_name */
491832Swollman		struct sm_stat_res			 SM_STAT(struct sm_name) = 1;
501832Swollman
511832Swollman		/* res_stat = stat_succ if status monitor agrees to monitor */
521832Swollman		/* res_stat = stat_fail if status monitor cannot monitor */
531832Swollman		/* stat consists of state number of local site */
541832Swollman		struct sm_stat_res			 SM_MON(struct mon) = 2;
551832Swollman
561832Swollman		/* stat consists of state number of local site */
571832Swollman		struct sm_stat				 SM_UNMON(struct mon_id) = 3;
581832Swollman
591832Swollman		/* stat consists of state number of local site */
601832Swollman		struct sm_stat				 SM_UNMON_ALL(struct my_id) = 4;
611832Swollman
621832Swollman		void					 SM_SIMU_CRASH(void) = 5;
6374462Salfred		void					 SM_NOTIFY(struct stat_chge) = 6;
641832Swollman
651832Swollman	} = 1;
661832Swollman} = 100024;
671832Swollman
681832Swollmanconst	SM_MAXSTRLEN = 1024;
691832Swollman
701832Swollmanstruct sm_name {
711832Swollman	string mon_name<SM_MAXSTRLEN>;
721832Swollman};
731832Swollman
741832Swollmanstruct my_id {
751832Swollman	string	 my_name<SM_MAXSTRLEN>;		/* name of the site iniates the monitoring request*/
761832Swollman	int	my_prog;			/* rpc program # of the requesting process */
771832Swollman	int	my_vers;			/* rpc version # of the requesting process */
781832Swollman	int	my_proc;			/* rpc procedure # of the requesting process */
791832Swollman};
801832Swollman
811832Swollmanstruct mon_id {
821832Swollman	string	mon_name<SM_MAXSTRLEN>;		/* name of the site to be monitored */
831832Swollman	struct my_id my_id;
841832Swollman};
851832Swollman
861832Swollman
871832Swollmanstruct mon{
881832Swollman	struct mon_id mon_id;
891832Swollman	opaque priv[16]; 		/* private information to store at monitor for requesting process */
901832Swollman};
911832Swollman
9274462Salfredstruct stat_chge {
9374462Salfred	string  mon_name<SM_MAXSTRLEN>;         /* name of the site that had the state change */
9474462Salfred	int state;
9574462Salfred};
961832Swollman
971832Swollman/*
981832Swollman * state # of status monitor monitonically increases each time
991832Swollman * status of the site changes:
1001832Swollman * an even number (>= 0) indicates the site is down and
1011832Swollman * an odd number (> 0) indicates the site is up;
1021832Swollman */
1031832Swollmanstruct sm_stat {
1041832Swollman	int state;		/* state # of status monitor */
1051832Swollman};
1061832Swollman
10792970Salfredenum sm_res {
1081832Swollman	stat_succ = 0,		/* status monitor agrees to monitor */
1091832Swollman	stat_fail = 1		/* status monitor cannot monitor */
1101832Swollman};
1111832Swollman
1121832Swollmanstruct sm_stat_res {
11392970Salfred	sm_res res_stat;
1141832Swollman	int state;
1151832Swollman};
1161832Swollman
1171832Swollman/*
1181832Swollman * structure of the status message sent back by the status monitor
1191832Swollman * when monitor site status changes
1201832Swollman */
12192970Salfredstruct sm_status {
1221832Swollman	string mon_name<SM_MAXSTRLEN>;
1231832Swollman	int state;
1241832Swollman	opaque priv[16];		/* stored private information */
1251832Swollman};
126