|
Squid Web Cache master
|
Classes | |
| class | Config |
Enumerations | |
| enum | ConnectionDirection { dirAccepted , dirOpened } |
| Possible Squid roles in connection handling. More... | |
Functions | |
| void | getTosFromServer (const Comm::ConnectionPointer &server, fde *clientFde) |
| nfmark_t | getNfConnmark (const Comm::ConnectionPointer &conn, const ConnectionDirection connDir) |
| bool | setNfConnmark (Comm::ConnectionPointer &conn, const ConnectionDirection connDir, const NfMarkConfig &cm) |
| int | doTosLocalMiss (const Comm::ConnectionPointer &conn, const hier_code hierCode) |
| int | doNfmarkLocalMiss (const Comm::ConnectionPointer &conn, const hier_code hierCode) |
| int | doTosLocalHit (const Comm::ConnectionPointer &conn) |
| int | doNfmarkLocalHit (const Comm::ConnectionPointer &conn) |
| int | setSockTos (const Comm::ConnectionPointer &conn, tos_t tos) |
| int | setSockTos (const int fd, tos_t tos, int type) |
| int | setSockNfmark (const Comm::ConnectionPointer &conn, nfmark_t mark) |
| int | setSockNfmark (const int fd, nfmark_t mark) |
Variables | |
| Config | TheConfig |
| Globally available instance of Qos::Config. | |
QOS namespace contains all the QOS functionality: global functions within the namespace and the configuration parameters within a config class.
| Enumerator | |
|---|---|
| dirAccepted | accepted (from a client by Squid) |
| dirOpened | opened (by Squid to an origin server or peer) |
Definition at line 70 of file QosConfig.h.
| int Ip::Qos::doNfmarkLocalHit | ( | const Comm::ConnectionPointer & | conn | ) |
Function to work out and then apply to the socket the appropriate netfilter mark value to set on packets when items have been retrieved from local cache. Called by clientReplyContext::doGetMoreData if QOS is enabled for TOS.
| conn | Descriptor of socket to set the mark for |
Definition at line 280 of file QosConfig.cc.
References debugs, setSockNfmark(), and TheConfig.
Referenced by clientReplyContext::doGetMoreData().
| int Ip::Qos::doNfmarkLocalMiss | ( | const Comm::ConnectionPointer & | conn, |
| const hier_code | hierCode | ||
| ) |
Function to work out and then apply to the socket the appropriate netfilter mark value to set on packets when items have not been retrieved from local cache. Called by clientReplyContext::sendMoreData if QOS is enabled for TOS.
| conn | Descriptor of socket to set the mark for |
| hierCode | Hier code of request |
Definition at line 252 of file QosConfig.cc.
References debugs, Comm::Connection::fd, fd_table, Ip::Qos::Config::markMiss, Ip::Qos::Config::markMissMask, Ip::Qos::Config::markParentHit, Ip::Qos::Config::markSiblingHit, PARENT_HIT, Ip::Qos::Config::preserveMissMarkMask, setSockNfmark(), SIBLING_HIT, and TheConfig.
Referenced by clientReplyContext::sendMoreData().
| int Ip::Qos::doTosLocalHit | ( | const Comm::ConnectionPointer & | conn | ) |
Function to work out and then apply to the socket the appropriate TOS value to set on packets when items have been retrieved from local cache. Called by clientReplyContext::doGetMoreData if QOS is enabled for TOS.
| conn | Descriptor of socket to set the TOS for |
Definition at line 273 of file QosConfig.cc.
References debugs, setSockTos(), and TheConfig.
Referenced by clientReplyContext::doGetMoreData().
| int Ip::Qos::doTosLocalMiss | ( | const Comm::ConnectionPointer & | conn, |
| const hier_code | hierCode | ||
| ) |
Function to work out and then apply to the socket the appropriate TOS value to set on packets when items have not been retrieved from local cache. Called by clientReplyContext::sendMoreData if QOS is enabled for TOS.
| conn | Descriptor of socket to set the TOS for |
| hierCode | Hier code of request |
Definition at line 231 of file QosConfig.cc.
References debugs, Comm::Connection::fd, fd_table, PARENT_HIT, Ip::Qos::Config::preserveMissTosMask, setSockTos(), SIBLING_HIT, TheConfig, Ip::Qos::Config::tosMiss, Ip::Qos::Config::tosMissMask, Ip::Qos::Config::tosParentHit, and Ip::Qos::Config::tosSiblingHit.
Referenced by clientReplyContext::sendMoreData().
| nfmark_t Ip::Qos::getNfConnmark | ( | const Comm::ConnectionPointer & | conn, |
| const ConnectionDirection | connDir | ||
| ) |
Function to retrieve the netfilter CONNMARK value of the connection. Called by FwdState::dispatch if QOS options are enabled or by Comm::TcpAcceptor::acceptOne
| conn | Pointer to connection to get mark for |
| connDir | Specifies connection type (incoming or outgoing) |
Definition at line 151 of file QosConfig.cc.
References debugs, dirAccepted, Comm::Connection::local, Comm::Connection::remote, and xstrerr().
Referenced by Comm::TcpAcceptor::acceptInto(), and FwdState::dispatch().
| void Ip::Qos::getTosFromServer | ( | const Comm::ConnectionPointer & | server, |
| fde * | clientFde | ||
| ) |
Function to retrieve the TOS value of the inbound packet. Called by FwdState::dispatch if QOS options are enabled. Bug 2537: This part of ZPH only applies to patched Linux kernels
| server | Server side descriptor of connection to get TOS for |
| clientFde | Pointer to client side fde instance to set tosFromServer in |
Definition at line 48 of file QosConfig.cc.
References cmsghdr::cmsg_len, CMSG_LEN, cmsghdr::cmsg_level, cmsghdr::cmsg_type, DBG_IMPORTANT, debugs, server, SQUID_CMSG_DATA, fde::tosFromServer, xgetsockopt(), xsetsockopt(), and xstrerr().
Referenced by FwdState::dispatch().
| bool Ip::Qos::setNfConnmark | ( | Comm::ConnectionPointer & | conn, |
| const ConnectionDirection | connDir, | ||
| const NfMarkConfig & | cm | ||
| ) |
Function to set the netfilter CONNMARK value on the connection. Called by ClientHttpRequest::doCallouts.
| conn | Pointer to connection to set mark on |
| connDir | Specifies connection type (incoming or outgoing) @cm Netfilter mark configuration (mark and mask) |
Definition at line 186 of file QosConfig.cc.
References Ip::NfMarkConfig::applyToMark(), debugs, dirAccepted, Comm::Connection::local, Comm::Connection::nfConnmark, Comm::Connection::remote, and xstrerr().
Referenced by ClientHttpRequest::doCallouts().
| int Ip::Qos::setSockNfmark | ( | const Comm::ConnectionPointer & | conn, |
| nfmark_t | mark | ||
| ) |
Function to set the netfilter mark value of packets. Sets the value on the socket which then gets copied to the packets. Called from Ip::Qos::doNfmarkLocalMiss
| conn | Descriptor of socket to set the mark for |
Definition at line 590 of file QosConfig.cc.
References Comm::Connection::fd, Comm::Connection::nfmark, and setSockNfmark().
Referenced by Comm::ConnOpener::createFd(), ClientHttpRequest::doCallouts(), doNfmarkLocalHit(), doNfmarkLocalMiss(), ResetMarkingsToServer(), and setSockNfmark().
The low level variant of setSockNfmark function to set the netfilter mark value of packets. Avoid if you can use the Connection-based setSockNfmark().
| fd | Descriptor of socket to set the mark for |
Definition at line 566 of file QosConfig.cc.
References DBG_IMPORTANT, debugs, xsetsockopt(), and xstrerr().
| int Ip::Qos::setSockTos | ( | const Comm::ConnectionPointer & | conn, |
| tos_t | tos | ||
| ) |
Function to set the TOS value of packets. Sets the value on the socket which then gets copied to the packets.
| conn | Descriptor of socket to set the TOS for |
Definition at line 558 of file QosConfig.cc.
References Comm::Connection::fd, Ip::Address::isIPv4(), Comm::Connection::remote, setSockTos(), and Comm::Connection::tos.
Referenced by Comm::ConnOpener::createFd(), ClientHttpRequest::doCallouts(), doTosLocalHit(), doTosLocalMiss(), ResetMarkingsToServer(), and setSockTos().
The low level variant of setSockTos function to set TOS value of packets. Avoid if you can use the Connection-based setSockTos().
| fd | Descriptor of socket to set the TOS for |
| type | The socket family, AF_INET or AF_INET6 |
Definition at line 518 of file QosConfig.cc.
References DBG_IMPORTANT, debugs, xsetsockopt(), and xstrerr().
|
extern |
Definition at line 288 of file QosConfig.cc.
Referenced by FwdState::dispatch(), ClientHttpRequest::doCallouts(), clientReplyContext::doGetMoreData(), doNfmarkLocalHit(), doNfmarkLocalMiss(), doTosLocalHit(), doTosLocalMiss(), GetNfmarkToServer(), GetTosToServer(), restoreCapabilities(), and clientReplyContext::sendMoreData().