#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) | 
| const char * | 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()
| 
 | inline | 
◆ closing()
| 
 | inline | 
Definition at line 75 of file fde.h.
References fde::_fde_flags::close_request, and flags.
Referenced by _comm_close(), and checkTimeouts().
◆ 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()
| const char * 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_.
Referenced by fd_open().
◆ 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(), fd_bytes(), and fdDumpOpen().
◆ bytes_written
| int64_t fde::bytes_written = 0 | 
Definition at line 135 of file fde.h.
Referenced by dumpStats(), fd_bytes(), and fdDumpOpen().
◆ clientInfo
| ClientInfo* fde::clientInfo = nullptr | 
Definition at line 143 of file fde.h.
Referenced by BandwidthBucket::SelectBucket().
◆ closeHandler
| AsyncCall::Pointer fde::closeHandler | 
Definition at line 157 of file fde.h.
Referenced by commCallCloseHandlers(), and examine_select().
◆ codeContext
| CodeContextPointer fde::codeContext | 
Definition at line 181 of file fde.h.
Referenced by checkTimeouts().
◆ desc
| char fde::desc[FD_DESC_SZ] | 
Definition at line 115 of file fde.h.
Referenced by dumpStats(), examine_select(), fd_close(), fd_note(), fdDumpOpen(), and fde().
◆ disk
| _fde_disk fde::disk | 
Definition at line 148 of file fde.h.
Referenced by diskHandleRead(), diskHandleWrite(), and file_write().
◆ dynamicTlsContext
| Security::ContextPointer fde::dynamicTlsContext | 
◆ epoll_state
◆ flags
| struct fde::_fde_flags fde::flags | 
Referenced by _comm_close(), Comm::TcpAcceptor::acceptInto(), AlreadyTimedOut(), closing(), comm_connect_addr(), comm_local_port(), commCloseAllSockets(), commSetConnTimeout(), commUnsetFdTimeout(), diskHandleWrite(), Comm::DoSelect(), dumpStats(), fd_close(), fd_open(), fdDumpOpen(), file_close(), file_write(), setIo(), Comm::SetSelect(), useBufferedIo(), and useDefaultIo().
◆ halfClosedReader
| AsyncCall::Pointer fde::halfClosedReader | 
◆ ipaddr
| char fde::ipaddr[MAX_IPSTRLEN] | 
Definition at line 114 of file fde.h.
Referenced by Comm::TcpAcceptor::acceptInto(), comm_connect_addr(), fde(), and remoteAddr().
◆ lifetime_data
◆ local_addr
| Ip::Address fde::local_addr | 
Definition at line 108 of file fde.h.
Referenced by Comm::TcpAcceptor::acceptInto(), comm_connect_addr(), comm_init_opened(), comm_local_port(), and 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 | 
◆ pconn
| struct { ... } fde::pconn | 
Referenced by noteUse().
◆ read_data
| void* fde::read_data = nullptr | 
Definition at line 150 of file fde.h.
Referenced by Comm::DoSelect(), file_close(), and Comm::SetSelect().
◆ read_handler
| PF* fde::read_handler | 
Definition at line 149 of file fde.h.
Referenced by Comm::DoSelect(), examine_select(), fd_close(), fde(), file_close(), readPending(), and Comm::SetSelect().
◆ 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 Comm::TcpAcceptor::acceptInto(), comm_connect_addr(), and remoteAddr().
◆ sock_family
| int fde::sock_family = 0 | 
Definition at line 113 of file fde.h.
Referenced by Comm::TcpAcceptor::acceptInto(), comm_connect_addr(), comm_init_opened(), and comm_local_port().
◆ ssl
| Security::SessionPointer fde::ssl | 
Definition at line 159 of file fde.h.
Referenced by _comm_close().
◆ 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 AlreadyTimedOut(), Comm::ConnOpener::cleanFd(), commSetConnTimeout(), commUnsetFdTimeout(), dumpStats(), and Comm::SetSelect().
◆ timeoutHandler
| AsyncCall::Pointer fde::timeoutHandler | 
Definition at line 153 of file fde.h.
Referenced by checkTimeouts(), Comm::ConnOpener::cleanFd(), commCloseAllSockets(), commSetConnTimeout(), commUnsetFdTimeout(), dumpStats(), and examine_select().
◆ 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 _comm_close(), commCloseAllSockets(), dumpStats(), examine_select(), fd_close(), fd_open(), readPending(), and remoteAddr().
◆ uses
◆ write_data
| void* fde::write_data = nullptr | 
Definition at line 152 of file fde.h.
Referenced by Comm::ConnOpener::cleanFd(), Comm::DoSelect(), and Comm::SetSelect().
◆ write_handler
| PF* fde::write_handler | 
Definition at line 151 of file fde.h.
Referenced by Comm::ConnOpener::cleanFd(), Comm::DoSelect(), dumpStats(), examine_select(), fd_close(), fde(), file_close(), and Comm::SetSelect().
◆ 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 checkTimeouts(), MessageBucket::scheduleWrite(), and 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
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products
