1 #ifndef PACKETPP_FTP_LAYER 2 #define PACKETPP_FTP_LAYER 31 static bool isFtpPort(uint16_t port) {
return port == 21; }
74 ABOR = (
'A') | (
'B' << 8) | (
'O' << 16) | (
'R' << 24),
76 ACCT = (
'A') | (
'C' << 8) | (
'C' << 16) | (
'T' << 24),
78 ADAT = (
'A') | (
'D' << 8) | (
'A' << 16) | (
'T' << 24),
80 ALLO = (
'A') | (
'L' << 8) | (
'L' << 16) | (
'O' << 24),
82 APPE = (
'A') | (
'P' << 8) | (
'P' << 16) | (
'E' << 24),
84 AUTH = (
'A') | (
'U' << 8) | (
'T' << 16) | (
'H' << 24),
86 AVBL = (
'A') | (
'V' << 8) | (
'B' << 16) | (
'L' << 24),
88 CCC = (
'C') | (
'C' << 8) | (
'C' << 16),
90 CDUP = (
'C') | (
'D' << 8) | (
'U' << 16) | (
'P' << 24),
92 CONF = (
'C') | (
'O' << 8) | (
'N' << 16) | (
'F' << 24),
94 CSID = (
'C') | (
'S' << 8) | (
'I' << 16) | (
'D' << 24),
96 CWD = (
'C') | (
'W' << 8) | (
'D' << 16),
98 DELE = (
'D') | (
'E' << 8) | (
'L' << 16) | (
'E' << 24),
100 DSIZ = (
'D') | (
'S' << 8) | (
'I' << 16) | (
'Z' << 24),
102 ENC = (
'E') | (
'N' << 8) | (
'C' << 16),
104 EPRT = (
'E') | (
'P' << 8) | (
'R' << 16) | (
'T' << 24),
106 EPSV = (
'E') | (
'P' << 8) | (
'S' << 16) | (
'V' << 24),
108 FEAT = (
'F') | (
'E' << 8) | (
'A' << 16) | (
'T' << 24),
110 HELP = (
'H') | (
'E' << 8) | (
'L' << 16) | (
'P' << 24),
112 HOST = (
'H') | (
'O' << 8) | (
'S' << 16) | (
'T' << 24),
114 LANG = (
'L') | (
'A' << 8) | (
'N' << 16) | (
'G' << 24),
116 LIST = (
'L') | (
'I' << 8) | (
'S' << 16) | (
'T' << 24),
118 LPRT = (
'L') | (
'P' << 8) | (
'R' << 16) | (
'T' << 24),
120 LPSV = (
'L') | (
'P' << 8) | (
'S' << 16) | (
'V' << 24),
122 MDTM = (
'M') | (
'D' << 8) | (
'T' << 16) | (
'M' << 24),
124 MFCT = (
'M') | (
'F' << 8) | (
'C' << 16) | (
'T' << 24),
126 MFF = (
'M') | (
'F' << 8) | (
'F' << 16),
128 MFMT = (
'M') | (
'F' << 8) | (
'M' << 16) | (
'T' << 24),
130 MIC = (
'M') | (
'I' << 8) | (
'C' << 16),
132 MKD = (
'M') | (
'K' << 8) | (
'D' << 16),
134 MLSD = (
'M') | (
'L' << 8) | (
'S' << 16) | (
'D' << 24),
136 MLST = (
'M') | (
'L' << 8) | (
'S' << 16) | (
'T' << 24),
138 MODE = (
'M') | (
'O' << 8) | (
'D' << 16) | (
'E' << 24),
140 NLST = (
'N') | (
'L' << 8) | (
'S' << 16) | (
'T' << 24),
142 NOOP = (
'N') | (
'O' << 8) | (
'O' << 16) | (
'P' << 24),
144 OPTS = (
'O') | (
'P' << 8) | (
'T' << 16) | (
'S' << 24),
146 PASS = (
'P') | (
'A' << 8) | (
'S' << 16) | (
'S' << 24),
148 PASV = (
'P') | (
'A' << 8) | (
'S' << 16) | (
'V' << 24),
150 PBSZ = (
'P') | (
'B' << 8) | (
'S' << 16) | (
'Z' << 24),
152 PORT = (
'P') | (
'O' << 8) | (
'R' << 16) | (
'T' << 24),
154 PROT = (
'P') | (
'R' << 8) | (
'O' << 16) | (
'T' << 24),
156 PWD = (
'P') | (
'W' << 8) | (
'D' << 16),
158 QUIT = (
'Q') | (
'U' << 8) | (
'I' << 16) | (
'T' << 24),
160 REIN = (
'R') | (
'E' << 8) | (
'I' << 16) | (
'N' << 24),
162 REST = (
'R') | (
'E' << 8) | (
'S' << 16) | (
'T' << 24),
164 RETR = (
'R') | (
'E' << 8) | (
'T' << 16) | (
'R' << 24),
166 RMD = (
'R') | (
'M' << 8) | (
'D' << 16),
168 RMDA = (
'R') | (
'M' << 8) | (
'D' << 16) | (
'A' << 24),
170 RNFR = (
'R') | (
'N' << 8) | (
'F' << 16) | (
'R' << 24),
172 RNTO = (
'R') | (
'N' << 8) | (
'T' << 16) | (
'O' << 24),
174 SITE = (
'S') | (
'I' << 8) | (
'T' << 16) | (
'E' << 24),
176 SIZE = (
'S') | (
'I' << 8) | (
'Z' << 16) | (
'E' << 24),
178 SMNT = (
'S') | (
'M' << 8) | (
'N' << 16) | (
'T' << 24),
180 SPSV = (
'S') | (
'P' << 8) | (
'S' << 16) | (
'V' << 24),
182 STAT = (
'S') | (
'T' << 8) | (
'A' << 16) | (
'T' << 24),
184 STOR = (
'S') | (
'T' << 8) | (
'O' << 16) | (
'R' << 24),
186 STOU = (
'S') | (
'T' << 8) | (
'O' << 16) | (
'U' << 24),
188 STRU = (
'S') | (
'T' << 8) | (
'R' << 16) | (
'U' << 24),
190 SYST = (
'S') | (
'Y' << 8) | (
'S' << 16) | (
'T' << 24),
192 THMB = (
'T') | (
'H' << 8) | (
'M' << 16) | (
'B' << 24),
194 TYPE = (
'T') | (
'Y' << 8) | (
'P' << 16) | (
'E' << 24),
196 USER = (
'U') | (
'S' << 8) | (
'E' << 16) | (
'R' << 24),
198 XCUP = (
'X') | (
'C' << 8) | (
'U' << 16) | (
'P' << 24),
200 XMKD = (
'X') | (
'M' << 8) | (
'K' << 16) | (
'D' << 24),
202 XPWD = (
'X') | (
'P' << 8) | (
'W' << 16) | (
'D' << 24),
204 XRCP = (
'X') | (
'R' << 8) | (
'C' << 16) | (
'P' << 24),
206 XRMD = (
'X') | (
'R' << 8) | (
'M' << 16) | (
'D' << 24),
208 XRSQ = (
'X') | (
'R' << 8) | (
'S' << 16) | (
'Q' << 24),
210 XSEM = (
'X') | (
'S' << 8) | (
'E' << 16) | (
'M' << 24),
212 XSEN = (
'X') | (
'S' << 8) | (
'E' << 16) | (
'N' << 24)
247 std::string getCommandString()
const;
254 bool setCommandOption(
const std::string &value);
261 std::string getCommandOption(
bool removeEscapeCharacters =
true)
const;
268 static std::string getCommandInfo(
FtpCommand code);
275 static std::string getCommandAsString(
FtpCommand code);
300 RESTART_MARKER = 110,
302 SERVICE_READY_IN_MIN = 120,
304 DATA_ALREADY_OPEN_START_TRANSFER = 125,
310 COMMAND_NOT_IMPLEMENTED_SUPERFLUOUS = 202,
320 NAME_SYSTEM_TYPE = 215,
322 SERVICE_READY_FOR_USER = 220,
324 SERVICE_CLOSING_CONTROL = 221,
326 DATA_OPEN_NO_TRANSFER = 225,
330 ENTERING_PASSIVE = 227,
332 ENTERING_EXTENDED_PASSIVE = 229,
334 USER_LOG_IN_PROCEED = 230,
336 USER_LOG_IN_AUTHORIZED = 232,
338 SEC_DATA_EXCHANGE_COMPLETE = 234,
340 SEC_DATA_EXCHANGE_COMPLETE_SUCCESS = 235,
342 REQ_FILE_OK_COMPLETE = 250,
344 PATHNAME_CREATED = 257,
346 USER_OK_NEED_PASSWORD = 331,
350 REQ_SEC_MECHANISM_OK = 334,
352 SEC_IS_ACCEPTABLE = 335,
354 USER_OK_NEED_PASS_CHALLENGE = 336,
356 FILE_PENDING_ACTION = 350,
358 SERVICE_NOT_AVAILABLE = 421,
360 CANT_OPEN_DATA_CONNECTION = 425,
362 CONNECTION_CLOSED = 426,
364 NEED_UNAVAILABLE_RESOURCE_TO_SEC = 431,
366 REQ_FILE_ACTION_NOT_TAKEN = 450,
368 REQ_ACTION_ABORTED = 451,
370 REQ_ACTION_NOT_TAKEN = 452,
372 SYNTAX_ERROR_COMMAND_UNRECOGNIZED = 500,
374 SYNTAX_ERROR_PARAMETER_OR_ARGUMENT = 501,
376 COMMAND_NOT_IMPLEMENTED = 502,
378 BAD_SEQUENCE_COMMANDS = 503,
380 COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER = 504,
382 NETWORK_PROTOCOL_NOT_SUPPORTED = 522,
386 NEED_ACCOUNT_FOR_STORE_FILE = 532,
388 COMMAND_PROTECTION_DENIED = 533,
390 REQUEST_DENIED = 534,
392 FAILED_SEC_CHECK = 535,
394 REQ_PROT_LEVEL_NOT_SUPPORTED = 536,
396 COMMAND_PROTECTION_LEVEL_NOT_SUPPORTED = 537,
398 FILE_UNAVAILABLE = 550,
400 PAGE_TYPE_UNKNOWN = 551,
402 EXCEED_STORAGE_ALLOCATION = 552,
404 FILENAME_NOT_ALLOWED = 553,
406 INTEGRITY_PROTECTED = 631,
408 CONFIDENTIALITY_AND_INTEGRITY_PROTECTED = 632,
410 CONFIDENTIALITY_PROTECTED = 633
445 std::string getStatusCodeString()
const;
452 bool setStatusOption(
const std::string &value);
459 std::string getStatusOption(
bool removeEscapeCharacters =
true)
const;
466 static std::string getStatusCodeAsString(
FtpStatusCode code);
FtpResponseLayer(const FtpStatusCode &code, const std::string &option="")
Definition: FtpLayer.h:426
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:333
size_t getHeaderLen() const
Definition: FtpLayer.h:47
static bool isFtpPort(uint16_t port)
Definition: FtpLayer.h:31
Definition: SingleCommandTextProtocol.h:19
static bool isFtpDataPort(uint16_t port)
Definition: FtpLayer.h:37
FtpRequestLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: FtpLayer.h:221
FtpDataLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: FtpLayer.h:489
Definition: ProtocolType.h:348
Definition: FtpLayer.h:479
Definition: FtpLayer.h:19
FtpRequestLayer(const FtpCommand &command, const std::string &option="")
Definition: FtpLayer.h:228
FtpResponseLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: FtpLayer.h:419
FtpStatusCode
Definition: FtpLayer.h:295
void parseNextLayer()
FTP is the always last so does nothing for this layer.
Definition: FtpLayer.h:42
Definition: FtpLayer.h:288
Definition: PayloadLayer.h:19
FtpCommand
Definition: FtpLayer.h:69
virtual std::string toString() const =0
const ProtocolType FTP
Definition: ProtocolType.h:268
void computeCalculateFields()
Does nothing for this layer.
Definition: FtpLayer.h:50
OsiModelLayer getOsiModelLayer() const
Definition: FtpLayer.h:55
Definition: FtpLayer.h:62