aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/fs_ioctl_autofs.txt
blob: a53d6c7e340818952e808204eb8efed070d0259f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Copyright 2021 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

include <uapi/linux/fs.h>
include <uapi/linux/auto_fs.h>
include <uapi/linux/auto_dev-ioctl.h>

# Root directory ioctls.

# TODO: connect this with wait queues, once we have descriptions for them.
type autofs_wqt_t intptr
autofs_exp_how = AUTOFS_EXP_NORMAL, AUTOFS_EXP_IMMEDIATE, AUTOFS_EXP_LEAVES, AUTOFS_EXP_FORCED

ioctl$AUTOFS_IOC_READY(fd fd, cmd const[AUTOFS_IOC_READY], arg autofs_wqt_t)
ioctl$AUTOFS_IOC_FAIL(fd fd, cmd const[AUTOFS_IOC_FAIL], arg autofs_wqt_t)
ioctl$AUTOFS_IOC_CATATONIC(fd fd, cmd const[AUTOFS_IOC_CATATONIC], arg const[0])
ioctl$AUTOFS_IOC_PROTOVER(fd fd, cmd const[AUTOFS_IOC_PROTOVER], arg ptr[out, int32])
ioctl$AUTOFS_IOC_PROTOSUBVER(fd fd, cmd const[AUTOFS_IOC_PROTOSUBVER], arg ptr[out, int32])
ioctl$AUTOFS_IOC_SETTIMEOUT(fd fd, cmd const[AUTOFS_IOC_PROTOSUBVER], arg ptr[in, int64])
ioctl$AUTOFS_IOC_ASKUMOUNT(fd fd, cmd const[AUTOFS_IOC_ASKUMOUNT], arg ptr[out, int32])
ioctl$AUTOFS_IOC_EXPIRE(fd fd, cmd const[AUTOFS_IOC_EXPIRE], arg ptr[in, autofs_packet_expire])
ioctl$AUTOFS_IOC_EXPIRE_MULTI(fd fd, cmd const[AUTOFS_IOC_EXPIRE_MULTI], arg ptr[in, flags[autofs_exp_how, int32]])

define AUTOFS_NAME_MAX	NAME_MAX + 1

autofs_packet_hdr {
	proto_version	int32
	type		int32
}

autofs_packet_expire {
	hdr	autofs_packet_hdr
	len	len[name, int32]
	name	string[filename, AUTOFS_NAME_MAX]
}

# Communication via /dev/autofs.

args_protover {
	version	int32
}

args_protosubver {
	sub_version	int32
}

args_openmount {
	devid	int32
}

args_ready {
	token	int32
}

args_fail {
	token	int32
	status	int32
}

args_setpipefd {
	pipefd	fd
}

args_timeout {
	timeout	int64
}

args_requester {
	uid	uid
	gid	gid
}

args_expire {
	how	flags[autofs_exp_how, int32]
}

args_askumount {
	may_umount	int32
}

autofs_type = AUTOFS_TYPE_ANY, AUTOFS_TYPE_INDIRECT, AUTOFS_TYPE_DIRECT, AUTOFS_TYPE_OFFSET

args_ismountpoint {
	type	flags[autofs_type, int32]
	devid	int32	(out_overlay)
	magic	int32
}

# autofs_dev_ioctl struct has a union of command-specific structs, so we must pad it to
# the maximum size.
type autofs_dev_ioctl_base[NESTED] {
	ver_major	const[AUTOFS_DEV_IOCTL_VERSION_MAJOR, int32]
	ver_minor	const[AUTOFS_DEV_IOCTL_VERSION_MINOR, int32]
	size		len[parent, int32]
	ioctlfd		fd
	content		NESTED
} [size[AUTOFS_DEV_IOCTL_SIZE]]

type autofs_dev_ioctl[NESTED] {
	base	autofs_dev_ioctl_base[NESTED]
	path	filename
}

ioctl$AUTOFS_DEV_IOCTL_VERSION(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_VERSION], arg ptr[inout, autofs_dev_ioctl[void]])
ioctl$AUTOFS_DEV_IOCTL_PROTOVER(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_PROTOVER], arg ptr[inout, autofs_dev_ioctl[args_protover]])
ioctl$AUTOFS_DEV_IOCTL_PROTOSUBVER(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_PROTOSUBVER], arg ptr[inout, autofs_dev_ioctl[args_protosubver]])
ioctl$AUTOFS_DEV_IOCTL_OPENMOUNT(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_OPENMOUNT], arg ptr[inout, autofs_dev_ioctl[args_openmount]])
ioctl$AUTOFS_DEV_IOCTL_CLOSEMOUNT(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_CLOSEMOUNT], arg ptr[inout, autofs_dev_ioctl[void]])
ioctl$AUTOFS_DEV_IOCTL_READY(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_READY], arg ptr[inout, autofs_dev_ioctl[args_ready]])
ioctl$AUTOFS_DEV_IOCTL_FAIL(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_FAIL], arg ptr[inout, autofs_dev_ioctl[args_fail]])
ioctl$AUTOFS_DEV_IOCTL_SETPIPEFD(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_SETPIPEFD], arg ptr[inout, autofs_dev_ioctl[args_setpipefd]])
ioctl$AUTOFS_DEV_IOCTL_CATATONIC(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_CATATONIC], arg ptr[inout, autofs_dev_ioctl[void]])
ioctl$AUTOFS_DEV_IOCTL_TIMEOUT(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_TIMEOUT], arg ptr[inout, autofs_dev_ioctl[args_timeout]])
ioctl$AUTOFS_DEV_IOCTL_REQUESTER(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_REQUESTER], arg ptr[inout, autofs_dev_ioctl[args_requester]])
ioctl$AUTOFS_DEV_IOCTL_EXPIRE(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_EXPIRE], arg ptr[inout, autofs_dev_ioctl[args_expire]])
ioctl$AUTOFS_DEV_IOCTL_ASKUMOUNT(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_ASKUMOUNT], arg ptr[inout, autofs_dev_ioctl[args_askumount]])
ioctl$AUTOFS_DEV_IOCTL_ISMOUNTPOINT(fd fd_autofs, cmd const[AUTOFS_DEV_IOCTL_ISMOUNTPOINT], arg ptr[inout, autofs_dev_ioctl[args_ismountpoint]])