sm_inter.x 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * Status monitor protocol specification
  3. * Copyright (c) 2010, Oracle America, Inc.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are
  7. * met:
  8. *
  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.
  18. *
  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.
  31. */
  32. program SM_PROG {
  33. version SM_VERS {
  34. /* res_stat = stat_succ if status monitor agrees to monitor */
  35. /* res_stat = stat_fail if status monitor cannot monitor */
  36. /* if res_stat == stat_succ, state = state number of site sm_name */
  37. struct sm_stat_res SM_STAT(struct sm_name) = 1;
  38. /* res_stat = stat_succ if status monitor agrees to monitor */
  39. /* res_stat = stat_fail if status monitor cannot monitor */
  40. /* stat consists of state number of local site */
  41. struct sm_stat_res SM_MON(struct mon) = 2;
  42. /* stat consists of state number of local site */
  43. struct sm_stat SM_UNMON(struct mon_id) = 3;
  44. /* stat consists of state number of local site */
  45. struct sm_stat SM_UNMON_ALL(struct my_id) = 4;
  46. void SM_SIMU_CRASH(void) = 5;
  47. } = 1;
  48. } = 100024;
  49. const SM_MAXSTRLEN = 1024;
  50. struct sm_name {
  51. string mon_name<SM_MAXSTRLEN>;
  52. };
  53. struct my_id {
  54. string my_name<SM_MAXSTRLEN>; /* name of the site initiating the monitoring request*/
  55. int my_prog; /* rpc program # of the requesting process */
  56. int my_vers; /* rpc version # of the requesting process */
  57. int my_proc; /* rpc procedure # of the requesting process */
  58. };
  59. struct mon_id {
  60. string mon_name<SM_MAXSTRLEN>; /* name of the site to be monitored */
  61. struct my_id my_id;
  62. };
  63. struct mon{
  64. struct mon_id mon_id;
  65. opaque priv[16]; /* private information to store at monitor for requesting process */
  66. };
  67. /*
  68. * state # of status monitor monotonically increases each time
  69. * status of the site changes:
  70. * an even number (>= 0) indicates the site is down and
  71. * an odd number (> 0) indicates the site is up;
  72. */
  73. struct sm_stat {
  74. int state; /* state # of status monitor */
  75. };
  76. enum res {
  77. stat_succ = 0, /* status monitor agrees to monitor */
  78. stat_fail = 1 /* status monitor cannot monitor */
  79. };
  80. struct sm_stat_res {
  81. res res_stat;
  82. int state;
  83. };
  84. /*
  85. * structure of the status message sent back by the status monitor
  86. * when monitor site status changes
  87. */
  88. struct status {
  89. string mon_name<SM_MAXSTRLEN>;
  90. int state;
  91. opaque priv[16]; /* stored private information */
  92. };