]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * Copyright (C) 1996-2025 The Squid Software Foundation and contributors | |
3 | * | |
4 | * Squid software is distributed under GPLv2+ license and includes | |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
7 | */ | |
8 | ||
9 | #ifndef SQUID_SRC_FTP_ELEMENTS_H | |
10 | #define SQUID_SRC_FTP_ELEMENTS_H | |
11 | ||
12 | #include "http/forward.h" | |
13 | #include "http/StatusCode.h" | |
14 | #include "sbuf/forward.h" | |
15 | ||
16 | namespace AnyP | |
17 | { | |
18 | class ProtocolVersion; | |
19 | } | |
20 | ||
21 | namespace Ftp | |
22 | { | |
23 | ||
24 | /// Protocol version to use in Http::Message structures wrapping FTP messages. | |
25 | AnyP::ProtocolVersion ProtocolVersion(); | |
26 | ||
27 | /// Create an internal HttpReply structure to house FTP control response info. | |
28 | HttpReply *HttpReplyWrapper(const int ftpStatus, const char *ftpReason, const Http::StatusCode httpStatus, const int64_t clen); | |
29 | ||
30 | /* FTP Commands used by Squid. ALLCAPS case. Safe for static initializaton. */ | |
31 | const SBuf &cmdAppe(); | |
32 | const SBuf &cmdAuth(); | |
33 | const SBuf &cmdCwd(); | |
34 | const SBuf &cmdDele(); | |
35 | const SBuf &cmdEprt(); | |
36 | const SBuf &cmdEpsv(); | |
37 | const SBuf &cmdList(); | |
38 | const SBuf &cmdMkd(); | |
39 | const SBuf &cmdMlsd(); | |
40 | const SBuf &cmdMlst(); | |
41 | const SBuf &cmdNlst(); | |
42 | const SBuf &cmdRetr(); | |
43 | const SBuf &cmdRmd(); | |
44 | const SBuf &cmdRnfr(); | |
45 | const SBuf &cmdRnto(); | |
46 | const SBuf &cmdSmnt(); | |
47 | const SBuf &cmdStat(); | |
48 | const SBuf &cmdStor(); | |
49 | const SBuf &cmdStou(); | |
50 | const SBuf &cmdUser(); | |
51 | ||
52 | /// whether this is an informational 1xx response status code | |
53 | inline bool Is1xx(const int sc) { return Http::scContinue <= sc && sc < Http::scOkay; } | |
54 | ||
55 | } // namespace Ftp | |
56 | ||
57 | #endif /* SQUID_SRC_FTP_ELEMENTS_H */ | |
58 |