]> git.proxmox.com Git - mirror_qemu.git/blame - hw/9pfs/9p-proxy.h
fsdev: rename virtio-9p-marshal.{c,h} to 9p-iov-marshal.{c,h}
[mirror_qemu.git] / hw / 9pfs / 9p-proxy.h
CommitLineData
4c793dda 1/*
494a8ebe 2 * 9p Proxy callback
4c793dda
MK
3 *
4 * Copyright IBM, Corp. 2011
5 *
6 * Authors:
7 * M. Mohan Kumar <mohan@in.ibm.com>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
11 */
494a8ebe
WL
12#ifndef _QEMU_9P_PROXY_H
13#define _QEMU_9P_PROXY_H
4c793dda
MK
14
15#define PROXY_MAX_IO_SZ (64 * 1024)
daf0b9ac 16#define V9FS_FD_VALID INT_MAX
4c793dda 17
17bff52b
MK
18/*
19 * proxy iovec only support one element and
20 * marsha/unmarshal doesn't do little endian conversion.
21 */
22#define proxy_unmarshal(in_sg, offset, fmt, args...) \
2209bd05 23 v9fs_iov_unmarshal(in_sg, 1, offset, 0, fmt, ##args)
17bff52b 24#define proxy_marshal(out_sg, offset, fmt, args...) \
2209bd05 25 v9fs_iov_marshal(out_sg, 1, offset, 0, fmt, ##args)
17bff52b 26
daf0b9ac
MK
27union MsgControl {
28 struct cmsghdr cmsg;
29 char control[CMSG_SPACE(sizeof(int))];
30};
31
4c793dda
MK
32typedef struct {
33 uint32_t type;
34 uint32_t size;
35} ProxyHeader;
36
37#define PROXY_HDR_SZ (sizeof(ProxyHeader))
38
daf0b9ac 39enum {
39f8c32c
MK
40 T_SUCCESS = 0,
41 T_ERROR,
42 T_OPEN,
daf0b9ac 43 T_CREATE,
39f8c32c
MK
44 T_MKNOD,
45 T_MKDIR,
46 T_SYMLINK,
47 T_LINK,
b178adc3
MK
48 T_LSTAT,
49 T_READLINK,
50 T_STATFS,
ea75fc4e
MK
51 T_CHMOD,
52 T_CHOWN,
53 T_TRUNCATE,
54 T_UTIME,
55 T_RENAME,
56 T_REMOVE,
d52b09e4
MK
57 T_LGETXATTR,
58 T_LLISTXATTR,
59 T_LSETXATTR,
60 T_LREMOVEXATTR,
d090e452 61 T_GETVERSION,
daf0b9ac
MK
62};
63
b178adc3
MK
64typedef struct {
65 uint64_t st_dev;
66 uint64_t st_ino;
67 uint64_t st_nlink;
68 uint32_t st_mode;
69 uint32_t st_uid;
70 uint32_t st_gid;
71 uint64_t st_rdev;
72 uint64_t st_size;
73 uint64_t st_blksize;
74 uint64_t st_blocks;
75 uint64_t st_atim_sec;
76 uint64_t st_atim_nsec;
77 uint64_t st_mtim_sec;
78 uint64_t st_mtim_nsec;
79 uint64_t st_ctim_sec;
80 uint64_t st_ctim_nsec;
81} ProxyStat;
82
83typedef struct {
84 uint64_t f_type;
85 uint64_t f_bsize;
86 uint64_t f_blocks;
87 uint64_t f_bfree;
88 uint64_t f_bavail;
89 uint64_t f_files;
90 uint64_t f_ffree;
91 uint64_t f_fsid[2];
92 uint64_t f_namelen;
93 uint64_t f_frsize;
94} ProxyStatFS;
4c793dda 95#endif