summaryrefslogtreecommitdiff
path: root/netfs/netfsComms.ice
blob: 44f983a8eb4ce74b468a3188c707051a69e2e9ef (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
module NetFSComms {
	// Exceptions
	exception SystemError {
		int syserrno;
	};
	exception AuthError {
	};
	exception ConfigError {
	};
	// Types
	struct VFS {
		long blockSize;
		long fragmentSize;
		long blocks;
		long freeBlocks;
		long availBlocks;
		long files;
		long freeFiles;
		long availFiles;
		long FSID;
		long flags;
		long maxNameLen;
	};
	struct Attr {
		int dev;
		long inode;
		int mode;
		int links;
		string uid;
		string gid;
		int rdev;
		long size;
		long blockSize;
		long blocks;
		long atime;
		long mtime;
		long ctime;
	};
	struct ReqEnv {
		string user;
		string grp;
		long tok;
	};
	sequence<byte> Buffer;
	sequence<string> NameList;
	// Interfaces
	interface FileSystem {
		idempotent void truncate(ReqEnv env, string path, long size) throws AuthError, SystemError;
		idempotent void ftruncate(ReqEnv env, int id, long size) throws AuthError, SystemError;
		idempotent Attr fgetattr(ReqEnv env, int id) throws AuthError, SystemError;

		void unlink(ReqEnv env, string path) throws AuthError, SystemError;

		int open(ReqEnv env, string path, int flags) throws AuthError, SystemError;
		int create(ReqEnv env, string path, int flags, int mode) throws AuthError, SystemError;
		void close(long tok, int id) throws AuthError, SystemError;

		idempotent Buffer read(long tok, int id, long offset, long size) throws AuthError, SystemError;
		idempotent void write(long tok, int id, long offset, long size, Buffer data) throws AuthError, SystemError;

		int opendir(ReqEnv env, string path) throws AuthError, SystemError;
		void closedir(long tok, int id) throws AuthError, SystemError;
		idempotent NameList readdir(long tok, int id) throws AuthError, SystemError;

		void mkdir(ReqEnv env, string path, int mode) throws AuthError, SystemError;
		void rmdir(ReqEnv env, string path) throws AuthError, SystemError;

		idempotent VFS statfs(ReqEnv env, string path) throws AuthError, SystemError;

		idempotent int access(ReqEnv env, string path, int mode) throws AuthError, SystemError;
		idempotent Attr getattr(ReqEnv env, string path) throws AuthError, SystemError;
		void symlink(ReqEnv env, string path1, string path2) throws AuthError, SystemError;
		void link(ReqEnv env, string path1, string path2) throws AuthError, SystemError;
		void rename(ReqEnv env, string from, string to) throws AuthError, SystemError;
		idempotent string readlink(ReqEnv env, string path) throws AuthError, SystemError;
		idempotent void chmod(ReqEnv env, string path, int mode) throws AuthError, SystemError;
		idempotent void chown(ReqEnv env, string path, int uid, int gid) throws AuthError, SystemError;
		idempotent void utimens(ReqEnv env, string path, long atime, long atimens, long mtime, long mtimens) throws AuthError, SystemError;
	};
	interface Service {
		long connect(string volume, string auth) throws AuthError, ConfigError;
		void disconnect(long tok) throws AuthError;
	};
};