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