master
1/* @(#)sm_inter.x 2.2 88/08/01 4.0 RPCSRC */
2/* @(#)sm_inter.x 1.7 87/06/24 Copyr 1987 Sun Micro */
3
4/*-
5 * Copyright (c) 2010, Oracle America, Inc.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials
16 * provided with the distribution.
17 * * Neither the name of the "Oracle America, Inc." nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
28 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35/*
36 * Status monitor protocol specification
37 * Copyright (C) 1986 Sun Microsystems, Inc.
38 *
39 */
40
41#ifndef RPC_HDR
42%#include <sys/cdefs.h>
43#endif
44
45program SM_PROG {
46 version SM_VERS {
47 /* res_stat = stat_succ if status monitor agrees to monitor */
48 /* res_stat = stat_fail if status monitor cannot monitor */
49 /* if res_stat == stat_succ, state = state number of site sm_name */
50 struct sm_stat_res SM_STAT(struct sm_name) = 1;
51
52 /* res_stat = stat_succ if status monitor agrees to monitor */
53 /* res_stat = stat_fail if status monitor cannot monitor */
54 /* stat consists of state number of local site */
55 struct sm_stat_res SM_MON(struct mon) = 2;
56
57 /* stat consists of state number of local site */
58 struct sm_stat SM_UNMON(struct mon_id) = 3;
59
60 /* stat consists of state number of local site */
61 struct sm_stat SM_UNMON_ALL(struct my_id) = 4;
62
63 void SM_SIMU_CRASH(void) = 5;
64 void SM_NOTIFY(struct stat_chge) = 6;
65
66 } = 1;
67} = 100024;
68
69const SM_MAXSTRLEN = 1024;
70
71struct sm_name {
72 string mon_name<SM_MAXSTRLEN>;
73};
74
75struct my_id {
76 string my_name<SM_MAXSTRLEN>; /* name of the site iniates the monitoring request*/
77 int my_prog; /* rpc program # of the requesting process */
78 int my_vers; /* rpc version # of the requesting process */
79 int my_proc; /* rpc procedure # of the requesting process */
80};
81
82struct mon_id {
83 string mon_name<SM_MAXSTRLEN>; /* name of the site to be monitored */
84 struct my_id my_id;
85};
86
87
88struct mon{
89 struct mon_id mon_id;
90 opaque priv[16]; /* private information to store at monitor for requesting process */
91};
92
93struct stat_chge {
94 string mon_name<SM_MAXSTRLEN>; /* name of the site that had the state change */
95 int state;
96};
97
98/*
99 * state # of status monitor monitonically increases each time
100 * status of the site changes:
101 * an even number (>= 0) indicates the site is down and
102 * an odd number (> 0) indicates the site is up;
103 */
104struct sm_stat {
105 int state; /* state # of status monitor */
106};
107
108enum sm_res {
109 stat_succ = 0, /* status monitor agrees to monitor */
110 stat_fail = 1 /* status monitor cannot monitor */
111};
112
113struct sm_stat_res {
114 sm_res res_stat;
115 int state;
116};
117
118/*
119 * structure of the status message sent back by the status monitor
120 * when monitor site status changes
121 */
122struct sm_status {
123 string mon_name<SM_MAXSTRLEN>;
124 int state;
125 opaque priv[16]; /* stored private information */
126};