Initial Commit
[Projects.git] / pkgbuilds / wiifuse / src / wiifuse-0.2.0 / shared.h
blob722dd4d40d734463a99f84144523c21908c24606
1 /*
2 * Copyright (C) 2008 dhewg, #wiidev efnet
4 * this file is part of wiifuse
5 * http://wiibrew.org/index.php?title=Wiifuse
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef _SHARED_H_
23 #define _SHARED_H_
25 #define WIIFUSE_VERSION "v0.2.0"
26 #define WIIFUSE_AUTH_DATA "wiifuse " WIIFUSE_VERSION
28 #define MODE_IRWXU 00700 // mask for file owner permissions
29 #define MODE_IRUSR 00400 // owner has read permission
30 #define MODE_IWUSR 00200 // owner has write permission
31 #define MODE_IXUSR 00100 // owner has execute permission
32 #define MODE_IRWXG 00070 // mask for group permissions
33 #define MODE_IRGRP 00040 // group has read permission
34 #define MODE_IWGRP 00020 // group has write permission
35 #define MODE_IXGRP 00010 // group has execute permission
36 #define MODE_IRWXO 00007 // mask for permissions for others (not in group)
37 #define MODE_IROTH 00004 // others have read permission
38 #define MODE_IWOTH 00002 // others have write permission
39 #define MODE_IXOTH 00001 // others have execute permission
41 #define ACCESS_R_OK 1
42 #define ACCESS_W_OK 2
43 #define ACCESS_X_OK 4
45 struct remote_attr {
46 u8 is_dir;
47 u16 nlink;
48 u32 size;
49 u32 owner;
50 u32 group;
51 u16 perms;
54 enum remote_result {
55 RES_UNKNOWN = 0,
56 RES_OK,
58 RES_ENOENT,
59 RES_ENOTDIR,
60 RES_EISDIR,
61 RES_EACCES,
62 RES_ENAMETOOLONG
65 enum remote_command {
66 CMD_AUTH = 0,
67 CMD_LOGLEVEL,
68 CMD_UMOUNT,
70 CMD_ES_IDENTIFY,
72 CMD_FS_ACCESS,
73 CMD_FS_GETATTR,
74 CMD_FS_OPEN,
75 CMD_FS_READ,
76 CMD_FS_OPENDIR,
77 CMD_FS_READDIR,
79 CMD_FS_MKDIR,
80 CMD_FS_RMDIR,
81 CMD_FS_CREATE,
82 CMD_FS_WRITE,
83 CMD_FS_CHOWN,
84 CMD_FS_CHMOD,
85 CMD_FS_RENAME,
86 CMD_FS_UNLINK,
88 CMD_FS_STATFS
91 #define PACKET_REQUEST_PAYLOAD 7
92 struct client_request {
93 enum remote_command command;
94 char *filename;
95 u8 *data;
96 u16 data_size;
99 #define PACKET_RESPONSE_PAYLOAD 6
100 struct server_response {
101 enum remote_result result;
102 u8 *data;
103 u16 data_size;
107 #endif