NLM add TEST procedure
[deb_libnfs.git] / nlm / nlm.x
1 /* based on rfc1813 and wireshark */
2
3
4 struct nlm_fh4 {
5 opaque data<>;
6 };
7
8 typedef string nlm4_oh<>;
9
10 struct nlm_cookie {
11 opaque data<>;
12 };
13
14 enum nlmstat4 {
15 NLM4_GRANTED = 0,
16 NLM4_DENIED = 1,
17 NLM4_DENIED_NOLOCKS = 2,
18 NLM4_BLOCKED = 3,
19 NLM4_DENIED_GRACE_PERIOD = 4,
20 NLM4_DEADLCK = 5,
21 NLM4_ROFS = 6,
22 NLM4_STALE_FH = 7,
23 NLM4_FBIG = 8,
24 NLM4_FAILED = 9
25 };
26
27 struct nlm4_holder {
28 bool exclusive;
29 unsigned int svid;
30 nlm4_oh oh;
31 unsigned hyper l_offset;
32 unsigned hyper l_len;
33 };
34
35 const NLM_MAXNAME = 256;
36 struct nlm4_lock {
37 string caller_name<NLM_MAXNAME>;
38 struct nlm_fh4 fh;
39 nlm4_oh oh;
40 unsigned int svid;
41 unsigned hyper l_offset;
42 unsigned hyper l_len;
43 };
44
45 struct nlm4_share {
46 string caller_name<NLM_MAXNAME>;
47 struct nlm_fh4 fh;
48 nlm4_oh oh;
49 unsigned int mode;
50 unsigned int access;
51 };
52
53
54 struct nlm4_testres_ok {
55 nlm_cookie cookie;
56 nlm4_holder holder;
57 };
58
59 union NLM4_TESTres switch (nlmstat4 status) {
60 case NLM4_GRANTED:
61 nlm4_testres_ok lock;
62 default:
63 void;
64 };
65
66 struct NLM4_TESTargs {
67 nlm_cookie cookie;
68 bool exclusive;
69 nlm4_lock lock;
70 };
71
72 program NLM_PROGRAM {
73 version NLM_V4 {
74 void
75 NLM4_NULL(void) = 0;
76
77 NLM4_TESTres
78 NLM4_TEST(NLM4_TESTargs) = 1;
79
80 /* nlm4_res */
81 /* NLM4_LOCK(nlm4_lockargs) = 2; */
82
83 /* nlm4_res */
84 /* NLM4_CANCEL(nlm4_cancargs) = 3; */
85
86 /* nlm4_res */
87 /* NLM4_UNLOCK(nlm4_unlockargs) = 4; */
88
89 /* nlm4_res */
90 /* NLM4_GRANTED(nlm4_testargs) = 5; */
91
92 void
93 NLM4_TEST_MSG(NLM4_TESTargs) = 6;
94
95 /* void */
96 /* NLM4_LOCK_MSG(nlm4_lockargs) = 7; */
97
98 /* void */
99 /* NLM4_CANCEL_MSG(nlm4_cancargs) = 8; */
100
101 /* void */
102 /* NLM4_UNLOCK_MSG(nlm4_unlockargs) = 9; */
103
104 /* void */
105 /* NLM4_GRANTED_MSG(nlm4_testargs) = 10; */
106
107 void
108 NLM4_TEST_RES(NLM4_TESTres) = 11;
109
110 /* void */
111 /* NLM4_LOCK_RES(nlm4_res) = 12; */
112
113 /* void */
114 /* NLM4_CANCEL_RES(nlm4_res) = 13; */
115
116 /* void */
117 /* NLM4_UNLOCK_RES(nlm4_res) = 14; */
118
119 /* void */
120 /* NLM4_GRANTED_RES(nlm4_res) = 15; */
121
122 /* nlm4_shareres */
123 /* NLM4_SHARE(nlm4_shareargs) = 20; */
124
125 /* nlm4_shareres */
126 /* NLM4_UNSHARE(nlm4_shareargs) = 21; */
127
128 /* nlm4_res */
129 /* NLM4_NM_LOCK(nlm4_lockargs) = 22; */
130
131 /* void */
132 /* NLM4_FREE_ALL(nlm4_notify) = 23; */
133 } = 4;
134 } = 100021;