Warning, /include/rpcsvc/sm_inter.x is written in an unsupported language. File is not indexed.
0001 /*
0002 * Status monitor protocol specification
0003 * Copyright (c) 2010, Oracle America, Inc.
0004 *
0005 * Redistribution and use in source and binary forms, with or without
0006 * modification, are permitted provided that the following conditions are
0007 * met:
0008 *
0009 * * Redistributions of source code must retain the above copyright
0010 * notice, this list of conditions and the following disclaimer.
0011 * * Redistributions in binary form must reproduce the above
0012 * copyright notice, this list of conditions and the following
0013 * disclaimer in the documentation and/or other materials
0014 * provided with the distribution.
0015 * * Neither the name of the "Oracle America, Inc." nor the names of its
0016 * contributors may be used to endorse or promote products derived
0017 * from this software without specific prior written permission.
0018 *
0019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0020 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0021 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
0022 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
0023 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
0024 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0025 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
0026 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0027 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
0028 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0029 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0030 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0031 */
0032
0033
0034 program SM_PROG {
0035 version SM_VERS {
0036 /* res_stat = stat_succ if status monitor agrees to monitor */
0037 /* res_stat = stat_fail if status monitor cannot monitor */
0038 /* if res_stat == stat_succ, state = state number of site sm_name */
0039 struct sm_stat_res SM_STAT(struct sm_name) = 1;
0040
0041 /* res_stat = stat_succ if status monitor agrees to monitor */
0042 /* res_stat = stat_fail if status monitor cannot monitor */
0043 /* stat consists of state number of local site */
0044 struct sm_stat_res SM_MON(struct mon) = 2;
0045
0046 /* stat consists of state number of local site */
0047 struct sm_stat SM_UNMON(struct mon_id) = 3;
0048
0049 /* stat consists of state number of local site */
0050 struct sm_stat SM_UNMON_ALL(struct my_id) = 4;
0051
0052 void SM_SIMU_CRASH(void) = 5;
0053
0054 } = 1;
0055 } = 100024;
0056
0057 const SM_MAXSTRLEN = 1024;
0058
0059 struct sm_name {
0060 string mon_name<SM_MAXSTRLEN>;
0061 };
0062
0063 struct my_id {
0064 string my_name<SM_MAXSTRLEN>; /* name of the site initiating the monitoring request*/
0065 int my_prog; /* rpc program # of the requesting process */
0066 int my_vers; /* rpc version # of the requesting process */
0067 int my_proc; /* rpc procedure # of the requesting process */
0068 };
0069
0070 struct mon_id {
0071 string mon_name<SM_MAXSTRLEN>; /* name of the site to be monitored */
0072 struct my_id my_id;
0073 };
0074
0075
0076 struct mon{
0077 struct mon_id mon_id;
0078 opaque priv[16]; /* private information to store at monitor for requesting process */
0079 };
0080
0081
0082 /*
0083 * state # of status monitor monotonically increases each time
0084 * status of the site changes:
0085 * an even number (>= 0) indicates the site is down and
0086 * an odd number (> 0) indicates the site is up;
0087 */
0088 struct sm_stat {
0089 int state; /* state # of status monitor */
0090 };
0091
0092 enum res {
0093 stat_succ = 0, /* status monitor agrees to monitor */
0094 stat_fail = 1 /* status monitor cannot monitor */
0095 };
0096
0097 struct sm_stat_res {
0098 res res_stat;
0099 int state;
0100 };
0101
0102 /*
0103 * structure of the status message sent back by the status monitor
0104 * when monitor site status changes
0105 */
0106 struct status {
0107 string mon_name<SM_MAXSTRLEN>;
0108 int state;
0109 opaque priv[16]; /* stored private information */
0110 };