xref: /haiku/src/add-ons/kernel/file_systems/netfs/client/ServerVolume.h (revision 5a1d355fdf2747f80f8c46e2539f844a0b813346)
1 // ServerVolume.h
2 
3 #ifndef NET_FS_SERVER_VOLUME_H
4 #define NET_FS_SERVER_VOLUME_H
5 
6 #include "Locker.h"
7 #include "NetAddress.h"
8 #include "ServerManager.h"
9 #include "VirtualVolume.h"
10 
11 class ExtendedServerInfo;
12 class ExtendedShareInfo;
13 class ServerConnectionProvider;
14 class ShareVolume;
15 class VirtualNode;
16 
17 class ServerVolume : public VirtualVolume {
18 public:
19 								ServerVolume(VolumeManager* volumeManager,
20 									ExtendedServerInfo* serverInfo);
21 								~ServerVolume();
22 
23 			NetAddress			GetServerAddress();
24 
25 			void				SetServerInfo(ExtendedServerInfo* serverInfo);
26 
27 			status_t			Init(const char* name);
28 			void				Uninit();
29 
30 	virtual	void				PrepareToUnmount();
31 
32 	virtual	void				HandleEvent(VolumeEvent* event);
33 
34 			// FS
35 	virtual	status_t			Unmount();
36 
37 			// queries
38 	virtual	status_t			OpenQuery(const char* queryString,
39 									uint32 flags, port_id port, int32 token,
40 									QueryIterator** iterator);
41 	virtual	void				FreeQueryIterator(QueryIterator* iterator);
42 	virtual	status_t			ReadQuery(QueryIterator* iterator,
43 									struct dirent* buffer, size_t bufferSize,
44 									int32 count, int32* countRead);
45 
46 private:
47 			status_t			_AddShare(ExtendedShareInfo* shareInfo);
48 			ShareVolume*		_GetShareVolume(int32 volumeID);
49 
50 protected:
51 			ExtendedServerInfo*	fServerInfo;
52 			ServerConnectionProvider* fConnectionProvider;
53 };
54 
55 #endif	// NET_FS_SERVER_VOLUME_H
56