+#define LOCKD_MSG_VERSION 3
+typedef struct nfs_lock_msg {
+ int lm_version; /* LOCKD_MSG version */
+ int lm_flags; /* request flags */
+ u_int64_t lm_xid; /* unique message transaction ID */
+ struct flock lm_fl; /* The lock request. */
+ struct sockaddr_storage lm_addr; /* The address. */
+ int lm_fh_len; /* The file handle length. */
+ struct xucred lm_cred; /* user cred for lock req */
+ u_int8_t lm_fh[NFSV3_MAX_FH_SIZE]; /* The file handle. */
+} LOCKD_MSG;
+
+/* lm_flags */
+#define LOCKD_MSG_BLOCK 0x0001 /* a blocking request */
+#define LOCKD_MSG_TEST 0x0002 /* just a lock test */
+#define LOCKD_MSG_NFSV3 0x0004 /* NFSv3 request */
+#define LOCKD_MSG_CANCEL 0x0008 /* cancelling blocked request */
+#define LOCKD_MSG_DENIED_GRACE 0x0010 /* lock denied due to grace period */
+#define LOCKD_MSG_RECLAIM 0x0020 /* lock reclaim request */
+#define LOCKD_MSG_TCP 0x0040 /* (try to) use TCP for request */
+
+/* The structure used to maintain the pending request queue */
+typedef struct nfs_lock_msg_request {
+ TAILQ_ENTRY(nfs_lock_msg_request) lmr_next; /* in-kernel pending request list */
+ int lmr_answered; /* received an answer? */
+ int lmr_errno; /* return status */
+ int lmr_saved_errno; /* original return status */
+ LOCKD_MSG lmr_msg; /* the message */
+} LOCKD_MSG_REQUEST;
+
+TAILQ_HEAD(nfs_lock_msg_queue, nfs_lock_msg_request);
+typedef struct nfs_lock_msg_queue LOCKD_MSG_QUEUE;
+