| 1 | /* |
| 2 | Copyright (c) 2014, Ronnie Sahlberg |
| 3 | All rights reserved. |
| 4 | |
| 5 | Redistribution and use in source and binary forms, with or without |
| 6 | modification, are permitted provided that the following conditions are met: |
| 7 | |
| 8 | 1. Redistributions of source code must retain the above copyright notice, this |
| 9 | list of conditions and the following disclaimer. |
| 10 | 2. Redistributions in binary form must reproduce the above copyright notice, |
| 11 | this list of conditions and the following disclaimer in the documentation |
| 12 | and/or other materials provided with the distribution. |
| 13 | |
| 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
| 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | |
| 25 | The views and conclusions contained in the software and documentation are those |
| 26 | of the authors and should not be interpreted as representing official policies, |
| 27 | either expressed or implied, of the FreeBSD Project. |
| 28 | */ |
| 29 | |
| 30 | /* |
| 31 | * Please do not edit this file. |
| 32 | * It was generated using rpcgen. |
| 33 | */ |
| 34 | |
| 35 | #ifndef _NLM_H_RPCGEN |
| 36 | #define _NLM_H_RPCGEN |
| 37 | |
| 38 | #include <nfsc/libnfs-zdr.h> |
| 39 | |
| 40 | |
| 41 | #ifdef __cplusplus |
| 42 | extern "C" { |
| 43 | #endif |
| 44 | |
| 45 | |
| 46 | struct nlm_fh4 { |
| 47 | struct { |
| 48 | u_int data_len; |
| 49 | char *data_val; |
| 50 | } data; |
| 51 | }; |
| 52 | typedef struct nlm_fh4 nlm_fh4; |
| 53 | |
| 54 | typedef char *nlm4_oh; |
| 55 | |
| 56 | struct nlm_cookie { |
| 57 | struct { |
| 58 | u_int data_len; |
| 59 | char *data_val; |
| 60 | } data; |
| 61 | }; |
| 62 | typedef struct nlm_cookie nlm_cookie; |
| 63 | |
| 64 | enum nlmstat4 { |
| 65 | NLM4_GRANTED = 0, |
| 66 | NLM4_DENIED = 1, |
| 67 | NLM4_DENIED_NOLOCKS = 2, |
| 68 | NLM4_BLOCKED = 3, |
| 69 | NLM4_DENIED_GRACE_PERIOD = 4, |
| 70 | NLM4_DEADLCK = 5, |
| 71 | NLM4_ROFS = 6, |
| 72 | NLM4_STALE_FH = 7, |
| 73 | NLM4_FBIG = 8, |
| 74 | NLM4_FAILED = 9, |
| 75 | }; |
| 76 | typedef enum nlmstat4 nlmstat4; |
| 77 | |
| 78 | struct nlm4_holder { |
| 79 | uint32_t exclusive; |
| 80 | u_int svid; |
| 81 | nlm4_oh oh; |
| 82 | u_quad_t l_offset; |
| 83 | u_quad_t l_len; |
| 84 | }; |
| 85 | typedef struct nlm4_holder nlm4_holder; |
| 86 | #define NLM_MAXNAME 256 |
| 87 | |
| 88 | struct nlm4_lock { |
| 89 | char *caller_name; |
| 90 | struct nlm_fh4 fh; |
| 91 | nlm4_oh oh; |
| 92 | u_int svid; |
| 93 | u_quad_t l_offset; |
| 94 | u_quad_t l_len; |
| 95 | }; |
| 96 | typedef struct nlm4_lock nlm4_lock; |
| 97 | |
| 98 | struct nlm4_share { |
| 99 | char *caller_name; |
| 100 | struct nlm_fh4 fh; |
| 101 | nlm4_oh oh; |
| 102 | u_int mode; |
| 103 | u_int access; |
| 104 | }; |
| 105 | typedef struct nlm4_share nlm4_share; |
| 106 | |
| 107 | struct nlm4_testres_denied { |
| 108 | nlm4_holder holder; |
| 109 | }; |
| 110 | typedef struct nlm4_testres_denied nlm4_testres_denied; |
| 111 | |
| 112 | struct nlm4_testreply { |
| 113 | nlmstat4 status; |
| 114 | union { |
| 115 | nlm4_testres_denied lock; |
| 116 | } nlm4_testreply_u; |
| 117 | }; |
| 118 | typedef struct nlm4_testreply nlm4_testreply; |
| 119 | |
| 120 | struct NLM4_TESTres { |
| 121 | nlm_cookie cookie; |
| 122 | nlm4_testreply reply; |
| 123 | }; |
| 124 | typedef struct NLM4_TESTres NLM4_TESTres; |
| 125 | |
| 126 | struct NLM4_TESTargs { |
| 127 | nlm_cookie cookie; |
| 128 | uint32_t exclusive; |
| 129 | nlm4_lock lock; |
| 130 | }; |
| 131 | typedef struct NLM4_TESTargs NLM4_TESTargs; |
| 132 | |
| 133 | struct NLM4_CANCres { |
| 134 | nlm_cookie cookie; |
| 135 | nlmstat4 status; |
| 136 | }; |
| 137 | typedef struct NLM4_CANCres NLM4_CANCres; |
| 138 | |
| 139 | struct NLM4_CANCargs { |
| 140 | nlm_cookie cookie; |
| 141 | uint32_t block; |
| 142 | uint32_t exclusive; |
| 143 | nlm4_lock lock; |
| 144 | }; |
| 145 | typedef struct NLM4_CANCargs NLM4_CANCargs; |
| 146 | |
| 147 | struct NLM4_UNLOCKres { |
| 148 | nlm_cookie cookie; |
| 149 | nlmstat4 status; |
| 150 | }; |
| 151 | typedef struct NLM4_UNLOCKres NLM4_UNLOCKres; |
| 152 | |
| 153 | struct NLM4_UNLOCKargs { |
| 154 | nlm_cookie cookie; |
| 155 | nlm4_lock lock; |
| 156 | }; |
| 157 | typedef struct NLM4_UNLOCKargs NLM4_UNLOCKargs; |
| 158 | |
| 159 | struct NLM4_LOCKres { |
| 160 | nlm_cookie cookie; |
| 161 | nlmstat4 status; |
| 162 | }; |
| 163 | typedef struct NLM4_LOCKres NLM4_LOCKres; |
| 164 | |
| 165 | struct NLM4_LOCKargs { |
| 166 | nlm_cookie cookie; |
| 167 | uint32_t block; |
| 168 | uint32_t exclusive; |
| 169 | nlm4_lock lock; |
| 170 | uint32_t reclaim; |
| 171 | int state; |
| 172 | }; |
| 173 | typedef struct NLM4_LOCKargs NLM4_LOCKargs; |
| 174 | |
| 175 | struct NLM4_GRANTEDargs { |
| 176 | nlm_cookie cookie; |
| 177 | uint32_t exclusive; |
| 178 | nlm4_lock lock; |
| 179 | }; |
| 180 | typedef struct NLM4_GRANTEDargs NLM4_GRANTEDargs; |
| 181 | |
| 182 | struct NLM4_GRANTEDres { |
| 183 | nlm_cookie cookie; |
| 184 | nlmstat4 status; |
| 185 | }; |
| 186 | typedef struct NLM4_GRANTEDres NLM4_GRANTEDres; |
| 187 | |
| 188 | #define NLM_PROGRAM 100021 |
| 189 | #define NLM_V4 4 |
| 190 | |
| 191 | #if defined(__STDC__) || defined(__cplusplus) |
| 192 | #define NLM4_NULL 0 |
| 193 | extern void * nlm4_null_4(void *, void *); |
| 194 | extern void * nlm4_null_4_svc(void *, struct svc_req *); |
| 195 | #define NLM4_TEST 1 |
| 196 | extern NLM4_TESTres * nlm4_test_4(NLM4_TESTargs *, void *); |
| 197 | extern NLM4_TESTres * nlm4_test_4_svc(NLM4_TESTargs *, struct svc_req *); |
| 198 | #define NLM4_LOCK 2 |
| 199 | extern NLM4_LOCKres * nlm4_lock_4(NLM4_LOCKargs *, void *); |
| 200 | extern NLM4_LOCKres * nlm4_lock_4_svc(NLM4_LOCKargs *, struct svc_req *); |
| 201 | #define NLM4_CANCEL 3 |
| 202 | extern NLM4_CANCres * nlm4_cancel_4(NLM4_CANCargs *, void *); |
| 203 | extern NLM4_CANCres * nlm4_cancel_4_svc(NLM4_CANCargs *, struct svc_req *); |
| 204 | #define NLM4_UNLOCK 4 |
| 205 | extern NLM4_UNLOCKres * nlm4_unlock_4(NLM4_UNLOCKargs *, void *); |
| 206 | extern NLM4_UNLOCKres * nlm4_unlock_4_svc(NLM4_UNLOCKargs *, struct svc_req *); |
| 207 | #define NLM4_GRANT 5 |
| 208 | extern NLM4_GRANTEDres * nlm4_grant_4(NLM4_GRANTEDargs *, void *); |
| 209 | extern NLM4_GRANTEDres * nlm4_grant_4_svc(NLM4_GRANTEDargs *, struct svc_req *); |
| 210 | #define NLM4_TEST_MSG 6 |
| 211 | extern void * nlm4_test_msg_4(NLM4_TESTargs *, void *); |
| 212 | extern void * nlm4_test_msg_4_svc(NLM4_TESTargs *, struct svc_req *); |
| 213 | #define NLM4_LOCK_MSG 7 |
| 214 | extern void * nlm4_lock_msg_4(NLM4_LOCKargs *, void *); |
| 215 | extern void * nlm4_lock_msg_4_svc(NLM4_LOCKargs *, struct svc_req *); |
| 216 | #define NLM4_CANCEL_MSG 8 |
| 217 | extern void * nlm4_cancel_msg_4(NLM4_CANCargs *, void *); |
| 218 | extern void * nlm4_cancel_msg_4_svc(NLM4_CANCargs *, struct svc_req *); |
| 219 | #define NLM4_UNLOCK_MSG 9 |
| 220 | extern void * nlm4_unlock_msg_4(NLM4_UNLOCKargs *, void *); |
| 221 | extern void * nlm4_unlock_msg_4_svc(NLM4_UNLOCKargs *, struct svc_req *); |
| 222 | #define NLM4_GRANT_MSG 10 |
| 223 | extern void * nlm4_grant_msg_4(NLM4_GRANTEDargs *, void *); |
| 224 | extern void * nlm4_grant_msg_4_svc(NLM4_GRANTEDargs *, struct svc_req *); |
| 225 | #define NLM4_TEST_RES 11 |
| 226 | extern void * nlm4_test_res_4(NLM4_TESTres *, void *); |
| 227 | extern void * nlm4_test_res_4_svc(NLM4_TESTres *, struct svc_req *); |
| 228 | #define NLM4_LOCK_RES 12 |
| 229 | extern void * nlm4_lock_res_4(NLM4_LOCKres *, void *); |
| 230 | extern void * nlm4_lock_res_4_svc(NLM4_LOCKres *, struct svc_req *); |
| 231 | #define NLM4_CANCEL_RES 13 |
| 232 | extern void * nlm4_cancel_res_4(NLM4_CANCres *, void *); |
| 233 | extern void * nlm4_cancel_res_4_svc(NLM4_CANCres *, struct svc_req *); |
| 234 | #define NLM4_UNLOCK_RES 14 |
| 235 | extern void * nlm4_unlock_res_4(NLM4_UNLOCKres *, void *); |
| 236 | extern void * nlm4_unlock_res_4_svc(NLM4_UNLOCKres *, struct svc_req *); |
| 237 | #define NLM4_GRANT_RES 15 |
| 238 | extern void * nlm4_grant_res_4(NLM4_GRANTEDres *, void *); |
| 239 | extern void * nlm4_grant_res_4_svc(NLM4_GRANTEDres *, struct svc_req *); |
| 240 | extern int nlm_program_4_freeresult (void *, zdrproc_t, caddr_t); |
| 241 | |
| 242 | #else /* K&R C */ |
| 243 | #define NLM4_NULL 0 |
| 244 | extern void * nlm4_null_4(); |
| 245 | extern void * nlm4_null_4_svc(); |
| 246 | #define NLM4_TEST 1 |
| 247 | extern NLM4_TESTres * nlm4_test_4(); |
| 248 | extern NLM4_TESTres * nlm4_test_4_svc(); |
| 249 | #define NLM4_LOCK 2 |
| 250 | extern NLM4_LOCKres * nlm4_lock_4(); |
| 251 | extern NLM4_LOCKres * nlm4_lock_4_svc(); |
| 252 | #define NLM4_CANCEL 3 |
| 253 | extern NLM4_CANCres * nlm4_cancel_4(); |
| 254 | extern NLM4_CANCres * nlm4_cancel_4_svc(); |
| 255 | #define NLM4_UNLOCK 4 |
| 256 | extern NLM4_UNLOCKres * nlm4_unlock_4(); |
| 257 | extern NLM4_UNLOCKres * nlm4_unlock_4_svc(); |
| 258 | #define NLM4_GRANT 5 |
| 259 | extern NLM4_GRANTEDres * nlm4_grant_4(); |
| 260 | extern NLM4_GRANTEDres * nlm4_grant_4_svc(); |
| 261 | #define NLM4_TEST_MSG 6 |
| 262 | extern void * nlm4_test_msg_4(); |
| 263 | extern void * nlm4_test_msg_4_svc(); |
| 264 | #define NLM4_LOCK_MSG 7 |
| 265 | extern void * nlm4_lock_msg_4(); |
| 266 | extern void * nlm4_lock_msg_4_svc(); |
| 267 | #define NLM4_CANCEL_MSG 8 |
| 268 | extern void * nlm4_cancel_msg_4(); |
| 269 | extern void * nlm4_cancel_msg_4_svc(); |
| 270 | #define NLM4_UNLOCK_MSG 9 |
| 271 | extern void * nlm4_unlock_msg_4(); |
| 272 | extern void * nlm4_unlock_msg_4_svc(); |
| 273 | #define NLM4_GRANT_MSG 10 |
| 274 | extern void * nlm4_grant_msg_4(); |
| 275 | extern void * nlm4_grant_msg_4_svc(); |
| 276 | #define NLM4_TEST_RES 11 |
| 277 | extern void * nlm4_test_res_4(); |
| 278 | extern void * nlm4_test_res_4_svc(); |
| 279 | #define NLM4_LOCK_RES 12 |
| 280 | extern void * nlm4_lock_res_4(); |
| 281 | extern void * nlm4_lock_res_4_svc(); |
| 282 | #define NLM4_CANCEL_RES 13 |
| 283 | extern void * nlm4_cancel_res_4(); |
| 284 | extern void * nlm4_cancel_res_4_svc(); |
| 285 | #define NLM4_UNLOCK_RES 14 |
| 286 | extern void * nlm4_unlock_res_4(); |
| 287 | extern void * nlm4_unlock_res_4_svc(); |
| 288 | #define NLM4_GRANT_RES 15 |
| 289 | extern void * nlm4_grant_res_4(); |
| 290 | extern void * nlm4_grant_res_4_svc(); |
| 291 | extern int nlm_program_4_freeresult (); |
| 292 | #endif /* K&R C */ |
| 293 | |
| 294 | /* the zdr functions */ |
| 295 | |
| 296 | #if defined(__STDC__) || defined(__cplusplus) |
| 297 | extern uint32_t zdr_nlm_fh4 (ZDR *, nlm_fh4*); |
| 298 | extern uint32_t zdr_nlm4_oh (ZDR *, nlm4_oh*); |
| 299 | extern uint32_t zdr_nlm_cookie (ZDR *, nlm_cookie*); |
| 300 | extern uint32_t zdr_nlmstat4 (ZDR *, nlmstat4*); |
| 301 | extern uint32_t zdr_nlm4_holder (ZDR *, nlm4_holder*); |
| 302 | extern uint32_t zdr_nlm4_lock (ZDR *, nlm4_lock*); |
| 303 | extern uint32_t zdr_nlm4_share (ZDR *, nlm4_share*); |
| 304 | extern uint32_t zdr_nlm4_testres_denied (ZDR *, nlm4_testres_denied*); |
| 305 | extern uint32_t zdr_nlm4_testreply (ZDR *, nlm4_testreply*); |
| 306 | extern uint32_t zdr_NLM4_TESTres (ZDR *, NLM4_TESTres*); |
| 307 | extern uint32_t zdr_NLM4_TESTargs (ZDR *, NLM4_TESTargs*); |
| 308 | extern uint32_t zdr_NLM4_CANCres (ZDR *, NLM4_CANCres*); |
| 309 | extern uint32_t zdr_NLM4_CANCargs (ZDR *, NLM4_CANCargs*); |
| 310 | extern uint32_t zdr_NLM4_UNLOCKres (ZDR *, NLM4_UNLOCKres*); |
| 311 | extern uint32_t zdr_NLM4_UNLOCKargs (ZDR *, NLM4_UNLOCKargs*); |
| 312 | extern uint32_t zdr_NLM4_LOCKres (ZDR *, NLM4_LOCKres*); |
| 313 | extern uint32_t zdr_NLM4_LOCKargs (ZDR *, NLM4_LOCKargs*); |
| 314 | extern uint32_t zdr_NLM4_GRANTEDargs (ZDR *, NLM4_GRANTEDargs*); |
| 315 | extern uint32_t zdr_NLM4_GRANTEDres (ZDR *, NLM4_GRANTEDres*); |
| 316 | |
| 317 | #else /* K&R C */ |
| 318 | extern uint32_t zdr_nlm_fh4 (); |
| 319 | extern uint32_t zdr_nlm4_oh (); |
| 320 | extern uint32_t zdr_nlm_cookie (); |
| 321 | extern uint32_t zdr_nlmstat4 (); |
| 322 | extern uint32_t zdr_nlm4_holder (); |
| 323 | extern uint32_t zdr_nlm4_lock (); |
| 324 | extern uint32_t zdr_nlm4_share (); |
| 325 | extern uint32_t zdr_nlm4_testres_denied (); |
| 326 | extern uint32_t zdr_nlm4_testreply (); |
| 327 | extern uint32_t zdr_NLM4_TESTres (); |
| 328 | extern uint32_t zdr_NLM4_TESTargs (); |
| 329 | extern uint32_t zdr_NLM4_CANCres (); |
| 330 | extern uint32_t zdr_NLM4_CANCargs (); |
| 331 | extern uint32_t zdr_NLM4_UNLOCKres (); |
| 332 | extern uint32_t zdr_NLM4_UNLOCKargs (); |
| 333 | extern uint32_t zdr_NLM4_LOCKres (); |
| 334 | extern uint32_t zdr_NLM4_LOCKargs (); |
| 335 | extern uint32_t zdr_NLM4_GRANTEDargs (); |
| 336 | extern uint32_t zdr_NLM4_GRANTEDres (); |
| 337 | |
| 338 | #endif /* K&R C */ |
| 339 | |
| 340 | #ifdef __cplusplus |
| 341 | } |
| 342 | #endif |
| 343 | |
| 344 | #endif /* !_NLM_H_RPCGEN */ |