#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 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 55 of file fde.h.

Member Function Documentation

◆ clear()

void fde::clear ( )
inline

Definition at line 65 of file fde.h.

Referenced by fd_close().

◆ closing()

bool fde::closing ( ) const
inline

Definition at line 68 of file fde.h.

Referenced by _comm_close(), and checkTimeouts().

◆ DumpStats()

void fde::DumpStats ( StoreEntry dumpEntry)
static

Definition at line 97 of file fde.cc.

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

Referenced by statRegisterWithCacheManager().

◆ dumpStats()

void fde::dumpStats ( StoreEntry dumpEntry,
int  fdNumber 
) const

◆ noteUse()

void fde::noteUse ( )
inline

Definition at line 91 of file fde.h.

◆ read()

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

Definition at line 80 of file fde.h.

◆ readPending()

bool fde::readPending ( int  fdNumber) const

Definition at line 64 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 126 of file fde.cc.

References buf, 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 23 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 50 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 34 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 81 of file fde.h.

Member Data Documentation

◆ bytes_read

int64_t fde::bytes_read = 0

Definition at line 127 of file fde.h.

Referenced by dumpStats(), fd_bytes(), and fdDumpOpen().

◆ bytes_written

int64_t fde::bytes_written = 0

Definition at line 128 of file fde.h.

Referenced by dumpStats(), fd_bytes(), and fdDumpOpen().

◆ clientInfo

ClientInfo* fde::clientInfo = nullptr

Definition at line 136 of file fde.h.

Referenced by BandwidthBucket::SelectBucket().

◆ closeHandler

AsyncCall::Pointer fde::closeHandler

Definition at line 150 of file fde.h.

Referenced by comm_poll_tcp_incoming(), commCallCloseHandlers(), and examine_select().

◆ codeContext

CodeContextPointer fde::codeContext

Definition at line 174 of file fde.h.

Referenced by checkTimeouts(), commIncomingStats(), and epolltype_atoi().

◆ desc

char fde::desc[FD_DESC_SZ]

Definition at line 108 of file fde.h.

Referenced by comm_poll_tcp_incoming(), dumpStats(), examine_select(), fd_close(), fd_note(), and fdDumpOpen().

◆ disk

_fde_disk fde::disk

Definition at line 141 of file fde.h.

Referenced by diskHandleRead(), diskHandleWrite(), and file_write().

◆ dynamicTlsContext

Security::ContextPointer fde::dynamicTlsContext

Definition at line 153 of file fde.h.

Referenced by comm_close_complete().

◆ epoll_state

unsigned fde::epoll_state = 0

Definition at line 139 of file fde.h.

Referenced by commIncomingStats(), epolltype_atoi(), and fd_open().

◆ flags

◆ halfClosedReader

AsyncCall::Pointer fde::halfClosedReader

Definition at line 151 of file fde.h.

◆ ipaddr

char fde::ipaddr[MAX_IPSTRLEN]

Definition at line 107 of file fde.h.

Referenced by comm_connect_addr(), Comm::TcpAcceptor::oldAccept(), and remoteAddr().

◆ lifetime_data

void* fde::lifetime_data = nullptr

Definition at line 149 of file fde.h.

◆ local_addr

◆ 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 164 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 104 of file fde.h.

◆ pconn

struct { ... } fde::pconn

◆ read_data

void* fde::read_data = nullptr

◆ read_handler

◆ readMethod_

READ_HANDLER* fde::readMethod_ = nullptr
private

Definition at line 178 of file fde.h.

Referenced by setIo(), useBufferedIo(), and useDefaultIo().

◆ remote_port

unsigned short fde::remote_port = 0

Definition at line 99 of file fde.h.

Referenced by comm_connect_addr(), Comm::TcpAcceptor::oldAccept(), and remoteAddr().

◆ sock_family

int fde::sock_family = 0

◆ ssl

Definition at line 152 of file fde.h.

Referenced by _comm_close(), and comm_close_complete().

◆ Table

fde * fde::Table = nullptr
static

Definition at line 96 of file fde.h.

◆ timeout

◆ timeoutHandler

◆ 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 159 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 102 of file fde.h.

◆ type

◆ uses

int fde::uses = 0

Definition at line 131 of file fde.h.

◆ write_data

◆ write_handler

◆ writeMethod_

WRITE_HANDLER* fde::writeMethod_ = nullptr
private

Definition at line 179 of file fde.h.

Referenced by setIo(), useBufferedIo(), and useDefaultIo().

◆ writeQuotaHandler

MessageBucket::Pointer fde::writeQuotaHandler

◆ writeStart

time_t fde::writeStart = 0

Definition at line 148 of file fde.h.


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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors