1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate %/* 23*7c478bd9Sstevel@tonic-gate % * Copyright (c) 1986, 1994 by Sun Microsystems, Inc. 24*7c478bd9Sstevel@tonic-gate % * All rights reserved. 25*7c478bd9Sstevel@tonic-gate % */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate %/* from sm_inter.x */ 28*7c478bd9Sstevel@tonic-gate 29*7c478bd9Sstevel@tonic-gate #ifdef RPC_HDR 30*7c478bd9Sstevel@tonic-gate % 31*7c478bd9Sstevel@tonic-gate %#pragma ident "%Z%%M% %I% %E% SMI" 32*7c478bd9Sstevel@tonic-gate % 33*7c478bd9Sstevel@tonic-gate #endif 34*7c478bd9Sstevel@tonic-gate 35*7c478bd9Sstevel@tonic-gate /* 36*7c478bd9Sstevel@tonic-gate * Status monitor protocol specification 37*7c478bd9Sstevel@tonic-gate */ 38*7c478bd9Sstevel@tonic-gate 39*7c478bd9Sstevel@tonic-gate program SM_PROG { 40*7c478bd9Sstevel@tonic-gate version SM_VERS { 41*7c478bd9Sstevel@tonic-gate /* res_stat = stat_succ if status monitor agrees to monitor */ 42*7c478bd9Sstevel@tonic-gate /* res_stat = stat_fail if status monitor cannot monitor */ 43*7c478bd9Sstevel@tonic-gate /* if res_stat == stat_succ, state = state number of site */ 44*7c478bd9Sstevel@tonic-gate /* sm_name */ 45*7c478bd9Sstevel@tonic-gate struct sm_stat_res SM_STAT(struct sm_name) = 1; 46*7c478bd9Sstevel@tonic-gate 47*7c478bd9Sstevel@tonic-gate /* res_stat = stat_succ if status monitor agrees to monitor */ 48*7c478bd9Sstevel@tonic-gate /* res_stat = stat_fail if status monitor cannot monitor */ 49*7c478bd9Sstevel@tonic-gate /* stat consists of state number of local site */ 50*7c478bd9Sstevel@tonic-gate struct sm_stat_res SM_MON(struct mon) = 2; 51*7c478bd9Sstevel@tonic-gate 52*7c478bd9Sstevel@tonic-gate /* stat consists of state number of local site */ 53*7c478bd9Sstevel@tonic-gate struct sm_stat SM_UNMON(struct mon_id) = 3; 54*7c478bd9Sstevel@tonic-gate 55*7c478bd9Sstevel@tonic-gate /* stat consists of state number of local site */ 56*7c478bd9Sstevel@tonic-gate struct sm_stat SM_UNMON_ALL(struct my_id) = 4; 57*7c478bd9Sstevel@tonic-gate 58*7c478bd9Sstevel@tonic-gate void SM_SIMU_CRASH(void) = 5; 59*7c478bd9Sstevel@tonic-gate 60*7c478bd9Sstevel@tonic-gate void SM_NOTIFY(struct stat_chge) = 6; 61*7c478bd9Sstevel@tonic-gate } = 1; 62*7c478bd9Sstevel@tonic-gate } = 100024; 63*7c478bd9Sstevel@tonic-gate 64*7c478bd9Sstevel@tonic-gate const SM_MAXSTRLEN = 1024; 65*7c478bd9Sstevel@tonic-gate 66*7c478bd9Sstevel@tonic-gate struct sm_name { 67*7c478bd9Sstevel@tonic-gate string mon_name<SM_MAXSTRLEN>; 68*7c478bd9Sstevel@tonic-gate }; 69*7c478bd9Sstevel@tonic-gate 70*7c478bd9Sstevel@tonic-gate struct my_id { 71*7c478bd9Sstevel@tonic-gate string my_name<SM_MAXSTRLEN>; /* name of the site iniates the */ 72*7c478bd9Sstevel@tonic-gate /* monitoring request */ 73*7c478bd9Sstevel@tonic-gate int my_prog; /* rpc program # of the requesting process */ 74*7c478bd9Sstevel@tonic-gate int my_vers; /* rpc version # of the requesting process */ 75*7c478bd9Sstevel@tonic-gate int my_proc; /* rpc procedure # of the requesting process */ 76*7c478bd9Sstevel@tonic-gate }; 77*7c478bd9Sstevel@tonic-gate 78*7c478bd9Sstevel@tonic-gate struct mon_id { 79*7c478bd9Sstevel@tonic-gate string mon_name<SM_MAXSTRLEN>; /* name of the site to be monitored */ 80*7c478bd9Sstevel@tonic-gate struct my_id my_id; 81*7c478bd9Sstevel@tonic-gate }; 82*7c478bd9Sstevel@tonic-gate 83*7c478bd9Sstevel@tonic-gate 84*7c478bd9Sstevel@tonic-gate struct mon{ 85*7c478bd9Sstevel@tonic-gate struct mon_id mon_id; 86*7c478bd9Sstevel@tonic-gate opaque priv[16]; /* private information to store at monitor */ 87*7c478bd9Sstevel@tonic-gate /* for requesting process */ 88*7c478bd9Sstevel@tonic-gate }; 89*7c478bd9Sstevel@tonic-gate 90*7c478bd9Sstevel@tonic-gate 91*7c478bd9Sstevel@tonic-gate /* 92*7c478bd9Sstevel@tonic-gate * state # of status monitor monitonically increases each time 93*7c478bd9Sstevel@tonic-gate * status of the site changes: 94*7c478bd9Sstevel@tonic-gate * an even number (>= 0) indicates the site is down and 95*7c478bd9Sstevel@tonic-gate * an odd number (> 0) indicates the site is up; 96*7c478bd9Sstevel@tonic-gate */ 97*7c478bd9Sstevel@tonic-gate struct sm_stat { 98*7c478bd9Sstevel@tonic-gate int state; /* state # of status monitor */ 99*7c478bd9Sstevel@tonic-gate }; 100*7c478bd9Sstevel@tonic-gate 101*7c478bd9Sstevel@tonic-gate enum res { 102*7c478bd9Sstevel@tonic-gate stat_succ = 0, /* status monitor agrees to monitor */ 103*7c478bd9Sstevel@tonic-gate stat_fail = 1 /* status monitor cannot monitor */ 104*7c478bd9Sstevel@tonic-gate }; 105*7c478bd9Sstevel@tonic-gate 106*7c478bd9Sstevel@tonic-gate struct sm_stat_res { 107*7c478bd9Sstevel@tonic-gate res res_stat; 108*7c478bd9Sstevel@tonic-gate int state; 109*7c478bd9Sstevel@tonic-gate }; 110*7c478bd9Sstevel@tonic-gate 111*7c478bd9Sstevel@tonic-gate /* 112*7c478bd9Sstevel@tonic-gate * structure of the status message sent by the status monitor to the 113*7c478bd9Sstevel@tonic-gate * requesting program when a monitored site changes status. 114*7c478bd9Sstevel@tonic-gate */ 115*7c478bd9Sstevel@tonic-gate struct status { 116*7c478bd9Sstevel@tonic-gate string mon_name<SM_MAXSTRLEN>; 117*7c478bd9Sstevel@tonic-gate int state; 118*7c478bd9Sstevel@tonic-gate opaque priv[16]; /* stored private information */ 119*7c478bd9Sstevel@tonic-gate }; 120*7c478bd9Sstevel@tonic-gate 121*7c478bd9Sstevel@tonic-gate /* 122*7c478bd9Sstevel@tonic-gate * structure sent between statd's to announce a state change (e.g., 123*7c478bd9Sstevel@tonic-gate * reboot). 124*7c478bd9Sstevel@tonic-gate */ 125*7c478bd9Sstevel@tonic-gate struct stat_chge { 126*7c478bd9Sstevel@tonic-gate string mon_name<SM_MAXSTRLEN>; 127*7c478bd9Sstevel@tonic-gate int state; 128*7c478bd9Sstevel@tonic-gate }; 129