2 * linux/include/linux/lockd/xdr.h
4 * XDR types for the NLM protocol
6 * Copyright (C) 1996 Olaf Kirch <okir@monad.swb.de>
13 #include <linux/nfs.h>
14 #include <linux/sunrpc/xdr.h>
16 #define NLM_MAXCOOKIELEN 32
17 #define NLM_MAXSTRLEN 1024
19 #define nlm_granted __constant_htonl(NLM_LCK_GRANTED)
20 #define nlm_lck_denied __constant_htonl(NLM_LCK_DENIED)
21 #define nlm_lck_denied_nolocks __constant_htonl(NLM_LCK_DENIED_NOLOCKS)
22 #define nlm_lck_blocked __constant_htonl(NLM_LCK_BLOCKED)
23 #define nlm_lck_denied_grace_period __constant_htonl(NLM_LCK_DENIED_GRACE_PERIOD)
25 /* Lock info passed via NLM */
28 int len
; /* length of "caller" */
36 * NLM cookies. Technically they can be 1K, but Linux only uses 8 bytes.
37 * FreeBSD uses 16, Apple Mac OS X 10.3 uses 20. Therefore we set it to
43 unsigned char data
[NLM_MAXCOOKIELEN
];
48 * Generic lockd arguments for all but sm_notify
51 struct nlm_cookie cookie
;
61 typedef struct nlm_args nlm_args
;
64 * Generic lockd result
67 struct nlm_cookie cookie
;
73 * statd callback when client has rebooted
85 * Contents of statd callback when monitored host rebooted
87 #define NLMSVC_XDRSIZE sizeof(struct nlm_args)
89 int nlmsvc_decode_testargs(struct svc_rqst
*, u32
*, struct nlm_args
*);
90 int nlmsvc_encode_testres(struct svc_rqst
*, u32
*, struct nlm_res
*);
91 int nlmsvc_decode_lockargs(struct svc_rqst
*, u32
*, struct nlm_args
*);
92 int nlmsvc_decode_cancargs(struct svc_rqst
*, u32
*, struct nlm_args
*);
93 int nlmsvc_decode_unlockargs(struct svc_rqst
*, u32
*, struct nlm_args
*);
94 int nlmsvc_encode_res(struct svc_rqst
*, u32
*, struct nlm_res
*);
95 int nlmsvc_decode_res(struct svc_rqst
*, u32
*, struct nlm_res
*);
96 int nlmsvc_encode_void(struct svc_rqst
*, u32
*, void *);
97 int nlmsvc_decode_void(struct svc_rqst
*, u32
*, void *);
98 int nlmsvc_decode_shareargs(struct svc_rqst
*, u32
*, struct nlm_args
*);
99 int nlmsvc_encode_shareres(struct svc_rqst
*, u32
*, struct nlm_res
*);
100 int nlmsvc_decode_notify(struct svc_rqst
*, u32
*, struct nlm_args
*);
101 int nlmsvc_decode_reboot(struct svc_rqst
*, u32
*, struct nlm_reboot
*);
103 int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *);
104 int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
105 int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *);
106 int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
109 #endif /* LOCKD_XDR_H */