dafscommon.hpp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2019 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef DAFSCOMMON_HPP
  14. #define DAFSCOMMON_HPP
  15. const unsigned RFEnoerror = 0;
  16. enum
  17. {
  18. RFCopenIO, // 0
  19. RFCcloseIO,
  20. RFCread,
  21. RFCwrite,
  22. RFCsize,
  23. RFCexists,
  24. RFCremove,
  25. RFCrename,
  26. RFCgetver,
  27. RFCisfile,
  28. RFCisdirectory, // 10
  29. RFCisreadonly,
  30. RFCsetreadonly,
  31. RFCgettime,
  32. RFCsettime,
  33. RFCcreatedir,
  34. RFCgetdir,
  35. RFCstop,
  36. RFCexec, // legacy cmd removed
  37. RFCdummy1, // legacy placeholder
  38. RFCredeploy, // 20
  39. RFCgetcrc,
  40. RFCmove,
  41. // 1.5 features below
  42. RFCsetsize,
  43. RFCextractblobelements,
  44. RFCcopy,
  45. RFCappend,
  46. RFCmonitordir,
  47. RFCsettrace,
  48. RFCgetinfo,
  49. RFCfirewall, // not used currently // 30
  50. RFCunlock,
  51. RFCunlockreply,
  52. RFCinvalid,
  53. RFCcopysection,
  54. // 1.7e
  55. RFCtreecopy,
  56. // 1.7e - 1
  57. RFCtreecopytmp,
  58. // 1.8
  59. RFCsetthrottle, // legacy version
  60. // 1.9
  61. RFCsetthrottle2,
  62. RFCsetfileperms,
  63. // 2.0
  64. RFCreadfilteredindex, // No longer used // 40
  65. RFCreadfilteredindexcount,
  66. RFCreadfilteredindexblob,
  67. // 2.2
  68. RFCStreamRead, // 43
  69. // 2.4
  70. RFCStreamReadTestSocket, // 44
  71. // 2.5
  72. RFCStreamGeneral, // 45
  73. RFCStreamReadJSON = '{',
  74. RFCmaxnormal,
  75. RFCmax,
  76. RFCunknown = 255 // 0 would have been more sensible, but can't break backward compatibility
  77. };
  78. enum DAFS_ERROR_CODES {
  79. DAFSERR_connection_failed = -1,
  80. DAFSERR_authenticate_failed = -2,
  81. DAFSERR_protocol_failure = -3,
  82. DAFSERR_serveraccept_failed = -4,
  83. DAFSERR_serverinit_failed = -5,
  84. DAFSERR_cmdstream_invalidexpiry = -6,
  85. DAFSERR_cmdstream_authexpired = -7,
  86. DAFSERR_cmdstream_unsupported_recfmt = -8,
  87. DAFSERR_cmdstream_openfailure = -9,
  88. DAFSERR_cmdstream_protocol_failure = -10,
  89. DAFSERR_cmdstream_unauthorized = -11,
  90. DAFSERR_cmdstream_unknownwritehandle = -12,
  91. DAFSERR_cmdstream_generalwritefailure = -13
  92. };
  93. inline MemoryBuffer & initSendBuffer(MemoryBuffer & buff)
  94. {
  95. buff.setEndian(__BIG_ENDIAN); // transfer as big endian...
  96. buff.append((unsigned)0); // reserve space for length prefix
  97. return buff;
  98. }
  99. #endif // DAFSCOMMON_HPP