Ip::Qos Namespace Reference

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. More...
 

Detailed Description

QOS namespace contains all the QOS functionality: global functions within the namespace and the configuration parameters within a config class.

Enumeration Type Documentation

◆ ConnectionDirection

Enumerator
dirAccepted 

accepted (from a client by Squid)

dirOpened 

opened (by Squid to an origin server or peer)

Definition at line 68 of file QosConfig.h.

Function Documentation

◆ doNfmarkLocalHit()

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.

Parameters
connDescriptor of socket to set the mark for

Definition at line 275 of file QosConfig.cc.

References conn, debugs, setSockNfmark(), and TheConfig.

Referenced by clientReplyContext::doGetMoreData().

◆ doNfmarkLocalMiss()

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.

Parameters
connDescriptor of socket to set the mark for
hierCodeHier code of request

Definition at line 247 of file QosConfig.cc.

References conn, debugs, 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, Adaptation::Ecap::TheConfig, and TheConfig.

Referenced by clientReplyContext::sendMoreData().

◆ doTosLocalHit()

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.

Parameters
connDescriptor of socket to set the TOS for

Definition at line 268 of file QosConfig.cc.

References conn, debugs, setSockTos(), and TheConfig.

Referenced by clientReplyContext::doGetMoreData().

◆ doTosLocalMiss()

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.

Parameters
connDescriptor of socket to set the TOS for
hierCodeHier code of request

Definition at line 226 of file QosConfig.cc.

References conn, debugs, fd_table, PARENT_HIT, Ip::Qos::Config::preserveMissTosMask, setSockTos(), SIBLING_HIT, Adaptation::Ecap::TheConfig, TheConfig, Ip::Qos::Config::tosMiss, Ip::Qos::Config::tosMissMask, Ip::Qos::Config::tosParentHit, and Ip::Qos::Config::tosSiblingHit.

Referenced by clientReplyContext::sendMoreData().

◆ getNfConnmark()

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

Parameters
connPointer to connection to get mark for
connDirSpecifies connection type (incoming or outgoing)

Definition at line 146 of file QosConfig.cc.

References conn, debugs, dirAccepted, and xstrerr().

Referenced by Comm::TcpAcceptor::acceptInto(), and FwdState::dispatch().

◆ getTosFromServer()

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

Parameters
serverServer side descriptor of connection to get TOS for
clientFdePointer to client side fde instance to set tosFromServer in

Definition at line 43 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, and xstrerr().

Referenced by FwdState::dispatch().

◆ setNfConnmark()

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.

Parameters
connPointer to connection to set mark on
connDirSpecifies connection type (incoming or outgoing) @cm Netfilter mark configuration (mark and mask)

Definition at line 181 of file QosConfig.cc.

References Ip::NfMarkConfig::applyToMark(), conn, debugs, dirAccepted, and xstrerr().

Referenced by ClientHttpRequest::doCallouts().

◆ setSockNfmark() [1/2]

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

Parameters
connDescriptor of socket to set the mark for

Definition at line 602 of file QosConfig.cc.

References conn, and setSockNfmark().

Referenced by Comm::ConnOpener::createFd(), ClientHttpRequest::doCallouts(), doNfmarkLocalHit(), doNfmarkLocalMiss(), ResetMarkingsToServer(), and setSockNfmark().

◆ setSockNfmark() [2/2]

int Ip::Qos::setSockNfmark ( const int  fd,
nfmark_t  mark 
)

The low level variant of setSockNfmark function to set the netfilter mark value of packets. Avoid if you can use the Connection-based setSockNfmark().

Parameters
fdDescriptor of socket to set the mark for

Definition at line 578 of file QosConfig.cc.

References DBG_IMPORTANT, debugs, and xstrerr().

◆ setSockTos() [1/2]

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.

Parameters
connDescriptor of socket to set the TOS for

Definition at line 570 of file QosConfig.cc.

References conn, and setSockTos().

Referenced by Comm::ConnOpener::createFd(), ClientHttpRequest::doCallouts(), doTosLocalHit(), doTosLocalMiss(), ResetMarkingsToServer(), and setSockTos().

◆ setSockTos() [2/2]

int Ip::Qos::setSockTos ( const int  fd,
tos_t  tos,
int  type 
)

The low level variant of setSockTos function to set TOS value of packets. Avoid if you can use the Connection-based setSockTos().

Parameters
fdDescriptor of socket to set the TOS for
typeThe socket family, AF_INET or AF_INET6

Definition at line 530 of file QosConfig.cc.

References DBG_IMPORTANT, debugs, and xstrerr().

Variable Documentation

◆ TheConfig

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors