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