#define MAX_LOCKED_FILENODES 10
+struct HgfsTransportSessionInfo {
+ /* Default session id. */
+ uint64 defaultSessionId;
+
+ /* Lock to manipulate the list of sessions */
+ MXUserExclLock *sessionArrayLock;
+
+ /* List of sessions */
+ DblLnkLst_Links sessionArray;
+
+ /* Max packet size that is supported by both client and server. */
+ uint32 maxPacketSize;
+
+ /* Total number of sessions present this transport session*/
+ uint32 numSessions;
+
+ /* Transport session context. */
+ void *transportData;
+
+ /* Current state of the session. */
+ HgfsSessionInfoState state;
+
+ /* Session is dynamic or internal. */
+ HgfsSessionInfoType type;
+
+ /* Function callbacks into Hgfs Channels. */
+ HgfsServerChannelCallbacks *channelCbTable;
+
+ Atomic_uint32 refCount; /* Reference count for session. */
+
+ HgfsServerChannelData channelCapabilities;
+};
+
/* The input request paramaters object. */
typedef struct HgfsInputParam {
const void *request; /* Hgfs header followed by operation request */
Bool markedForDeletion;
} HgfsSharedFolderProperties;
-static void HgfsServerTransportRemoveSessionFromList(HgfsTransportSessionInfo *transportSession,
- HgfsSessionInfo *sessionInfo);
+
+/* Allocate/Add sessions helper functions. */
+
+static Bool
+HgfsServerAllocateSession(HgfsTransportSessionInfo *transportSession,
+ HgfsSessionInfo **sessionData);
+static HgfsInternalStatus
+HgfsServerTransportAddSessionToList(HgfsTransportSessionInfo *transportSession,
+ HgfsSessionInfo *sessionInfo);
+static void
+HgfsServerTransportRemoveSessionFromList(HgfsTransportSessionInfo *transportSession,
+ HgfsSessionInfo *sessionInfo);
+static HgfsSessionInfo *
+HgfsServerTransportGetSessionInfo(HgfsTransportSessionInfo *transportSession,
+ uint64 sessionId);
/* Local functions. */
static void HgfsInvalidateSessionObjects(DblLnkLst_Links *shares,
*----------------------------------------------------------------------------
*/
-void
+static void
HgfsServerSessionGet(HgfsSessionInfo *session) // IN: session context
{
ASSERT(session);
*-----------------------------------------------------------------------------
*/
-HgfsSessionInfo *
+static HgfsSessionInfo *
HgfsServerTransportGetSessionInfo(HgfsTransportSessionInfo *transportSession, // IN: transport session info
uint64 sessionId) // IN: session id
{
*-----------------------------------------------------------------------------
*/
-HgfsInternalStatus
+static HgfsInternalStatus
HgfsServerTransportAddSessionToList(HgfsTransportSessionInfo *transportSession, // IN: transport session info
HgfsSessionInfo *session) // IN: session info
{
*-----------------------------------------------------------------------------
*/
-Bool
+static Bool
HgfsServerAllocateSession(HgfsTransportSessionInfo *transportSession, // IN:
HgfsSessionInfo **sessionData) // OUT:
{
#define HGFS_DEBUG_ASYNC (0)
+typedef struct HgfsTransportSessionInfo HgfsTransportSessionInfo;
/* Identifier for a local file */
typedef struct HgfsLocalId {
HGFS_SESSION_STATE_CLOSED,
} HgfsSessionInfoState;
-typedef struct HgfsTransportSessionInfo {
- /* Default session id. */
- uint64 defaultSessionId;
-
- /* Lock to manipulate the list of sessions */
- MXUserExclLock *sessionArrayLock;
-
- /* List of sessions */
- DblLnkLst_Links sessionArray;
-
- /* Max packet size that is supported by both client and server. */
- uint32 maxPacketSize;
-
- /* Total number of sessions present this transport session*/
- uint32 numSessions;
-
- /* Transport session context. */
- void *transportData;
-
- /* Current state of the session. */
- HgfsSessionInfoState state;
-
- /* Session is dynamic or internal. */
- HgfsSessionInfoType type;
-
- /* Function callbacks into Hgfs Channels. */
- HgfsServerChannelCallbacks *channelCbTable;
-
- Atomic_uint32 refCount; /* Reference count for session. */
-
- HgfsServerChannelData channelCapabilities;
-} HgfsTransportSessionInfo;
-
typedef struct HgfsSessionInfo {
DblLnkLst_Links links;
HgfsSessionInfo *session, // IN: Session info
HgfsHandle searchHandle); // IN: search to restart
-/* Allocate/Add sessions helper functions. */
-
-Bool HgfsServerAllocateSession(HgfsTransportSessionInfo *transportSession,
- HgfsSessionInfo **sessionData);
-
-void HgfsServerSessionGet(HgfsSessionInfo *session);
-
-HgfsInternalStatus HgfsServerTransportAddSessionToList(HgfsTransportSessionInfo *transportSession,
- HgfsSessionInfo *sessionInfo);
void *
HgfsAllocInitReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet
const char* target); // IN: target file name
-/* Get the session with a specific session id */
-HgfsSessionInfo *
-HgfsServerTransportGetSessionInfo(HgfsTransportSessionInfo *transportSession, // IN: transport session info
- uint64 sessionId); // IN: session id
Bool
HgfsPacketSend(HgfsPacket *packet, // IN/OUT: Hgfs Packet