blob: ec260274be0ced9fd057cb2d3f78c9c7b6b622e9 [file] [log] [blame]
Jeff Layton0ab628d2012-03-21 09:52:06 -04001/*
2 * Upcall description for nfsdcld communication
3 *
4 * Copyright (c) 2012 Red Hat, Inc.
5 * Author(s): Jeff Layton <jlayton@redhat.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#ifndef _NFSD_CLD_H
23#define _NFSD_CLD_H
24
Dmitry V. Levin16719192017-03-01 03:12:03 +030025#include <linux/types.h>
26
Jeff Layton0ab628d2012-03-21 09:52:06 -040027/* latest upcall version available */
28#define CLD_UPCALL_VERSION 1
29
30/* defined by RFC3530 */
31#define NFS4_OPAQUE_LIMIT 1024
32
33enum cld_command {
34 Cld_Create, /* create a record for this cm_id */
35 Cld_Remove, /* remove record of this cm_id */
36 Cld_Check, /* is this cm_id allowed? */
37 Cld_GraceDone, /* grace period is complete */
38};
39
40/* representation of long-form NFSv4 client ID */
41struct cld_name {
Dmitry V. Levin16719192017-03-01 03:12:03 +030042 __u16 cn_len; /* length of cm_id */
Jeff Layton0ab628d2012-03-21 09:52:06 -040043 unsigned char cn_id[NFS4_OPAQUE_LIMIT]; /* client-provided */
44} __attribute__((packed));
45
46/* message struct for communication with userspace */
47struct cld_msg {
Dmitry V. Levin16719192017-03-01 03:12:03 +030048 __u8 cm_vers; /* upcall version */
49 __u8 cm_cmd; /* upcall command */
50 __s16 cm_status; /* return code */
51 __u32 cm_xid; /* transaction id */
Jeff Layton0ab628d2012-03-21 09:52:06 -040052 union {
Dmitry V. Levin16719192017-03-01 03:12:03 +030053 __s64 cm_gracetime; /* grace period start time */
Jeff Layton0ab628d2012-03-21 09:52:06 -040054 struct cld_name cm_name;
55 } __attribute__((packed)) cm_u;
56} __attribute__((packed));
57
58#endif /* !_NFSD_CLD_H */