Ftp Namespace Reference

Classes

class  Channel
 
class  CtrlChannel
 
class  DataChannel
 
class  Client
 FTP client functionality shared among FTP Gateway and Relay clients. More...
 
struct  GatewayFlags
 
class  Gateway
 
class  Relay
 
class  MasterState
 Transaction information shared among our FTP client and server jobs. More...
 
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

AsyncJobPointer StartGateway (FwdState *const fwdState)
 A new FTP Gateway job. More...
 
AsyncJobPointer 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 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

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

Definition at line 87 of file FtpGateway.cc.

Enumeration Type Documentation

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

Definition at line 20 of file FtpServer.h.

Function Documentation

const SBuf & Ftp::cmdAppe ( )

Definition at line 56 of file Elements.cc.

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

const SBuf & Ftp::cmdAuth ( )

Definition at line 63 of file Elements.cc.

Referenced by SupportedCommand().

const SBuf & Ftp::cmdCwd ( )

Definition at line 70 of file Elements.cc.

Referenced by CommandHasPathParameter().

const SBuf & Ftp::cmdDele ( )

Definition at line 77 of file Elements.cc.

Referenced by CommandHasPathParameter().

const SBuf & Ftp::cmdEprt ( )

Definition at line 84 of file Elements.cc.

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

const SBuf & Ftp::cmdEpsv ( )

Definition at line 91 of file Elements.cc.

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

const SBuf & Ftp::cmdList ( )

Definition at line 98 of file Elements.cc.

Referenced by CommandHasPathParameter().

const SBuf & Ftp::cmdMkd ( )

Definition at line 105 of file Elements.cc.

Referenced by CommandHasPathParameter().

const SBuf & Ftp::cmdMlsd ( )

Definition at line 112 of file Elements.cc.

Referenced by CommandHasPathParameter().

const SBuf & Ftp::cmdMlst ( )

Definition at line 119 of file Elements.cc.

Referenced by CommandHasPathParameter().

const SBuf & Ftp::cmdNlst ( )

Definition at line 126 of file Elements.cc.

Referenced by CommandHasPathParameter().

const SBuf & Ftp::cmdRetr ( )

Definition at line 133 of file Elements.cc.

Referenced by CommandHasPathParameter().

const SBuf & Ftp::cmdRmd ( )

Definition at line 140 of file Elements.cc.

Referenced by CommandHasPathParameter().

const SBuf & Ftp::cmdRnfr ( )

Definition at line 147 of file Elements.cc.

Referenced by CommandHasPathParameter().

const SBuf & Ftp::cmdRnto ( )

Definition at line 154 of file Elements.cc.

Referenced by CommandHasPathParameter().

const SBuf & Ftp::cmdSmnt ( )

Definition at line 161 of file Elements.cc.

Referenced by CommandHasPathParameter().

const SBuf & Ftp::cmdStat ( )

Definition at line 168 of file Elements.cc.

Referenced by CommandHasPathParameter().

const SBuf & Ftp::cmdStor ( )

Definition at line 175 of file Elements.cc.

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

const SBuf & Ftp::cmdStou ( )

Definition at line 182 of file Elements.cc.

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

const SBuf & Ftp::cmdUser ( )

Definition at line 189 of file Elements.cc.

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

static bool Ftp::CommandHasPathParameter ( const SBuf cmd)
static
static char* Ftp::escapeIAC ( const char *  buf)
static

Definition at line 38 of file FtpClient.cc.

References assert, buf, p, and xmalloc.

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

bool Ftp::ParseIpPort ( const char *  buf,
const char *  forceIp,
Ip::Address addr 
)
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 buf, Config, SquidConfig::Ftp, Ip::Address::isAnyAddr(), Ip::Address::isIPv6(), MAX_IPSTRLEN, port, Ip::Address::port(), and SquidConfig::sanitycheck.

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

AsyncJob::Pointer Ftp::StartGateway ( FwdState *const  fwdState)

Definition at line 2762 of file FtpGateway.cc.

References AsyncJob::Start().

Referenced by FwdState::dispatch().

AsyncJob::Pointer Ftp::StartRelay ( FwdState *const  fwdState)

Definition at line 801 of file FtpRelay.cc.

References AsyncJob::Start().

Referenced by FwdState::dispatch().

void Ftp::StopListening ( )

Definition at line 285 of file FtpServer.cc.

References DBG_IMPORTANT, debugs, FtpPortList, and NULL.

Referenced by clientConnectionsClose().

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

Definition at line 1844 of file FtpServer.cc.

References cmdAuth().

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

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().

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 a URL class API call.

Definition at line 2669 of file FtpGateway.cc.

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

Referenced by ErrorState::Convert().

Variable Documentation

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors