/usr/include/nfstrace/api/cifs_commands.h is in nfstrace 0.4.1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | //------------------------------------------------------------------------------
// Author: Andrey Kuznetsov
// Description: Definition of CIFSv1 commands
// Copyright (c) 2014 EPAM Systems
//------------------------------------------------------------------------------
/*
This file is part of Nfstrace.
Nfstrace 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, version 2 of the License.
Nfstrace 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 Nfstrace. If not, see <http://www.gnu.org/licenses/>.
*/
//------------------------------------------------------------------------------
#ifndef API_CIFS_COMMANDS_H
#define API_CIFS_COMMANDS_H
//------------------------------------------------------------------------------
#include <cstdint>
#include "cifs_pc_to_net.h"
//------------------------------------------------------------------------------
namespace NST
{
namespace API
{
/*! SMB 1 version
*/
namespace SMBv1
{
/*! CIFS v1 commands list
*/
enum class SMBv1Commands
{
SMB_COM_CREATE_DIRECTORY, //!< Create a new directory.
SMB_COM_DELETE_DIRECTORY, //!< Delete an empty directory.
SMB_COM_OPEN, //!< Open a file.
SMB_COM_CREATE, //!< Create or open a file.
SMB_COM_CLOSE, //!< Close a file.
SMB_COM_FLUSH, //!< Flush data for a file
SMB_COM_DELETE, //!< Delete a file.
SMB_COM_RENAME, //!< Rename a file or set of files.
SMB_COM_QUERY_INFORMATION, //!< Get file attributes.
SMB_COM_SET_INFORMATION, //!< Set file attributes.
SMB_COM_READ, //!< Read from a file.
SMB_COM_WRITE, //!< Write to a file.
SMB_COM_LOCK_BYTE_RANGE, //!< Request a byte-range lock on a file.
SMB_COM_UNLOCK_BYTE_RANGE, //!< Release a byte-range lock on a file.
SMB_COM_CREATE_TEMPORARY, //!< Create a temporary file.
SMB_COM_CREATE_NEW, //!< Create and open a new file.
SMB_COM_CHECK_DIRECTORY, //!< Verify that the specified pathname resolves to a directory.Listed as SMBchkpath in some documentation.
SMB_COM_PROCESS_EXIT, //!< Indicate process exit.
SMB_COM_SEEK, //!< Set the current file pointer within a file.
SMB_COM_LOCK_AND_READ, //!< Lock and read a byte-range within a file.
SMB_COM_WRITE_AND_UNLOCK, //!< Write and unlock a byte-range within a file.
SMB_COM_READ_RAW, //!< Read a block in raw mode.
SMB_COM_READ_MPX, //!< Multiplexed block read. Listed as SMBreadmpx in some documentation.
SMB_COM_READ_MPX_SECONDARY, //!< Multiplexed block read
SMB_COM_WRITE_RAW, //!< Write a block in raw mode.
SMB_COM_WRITE_MPX, //!< Multiplexed block write.
SMB_COM_WRITE_MPX_SECONDARY, //!< Multiplexed block write
SMB_COM_WRITE_COMPLETE, //!< Raw block write
SMB_COM_QUERY_SERVER, //!< Reserved
SMB_COM_SET_INFORMATION2, //!< Set an extended set of file attributes.
SMB_COM_QUERY_INFORMATION2, //!< Get an extended set of file attributes.
SMB_COM_LOCKING_ANDX, //!< Lock multiple byte ranges; AndX chaining.
SMB_COM_TRANSACTION, //!< Transaction.
SMB_COM_TRANSACTION_SECONDARY, //!< Transaction secondary request.
SMB_COM_IOCTL, //!< Pass an I/O Control function request to the server.
SMB_COM_IOCTL_SECONDARY, //!< IOCTL secondary request.
SMB_COM_COPY, //!< Copy a file or directory.
SMB_COM_MOVE, //!< Move a file or directory.
SMB_COM_ECHO, //!< Echo request (ping).
SMB_COM_WRITE_AND_CLOSE, //!< Write to and close a file.
SMB_COM_OPEN_ANDX, //!< Extended file open with AndX chaining.
SMB_COM_READ_ANDX, //!< Extended file read with AndX chaining.
SMB_COM_WRITE_ANDX, //!< Extended file write with AndX chaining.
SMB_COM_NEW_FILE_SIZE, //!< Reserved
SMB_COM_CLOSE_AND_TREE_DISC, //!< Close an open file and tree disconnect.
SMB_COM_TRANSACTION2, //!< Transaction 2 format request/response.
SMB_COM_TRANSACTION2_SECONDARY, //!< Transaction 2 secondary request.
SMB_COM_FIND_CLOSE2, //!< Close an active search.
SMB_COM_FIND_NOTIFY_CLOSE, //!< Notification of the closure of an active search.
SMB_COM_TREE_CONNECT, //!< Tree connect.
SMB_COM_TREE_DISCONNECT, //!< Tree disconnect.
SMB_COM_NEGOTIATE, //!< Negotiate protocol dialect.
SMB_COM_SESSION_SETUP_ANDX, //!< Session Setup with AndX chaining.
SMB_COM_LOGOFF_ANDX, //!< User logoff with AndX chaining.
SMB_COM_TREE_CONNECT_ANDX, //!< Tree connect with AndX chaining.
SMB_COM_SECURITY_PACKAGE_ANDX, //!< Negotiate security packages with AndX chaining.
SMB_COM_QUERY_INFORMATION_DISK, //!< Retrieve file system information from the server.
SMB_COM_SEARCH, //!< Directory wildcard search.
SMB_COM_FIND, //!< Start or continue an extended wildcard directory search.
SMB_COM_FIND_UNIQUE, //!< Perform a one-time extended wildcard directory search.
SMB_COM_FIND_CLOSE, //!< End an extended wildcard directory search.
SMB_COM_NT_TRANSACT, //!< NT format transaction request/response.
SMB_COM_NT_TRANSACT_SECONDARY, //!< NT format transaction secondary request.
SMB_COM_NT_CREATE_ANDX, //!< Create or open a file or a directory.
SMB_COM_NT_CANCEL, //!< Cancel a request currently pending at the server.
SMB_COM_NT_RENAME, //!< File rename with extended semantics.
SMB_COM_OPEN_PRINT_FILE, //!< Create a print queue spool file.
SMB_COM_WRITE_PRINT_FILE, //!< Write to a print queue spool file.
SMB_COM_CLOSE_PRINT_FILE, //!< Close a print queue spool file.
SMB_COM_GET_PRINT_QUEUE, //!< Request print queue information.
SMB_COM_READ_BULK, //!< Reserved
SMB_COM_WRITE_BULK, //!< Reserved
SMB_COM_WRITE_BULK_DATA, //!< Reserved
SMB_COM_INVALID, //!< As the name suggests
SMB_COM_NO_ANDX_COMMAND, //!< Also known as the NIL command. It identifies the end of an AndX Chain
CMD_COUNT
};
static const int commandsCount = 255;
struct CreateDirectoryArgumentType{} __attribute__ ((__packed__)); //!< CreateDirectory arguments
struct CreateDirectoryResultType{} __attribute__ ((__packed__)); //!< CreateDirectory results
struct DeleteDirectoryArgumentType{} __attribute__ ((__packed__)); //!< DeleteDirectory arguments
struct DeleteDirectoryResultType{} __attribute__ ((__packed__)); //!< DeleteDirectory results
struct OpenArgumentType{} __attribute__ ((__packed__)); //!< Open arguments
struct OpenResultType{} __attribute__ ((__packed__)); //!< Open results
struct CreateArgumentType{} __attribute__ ((__packed__)); //!< Create arguments
struct CreateResultType{} __attribute__ ((__packed__)); //!< Create results
struct CloseArgumentType{} __attribute__ ((__packed__)); //!< Close arguments
struct CloseResultType{} __attribute__ ((__packed__)); //!< Close results
struct FlushArgumentType{} __attribute__ ((__packed__)); //!< Flush arguments
struct FlushResultType{} __attribute__ ((__packed__)); //!< Flush results
struct DeleteArgumentType{} __attribute__ ((__packed__)); //!< Delete arguments
struct DeleteResultType{} __attribute__ ((__packed__)); //!< Delete results
struct RenameArgumentType{} __attribute__ ((__packed__)); //!< Rename arguments
struct RenameResultType{} __attribute__ ((__packed__)); //!< Rename results
struct QueryInformationArgumentType{} __attribute__ ((__packed__)); //!< QueryInformation arguments
struct QueryInformationResultType{} __attribute__ ((__packed__)); //!< QueryInformation results
struct SetInformationArgumentType{} __attribute__ ((__packed__)); //!< Set Information arguments
struct SetInformationResultType{} __attribute__ ((__packed__)); //!< Set Information results
struct ReadArgumentType{} __attribute__ ((__packed__)); //!< Read arguments
struct ReadResultType{} __attribute__ ((__packed__)); //!< Read results
struct WriteArgumentType{} __attribute__ ((__packed__)); //!< Write arguments
struct WriteResultType{} __attribute__ ((__packed__)); //!< Write results
struct LockByteRangeArgumentType{} __attribute__ ((__packed__)); //!< Lock Byte Range arguments
struct LockByteRangeResultType{} __attribute__ ((__packed__)); //!< Lock Byte Range results
struct UnlockByteRangeArgumentType{} __attribute__ ((__packed__)); //!< UnLock Byte Range arguments
struct UnlockByteRangeResultType{} __attribute__ ((__packed__)); //!< UnLock Byte Range results
struct CreateTemporaryArgumentType{} __attribute__ ((__packed__)); //!< Create Temporary file arguments
struct CreateTemporaryResultType{} __attribute__ ((__packed__)); //!< Create Temporary file results
struct CreateNewArgumentType{} __attribute__ ((__packed__)); //!< Create a new file arguments
struct CreateNewResultType{} __attribute__ ((__packed__)); //!< Create a new file results
struct CheckDirectoryArgumentType{} __attribute__ ((__packed__)); //!< CheckDirectory arguments
struct CheckDirectoryResultType{} __attribute__ ((__packed__)); //!< CheckDirectory results
struct ProcessExitArgumentType{} __attribute__ ((__packed__)); //!< Process Exit arguments
struct ProcessExitResultType{} __attribute__ ((__packed__)); //!< Process Exit results
struct SeekArgumentType{} __attribute__ ((__packed__)); //!< Seek arguments
struct SeekResultType{} __attribute__ ((__packed__)); //!< Seek results
struct LockAndReadArgumentType{} __attribute__ ((__packed__)); //!< Lock And Read arguments
struct LockAndReadResultType{} __attribute__ ((__packed__)); //!< Lock And Read results
struct WriteAndUnlockArgumentType{} __attribute__ ((__packed__)); //!< Write And Unlock arguments
struct WriteAndUnlockResultType{} __attribute__ ((__packed__)); //!< Write And Unlock results
struct ReadRawArgumentType{} __attribute__ ((__packed__)); //!< Read raw command's arguments
struct ReadRawResultType{} __attribute__ ((__packed__)); //!< Read raw command's results
struct ReadMpxArgumentType{} __attribute__ ((__packed__)); //!< Read Mpx command's arguments
struct ReadMpxResultType{} __attribute__ ((__packed__)); //!< Read Mpx command's results
struct ReadMpxSecondaryArgumentType{} __attribute__ ((__packed__)); //!< Read Read Mpx Secondary command's arguments
struct ReadMpxSecondaryResultType{} __attribute__ ((__packed__)); //!< Read Read Mpx Secondary command's results
struct WriteRawArgumentType{} __attribute__ ((__packed__)); //!< Write Raw command's arguments
struct WriteRawResultType{} __attribute__ ((__packed__)); //!< Write Raw command's results
struct WriteMpxArgumentType{} __attribute__ ((__packed__)); //!< Write Mpx command's arguments
struct WriteMpxResultType{} __attribute__ ((__packed__)); //!< Write Mpx command's results
struct WriteMpxSecondaryArgumentType{} __attribute__ ((__packed__)); //!< Write Mpx 2 command's arguments
struct WriteMpxSecondaryResultType{} __attribute__ ((__packed__)); //!< Write Mpx 2 command's results
struct WriteCompleteArgumentType{} __attribute__ ((__packed__)); //!< Write Complete command's arguments
struct WriteCompleteResultType{} __attribute__ ((__packed__)); //!< Write Complete command's results
struct QueryServerArgumentType{} __attribute__ ((__packed__)); //!< Query Server (reserved) command's arguments
struct QueryServerResultType{} __attribute__ ((__packed__)); //!< Query Server (reserved) command's results
struct SetInformation2ArgumentType{} __attribute__ ((__packed__)); //!< Set Information 2 command's arguments
struct SetInformation2ResultType{} __attribute__ ((__packed__)); //!< Set Information 2 command's results
struct QueryInformation2ArgumentType{} __attribute__ ((__packed__)); //!< Query Information 2 command's arguments
struct QueryInformation2ResultType{} __attribute__ ((__packed__)); //!< Query Information 2 command's results
struct LockingAndxArgumentType{} __attribute__ ((__packed__)); //!< Lock some bytes of the file command's arguments
struct LockingAndxResultType{} __attribute__ ((__packed__)); //!< Lock some bytes of the file command's results
struct TransactionArgumentType{} __attribute__ ((__packed__)); //!< Transaction command's arguments
struct TransactionResultType{} __attribute__ ((__packed__)); //!< Transaction command's results
struct TransactionSecondaryArgumentType{} __attribute__ ((__packed__)); //!< Transaction 2 command's arguments
struct TransactionSecondaryResultType{} __attribute__ ((__packed__)); //!< Transaction 2 command's results
struct IoctlArgumentType{} __attribute__ ((__packed__)); //!< Ioctl command's arguments
struct IoctlResultType{} __attribute__ ((__packed__)); //!< Ioctl command's results
struct IoctlSecondaryArgumentType{} __attribute__ ((__packed__)); //!< Ioctl 2 command's arguments
struct IoctlSecondaryResultType{} __attribute__ ((__packed__)); //!< Ioctl 2 command's results
struct CopyArgumentType{} __attribute__ ((__packed__)); //!< Copy command's arguments
struct CopyResultType{} __attribute__ ((__packed__)); //!< Copy command's results
struct MoveArgumentType{} __attribute__ ((__packed__)); //!< Move command's arguments
struct MoveResultType{} __attribute__ ((__packed__)); //!< Move command's results
struct EchoArgumentType{} __attribute__ ((__packed__)); //!< Echo command's arguments
struct EchoResultType{} __attribute__ ((__packed__)); //!< Echo command's results
struct WriteAndCloseArgumentType{} __attribute__ ((__packed__)); //!< Write And Close command's arguments
struct WriteAndCloseResultType{} __attribute__ ((__packed__)); //!< Write And Close command's results
struct OpenAndxArgumentType{} __attribute__ ((__packed__)); //!< Open 2 command's arguments
struct OpenAndxResultType{} __attribute__ ((__packed__)); //!< Open 2 command's results
struct ReadAndxArgumentType{} __attribute__ ((__packed__)); //!< Read 2 command's arguments
struct ReadAndxResultType{} __attribute__ ((__packed__)); //!< Read 2 command's results
struct WriteAndxArgumentType{} __attribute__ ((__packed__)); //!< Write 2 command's arguments
struct WriteAndxResultType{} __attribute__ ((__packed__)); //!< Write 2 command's results
struct NewFileSizeArgumentType{} __attribute__ ((__packed__)); //!< New File Size command's arguments
struct NewFileSizeResultType{} __attribute__ ((__packed__)); //!< New File Size command's results
struct CloseAndTreeDiscArgumentType{} __attribute__ ((__packed__)); //!< Reserved command's arguments
struct CloseAndTreeDiscResultType{} __attribute__ ((__packed__)); //!< Reserved command's results
struct Transaction2ArgumentType{} __attribute__ ((__packed__)); //!< Transaction 2 command's arguments
struct Transaction2ResultType{} __attribute__ ((__packed__)); //!< Transaction 2 command's results
struct Transaction2SecondaryArgumentType{} __attribute__ ((__packed__)); //!< Transaction 3 command's arguments
struct Transaction2SecondaryResultType{} __attribute__ ((__packed__)); //!< Transaction 3 command's results
struct FindClose2ArgumentType{} __attribute__ ((__packed__)); //!< Search handle close command's arguments
struct FindClose2ResultType{} __attribute__ ((__packed__)); //!< Search handle close command's results
struct FindNotifyCloseArgumentType{} __attribute__ ((__packed__)); //!< Search handle close command's arguments
struct FindNotifyCloseResultType{} __attribute__ ((__packed__)); //!< Search handle close command's results
struct TreeConnectArgumentType{} __attribute__ ((__packed__)); //!< establish a client connection to a server share command's arguments
struct TreeConnectResultType{} __attribute__ ((__packed__)); //!< establish a client connection to a server share command's results
struct TreeDisconnectArgumentType{} __attribute__ ((__packed__)); //!< Disconnect command's arguments
struct TreeDisconnectResultType{} __attribute__ ((__packed__)); //!< Disconnect command's results
struct NegotiateArgumentType{} __attribute__ ((__packed__)); //!< Negotiate command's arguments
struct NegotiateResultType{} __attribute__ ((__packed__)); //!< Negotiate command's results
struct SessionSetupAndxArgumentType{} __attribute__ ((__packed__)); //!< Session setup command's arguments
struct SessionSetupAndxResultType{} __attribute__ ((__packed__)); //!< Session setup command's results
struct LogoffAndxArgumentType{} __attribute__ ((__packed__)); //!< Log off command's arguments
struct LogoffAndxResultType{} __attribute__ ((__packed__)); //!< Log off command's results
struct TreeConnectAndxArgumentType{} __attribute__ ((__packed__)); //!< Tree Connect command's arguments
struct TreeConnectAndxResultType{} __attribute__ ((__packed__)); //!< Tree Connect command's results
struct SecurityPackageAndxArgumentType{} __attribute__ ((__packed__)); //!< Security Package command's arguments
struct SecurityPackageAndxResultType{} __attribute__ ((__packed__)); //!< Security Package command's results
struct QueryInformationDiskArgumentType{} __attribute__ ((__packed__)); //!< Query Disk Information command's arguments
struct QueryInformationDiskResultType{} __attribute__ ((__packed__)); //!< Query Disk Information command's results
struct SearchArgumentType{} __attribute__ ((__packed__)); //!< Search command's arguments
struct SearchResultType{} __attribute__ ((__packed__)); //!< Search command's results
struct FindArgumentType{} __attribute__ ((__packed__)); //!< Find command's arguments
struct FindResultType{} __attribute__ ((__packed__)); //!< Find command's results
struct FindUniqueArgumentType{} __attribute__ ((__packed__)); //!< Find unique command's arguments
struct FindUniqueResultType{} __attribute__ ((__packed__)); //!< Find unique command's results
struct FindCloseArgumentType{} __attribute__ ((__packed__)); //!< Find close command's arguments
struct FindCloseResultType{} __attribute__ ((__packed__)); //!< Find close command's results
struct NtTransactArgumentType{} __attribute__ ((__packed__)); //!< Transact command's arguments
struct NtTransactResultType{} __attribute__ ((__packed__)); //!< Transact command's results
struct NtTransactSecondaryArgumentType{} __attribute__ ((__packed__)); //!< Transact 2 command's arguments
struct NtTransactSecondaryResultType{} __attribute__ ((__packed__)); //!< Transact 2 command's results
struct NtCreateAndxArgumentType{} __attribute__ ((__packed__)); //!< Create command's arguments
struct NtCreateAndxResultType{} __attribute__ ((__packed__)); //!< Create command's results
struct NtCancelArgumentType{} __attribute__ ((__packed__)); //!< Cancel command's arguments
struct NtCancelResultType{} __attribute__ ((__packed__)); //!< Cancel command's results
struct NtRenameArgumentType{} __attribute__ ((__packed__)); //!< Rename command's arguments
struct NtRenameResultType{} __attribute__ ((__packed__)); //!< Rename command's results
struct OpenPrintFileArgumentType{} __attribute__ ((__packed__)); //!< Open Print File command's arguments
struct OpenPrintFileResultType{} __attribute__ ((__packed__)); //!< Open Print File command's results
struct WritePrintFileArgumentType{} __attribute__ ((__packed__)); //!< Write Print File command's arguments
struct WritePrintFileResultType{} __attribute__ ((__packed__)); //!< Write Print File command's results
struct ClosePrintFileArgumentType{} __attribute__ ((__packed__)); //!< Close Print File command's arguments
struct ClosePrintFileResultType{} __attribute__ ((__packed__)); //!< Close Print File command's results
struct GetPrintQueueArgumentType{} __attribute__ ((__packed__)); //!< Get Print Queue command's arguments
struct GetPrintQueueResultType{} __attribute__ ((__packed__)); //!< Get Print Queue command's results
struct ReadBulkArgumentType{} __attribute__ ((__packed__)); //!< Read Bulk command's arguments
struct ReadBulkResultType{} __attribute__ ((__packed__)); //!< Read Bulk command's results
struct WriteBulkArgumentType{} __attribute__ ((__packed__)); //!< Write Bulk command's arguments
struct WriteBulkResultType{} __attribute__ ((__packed__)); //!< Write Bulk command's results
struct WriteBulkDataArgumentType{} __attribute__ ((__packed__)); //!< Write Bulk command's arguments
struct WriteBulkDataResultType{} __attribute__ ((__packed__)); //!< Write Bulk command's results
struct InvalidArgumentType{} __attribute__ ((__packed__)); //!< Invalid command's arguments
struct InvalidResultType{} __attribute__ ((__packed__)); //!< Invalid command's results
struct NoAndxCmdArgumentType{} __attribute__ ((__packed__)); //!< No command's arguments
struct NoAndxCmdResultType{} __attribute__ ((__packed__)); //!< No command's results
} // namespace SMBv1
} // namespace API
} // namespace NST
//------------------------------------------------------------------------------
#endif//API_CIFS_COMMANDS_H
//------------------------------------------------------------------------------
|