#include <fde.h>

Collaboration diagram for fde:

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 *)
 

Public Attributes

unsigned int type = 0
 
unsigned short remote_port = 0
 
Ip::Address local_addr
 
tos_t tosToServer = '\0'
 
nfmark_t nfmarkToServer = 0
 
int sock_family = 0
 
char ipaddr [MAX_IPSTRLEN]
 
char desc [FD_DESC_SZ]
 
struct fde::_fde_flags flags
 
int64_t bytes_read = 0
 
int64_t bytes_written = 0
 
struct {
   int   uses = 0
 
pconn
 
ClientInfoclientInfo = nullptr
 pointer to client info used in client write limiter or nullptr if not present More...
 
MessageBucket::Pointer writeQuotaHandler
 response write limiter, if configured More...
 
unsigned epoll_state = 0
 
_fde_disk disk
 
PFread_handler
 
void * read_data = nullptr
 
PFwrite_handler
 
void * write_data = nullptr
 
AsyncCall::Pointer timeoutHandler
 
time_t timeout = 0
 
time_t writeStart = 0
 
void * lifetime_data = nullptr
 
AsyncCall::Pointer closeHandler
 
AsyncCall::Pointer halfClosedReader
 
Security::SessionPointer ssl
 read handler for half-closed fds More...
 
Security::ContextPointer dynamicTlsContext
 cached and then freed when fd is closed More...
 
tos_t tosFromServer = '\0'
 
unsigned int nfConnmarkFromServer = 0
 
CodeContextPointer codeContext
 What the I/O handlers are supposed to work on. More...
 

Static Public Attributes

static fdeTable = nullptr
 global table of FD and their state. More...
 

Private Attributes

READ_HANDLERreadMethod_ = nullptr
 imports bytes into Squid More...
 
WRITE_HANDLERwriteMethod_ = nullptr
 exports Squid bytes More...
 

Detailed Description

Definition at line 51 of file fde.h.

Constructor & Destructor Documentation

◆ fde()

fde::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()

void fde::clear ( )
inline

Definition at line 72 of file fde.h.

References fde().

◆ closing()

bool fde::closing ( ) const
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

◆ DumpStats()

void fde::DumpStats ( StoreEntry dumpEntry)
static

Definition at line 96 of file fde.cc.

References dumpStats(), Squid_MaxFD, storeAppendPrintf(), and Table.

Referenced by statRegisterWithCacheManager().

◆ Init()

void fde::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()

void fde::noteUse ( )
inline

Definition at line 98 of file fde.h.

References pconn.

◆ read()

int fde::read ( int  fd,
char *  buf,
int  len 
)
inline

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

int fde::write ( int  fd,
const char *  buf,
int  len 
)
inline

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

Definition at line 157 of file fde.h.

◆ codeContext

CodeContextPointer fde::codeContext

Definition at line 181 of file fde.h.

◆ desc

char fde::desc[FD_DESC_SZ]

Definition at line 115 of file fde.h.

Referenced by fde(), and dumpStats().

◆ disk

_fde_disk fde::disk

Definition at line 148 of file fde.h.

◆ dynamicTlsContext

Security::ContextPointer fde::dynamicTlsContext

Definition at line 160 of file fde.h.

◆ epoll_state

unsigned fde::epoll_state = 0

Definition at line 146 of file fde.h.

◆ flags

struct fde::_fde_flags fde::flags

◆ halfClosedReader

AsyncCall::Pointer fde::halfClosedReader

Definition at line 158 of file fde.h.

◆ ipaddr

char fde::ipaddr[MAX_IPSTRLEN]

Definition at line 114 of file fde.h.

Referenced by fde(), and remoteAddr().

◆ lifetime_data

void* fde::lifetime_data = nullptr

Definition at line 156 of file fde.h.

◆ 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

The netfilter mark for packets going towards the server. See also nfConnmarkFromServer.

Definition at line 111 of file fde.h.

◆ 

struct { ... } fde::pconn

Referenced by noteUse().

◆ read_data

void* fde::read_data = nullptr

Definition at line 150 of file fde.h.

◆ read_handler

PF* fde::read_handler

Definition at line 149 of file fde.h.

Referenced by fde(), and readPending().

◆ readMethod_

READ_HANDLER* fde::readMethod_ = nullptr
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

int fde::sock_family = 0

Definition at line 113 of file fde.h.

◆ ssl

Definition at line 159 of file fde.h.

◆ Table

fde * fde::Table = nullptr
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'

The TOS value for packets going towards the server. See also tosFromServer.

Definition at line 109 of file fde.h.

◆ type

unsigned int fde::type = 0

Definition at line 105 of file fde.h.

Referenced by dumpStats(), readPending(), and remoteAddr().

◆ uses

int fde::uses = 0

Definition at line 138 of file fde.h.

◆ 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_

WRITE_HANDLER* fde::writeMethod_ = nullptr
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

time_t fde::writeStart = 0

Definition at line 155 of file fde.h.


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors