]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
HGFS: Clean up server packet abstraction part III
authorVMware, Inc <>
Wed, 18 Sep 2013 03:15:05 +0000 (20:15 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 23 Sep 2013 05:01:53 +0000 (22:01 -0700)
Now the HGFS server packet abstraction has moved from an invalid
const char * pointer for the input parameters set from the HgfsPacket
abstraction we make the pack functions correct too.
This fixes the packet header which can be of two different types to be
a const void * now and not the incorrect const char *.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
open-vm-tools/lib/hgfsServer/hgfsServerParameters.c
open-vm-tools/lib/hgfsServer/hgfsServerParameters.h

index e794752a881949a5b47d81392b62d2b2bf96b168..e4dced47637e914820ba57c3b95817f3d9dfecc8 100644 (file)
@@ -953,7 +953,7 @@ HgfsPackOpenV1Reply(HgfsFileOpenInfo *openInfo,   // IN: open info struct
 
 Bool
 HgfsPackOpenReply(HgfsPacket *packet,           // IN/OUT: Hgfs Packet
-                  char const *packetHeader,     // IN: packet header
+                  void const *packetHeader,     // IN: packet header
                   HgfsFileOpenInfo *openInfo,   // IN: open info struct
                   size_t *payloadSize,          // OUT: size of packet
                   HgfsSessionInfo *session)     // IN: Session info
@@ -1136,7 +1136,7 @@ HgfsUnpackCloseRequest(void const *packet,  // IN: request packet
 
 Bool
 HgfsPackCloseReply(HgfsPacket *packet,         // IN/OUT: Hgfs Packet
-                   char const *packetHeader,   // IN: packet header
+                   void const *packetHeader,   // IN: packet header
                    HgfsOp op,                  // IN: request type
                    size_t *payloadSize,        // OUT: size of packet excluding header
                    HgfsSessionInfo *session)   // IN: Session info
@@ -1312,7 +1312,7 @@ HgfsUnpackSearchCloseRequest(void const *packet,   // IN: request packet
 
 Bool
 HgfsPackSearchCloseReply(HgfsPacket *packet,         // IN/OUT: Hgfs Packet
-                         char const *packetHeader,   // IN: packet header
+                         void const *packetHeader,   // IN: packet header
                          HgfsOp op,                  // IN: request type
                          size_t *payloadSize,        // OUT: size of packet
                          HgfsSessionInfo *session)   // IN: Session info
@@ -1718,7 +1718,7 @@ HgfsUnpackDeleteRequest(void const *packet,      // IN: HGFS packet
 
 Bool
 HgfsPackDeleteReply(HgfsPacket *packet,        // IN/OUT: Hgfs Packet
-                    char const *packetHeader,  // IN: packet header
+                    void const *packetHeader,  // IN: packet header
                     HgfsOp op,                 // IN: requested operation
                     size_t *payloadSize,       // OUT: size of packet
                     HgfsSessionInfo *session)  // IN: Session info
@@ -2127,7 +2127,7 @@ HgfsUnpackRenameRequest(void const *packet,       // IN: HGFS packet
 
 Bool
 HgfsPackRenameReply(HgfsPacket *packet,        // IN/OUT: Hgfs Packet
-                    char const *packetHeader,  // IN: packet header
+                    void const *packetHeader,  // IN: packet header
                     HgfsOp op,                 // IN: requested operation
                     size_t *payloadSize,       // OUT: size of packet
                     HgfsSessionInfo *session)  // IN: Session info
@@ -2653,7 +2653,7 @@ HgfsUnpackGetattrRequest(void const *packet,         // IN: HGFS packet
 
 Bool
 HgfsPackGetattrReply(HgfsPacket *packet,         // IN/OUT: Hgfs Packet
-                     char const *packetHeader,   // IN: packet header
+                     void const *packetHeader,   // IN: packet header
                      HgfsFileAttrInfo *attr,     // IN: attr stucture
                      const char *utf8TargetName, // IN: optional target name
                      uint32 utf8TargetNameLen,   // IN: file name length
@@ -3654,7 +3654,7 @@ HgfsUnpackSetattrRequest(void const *packet,       // IN: HGFS packet
 
 Bool
 HgfsPackSetattrReply(HgfsPacket *packet,        // IN/OUT: Hgfs Packet
-                     char const *packetHeader,  // IN: packet header
+                     void const *packetHeader,  // IN: packet header
                      HgfsOp op,                 // IN: request type
                      size_t *payloadSize,       // OUT: size of packet
                      HgfsSessionInfo *session)  // IN: Session info
@@ -3948,7 +3948,7 @@ HgfsUnpackCreateDirRequest(void const *packet,      // IN: incoming packet
 
 Bool
 HgfsPackCreateDirReply(HgfsPacket *packet,        // IN/OUT: Hgfs Packet
-                       char const *packetHeader,  // IN: packet header
+                       void const *packetHeader,  // IN: packet header
                        HgfsOp op,                 // IN: request type
                        size_t *payloadSize,        // OUT: size of packet
                        HgfsSessionInfo *session)  // IN: Session info
@@ -4106,7 +4106,7 @@ HgfsUnpackWriteWin32StreamRequest(void const *packet, // IN: incoming packet
 
 Bool
 HgfsPackWriteWin32StreamReply(HgfsPacket *packet,        // IN/OUT: Hgfs Packet
-                              char const *packetHeader,  // IN: packet header
+                              void const *packetHeader,  // IN: packet header
                               HgfsOp op,                 // IN: request type
                               uint32 actualSize,         // IN: amount written
                               size_t *payloadSize,       // OUT: size of packet
@@ -4479,7 +4479,7 @@ HgfsUnpackWriteRequest(HgfsInputParam *input,   // IN: Input params
 
 Bool
 HgfsPackWriteReply(HgfsPacket *packet,           // IN/OUT: Hgfs Packet
-                   char const *packetHeader,     // IN: packet header
+                   void const *packetHeader,     // IN: packet header
                    HgfsOp op,                    // IN: request type
                    uint32 actualSize,            // IN: number of bytes that were written
                    size_t *payloadSize,          // OUT: size of packet
@@ -4678,7 +4678,7 @@ HgfsUnpackQueryVolumeRequest(void const *packet,     // IN: HGFS packet
 
 Bool
 HgfsPackQueryVolumeReply(HgfsPacket *packet,        // IN/OUT: Hgfs Packet
-                         char const *packetHeader,  // IN: packet header
+                         void const *packetHeader,  // IN: packet header
                          HgfsOp op,                 // IN: request type
                          uint64 freeBytes,          // IN: volume free space
                          uint64 totalBytes,         // IN: volume capacity
@@ -4924,7 +4924,7 @@ HgfsUnpackSymlinkCreateRequest(void const *packet,        // IN: HGFS packet
 
 Bool
 HgfsPackSymlinkCreateReply(HgfsPacket *packet,        // IN/OUT: Hgfs Packet
-                           char const *packetHeader,  // IN: packet header
+                           void const *packetHeader,  // IN: packet header
                            HgfsOp op,                 // IN: request type
                            size_t *payloadSize,       // OUT: size of packet
                            HgfsSessionInfo *session)  // IN: Session info
@@ -5116,7 +5116,7 @@ HgfsUnpackSearchOpenRequest(void const *packet,      // IN: HGFS packet
 
 Bool
 HgfsPackSearchOpenReply(HgfsPacket *packet,          // IN/OUT: Hgfs Packet
-                        char const *packetHeader,    // IN: packet header
+                        void const *packetHeader,    // IN: packet header
                         HgfsOp op,                   // IN: request type
                         HgfsHandle search,           // IN: search handle
                         size_t *payloadSize,         // OUT: size of packet
@@ -5258,7 +5258,7 @@ HgfsUnpackCreateSessionRequest(void const *packet,          // IN: HGFS packet
 
 Bool
 HgfsPackCreateSessionReply(HgfsPacket *packet,        // IN/OUT: Hgfs Packet
-                           char const *packetHeader,  // IN: packet header
+                           void const *packetHeader,  // IN: packet header
                            size_t *payloadSize,       // OUT: size of packet
                            HgfsSessionInfo *session)  // IN: Session info
 {
@@ -5301,7 +5301,7 @@ HgfsPackCreateSessionReply(HgfsPacket *packet,        // IN/OUT: Hgfs Packet
 
 Bool
 HgfsPackDestroySessionReply(HgfsPacket *packet,        // IN/OUT: Hgfs Packet
-                            char const *packetHeader,  // IN: packet header
+                            void const *packetHeader,  // IN: packet header
                             size_t *payloadSize,        // OUT: size of packet
                             HgfsSessionInfo *session)  // IN: Session info
 {
@@ -5390,7 +5390,7 @@ HgfsPackSetWatchReplyV4(HgfsSubscriberHandle watchId, // IN: host id of thee new
 
 Bool
 HgfsPackSetWatchReply(HgfsPacket *packet,           // IN/OUT: Hgfs Packet
-                      char const *packetHeader,     // IN: packet header
+                      void const *packetHeader,     // IN: packet header
                       HgfsOp     op,                // IN: operation code
                       HgfsSubscriberHandle watchId, // IN: id of the new watch
                       size_t *payloadSize,          // OUT: size of packet
@@ -5538,7 +5538,7 @@ HgfsUnpackSetWatchRequest(void const *packet,      // IN: HGFS packet
 
 Bool
 HgfsPackRemoveWatchReply(HgfsPacket *packet,           // IN/OUT: Hgfs Packet
-                         char const *packetHeader,     // IN: packet header
+                         void const *packetHeader,     // IN: packet header
                          HgfsOp     op,                // IN: operation code
                          size_t *payloadSize,          // OUT: size of packet
                          HgfsSessionInfo *session)     // IN: Session info
index 7642b990b0b7d1eb750aab6f5907bd3f7268c379..c2958d220898f93612d1ee0aa26d4822e0490517 100644 (file)
@@ -66,7 +66,7 @@ HgfsUnpackOpenRequest(void const *packet,          // IN: incoming packet
 
 Bool
 HgfsPackOpenReply(HgfsPacket *packet,           // IN/OUT: Hgfs Packet
-                  char const *packetHeader,     // IN: packet header
+                  void const *packetHeader,     // IN: packet header
                   HgfsFileOpenInfo *openInfo,   // IN: open info struct
                   size_t *payloadSize,          // OUT: outgoing packet size
                   HgfsSessionInfo *session);    // IN: Session Info
@@ -94,7 +94,7 @@ HgfsUnpackDeleteRequest(void const *packet,         // IN: request packet
 
 Bool
 HgfsPackDeleteReply(HgfsPacket *packet,         // IN/OUT: Hgfs Packet
-                    char const *packetHeader,   // IN: packet header
+                    void const *packetHeader,   // IN: packet header
                     HgfsOp op,                  // IN: requested operation
                     size_t *payloadSize,        // OUT: size of HGFS packet
                     HgfsSessionInfo *session);  // IN: Session Info
@@ -115,14 +115,14 @@ HgfsUnpackRenameRequest(void const *packet,         // IN: request packet
 
 Bool
 HgfsPackRenameReply(HgfsPacket *packet,         // IN/OUT: Hgfs Packet
-                    char const *packetHeader,   // IN: packet header
+                    void const *packetHeader,   // IN: packet header
                     HgfsOp op,                  // IN: requested operation
                     size_t *payloadSize,        // OUT: size of packet
                     HgfsSessionInfo *session);  // IN: Session Info
 
 Bool
 HgfsPackGetattrReply(HgfsPacket *packet,          // IN/OUT: Hgfs packet
-                     char const *packetHeader,    // IN: packet header
+                     void const *packetHeader,    // IN: packet header
                      HgfsFileAttrInfo *attr,      // IN: attr stucture
                      const char *utf8TargetName,  // IN: optional target name
                      uint32 utf8TargetNameLen,    // IN: file name length
@@ -130,7 +130,7 @@ HgfsPackGetattrReply(HgfsPacket *packet,          // IN/OUT: Hgfs packet
                      HgfsSessionInfo *session);   // IN: Session Info
 Bool
 HgfsPackSymlinkCreateReply(HgfsPacket *packet,        // IN/OUT: Hgfs packet
-                           char const *packetHeader,  // IN: packet header
+                           void const *packetHeader,  // IN: packet header
                            HgfsOp op,                 // IN: request type
                            size_t *payloadSize,       // OUT: size of HGFS packet
                            HgfsSessionInfo *session); // IN: Session Info
@@ -166,7 +166,7 @@ HgfsUnpackSetattrRequest(void const *packet,            // IN: request packet
 
 Bool
 HgfsPackSetattrReply(HgfsPacket *packet,         // IN/OUT: Hgfs Packet
-                     char const *packetHeader,   // IN: packet header
+                     void const *packetHeader,   // IN: packet header
                      HgfsOp op,                  // IN: request type
                      size_t *payloadSize,        // OUT: size of packet
                      HgfsSessionInfo *session);  // IN: Session Info
@@ -179,14 +179,14 @@ HgfsUnpackCreateDirRequest(void const *packet,       // IN: HGFS packet
 
 Bool
 HgfsPackCreateDirReply(HgfsPacket *packet,         // IN/OUT: Hgfs Packet
-                       char const *packetHeader,   // IN: packet header
+                       void const *packetHeader,   // IN: packet header
                        HgfsOp op,                  // IN: request type
                        size_t *payloadSize,        // OUT: size of packet
                        HgfsSessionInfo *session);  // IN: Session Info
 
 Bool
 HgfsPackQueryVolumeReply(HgfsPacket *packet,         // IN/OUT: Hgfs Packet
-                         char const *packetHeader,  // IN: packet header
+                         void const *packetHeader,  // IN: packet header
                          HgfsOp op,                 // IN: request type
                          uint64 freeBytes,          // IN: volume free space
                          uint64 totalBytes,         // IN: volume capacity
@@ -230,7 +230,7 @@ HgfsUnpackCreateSessionRequest(void const *packetHeader,     // IN: request pack
                                HgfsCreateSessionInfo *info); // IN/OUT: info struct
 Bool
 HgfsPackWriteWin32StreamReply(HgfsPacket *packet,         // IN/OUT: Hgfs Packet
-                              char const *packetHeader,   // IN: packet headert
+                              void const *packetHeader,   // IN: packet headert
                               HgfsOp op,                  // IN: request type
                               uint32 actualSize,          // IN: amount written
                               size_t *payloadSize,        // OUT: size of packet
@@ -250,7 +250,7 @@ HgfsUnpackSearchOpenRequest(void const *packet,      // IN: HGFS packet
                             uint32 *caseFlags);      // OUT: case flags
 Bool
 HgfsPackCloseReply(HgfsPacket *packet,          // IN/OUT: Hgfs Packet
-                   char const *packetHeader,    // IN: packet header
+                   void const *packetHeader,    // IN: packet header
                    HgfsOp op,                   // IN: request type
                    size_t *payloadSize,         // OUT: size of packet
                    HgfsSessionInfo *session);   // IN: Session Info
@@ -262,20 +262,20 @@ HgfsUnpackSearchCloseRequest(void const *packet,    // IN: request packet
                              HgfsHandle *file);     // OUT: Handle to close
 Bool
 HgfsPackSearchOpenReply(HgfsPacket *packet,          // IN/OUT: Hgfs Packet
-                        char const *packetHeader,    // IN: packet header
+                        void const *packetHeader,    // IN: packet header
                         HgfsOp op,                   // IN: request type
                         HgfsHandle search,           // IN: search handle
                         size_t *packetSize,          // OUT: size of packet
                         HgfsSessionInfo *session);   // IN: Session Info
 Bool
 HgfsPackSearchCloseReply(HgfsPacket *packet,         // IN/OUT: Hgfs Packet
-                         char const *packetHeader,   // IN: packet header
+                         void const *packetHeader,   // IN: packet header
                          HgfsOp op,                  // IN: request type
                          size_t *packetSize,         // OUT: size of packet
                          HgfsSessionInfo *session);  // IN: Session Info
 Bool
 HgfsPackWriteReply(HgfsPacket *packet,           // IN/OUT: Hgfs Packet
-                   char const *packetHeader,     // IN: packet header
+                   void const *packetHeader,     // IN: packet header
                    HgfsOp op,                    // IN: request type
                    uint32 actualSize,            // IN: number of bytes that were written
                    size_t *payloadSize,          // OUT: size of packet
@@ -296,12 +296,12 @@ HgfsUnpackWriteRequest(HgfsInputParam *input,   // IN: Input params
                        const char **data);      // OUT: data to be written
 Bool
 HgfsPackCreateSessionReply(HgfsPacket *packet,        // IN/OUT: Hgfs Packet
-                           char const *packetHeader,  // IN: packet header
+                           void const *packetHeader,  // IN: packet header
                            size_t *payloadSize,       // OUT: size of packet
                            HgfsSessionInfo *session); // IN: Session Info
 Bool
 HgfsPackDestroySessionReply(HgfsPacket *packet,        // IN/OUT: Hgfs Packet
-                            char const *packetHeader,  // IN: packet header
+                            void const *packetHeader,  // IN: packet header
                             size_t *payloadSize,       // OUT: size of packet
                             HgfsSessionInfo *session); // IN: Session Info
 void
@@ -320,7 +320,7 @@ HgfsUnpackSetWatchRequest(void const *packet,      // IN: HGFS packet
                           uint32 *caseFlags);      // OUT: case-sensitivity flags
 Bool
 HgfsPackSetWatchReply(HgfsPacket *packet,           // IN/OUT: Hgfs Packet
-                      char const *packetHeader,     // IN: packet header
+                      void const *packetHeader,     // IN: packet header
                       HgfsOp     op,                // IN: operation code
                       HgfsSubscriberHandle watchId, // IN: new watch id
                       size_t *payloadSize,          // OUT: size of packet
@@ -332,7 +332,7 @@ HgfsUnpackRemoveWatchRequest(void const *packet,             // IN: HGFS packet
                              HgfsSubscriberHandle *watchId); // OUT: watch Id
 Bool
 HgfsPackRemoveWatchReply(HgfsPacket *packet,           // IN/OUT: Hgfs Packet
-                         char const *packetHeader,     // IN: packet header
+                         void const *packetHeader,     // IN: packet header
                          HgfsOp     op,                // IN: operation code
                          size_t *payloadSize,          // OUT: size of packet
                          HgfsSessionInfo *session);    // IN: Session info