Ftp Namespace Reference

Classes

class  Channel
 
class  Client
 FTP client functionality shared among FTP Gateway and Relay clients. More...
 
class  CtrlChannel
 
class  DataChannel
 
class  ErrorDetail
 
class  Gateway
 
struct  GatewayFlags
 
class  MasterState
 Transaction information shared among our FTP client and server jobs. More...
 
class  Relay
 
class  Server
 Manages a control connection from an FTP client. More...
 

Typedefs

typedef void() StateMethod(Ftp::Gateway *)
 

Enumerations

enum  ServerState {
  fssBegin ,
  fssConnected ,
  fssHandleFeat ,
  fssHandlePasv ,
  fssHandlePort ,
  fssHandleDataRequest ,
  fssHandleUploadRequest ,
  fssHandleEprt ,
  fssHandleEpsv ,
  fssHandleCwd ,
  fssHandlePass ,
  fssHandleCdup ,
  fssError
}
 

Functions

void StartGateway (FwdState *const fwdState)
 A new FTP Gateway job. More...
 
void StartRelay (FwdState *const fwdState)
 A new FTP Relay job. More...
 
const SBufUrlWith2f (HttpRequest *)
 
static char * escapeIAC (const char *buf)
 
AnyP::ProtocolVersion ProtocolVersion ()
 Protocol version to use in Http::Message structures wrapping FTP messages. More...
 
HttpReplyHttpReplyWrapper (const int ftpStatus, const char *ftpReason, const Http::StatusCode httpStatus, const int64_t clen)
 Create an internal HttpReply structure to house FTP control response info. More...
 
const SBufcmdAppe ()
 
const SBufcmdAuth ()
 
const SBufcmdCwd ()
 
const SBufcmdDele ()
 
const SBufcmdEprt ()
 
const SBufcmdEpsv ()
 
const SBufcmdList ()
 
const SBufcmdMkd ()
 
const SBufcmdMlsd ()
 
const SBufcmdMlst ()
 
const SBufcmdNlst ()
 
const SBufcmdRetr ()
 
const SBufcmdRmd ()
 
const SBufcmdRnfr ()
 
const SBufcmdRnto ()
 
const SBufcmdSmnt ()
 
const SBufcmdStat ()
 
const SBufcmdStor ()
 
const SBufcmdStou ()
 
const SBufcmdUser ()
 
bool Is1xx (const int sc)
 whether this is an informational 1xx response status code More...
 
bool ParseIpPort (const char *buf, const char *forceIp, Ip::Address &addr)
 parses and validates "A1,A2,A3,A4,P1,P2" IP,port sequence More...
 
bool ParseProtoIpPort (const char *buf, Ip::Address &addr)
 
const char * UnescapeDoubleQuoted (const char *quotedPath)
 parses an FTP-quoted quote-escaped path More...
 
void StartListening ()
 accept connections on all configured ftp_ports More...
 
void StopListening ()
 reject new connections to any configured ftp_port More...
 
static void PrintReply (MemBuf &mb, const HttpReply *reply, const char *const prefix="")
 
static bool SupportedCommand (const SBuf &name)
 Whether Squid FTP Relay supports a named feature (e.g., a command). More...
 
static bool CommandHasPathParameter (const SBuf &cmd)
 whether the given FTP command has a pathname parameter More...
 

Variables

const char *const crlf = "\r\n"
 

Typedef Documentation

◆ StateMethod

typedef void() Ftp::StateMethod(Ftp::Gateway *)

Definition at line 89 of file FtpGateway.cc.

Enumeration Type Documentation

◆ ServerState

Enumerator
fssBegin 
fssConnected 
fssHandleFeat 
fssHandlePasv 
fssHandlePort 
fssHandleDataRequest 
fssHandleUploadRequest 
fssHandleEprt 
fssHandleEpsv 
fssHandleCwd 
fssHandlePass 
fssHandleCdup 
fssError 

Definition at line 23 of file FtpServer.h.

Function Documentation

◆ cmdAppe()

const SBuf & Ftp::cmdAppe ( )

Definition at line 56 of file Elements.cc.

Referenced by CommandHasPathParameter(), and Ftp::Server::parseOneRequest().

◆ cmdAuth()

const SBuf & Ftp::cmdAuth ( )

Definition at line 63 of file Elements.cc.

Referenced by SupportedCommand().

◆ cmdCwd()

const SBuf & Ftp::cmdCwd ( )

Definition at line 70 of file Elements.cc.

Referenced by CommandHasPathParameter().

◆ cmdDele()

const SBuf & Ftp::cmdDele ( )

Definition at line 77 of file Elements.cc.

Referenced by CommandHasPathParameter().

◆ cmdEprt()

const SBuf & Ftp::cmdEprt ( )

Definition at line 84 of file Elements.cc.

Referenced by Ftp::Server::handleFeatReply().

◆ cmdEpsv()

const SBuf & Ftp::cmdEpsv ( )

Definition at line 91 of file Elements.cc.

Referenced by Ftp::Server::handleFeatReply().

◆ cmdList()

const SBuf & Ftp::cmdList ( )

Definition at line 98 of file Elements.cc.

Referenced by CommandHasPathParameter().

◆ cmdMkd()

const SBuf & Ftp::cmdMkd ( )

Definition at line 105 of file Elements.cc.

Referenced by CommandHasPathParameter().

◆ cmdMlsd()

const SBuf & Ftp::cmdMlsd ( )

Definition at line 112 of file Elements.cc.

Referenced by CommandHasPathParameter().

◆ cmdMlst()

const SBuf & Ftp::cmdMlst ( )

Definition at line 119 of file Elements.cc.

Referenced by CommandHasPathParameter().

◆ cmdNlst()

const SBuf & Ftp::cmdNlst ( )

Definition at line 126 of file Elements.cc.

Referenced by CommandHasPathParameter().

◆ cmdRetr()

const SBuf & Ftp::cmdRetr ( )

Definition at line 133 of file Elements.cc.

Referenced by CommandHasPathParameter().

◆ cmdRmd()

const SBuf & Ftp::cmdRmd ( )

Definition at line 140 of file Elements.cc.

Referenced by CommandHasPathParameter().

◆ cmdRnfr()

const SBuf & Ftp::cmdRnfr ( )

Definition at line 147 of file Elements.cc.

Referenced by CommandHasPathParameter().

◆ cmdRnto()

const SBuf & Ftp::cmdRnto ( )

Definition at line 154 of file Elements.cc.

Referenced by CommandHasPathParameter().

◆ cmdSmnt()

const SBuf & Ftp::cmdSmnt ( )

Definition at line 161 of file Elements.cc.

Referenced by CommandHasPathParameter().

◆ cmdStat()

const SBuf & Ftp::cmdStat ( )

Definition at line 168 of file Elements.cc.

Referenced by CommandHasPathParameter().

◆ cmdStor()

const SBuf & Ftp::cmdStor ( )

Definition at line 175 of file Elements.cc.

Referenced by CommandHasPathParameter(), and Ftp::Server::parseOneRequest().

◆ cmdStou()

const SBuf & Ftp::cmdStou ( )

Definition at line 182 of file Elements.cc.

Referenced by Ftp::Server::parseOneRequest().

◆ cmdUser()

const SBuf & Ftp::cmdUser ( )

Definition at line 189 of file Elements.cc.

Referenced by Ftp::Server::parseOneRequest().

◆ CommandHasPathParameter()

static bool Ftp::CommandHasPathParameter ( const SBuf cmd)
static

◆ escapeIAC()

static char * Ftp::escapeIAC ( const char *  buf)
static

Definition at line 43 of file FtpClient.cc.

References assert, and xmalloc.

Referenced by Ftp::Client::writeCommand().

◆ HttpReplyWrapper()

◆ Is1xx()

◆ ParseIpPort()

bool Ftp::ParseIpPort ( const char *  buf,
const char *  forceIp,
Ip::Address addr 
)

◆ ParseProtoIpPort()

bool Ftp::ParseProtoIpPort ( const char *  buf,
Ip::Address addr 
)

parses and validates EPRT "<d><net-prt><d><net-addr><d><tcp-port><d>" proto,IP,port sequence

Definition at line 52 of file Parsing.cc.

References Config, SquidConfig::Ftp, Ip::Address::isAnyAddr(), Ip::Address::isIPv6(), MAX_IPSTRLEN, port, Ip::Address::port(), and SquidConfig::sanitycheck.

Referenced by Ftp::Server::handleEprtRequest().

◆ PrintReply()

◆ ProtocolVersion()

◆ StartGateway()

void Ftp::StartGateway ( FwdState *const  fwdState)

Definition at line 2675 of file FtpGateway.cc.

References AsyncJob::Start().

Referenced by FwdState::dispatch().

◆ StartListening()

◆ StartRelay()

void Ftp::StartRelay ( FwdState *const  fwdState)

Definition at line 807 of file FtpRelay.cc.

References AsyncJob::Start().

Referenced by FwdState::dispatch().

◆ StopListening()

void Ftp::StopListening ( )

◆ SupportedCommand()

static bool Ftp::SupportedCommand ( const SBuf name)
static

Definition at line 1842 of file FtpServer.cc.

References cmdAuth().

Referenced by Ftp::Server::handleFeatReply(), and Ftp::Server::parseOneRequest().

◆ UnescapeDoubleQuoted()

const char * Ftp::UnescapeDoubleQuoted ( const char *  quotedPath)

Definition at line 90 of file Parsing.cc.

References MemBuf::append(), MemBuf::content(), and MemBuf::reset().

Referenced by Ftp::Relay::stopDirTracking().

◆ UrlWith2f()

const SBuf & Ftp::UrlWith2f ( HttpRequest request)

Construct an URI with leading / in PATH portion for use by CWD command possibly others. FTP encodes absolute paths as beginning with '/' after the initial URI path delimiter, which happens to be / itself. This makes FTP absolute URI appear as: ftp:host:port//root/path To encompass older software which compacts multiple // to / in transit We use standard URI-encoding on the second / making it ftp:host:port/%2froot/path AKA 'the FTP %2f hack'.

TODO: Should be an AnyP::Uri member

Definition at line 2594 of file FtpGateway.cc.

References SBuf::append(), HttpRequest::effectiveRequestUri(), AnyP::Uri::getScheme(), Store::nil, AnyP::Uri::path(), AnyP::PROTO_FTP, and HttpRequest::url.

Referenced by ErrorState::compileLegacyCode().

Variable Documentation

◆ crlf

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors