From 613f7c83ae42015ba3874cc8fdfcdbb74d74fd2f Mon Sep 17 00:00:00 2001 From: Dennis Syrovatsky Date: Sun, 18 Dec 2005 14:24:06 +0000 Subject: [PATCH] Added SFTMsgReader and SFTMsgWriter classes to the rfb project. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@462 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- rfb/SFTMsgReader.cxx | 104 +++++++++++++++++++++++++++++++++++++++++++ rfb/SFTMsgReader.h | 66 +++++++++++++++++++++++++++ rfb/SFTMsgWriter.cxx | 86 +++++++++++++++++++++++++++++++++++ rfb/SFTMsgWriter.h | 53 ++++++++++++++++++++++ rfb/rfb.dsp | 16 +++++++ 5 files changed, 325 insertions(+) create mode 100644 rfb/SFTMsgReader.cxx create mode 100644 rfb/SFTMsgReader.h create mode 100644 rfb/SFTMsgWriter.cxx create mode 100644 rfb/SFTMsgWriter.h diff --git a/rfb/SFTMsgReader.cxx b/rfb/SFTMsgReader.cxx new file mode 100644 index 00000000..2ff437b0 --- /dev/null +++ b/rfb/SFTMsgReader.cxx @@ -0,0 +1,104 @@ +/* Copyright (C) 2005 TightVNC Team. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + * + * TightVNC distribution homepage on the Web: http://www.tightvnc.com/ + * + */ + +// -=- SFTMsgReader.cxx + +#include + +using namespace rfb; + +SFTMsgReader::SFTMsgReader(rdr::InStream *pIS) +{ + m_pIS = pIS; +} + +SFTMsgReader::~SFTMsgReader() +{ +} + +bool +SFTMsgReader::readFileListRqst(unsigned int *pDirNameSize, char *pDirName, + unsigned int *pFlags, bool *bDirOnly) +{ + return false; +} + +bool +SFTMsgReader::readFileDownloadRqst(unsigned int *pFilenameSize, char *pFilename, + unsigned int *pPosition) +{ + return false; +} + +bool +SFTMsgReader::readFileUploadRqst(unsigned int *pFilenameSize, char *pFilename, + unsigned int *pPosition) +{ + return false; +} + +void * +SFTMsgReader::readFileUploadData(unsigned int *pDataSize, unsigned int *pModTime) +{ + return NULL; +} + +bool +SFTMsgReader::readFileCreateDirRqst(unsigned int *pDirNameSize, char *pDirName) +{ + return false; +} + +bool +SFTMsgReader::readFileDirSizeRqst(unsigned int *pDirNameSize, char *pDirName) +{ + return false; +} + +bool +SFTMsgReader::readFileDeleteRqst(unsigned int *pNameSize, char *pName) +{ + return false; +} + +bool readFileRenameRqst(unsigned int *pOldNameSize, unsigned int *pNewNameSize, + char *pOldName, char *pNewName) +{ + return false; +} + +char * +SFTMsgReader::readFileDownloadCancel(unsigned int *pReasonSize) +{ + return NULL; +} + +char * +SFTMsgReader::readFileUploadFailed(unsigned int *pReasonSize) +{ + return NULL; +} + +bool +SFTMsgReader::readU8U16StringMsg(unsigned int *pReasonSize, char *pReason) +{ + return false; +} diff --git a/rfb/SFTMsgReader.h b/rfb/SFTMsgReader.h new file mode 100644 index 00000000..d2536457 --- /dev/null +++ b/rfb/SFTMsgReader.h @@ -0,0 +1,66 @@ +/* Copyright (C) 2005 TightVNC Team. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + * + * TightVNC distribution homepage on the Web: http://www.tightvnc.com/ + * + */ + +// -=- SFTMsgReader.h + +#ifndef __RFB_SFTMSGREADER_H__ +#define __RFB_SFTMSGREADER_H__ + +#include + +namespace rfb { + class SFTMsgReader + { + public: + SFTMsgReader(rdr::InStream *pIS); + ~SFTMsgReader(); + + bool readFileListRqst(unsigned int *pDirNameSize, char *pDirName, + unsigned int *pFlags, bool *bDirOnly); + + + bool readFileDownloadRqst(unsigned int *pFilenameSize, char *pFilename, + unsigned int *pPosition); + + bool readFileUploadRqst(unsigned int *pFilenameSize, char *pFilename, + unsigned int *pPosition); + + void *readFileUploadData(unsigned int *pDataSize, unsigned int *pModTime); + + + bool readFileCreateDirRqst(unsigned int *pDirNameSize, char *pDirName); + bool readFileDirSizeRqst(unsigned int *pDirNameSize, char *pDirName); + bool readFileDeleteRqst(unsigned int *pNameSize, char *pName); + + bool readFileRenameRqst(unsigned int *pOldNameSize, unsigned int *pNewNameSize, + char *pOldName, char *pNewName); + + char *readFileDownloadCancel(unsigned int *pReasonSize); + char *readFileUploadFailed(unsigned int *pReasonSize); + + private: + rdr::InStream *m_pIS; + + bool readU8U16StringMsg(unsigned int *pReasonSize, char *pReason); + }; +} + +#endif // __RFB_SFTMSGREADER_H__ diff --git a/rfb/SFTMsgWriter.cxx b/rfb/SFTMsgWriter.cxx new file mode 100644 index 00000000..e74775e1 --- /dev/null +++ b/rfb/SFTMsgWriter.cxx @@ -0,0 +1,86 @@ +/* Copyright (C) 2005 TightVNC Team. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + * + * TightVNC distribution homepage on the Web: http://www.tightvnc.com/ + * + */ + +// -=- SFTMsgWriter.cxx + +#include + +using namespace rfb; + +SFTMsgWriter::SFTMsgWriter(rdr::OutStream *pOS) +{ + m_pOS = pOS; +} + +SFTMsgWriter::~SFTMsgWriter() +{ +} + +bool +SFTMsgWriter::writeFileListData(unsigned char flags, rfb::FileInfo *pFileInfo) +{ + return false; +} + +bool +SFTMsgWriter::writeFileDownloadData(unsigned int dataSize, void *pData) +{ + return false; +} + +bool +SFTMsgWriter::writeFileDownloadData(unsigned int modTime) +{ + return false; +} + +bool +SFTMsgWriter::writeFileUploadCancel(unsigned int reasonLen, char *pReason) +{ + return false; +} + +bool +SFTMsgWriter::writeFileDownloadFailed(unsigned int reasonLen, char *pReason) +{ + return false; +} + +bool +SFTMsgWriter::writeFileDirSizeData(unsigned int dirSizeLow, + unsigned short dirSizeHigh) +{ + return false; +} + +bool +SFTMsgWriter::writeFileLastRqstFailed(unsigned char lastRequest, + unsigned short reasonLen, + char *pReason) +{ + return false; +} + +bool +SFTMsgWriter::writeU8U16StringMsg(unsigned char p1, unsigned short p2, char *pP3) +{ + return false; +} diff --git a/rfb/SFTMsgWriter.h b/rfb/SFTMsgWriter.h new file mode 100644 index 00000000..ba5bf1c9 --- /dev/null +++ b/rfb/SFTMsgWriter.h @@ -0,0 +1,53 @@ +/* Copyright (C) 2005 TightVNC Team. All Rights Reserved. + * + * This is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, + * USA. + * + * TightVNC distribution homepage on the Web: http://www.tightvnc.com/ + * + */ + +// -=- SFTMsgWriter.h + +#ifndef __RFB_SFTMSGWRITER_H__ +#define __RFB_SFTMSGWRITER_H__ + +#include +#include + +namespace rfb { + class SFTMsgWriter + { + public: + SFTMsgWriter(rdr::OutStream *pOS); + ~SFTMsgWriter(); + + bool writeFileListData(unsigned char flags, rfb::FileInfo *pFileInfo); + bool writeFileDownloadData(unsigned int dataSize, void *pData); + bool writeFileDownloadData(unsigned int modTime); + bool writeFileUploadCancel(unsigned int reasonLen, char *pReason); + bool writeFileDownloadFailed(unsigned int reasonLen, char *pReason); + bool writeFileDirSizeData(unsigned int dirSizeLow, unsigned short dirSizeHigh); + bool writeFileLastRqstFailed(unsigned char lastRequest, unsigned short reasonLen, + char *pReason); + + private: + rdr::OutStream *m_pOS; + + bool writeU8U16StringMsg(unsigned char p1, unsigned short p2, char *pP3); + }; +} + +#endif // __RFB_SFTMSGWRITER_H__ diff --git a/rfb/rfb.dsp b/rfb/rfb.dsp index 15f75aff..42da641a 100644 --- a/rfb/rfb.dsp +++ b/rfb/rfb.dsp @@ -262,6 +262,14 @@ SOURCE=.\ServerCore.cxx # End Source File # Begin Source File +SOURCE=.\SFTMsgReader.cxx +# End Source File +# Begin Source File + +SOURCE=.\SFTMsgWriter.cxx +# End Source File +# Begin Source File + SOURCE=.\SMsgHandler.cxx # End Source File # Begin Source File @@ -584,6 +592,14 @@ SOURCE=.\ServerCore.h # End Source File # Begin Source File +SOURCE=.\SFTMsgReader.h +# End Source File +# Begin Source File + +SOURCE=.\SFTMsgWriter.h +# End Source File +# Begin Source File + SOURCE=.\SMsgHandler.h # End Source File # Begin Source File -- 2.39.5