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