]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/statd/sm_inter.x
Define and use HIAVE_IFADDRS_H
[nfs-utils.git] / utils / statd / sm_inter.x
1 /*
2  * Copyright (C) 1986 Sun Microsystems, Inc.
3  * Modified by Jeffrey A. Uphoff, 1995, 1997-1999.
4  * Modified by Olaf Kirch, 1996.
5  * Modified by H.J. Lu, 1998.
6  *
7  * NSM for Linux.
8  */
9
10 /*
11  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
12  * unrestricted use provided that this legend is included on all tape
13  * media and as a part of the software program in whole or part.  Users
14  * may copy or modify Sun RPC without charge, but are not authorized
15  * to license or distribute it to anyone else except as part of a product or
16  * program developed by the user.
17  * 
18  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
19  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
20  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
21  * 
22  * Sun RPC is provided with no support and without any obligation on the
23  * part of Sun Microsystems, Inc. to assist in its use, correction,
24  * modification or enhancement.
25  * 
26  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
27  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
28  * OR ANY PART THEREOF.
29  * 
30  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
31  * or profits or other special, indirect and consequential damages, even if
32  * Sun has been advised of the possibility of such damages.
33  * 
34  * Sun Microsystems, Inc.
35  * 2550 Garcia Avenue
36  * Mountain View, California  94043
37  */
38
39 /*
40  * Status monitor protocol specification
41  */
42
43 #ifdef RPC_CLNT
44 %#include <string.h>
45 #endif
46
47 program SM_PROG { 
48         version SM_VERS  {
49                 /* res_stat = stat_succ if status monitor agrees to monitor */
50                 /* res_stat = stat_fail if status monitor cannot monitor */
51                 /* if res_stat == stat_succ, state = state number of site sm_name */
52                 struct sm_stat_res                       SM_STAT(struct sm_name) = 1;
53
54                 /* res_stat = stat_succ if status monitor agrees to monitor */
55                 /* res_stat = stat_fail if status monitor cannot monitor */
56                 /* stat consists of state number of local site */
57                 struct sm_stat_res                       SM_MON(struct mon) = 2;
58
59                 /* stat consists of state number of local site */
60                 struct sm_stat                           SM_UNMON(struct mon_id) = 3;
61
62                 /* stat consists of state number of local site */
63                 struct sm_stat                           SM_UNMON_ALL(struct my_id) = 4;
64
65                 void                                     SM_SIMU_CRASH(void) = 5;
66
67                 void                                     SM_NOTIFY(struct stat_chge) = 6;
68
69         } = 1;
70 } = 100024;
71
72 const   SM_MAXSTRLEN = 1024;
73 const   SM_PRIV_SIZE = 16;
74
75 struct sm_name {
76         string mon_name<SM_MAXSTRLEN>;
77 };
78
79 struct my_id {
80         string   my_name<SM_MAXSTRLEN>;         /* name of the site iniates the monitoring request*/
81         int     my_prog;                        /* rpc program # of the requesting process */
82         int     my_vers;                        /* rpc version # of the requesting process */
83         int     my_proc;                        /* rpc procedure # of the requesting process */
84 };
85
86 struct mon_id {
87         string  mon_name<SM_MAXSTRLEN>;         /* name of the site to be monitored */
88         struct my_id my_id;
89 };
90
91
92 struct mon {
93         struct mon_id mon_id;
94         opaque priv[SM_PRIV_SIZE];              /* private information to store at monitor for requesting process */
95 };
96
97 struct stat_chge {
98         string  mon_name<SM_MAXSTRLEN>;         /* name of the site that had the state change */
99         int     state;
100 };
101
102 /*
103  * state # of status monitor monitonically increases each time
104  * status of the site changes:
105  * an even number (>= 0) indicates the site is down and
106  * an odd number (> 0) indicates the site is up;
107  */
108 struct sm_stat {
109         int state;              /* state # of status monitor */
110 };
111
112 enum res {
113         stat_succ = 0,          /* status monitor agrees to monitor */
114         stat_fail = 1           /* status monitor cannot monitor */
115 };
116
117 struct sm_stat_res {
118         res res_stat;
119         int state;
120 };
121
122 /* 
123  * structure of the status message sent back by the status monitor
124  * when monitor site status changes
125  */
126 struct status {
127         string mon_name<SM_MAXSTRLEN>;
128         int state;
129         opaque priv[SM_PRIV_SIZE]; /* stored private information */
130 };
131
132 %#define SM_INTER_X