home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume13 / rpc3.9 / part09 / sm_inter.x < prev    next >
Encoding:
Text File  |  1988-02-27  |  2.2 KB  |  88 lines

  1. /* @(#)sm_inter.x    1.2 87/11/12 3.9 RPCSRC */
  2. /* @(#)sm_inter.x 1.7 87/06/24 Copyr 1987 Sun Micro */
  3.  
  4. /*
  5.  * Status monitor protocol specification
  6.  * Copyright (C) 1986 Sun Microsystems, Inc.
  7.  *
  8.  */
  9.  
  10.  
  11. program SM_PROG { 
  12.     version SM_VERS  {
  13.         /* res_stat = stat_succ if status monitor agrees to monitor */
  14.         /* res_stat = stat_fail if status monitor cannot monitor */
  15.         /* if res_stat == stat_succ, state = state number of site sm_name */
  16.         struct sm_stat_res             SM_STAT(struct sm_name) = 1;
  17.  
  18.         /* res_stat = stat_succ if status monitor agrees to monitor */
  19.         /* res_stat = stat_fail if status monitor cannot monitor */
  20.         /* stat consists of state number of local site */
  21.         struct sm_stat_res             SM_MON(struct mon) = 2;
  22.  
  23.         /* stat consists of state number of local site */
  24.         struct sm_stat                 SM_UNMON(struct mon_id) = 3;
  25.  
  26.         /* stat consists of state number of local site */
  27.         struct sm_stat                 SM_UNMON_ALL(struct my_id) = 4;
  28.  
  29.         void                     SM_SIMU_CRASH(void) = 5;
  30.  
  31.     } = 1;
  32. } = 100024;
  33.  
  34. const    SM_MAXSTRLEN = 1024;
  35.  
  36. struct sm_name {
  37.     string mon_name<SM_MAXSTRLEN>;
  38. };
  39.  
  40. struct my_id {
  41.     string     my_name<SM_MAXSTRLEN>;        /* name of the site iniates the monitoring request*/
  42.     int    my_prog;            /* rpc program # of the requesting process */
  43.     int    my_vers;            /* rpc version # of the requesting process */
  44.     int    my_proc;            /* rpc procedure # of the requesting process */
  45. };
  46.  
  47. struct mon_id {
  48.     string    mon_name<SM_MAXSTRLEN>;        /* name of the site to be monitored */
  49.     struct my_id my_id;
  50. };
  51.  
  52.  
  53. struct mon{
  54.     struct mon_id mon_id;
  55.     opaque priv[16];         /* private information to store at monitor for requesting process */
  56. };
  57.  
  58.  
  59. /*
  60.  * state # of status monitor monitonically increases each time
  61.  * status of the site changes:
  62.  * an even number (>= 0) indicates the site is down and
  63.  * an odd number (> 0) indicates the site is up;
  64.  */
  65. struct sm_stat {
  66.     int state;        /* state # of status monitor */
  67. };
  68.  
  69. enum res {
  70.     stat_succ = 0,        /* status monitor agrees to monitor */
  71.     stat_fail = 1        /* status monitor cannot monitor */
  72. };
  73.  
  74. struct sm_stat_res {
  75.     res res_stat;
  76.     int state;
  77. };
  78.  
  79. /* 
  80.  * structure of the status message sent back by the status monitor
  81.  * when monitor site status changes
  82.  */
  83. struct status {
  84.     string mon_name<SM_MAXSTRLEN>;
  85.     int state;
  86.     opaque priv[16];        /* stored private information */
  87. };
  88.