xref: /titanic_41/usr/src/uts/common/rpcsvc/sm_inter.x (revision 0b42f15ac52b077791d4ba079e8c163c592c3fda)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate %/*
237c478bd9Sstevel@tonic-gate % * Copyright (c) 1986, 1994 by Sun Microsystems, Inc.
247c478bd9Sstevel@tonic-gate % * All rights reserved.
257c478bd9Sstevel@tonic-gate % */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate %/* from sm_inter.x */
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate /*
307c478bd9Sstevel@tonic-gate  * Status monitor protocol specification
317c478bd9Sstevel@tonic-gate  */
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate program SM_PROG {
347c478bd9Sstevel@tonic-gate 	version SM_VERS  {
357c478bd9Sstevel@tonic-gate 		/* res_stat = stat_succ if status monitor agrees to monitor */
367c478bd9Sstevel@tonic-gate 		/* res_stat = stat_fail if status monitor cannot monitor */
377c478bd9Sstevel@tonic-gate 		/* if res_stat == stat_succ, state = state number of site */
387c478bd9Sstevel@tonic-gate                 /* sm_name */
397c478bd9Sstevel@tonic-gate 		struct sm_stat_res	SM_STAT(struct sm_name) = 1;
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate 		/* res_stat = stat_succ if status monitor agrees to monitor */
427c478bd9Sstevel@tonic-gate 		/* res_stat = stat_fail if status monitor cannot monitor */
437c478bd9Sstevel@tonic-gate 		/* stat consists of state number of local site */
447c478bd9Sstevel@tonic-gate 		struct sm_stat_res	SM_MON(struct mon) = 2;
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate 		/* stat consists of state number of local site */
477c478bd9Sstevel@tonic-gate 		struct sm_stat		SM_UNMON(struct mon_id) = 3;
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate 		/* stat consists of state number of local site */
507c478bd9Sstevel@tonic-gate 		struct sm_stat		SM_UNMON_ALL(struct my_id) = 4;
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate 		void			SM_SIMU_CRASH(void) = 5;
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate 		void			SM_NOTIFY(struct stat_chge) = 6;
557c478bd9Sstevel@tonic-gate 	} = 1;
567c478bd9Sstevel@tonic-gate } = 100024;
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate const	SM_MAXSTRLEN = 1024;
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate struct sm_name {
617c478bd9Sstevel@tonic-gate 	string mon_name<SM_MAXSTRLEN>;
627c478bd9Sstevel@tonic-gate };
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate struct my_id {
657c478bd9Sstevel@tonic-gate 	string	 my_name<SM_MAXSTRLEN>;	/* name of the site iniates the */
667c478bd9Sstevel@tonic-gate 					/* monitoring request */
677c478bd9Sstevel@tonic-gate 	int	my_prog;	/* rpc program # of the requesting process */
687c478bd9Sstevel@tonic-gate 	int	my_vers;	/* rpc version # of the requesting process */
697c478bd9Sstevel@tonic-gate 	int	my_proc;	/* rpc procedure # of the requesting process */
707c478bd9Sstevel@tonic-gate };
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate struct mon_id {
737c478bd9Sstevel@tonic-gate 	string	mon_name<SM_MAXSTRLEN>;	/* name of the site to be monitored */
747c478bd9Sstevel@tonic-gate 	struct my_id my_id;
757c478bd9Sstevel@tonic-gate };
767c478bd9Sstevel@tonic-gate 
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate struct mon{
797c478bd9Sstevel@tonic-gate 	struct mon_id mon_id;
807c478bd9Sstevel@tonic-gate 	opaque priv[16]; 	/* private information to store at monitor */
817c478bd9Sstevel@tonic-gate 				/* for requesting process */
827c478bd9Sstevel@tonic-gate };
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate /*
867c478bd9Sstevel@tonic-gate  * state # of status monitor monitonically increases each time
877c478bd9Sstevel@tonic-gate  * status of the site changes:
887c478bd9Sstevel@tonic-gate  * an even number (>= 0) indicates the site is down and
897c478bd9Sstevel@tonic-gate  * an odd number (> 0) indicates the site is up;
907c478bd9Sstevel@tonic-gate  */
917c478bd9Sstevel@tonic-gate struct sm_stat {
927c478bd9Sstevel@tonic-gate 	int state;		/* state # of status monitor */
937c478bd9Sstevel@tonic-gate };
947c478bd9Sstevel@tonic-gate 
95*bbaa8b60SDan Kruchinin enum sm_res {
967c478bd9Sstevel@tonic-gate 	stat_succ = 0,		/* status monitor agrees to monitor */
977c478bd9Sstevel@tonic-gate 	stat_fail = 1		/* status monitor cannot monitor */
987c478bd9Sstevel@tonic-gate };
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate struct sm_stat_res {
101*bbaa8b60SDan Kruchinin 	sm_res res_stat;
1027c478bd9Sstevel@tonic-gate 	int state;
1037c478bd9Sstevel@tonic-gate };
1047c478bd9Sstevel@tonic-gate 
1057c478bd9Sstevel@tonic-gate /*
1067c478bd9Sstevel@tonic-gate  * structure of the status message sent by the status monitor to the
1077c478bd9Sstevel@tonic-gate  * requesting program when a monitored site changes status.
1087c478bd9Sstevel@tonic-gate  */
109*bbaa8b60SDan Kruchinin struct sm_status {
1107c478bd9Sstevel@tonic-gate 	string mon_name<SM_MAXSTRLEN>;
1117c478bd9Sstevel@tonic-gate 	int state;
1127c478bd9Sstevel@tonic-gate 	opaque priv[16];		/* stored private information */
1137c478bd9Sstevel@tonic-gate };
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate /*
1167c478bd9Sstevel@tonic-gate  * structure sent between statd's to announce a state change (e.g.,
1177c478bd9Sstevel@tonic-gate  * reboot).
1187c478bd9Sstevel@tonic-gate  */
1197c478bd9Sstevel@tonic-gate struct stat_chge {
1207c478bd9Sstevel@tonic-gate 	string mon_name<SM_MAXSTRLEN>;
1217c478bd9Sstevel@tonic-gate 	int state;
1227c478bd9Sstevel@tonic-gate };
123