Home | History | Annotate | Line # | Download | only in librpcsvc
      1  1.1     jtc /*
      2  1.1     jtc  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
      3  1.1     jtc  * unrestricted use provided that this legend is included on all tape
      4  1.1     jtc  * media and as a part of the software program in whole or part.  Users
      5  1.1     jtc  * may copy or modify Sun RPC without charge, but are not authorized
      6  1.1     jtc  * to license or distribute it to anyone else except as part of a product or
      7  1.1     jtc  * program developed by the user.
      8  1.5  simonb  *
      9  1.1     jtc  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10  1.1     jtc  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11  1.1     jtc  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12  1.5  simonb  *
     13  1.1     jtc  * Sun RPC is provided with no support and without any obligation on the
     14  1.1     jtc  * part of Sun Microsystems, Inc. to assist in its use, correction,
     15  1.1     jtc  * modification or enhancement.
     16  1.5  simonb  *
     17  1.1     jtc  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18  1.1     jtc  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19  1.1     jtc  * OR ANY PART THEREOF.
     20  1.5  simonb  *
     21  1.1     jtc  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22  1.1     jtc  * or profits or other special, indirect and consequential damages, even if
     23  1.1     jtc  * Sun has been advised of the possibility of such damages.
     24  1.5  simonb  *
     25  1.1     jtc  * Sun Microsystems, Inc.
     26  1.1     jtc  * 2550 Garcia Avenue
     27  1.1     jtc  * Mountain View, California  94043
     28  1.1     jtc  */
     29  1.1     jtc 
     30  1.1     jtc /*
     31  1.1     jtc  * Status monitor protocol specification
     32  1.1     jtc  * Copyright (C) 1986 Sun Microsystems, Inc.
     33  1.1     jtc  *
     34  1.1     jtc  */
     35  1.1     jtc 
     36  1.1     jtc #ifndef RPC_HDR
     37  1.4   lukem %#include <sys/cdefs.h>
     38  1.6  kleink %#ifndef __lint__
     39  1.1     jtc %/*static char sccsid[] = "from: @(#)sm_inter.x 1.7 87/06/24 Copyr 1987 Sun Micro";*/
     40  1.1     jtc %/*static char sccsid[] = "from: @(#)sm_inter.x	2.2 88/08/01 4.0 RPCSRC";*/
     41  1.6  kleink %__RCSID("$NetBSD: sm_inter.x,v 1.6 2004/07/01 22:52:34 kleink Exp $");
     42  1.6  kleink %#endif /* not __lint__ */
     43  1.1     jtc #endif
     44  1.1     jtc 
     45  1.1     jtc const	SM_MAXSTRLEN = 1024;
     46  1.1     jtc 
     47  1.1     jtc struct sm_name {
     48  1.1     jtc 	string mon_name<SM_MAXSTRLEN>;
     49  1.1     jtc };
     50  1.1     jtc 
     51  1.1     jtc struct my_id {
     52  1.1     jtc 	string	 my_name<SM_MAXSTRLEN>;		/* name of the site iniates the monitoring request*/
     53  1.1     jtc 	int	my_prog;			/* rpc program # of the requesting process */
     54  1.1     jtc 	int	my_vers;			/* rpc version # of the requesting process */
     55  1.1     jtc 	int	my_proc;			/* rpc procedure # of the requesting process */
     56  1.1     jtc };
     57  1.1     jtc 
     58  1.1     jtc struct mon_id {
     59  1.1     jtc 	string	mon_name<SM_MAXSTRLEN>;		/* name of the site to be monitored */
     60  1.1     jtc 	struct my_id my_id;
     61  1.1     jtc };
     62  1.1     jtc 
     63  1.1     jtc 
     64  1.1     jtc struct mon {
     65  1.1     jtc 	struct mon_id mon_id;
     66  1.1     jtc 	opaque priv[16]; 		/* private information to store at monitor for requesting process */
     67  1.1     jtc };
     68  1.1     jtc 
     69  1.1     jtc struct stat_chge {
     70  1.1     jtc 	string	mon_name<SM_MAXSTRLEN>;		/* name of the site that had the state change */
     71  1.1     jtc 	int     state;
     72  1.1     jtc };
     73  1.1     jtc 
     74  1.1     jtc /*
     75  1.1     jtc  * state # of status monitor monitonically increases each time
     76  1.1     jtc  * status of the site changes:
     77  1.1     jtc  * an even number (>= 0) indicates the site is down and
     78  1.1     jtc  * an odd number (> 0) indicates the site is up;
     79  1.1     jtc  */
     80  1.1     jtc struct sm_stat {
     81  1.1     jtc 	int state;		/* state # of status monitor */
     82  1.1     jtc };
     83  1.1     jtc 
     84  1.1     jtc enum res {
     85  1.1     jtc 	stat_succ = 0,		/* status monitor agrees to monitor */
     86  1.1     jtc 	stat_fail = 1		/* status monitor cannot monitor */
     87  1.1     jtc };
     88  1.1     jtc 
     89  1.1     jtc struct sm_stat_res {
     90  1.1     jtc 	res res_stat;
     91  1.1     jtc 	int state;
     92  1.1     jtc };
     93  1.1     jtc 
     94  1.5  simonb /*
     95  1.1     jtc  * structure of the status message sent back by the status monitor
     96  1.1     jtc  * when monitor site status changes
     97  1.1     jtc  */
     98  1.1     jtc struct status {
     99  1.1     jtc 	string mon_name<SM_MAXSTRLEN>;
    100  1.1     jtc 	int state;
    101  1.1     jtc 	opaque priv[16];		/* stored private information */
    102  1.1     jtc };
    103  1.3   mikel 
    104  1.5  simonb program SM_PROG {
    105  1.3   mikel 	version SM_VERS  {
    106  1.3   mikel 		/* res_stat = stat_succ if status monitor agrees to monitor */
    107  1.3   mikel 		/* res_stat = stat_fail if status monitor cannot monitor */
    108  1.3   mikel 		/* if res_stat == stat_succ, state = state number of site sm_name */
    109  1.3   mikel 		struct sm_stat_res			 SM_STAT(struct sm_name) = 1;
    110  1.3   mikel 
    111  1.3   mikel 		/* res_stat = stat_succ if status monitor agrees to monitor */
    112  1.3   mikel 		/* res_stat = stat_fail if status monitor cannot monitor */
    113  1.3   mikel 		/* stat consists of state number of local site */
    114  1.3   mikel 		struct sm_stat_res			 SM_MON(struct mon) = 2;
    115  1.3   mikel 
    116  1.3   mikel 		/* stat consists of state number of local site */
    117  1.3   mikel 		struct sm_stat				 SM_UNMON(struct mon_id) = 3;
    118  1.3   mikel 
    119  1.3   mikel 		/* stat consists of state number of local site */
    120  1.3   mikel 		struct sm_stat				 SM_UNMON_ALL(struct my_id) = 4;
    121  1.3   mikel 
    122  1.3   mikel 		void					 SM_SIMU_CRASH(void) = 5;
    123  1.3   mikel 
    124  1.3   mikel 		void					 SM_NOTIFY(struct stat_chge) = 6;
    125  1.3   mikel 
    126  1.3   mikel 	} = 1;
    127  1.3   mikel } = 100024;
    128