summaryrefslogtreecommitdiff
path: root/netfs/netfsComms.ice
blob: 058412ab04c2dc877d457cbbc2b6b998b580b1b3 (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
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;
		int uid;
		int gid;
		int rdev;
		long size;
		long blockSize;
		long blocks;
		long atime;
		long mtime;
		long ctime;
	};
	sequence<byte> Buffer;
	sequence<string> NameList;
	// Interfaces
	interface Files {
		idempotent void truncate(long tok, string path, long size) throws AuthError, SystemError;
		idempotent void ftruncate(long tok, int id, long size) throws AuthError, SystemError;
		idempotent Attr fgetattr(long tok, int id) throws AuthError, SystemError;

		void unlink(long tok, string path) throws AuthError, SystemError;

		int open(long tok, string path, int flags) throws AuthError, SystemError;
		int create(long tok, 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;
	};
	interface Dirs {
		int opendir(long tok, 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(long tok, string path, int mode) throws AuthError, SystemError;
		void rmdir(long tok, string path) throws AuthError, SystemError;
	};
	interface System {
		idempotent VFS statfs(long tok, string path) throws AuthError, SystemError;
	};
	interface Misc {
		idempotent int access(long tok, string path, int mode) throws AuthError, SystemError;
		idempotent Attr getattr(long tok, string path) throws AuthError, SystemError;
		void symlink(long tok, string path1, string path2) throws AuthError, SystemError;
		void link(long tok, string path1, string path2) throws AuthError, SystemError;
		void rename(long tok, string from, string to) throws AuthError, SystemError;
		idempotent string readlink(long tok, string path) throws AuthError, SystemError;
		idempotent void chmod(long tok, string path, int mode) throws AuthError, SystemError;
		idempotent void chown(long tok, string path, int uid, int gid) throws AuthError, SystemError;
	};
	interface Service {
		long connect(string volume, string auth) throws AuthError, ConfigError;
		void disconnect(long tok) throws AuthError;
	};
};