1 /* SPDX-License-Identifier: GPL-2.0 */
3 * linux/include/linux/lockd/xdr.h
5 * XDR types for the NLM protocol
14 #include <linux/filelock.h>
15 #include <linux/nfs.h>
16 #include <linux/sunrpc/xdr.h>
18 #define SM_MAXSTRLEN 1024
19 #define SM_PRIV_SIZE 16
22 unsigned char data[SM_PRIV_SIZE];
27 #define NLM_MAXCOOKIELEN 32
28 #define NLM_MAXSTRLEN 1024
30 #define nlm_granted cpu_to_be32(NLM_LCK_GRANTED)
31 #define nlm_lck_denied cpu_to_be32(NLM_LCK_DENIED)
32 #define nlm_lck_denied_nolocks cpu_to_be32(NLM_LCK_DENIED_NOLOCKS)
33 #define nlm_lck_blocked cpu_to_be32(NLM_LCK_BLOCKED)
34 #define nlm_lck_denied_grace_period cpu_to_be32(NLM_LCK_DENIED_GRACE_PERIOD)
36 #define nlm_drop_reply cpu_to_be32(30000)
38 /* Lock info passed via NLM */
41 unsigned int len; /* length of "caller" */
51 * NLM cookies. Technically they can be 1K, but Linux only uses 8 bytes.
52 * FreeBSD uses 16, Apple Mac OS X 10.3 uses 20. Therefore we set it to
58 unsigned char data[NLM_MAXCOOKIELEN];
63 * Generic lockd arguments for all but sm_notify
66 struct nlm_cookie cookie;
76 typedef struct nlm_args nlm_args;
79 * Generic lockd result
82 struct nlm_cookie cookie;
88 * statd callback when client has rebooted
94 struct nsm_private priv;
98 * Contents of statd callback when monitored host rebooted
100 #define NLMSVC_XDRSIZE sizeof(struct nlm_args)
102 bool nlmsvc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr);
103 bool nlmsvc_decode_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
104 bool nlmsvc_decode_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
105 bool nlmsvc_decode_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
106 bool nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
107 bool nlmsvc_decode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr);
108 bool nlmsvc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr);
109 bool nlmsvc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
110 bool nlmsvc_decode_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr);
112 bool nlmsvc_encode_testres(struct svc_rqst *rqstp, struct xdr_stream *xdr);
113 bool nlmsvc_encode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr);
114 bool nlmsvc_encode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr);
115 bool nlmsvc_encode_shareres(struct svc_rqst *rqstp, struct xdr_stream *xdr);
117 #endif /* LOCKD_XDR_H */