1 // NetFSServerRoster.h 2 3 #ifndef NETFS_SERVER_ROSTER_H 4 #define NETFS_SERVER_ROSTER_H 5 6 #include <Messenger.h> 7 #include <OS.h> 8 9 class NetFSServerRoster { 10 public: 11 NetFSServerRoster(); 12 ~NetFSServerRoster(); 13 14 // server 15 bool IsServerRunning(); 16 status_t LaunchServer(); 17 status_t TerminateServer(bool force = false, 18 bigtime_t timeout = B_INFINITE_TIMEOUT); 19 status_t SaveServerSettings(); 20 21 // users 22 status_t AddUser(const char* user, const char* password); 23 status_t RemoveUser(const char* user); 24 status_t GetUsers(BMessage* users); 25 status_t GetUserStatistics(const char* user, 26 BMessage* statistics); 27 28 // shares 29 status_t AddShare(const char* share, const char* path); 30 status_t RemoveShare(const char* share); 31 status_t GetShares(BMessage* shares); 32 status_t GetShareUsers(const char* share, 33 BMessage* users); 34 status_t GetShareStatistics(const char* share, 35 BMessage* statistics); 36 37 // permissions 38 status_t SetUserPermissions(const char* share, 39 const char* user, uint32 permissions); 40 status_t GetUserPermissions(const char* share, 41 const char* user, uint32* permissions); 42 43 private: 44 status_t _InitMessenger(); 45 status_t _SendRequest(BMessage* request, 46 BMessage* reply = NULL); 47 48 private: 49 BMessenger fServerMessenger; 50 }; 51 52 #endif // NETFS_SERVER_ROSTER_H 53