#include <fde.h>
Classes | |
struct | _fde_flags |
Public Member Functions | |
fde () | |
void | clear () |
Clear the fde class back to NULL equivalent. More... | |
bool | closing () const |
True if comm_close for this fd has been called. More... | |
void | setIo (READ_HANDLER *, WRITE_HANDLER *) |
set I/O methods for a freshly opened descriptor More... | |
void | useDefaultIo () |
void | useBufferedIo (READ_HANDLER *, WRITE_HANDLER *) |
use I/O methods that maintain an internal-to-them buffer More... | |
int | read (int fd, char *buf, int len) |
int | write (int fd, const char *buf, int len) |
char const * | remoteAddr () const |
void | dumpStats (StoreEntry &, int) const |
bool | readPending (int) const |
void | noteUse () |
record a transaction on this FD More... | |
Static Public Member Functions | |
static void | Init () |
static void | DumpStats (StoreEntry *) |
Static Public Attributes | |
static fde * | Table = nullptr |
global table of FD and their state. More... | |
Private Attributes | |
READ_HANDLER * | readMethod_ = nullptr |
imports bytes into Squid More... | |
WRITE_HANDLER * | writeMethod_ = nullptr |
exports Squid bytes More... | |
Detailed Description
Constructor & Destructor Documentation
◆ fde()
|
inline |
Definition at line 62 of file fde.h.
References desc, ipaddr, read_handler, readMethod_, write_handler, and writeMethod_.
Referenced by clear().
Member Function Documentation
◆ clear()
◆ closing()
|
inline |
Definition at line 75 of file fde.h.
References fde::_fde_flags::close_request, and flags.
◆ dumpStats()
void fde::dumpStats | ( | StoreEntry & | dumpEntry, |
int | fdNumber | ||
) | const |
Definition at line 72 of file fde.cc.
References bytes_read, bytes_written, desc, fdTypeStr, flags, fde::_fde_flags::open, PRId64, readPending(), remoteAddr(), squid_curtime, storeAppendPrintf(), timeout, timeoutHandler, type, and write_handler.
Referenced by DumpStats().
◆ DumpStats()
|
static |
Definition at line 96 of file fde.cc.
References dumpStats(), Squid_MaxFD, storeAppendPrintf(), and Table.
Referenced by statRegisterWithCacheManager().
◆ Init()
|
static |
Configures fd_table (a.k.a. fde::Table). Call once, after learning the number of supported descriptors (i.e. setMaxFD()) and before dereferencing fd_table (e.g., before Comm I/O).
Definition at line 141 of file fde.cc.
References assert, Squid_MaxFD, Table, and xcalloc().
Referenced by TestUfs::commonInit(), and StartUsingConfig().
◆ noteUse()
◆ read()
Definition at line 87 of file fde.h.
References readMethod_.
◆ readPending()
bool fde::readPending | ( | int | fdNumber | ) | const |
Definition at line 63 of file fde.cc.
References FD_SOCKET, Comm::MonitorsRead(), read_handler, and type.
Referenced by dumpStats().
◆ remoteAddr()
char const * fde::remoteAddr | ( | ) | const |
Definition at line 125 of file fde.cc.
References FD_SOCKET, ipaddr, local_addr, MAX_IPSTRLEN, remote_port, Ip::Address::toUrl(), and type.
Referenced by dumpStats().
◆ setIo()
void fde::setIo | ( | READ_HANDLER * | reader, |
WRITE_HANDLER * | writer | ||
) |
Definition at line 22 of file fde.cc.
References assert, flags, fde::_fde_flags::read_pending, readMethod_, and writeMethod_.
◆ useBufferedIo()
void fde::useBufferedIo | ( | READ_HANDLER * | bufferingReader, |
WRITE_HANDLER * | bufferingWriter | ||
) |
Definition at line 49 of file fde.cc.
References assert, debugs, flags, fde::_fde_flags::read_pending, readMethod_, and writeMethod_.
◆ useDefaultIo()
void fde::useDefaultIo | ( | ) |
Use default I/O methods. When called after useBufferedIo(), the caller is responsible for any (unread or unwritten) buffered data.
Definition at line 33 of file fde.cc.
References debugs, default_read_method(), default_write_method(), flags, fde::_fde_flags::read_pending, readMethod_, and writeMethod_.
◆ write()
Definition at line 88 of file fde.h.
References writeMethod_.
Member Data Documentation
◆ bytes_read
int64_t fde::bytes_read = 0 |
Definition at line 134 of file fde.h.
Referenced by dumpStats().
◆ bytes_written
int64_t fde::bytes_written = 0 |
Definition at line 135 of file fde.h.
Referenced by dumpStats().
◆ clientInfo
ClientInfo* fde::clientInfo = nullptr |
Definition at line 143 of file fde.h.
Referenced by BandwidthBucket::SelectBucket().
◆ closeHandler
AsyncCall::Pointer fde::closeHandler |
◆ codeContext
CodeContextPointer fde::codeContext |
◆ desc
char fde::desc[FD_DESC_SZ] |
Definition at line 115 of file fde.h.
Referenced by fde(), and dumpStats().
◆ disk
◆ dynamicTlsContext
Security::ContextPointer fde::dynamicTlsContext |
◆ epoll_state
◆ flags
struct fde::_fde_flags fde::flags |
Referenced by closing(), dumpStats(), setIo(), useBufferedIo(), and useDefaultIo().
◆ halfClosedReader
AsyncCall::Pointer fde::halfClosedReader |
◆ ipaddr
char fde::ipaddr[MAX_IPSTRLEN] |
Definition at line 114 of file fde.h.
Referenced by fde(), and remoteAddr().
◆ lifetime_data
◆ local_addr
Ip::Address fde::local_addr |
Definition at line 108 of file fde.h.
Referenced by remoteAddr().
◆ nfConnmarkFromServer
unsigned int fde::nfConnmarkFromServer = 0 |
Stores the Netfilter mark value of the connection from the remote server. See FwdState::dispatch(). Note that this differs to nfmarkToServer in that this is the value we receive from the, connection, whereas nfmarkToServer is the value to set on packets leaving* Squid.
Definition at line 171 of file fde.h.
Referenced by FwdState::dispatch().
◆ nfmarkToServer
nfmark_t fde::nfmarkToServer = 0 |
◆
struct { ... } fde::pconn |
Referenced by noteUse().
◆ read_data
◆ read_handler
PF* fde::read_handler |
Definition at line 149 of file fde.h.
Referenced by fde(), and readPending().
◆ readMethod_
|
private |
Definition at line 185 of file fde.h.
Referenced by fde(), read(), setIo(), useBufferedIo(), and useDefaultIo().
◆ remote_port
unsigned short fde::remote_port = 0 |
Definition at line 106 of file fde.h.
Referenced by remoteAddr().
◆ sock_family
◆ ssl
Security::SessionPointer fde::ssl |
◆ Table
|
static |
Definition at line 103 of file fde.h.
Referenced by DumpStats(), and Init().
◆ timeout
time_t fde::timeout = 0 |
Definition at line 154 of file fde.h.
Referenced by Comm::ConnOpener::cleanFd(), and dumpStats().
◆ timeoutHandler
AsyncCall::Pointer fde::timeoutHandler |
Definition at line 153 of file fde.h.
Referenced by Comm::ConnOpener::cleanFd(), and dumpStats().
◆ tosFromServer
tos_t fde::tosFromServer = '\0' |
Stores the TOS flags of the packets from the remote server. See FwdState::dispatch(). Note that this differs to tosToServer in that this is the value we receive from the, connection, whereas tosToServer is the value to set on packets leaving* Squid.
Definition at line 166 of file fde.h.
Referenced by Ip::Qos::getTosFromServer().
◆ tosToServer
tos_t fde::tosToServer = '\0' |
◆ type
unsigned int fde::type = 0 |
Definition at line 105 of file fde.h.
Referenced by dumpStats(), readPending(), and remoteAddr().
◆ uses
◆ write_data
void* fde::write_data = nullptr |
Definition at line 152 of file fde.h.
Referenced by Comm::ConnOpener::cleanFd().
◆ write_handler
PF* fde::write_handler |
Definition at line 151 of file fde.h.
Referenced by fde(), Comm::ConnOpener::cleanFd(), and dumpStats().
◆ writeMethod_
|
private |
Definition at line 186 of file fde.h.
Referenced by fde(), setIo(), useBufferedIo(), useDefaultIo(), and write().
◆ writeQuotaHandler
MessageBucket::Pointer fde::writeQuotaHandler |
Definition at line 144 of file fde.h.
Referenced by BandwidthBucket::SelectBucket().
◆ writeStart
The documentation for this class was generated from the following files:
- src/fde.h
- src/fde.cc
- src/tests/stub_fd.cc