home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / bsd / rpcsvc / sm_inter.x < prev    next >
Text File  |  1990-01-29  |  2KB  |  90 lines

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