assert(http->out.offset == 0);
if (Ip::Qos::TheConfig.isHitTosActive()) {
- Ip::Qos::doTosLocalHit(http->getConn()->fd);
+ Ip::Qos::doTosLocalHit(http->getConn()->clientConn);
}
if (Ip::Qos::TheConfig.isHitNfmarkActive()) {
- Ip::Qos::doNfmarkLocalHit(http->getConn()->fd);
+ Ip::Qos::doNfmarkLocalHit(http->getConn()->clientConn);
}
localTempBuffer.offset = reqofs;
ch.my_addr = request->my_addr;
tos_t tos = aclMapTOS(Ip::Qos::TheConfig.tosToClient, &ch);
if (tos)
- Ip::Qos::setSockTos(getConn()->clientConn->fd, tos);
+ Ip::Qos::setSockTos(getConn()->clientConn, tos);
}
}
ch.my_addr = request->my_addr;
nfmark_t mark = aclMapNfmark(Ip::Qos::TheConfig.nfmarkToClient, &ch);
if (mark)
- Ip::Qos::setSockNfmark(getConn()->clientConn->fd, mark);
+ Ip::Qos::setSockNfmark(getConn()->clientConn, mark);
}
}
conn->flags |= COMM_DOBIND;
/* attempt native enabled port. */
- conn->fd = comm_openex(sock_type, proto, conn->local, conn->flags, 0, note);
+ conn->fd = comm_openex(sock_type, proto, conn->local, conn->flags, 0, 0, note);
}
int
int new_socket;
struct addrinfo *AI = NULL;
+ // temporary for the transition. comm_openex will eventually have a conn to play with.
+ Comm::ConnectionPointer conn = new Comm::Connection;
+ conn->local = addr;
+
PROF_start(comm_open);
/* Create socket for accepting new connections. */
statCounter.syscalls.sock.sockets++;
AI->ai_socktype = sock_type;
AI->ai_protocol = proto;
- debugs(50, 3, "comm_openex: Attempt open socket for: " << addr );
-
+ debugs(50, 3, "comm_openex: Attempt open socket for: " << conn );
new_socket = socket(AI->ai_family, AI->ai_socktype, AI->ai_protocol);
/* under IPv6 there is the possibility IPv6 is present but disabled. */
return -1;
}
- debugs(50, 3, "comm_openex: Opened socket FD " << new_socket << " : family=" << AI->ai_family << ", type=" << AI->ai_socktype << ", protocol=" << AI->ai_protocol );
+ conn->fd = new_socket;
+
+ debugs(50, 3, "comm_openex: Opened socket " << conn << " : family=" << AI->ai_family << ", type=" << AI->ai_socktype << ", protocol=" << AI->ai_protocol );
/* set TOS if needed */
if (tos)
- Ip::Qos::setSockTos(new_socket, tos);
+ Ip::Qos::setSockTos(conn, tos);
/* set netfilter mark if needed */
if (nfmark)
- Ip::Qos::setSockNfmark(new_socket, nfmark);
+ Ip::Qos::setSockNfmark(conn, nfmark);
if ( Ip::EnableIpv6&IPV6_SPECIAL_SPLITSTACK && addr.IsIPv6() )
- comm_set_v6only(new_socket, 1);
+ comm_set_v6only(conn->fd, 1);
/* Windows Vista supports Dual-Sockets. BUT defaults them to V6ONLY. Turn it OFF. */
/* Other OS may have this administratively disabled for general use. Same deal. */
if ( Ip::EnableIpv6&IPV6_SPECIAL_V4MAPPING && addr.IsIPv6() )
- comm_set_v6only(new_socket, 0);
+ comm_set_v6only(conn->fd, 0);
- // temporary for te transition. comm_openex will eventually have a conn to play with.
- Comm::ConnectionPointer temp = new Comm::Connection;
- temp->fd = new_socket;
- temp->local = addr;
- comm_init_opened(temp, tos, nfmark, note, AI);
- new_socket = comm_apply_flags(new_socket, addr, flags, AI);
+ comm_init_opened(conn, tos, nfmark, note, AI);
+ new_socket = comm_apply_flags(conn->fd, addr, flags, AI);
addr.FreeAddrInfo(AI);
PROF_stop(comm_open);
+ // XXX transition only. prevent conn from closing the new FD on functio exit.
+ conn->fd = -1;
return new_socket;
}
conn_->local.SetIPv4();
}
#endif
- conn_->fd = comm_openex(SOCK_STREAM, IPPROTO_TCP, conn_->local, conn_->flags, conn_->tos, host_);
+ conn_->fd = comm_openex(SOCK_STREAM, IPPROTO_TCP, conn_->local, conn_->flags, conn_->tos, conn_->nfmark, host_);
if (!conn_->isOpen()) {
doneConnecting(COMM_ERR_CONNECT, 0);
return;
int fd;
/** Quality of Service TOS values currently sent on this connection */
- int tos;
+ tos_t tos;
+
+ /** Netfilter MARK values currently sent on this connection */
+ nfmark_t nfmark;
/** COMM flags set on this connection */
int flags;
updateHierarchyInfo();
comm_add_close_handler(serverConnection()->fd, fwdServerClosedWrapper, this);
+
+ /* Update server side TOS and Netfilter mark on the connection. */
+ if (Ip::Qos::TheConfig.isAclTosActive()) {
+ temp->tos = GetTosToServer(request);
+ Ip::Qos::setSockTos(temp, temp->tos);
+ }
+#if SO_MARK
+ if (Ip::Qos::TheConfig.isAclNfmarkActive()) {
+ temp->nfmark = GetNfmarkToServer(request);
+ Ip::Qos::setSockNfmark(temp, temp->nfmark);
+ }
+#endif
+
dispatch();
return;
}
entry->mem_obj->checkUrlChecksum();
#endif
+ /* Get the server side TOS and Netfilter mark to be set on the connection. */
+ if (Ip::Qos::TheConfig.isAclTosActive()) {
+ serverDestinations[0]->tos = GetTosToServer(request);
+ }
+#if SO_MARK
+ if (Ip::Qos::TheConfig.isAclNfmarkActive()) {
+ serverDestinations[0]->nfmark = GetNfmarkToServer(request);
+ }
+#endif
+
AsyncCall::Pointer call = commCbCall(17,3, "fwdConnectDoneWrapper", CommConnectCbPtrFun(fwdConnectDoneWrapper, this));
Comm::ConnOpener *cs = new Comm::ConnOpener(serverDestinations[0], call, ctimeout);
cs->setHost(host);
*/
assert(Comm::IsConnOpen(serverConn));
- tos_t tos = GetTosToServer(request);
-
-#if SO_MARK
- nfmark_t mark = GetNfmarkToServer(request);
- debugs(17, 3, HERE << "got outgoing addr " << serverConn << ", tos " << int(tos)
- << ", netfilter mark " << mark);
-#else
- nfmark_t mark = 0;
- debugs(17, 3, HERE << "got outgoing addr " << serverConn << ", tos " << int(tos));
-#endif
-
fd_note(serverConnection()->fd, entry->url());
fd_table[serverConnection()->fd].noteUse(fwdPconnPool);
netdbPingSite(request->GetHost());
- /* Update server side TOS and Netfilter mark if using persistent connections. */
- if (Config.onoff.server_pconns) {
- if (Ip::Qos::TheConfig.isAclTosActive()) {
- tos_t tos = GetTosToServer(request);
- Ip::Qos::setSockTos(server_fd, tos);
- }
-#if SO_MARK
- if (Ip::Qos::TheConfig.isAclNfmarkActive()) {
- nfmark_t mark = GetNfmarkToServer(request);
- Ip::Qos::setSockNfmark(server_fd, mark);
- }
-#endif
- }
-
/* Retrieves remote server TOS or MARK value, and stores it as part of the
* original client request FD object. It is later used to forward
* remote server's TOS/MARK in the response to the client in case of a MISS.
*/
if (Ip::Qos::TheConfig.isHitNfmarkActive()) {
- fde * clientFde = &fd_table[clientConn->fd]; // XXX: move the fd_table access into Ip::Qos
- fde * servFde = &fd_table[serverConnection()->fd];
- if (clientFde && servFde) {
+ if (Comm::IsConnOpen(clientConn) && Comm::IsConnOpen(serverConnection())) {
+ fde * clientFde = &fd_table[clientConn->fd]; // XXX: move the fd_table access into Ip::Qos
/* Get the netfilter mark for the connection */
- Ip::Qos::getNfmarkFromServer(serverConnection()->fd, servFde, clientFde);
+ Ip::Qos::getNfmarkFromServer(serverConnection(), clientFde);
}
}
#if _SQUID_LINUX_
/* Bug 2537: The TOS forward part of QOS only applies to patched Linux kernels. */
if (Ip::Qos::TheConfig.isHitTosActive()) {
- fde * clientFde = &fd_table[clientConn->fd]; // XXX: move the fd_table access into Ip::Qos
- if (clientFde) {
+ if (Comm::IsConnOpen(clientConn)) {
+ fde * clientFde = &fd_table[clientConn->fd]; // XXX: move the fd_table access into Ip::Qos
/* Get the TOS value for the packet */
- Ip::Qos::getTosFromServer(serverConnection()->fd, clientFde);
+ Ip::Qos::getTosFromServer(serverConnection(), clientFde);
}
}
#endif
}
}
+// XXX: convert this to accepting a serverConn and migrate to QosConfig.cc
tos_t
GetTosToServer(HttpRequest * request)
{
return aclMapTOS(Ip::Qos::TheConfig.tosToServer, &ch);
}
+// XXX: convert this to accepting a serverConn and migrate to QosConfig.cc
nfmark_t
GetNfmarkToServer(HttpRequest * request)
{
/* Inline QOS functions */
+#include "comm/Connection.h"
int
-Ip::Qos::setSockTos(int fd, tos_t tos)
+Ip::Qos::setSockTos(const Comm::ConnectionPointer &conn, tos_t tos)
{
#ifdef IP_TOS
- int x = setsockopt(fd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos_t));
+ int x = setsockopt(conn->fd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos_t));
if (x < 0)
- debugs(50, 2, "Ip::Qos::setSockTos: setsockopt(IP_TOS) on FD " << fd << ": " << xstrerror());
+ debugs(50, 2, "Ip::Qos::setSockTos: setsockopt(IP_TOS) on " << conn << ": " << xstrerror());
return x;
#else
debugs(50, DBG_IMPORTANT, "WARNING: setsockopt(IP_TOS) not supported on this platform");
}
int
-Ip::Qos::setSockNfmark(int fd, nfmark_t mark)
+Ip::Qos::setSockNfmark(const Comm::ConnectionPointer &conn, nfmark_t mark)
{
#if SO_MARK
- int x = setsockopt(fd, SOL_SOCKET, SO_MARK, &mark, sizeof(nfmark_t));
+ int x = setsockopt(conn->fd, SOL_SOCKET, SO_MARK, &mark, sizeof(nfmark_t));
if (x < 0)
- debugs(50, 2, "setSockNfmark: setsockopt(SO_MARK) on FD " << fd << ": " << xstrerror());
+ debugs(50, 2, "setSockNfmark: setsockopt(SO_MARK) on " << conn << ": " << xstrerror());
return x;
#else
debugs(50, DBG_IMPORTANT, "WARNING: setsockopt(SO_MARK) not supported on this platform");
#include "squid.h"
#include "acl/Gadgets.h"
+#include "comm/Connection.h"
#include "ConfigParser.h"
#include "fde.h"
#include "hier_code.h"
/* Qos namespace */
void
-Ip::Qos::getTosFromServer(const int server_fd, fde *clientFde)
+Ip::Qos::getTosFromServer(const Comm::ConnectionPointer &server, fde *clientFde)
{
#if USE_QOS_TOS && _SQUID_LINUX_
/* Bug 2537: This part of ZPH only applies to patched Linux kernels. */
tos_t tos = 1;
- int tos_len = sizeof(tos);
+ int tos_len = sizeof(tos);
clientFde->tosFromServer = 0;
- if (setsockopt(server_fd,SOL_IP,IP_RECVTOS,&tos,tos_len)==0) {
+ if (setsockopt(server->fd,SOL_IP,IP_RECVTOS,&tos,tos_len)==0) {
unsigned char buf[512];
int len = 512;
- if (getsockopt(server_fd,SOL_IP,IP_PKTOPTIONS,buf,(socklen_t*)&len) == 0) {
+ if (getsockopt(server->fd,SOL_IP,IP_PKTOPTIONS,buf,(socklen_t*)&len) == 0) {
/* Parse the PKTOPTIONS structure to locate the TOS data message
* prepared in the kernel by the ZPH incoming TCP TOS preserving
* patch.
pbuf += CMSG_LEN(o->cmsg_len);
}
} else {
- debugs(33, 1, "QOS: error in getsockopt(IP_PKTOPTIONS) on FD " << server_fd << " " << xstrerror());
+ debugs(33, DBG_IMPORTANT, "QOS: error in getsockopt(IP_PKTOPTIONS) on " << server << " " << xstrerror());
}
} else {
- debugs(33, 1, "QOS: error in setsockopt(IP_RECVTOS) on FD " << server_fd << " " << xstrerror());
+ debugs(33, DBG_IMPORTANT, "QOS: error in setsockopt(IP_RECVTOS) on " << server << " " << xstrerror());
}
#endif
}
-void Ip::Qos::getNfmarkFromServer(const int server_fd, const fde *servFde, const fde *clientFde)
+void Ip::Qos::getNfmarkFromServer(const Comm::ConnectionPointer &server, const fde *clientFde)
{
#if USE_LIBNETFILTERCONNTRACK
/* Allocate a new conntrack */
* port numbers.
*/
- Ip::Address serv_fde_local_conn;
- struct addrinfo *addr = NULL;
- serv_fde_local_conn.InitAddrInfo(addr);
- getsockname(server_fd, addr->ai_addr, &(addr->ai_addrlen));
- serv_fde_local_conn = *addr;
- serv_fde_local_conn.GetAddrInfo(addr);
-
- unsigned short serv_fde_local_port = ((struct sockaddr_in*)addr->ai_addr)->sin_port;
- struct in6_addr serv_fde_local_ip6;
- struct in_addr serv_fde_local_ip;
-
- if (Ip::EnableIpv6 && serv_fde_local_conn.IsIPv6()) {
- serv_fde_local_ip6 = ((struct sockaddr_in6*)addr->ai_addr)->sin6_addr;
+ if (Ip::EnableIpv6 && server->local.IsIPv6()) {
nfct_set_attr_u8(ct, ATTR_L3PROTO, AF_INET6);
struct in6_addr serv_fde_remote_ip6;
- inet_pton(AF_INET6,servFde->ipaddr,(struct in6_addr*)&serv_fde_remote_ip6);
+ server->remote.GetAddr(&serv_fde_remote_ip6);
nfct_set_attr(ct, ATTR_IPV6_DST, serv_fde_remote_ip6.s6_addr);
- nfct_set_attr(ct, ATTR_IPV6_SRC, serv_fde_local_ip6.s6_addr);
+ struct in6_addr serv_fde_local_ip6;
+ server->local.GetAddr(serv_fde_local_ip6);
+ nfct_set_attr(ct, ATTR_IPV6_SRC, serv_fde_local_ip6.s6_addr);
} else {
- serv_fde_local_ip = ((struct sockaddr_in*)addr->ai_addr)->sin_addr;
nfct_set_attr_u8(ct, ATTR_L3PROTO, AF_INET);
- nfct_set_attr_u32(ct, ATTR_IPV4_DST, inet_addr(servFde->ipaddr));
- nfct_set_attr_u32(ct, ATTR_IPV4_SRC, serv_fde_local_ip.s_addr);
+ struct in6_addr serv_fde_remote_ip;
+ server->remote.GetAddr(&serv_fde_remote_ip);
+ nfct_set_attr_u32(ct, ATTR_IPV4_DST, serv_fde_remote_ip.s_addr);
+ struct in_addr serv_fde_local_ip;
+ server->local.GetAddr(serv_fde_local_ip);
+ nfct_set_attr_u32(ct, ATTR_IPV4_SRC, serv_fde_local_ip.s_addr);
}
nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_TCP);
- nfct_set_attr_u16(ct, ATTR_PORT_DST, htons(servFde->remote_port));
- nfct_set_attr_u16(ct, ATTR_PORT_SRC, serv_fde_local_port);
+ nfct_set_attr_u16(ct, ATTR_PORT_DST, htons(server->remote.GetPort()));
+ nfct_set_attr_u16(ct, ATTR_PORT_SRC, htons(server->local.GetPort()));
/* Open a handle to the conntrack */
if (struct nfct_handle *h = nfct_open(CONNTRACK, 0)) {
/* Register the callback. The callback function will record the mark value. */
- nfct_callback_register(h, NFCT_T_ALL, getNfMarkCallback, (void *)clientFde);
+ nfct_callback_register(h, NFCT_T_ALL, getNfMarkCallback, (void *)clientFde);
/* Query the conntrack table using the data previously set */
int x = nfct_query(h, NFCT_Q_GET, ct);
if (x == -1) {
- debugs(17, 2, "QOS: Failed to retrieve connection mark: (" << x << ") " << strerror(errno)
- << " (Destination " << servFde->ipaddr << ":" << servFde->remote_port
- << ", source " << serv_fde_local_conn << ")" );
+ debugs(17, 2, "QOS: Failed to retrieve connection mark: (" << x << ") " << xstrerror(errno)
+ << " (Destination " << server->remote << ", source " << server->local << ")" );
}
-
nfct_close(h);
} else {
debugs(17, 2, "QOS: Failed to open conntrack handle for upstream netfilter mark retrieval.");
#endif
int
-Ip::Qos::doTosLocalMiss(const int fd, const hier_code hierCode)
+Ip::Qos::doTosLocalMiss(const Comm::ConnectionPointer &conn, const hier_code hierCode)
{
tos_t tos = 0;
if (Ip::Qos::TheConfig.tosSiblingHit && hierCode==SIBLING_HIT) {
tos = Ip::Qos::TheConfig.tosMiss;
debugs(33, 2, "QOS: Cache miss, setting TOS=" << int(tos));
} else if (Ip::Qos::TheConfig.preserveMissTos && Ip::Qos::TheConfig.preserveMissTosMask) {
- tos = fd_table[fd].tosFromServer & Ip::Qos::TheConfig.preserveMissTosMask;
+ tos = fd_table[conn->fd].tosFromServer & Ip::Qos::TheConfig.preserveMissTosMask;
debugs(33, 2, "QOS: Preserving TOS on miss, TOS=" << int(tos));
}
- return setSockTos(fd, tos);
+ return setSockTos(conn, tos);
}
int
-Ip::Qos::doNfmarkLocalMiss(const int fd, const hier_code hierCode)
+Ip::Qos::doNfmarkLocalMiss(const Comm::ConnectionPointer &conn, const hier_code hierCode)
{
nfmark_t mark = 0;
if (Ip::Qos::TheConfig.markSiblingHit && hierCode==SIBLING_HIT) {
mark = Ip::Qos::TheConfig.markMiss;
debugs(33, 2, "QOS: Cache miss, setting Mark=" << mark);
} else if (Ip::Qos::TheConfig.preserveMissMark) {
- mark = fd_table[fd].nfmarkFromServer & Ip::Qos::TheConfig.preserveMissMarkMask;
+ mark = fd_table[conn->fd].nfmarkFromServer & Ip::Qos::TheConfig.preserveMissMarkMask;
debugs(33, 2, "QOS: Preserving mark on miss, Mark=" << mark);
}
- return setSockNfmark(fd, mark);
+ return setSockNfmark(conn, mark);
}
int
-Ip::Qos::doTosLocalHit(const int fd)
+Ip::Qos::doTosLocalHit(const Comm::ConnectionPointer &conn)
{
debugs(33, 2, "QOS: Setting TOS for local hit, TOS=" << int(Ip::Qos::TheConfig.tosLocalHit));
- return setSockTos(fd, Ip::Qos::TheConfig.tosLocalHit);
+ return setSockTos(conn, Ip::Qos::TheConfig.tosLocalHit);
}
int
-Ip::Qos::doNfmarkLocalHit(const int fd)
+Ip::Qos::doNfmarkLocalHit(const Comm::ConnectionPointer &conn)
{
debugs(33, 2, "QOS: Setting netfilter mark for local hit, mark=" << Ip::Qos::TheConfig.markLocalHit);
- return setSockNfmark(fd, Ip::Qos::TheConfig.markLocalHit);
+ return setSockNfmark(conn, Ip::Qos::TheConfig.markLocalHit);
}
/* Qos::Config class */
}
p += snprintf(p, 2, "\n");
}
-
+
if (isHitNfmarkActive()) {
p += snprintf(p, 11, "%s", name); // strlen("qos_flows ");
p += snprintf(p, 5, "%s", "mark");
#include "config.h"
#include "hier_code.h"
+#include "ip/forward.h"
#if HAVE_LIBNETFILTER_CONNTRACK_LIBNETFILTER_CONNTRACK_H
#include <libnetfilter_conntrack/libnetfilter_conntrack.h>
* 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
- * @param server_fd Server side descriptor of connection to get TOS for
+ * @param server Server side descriptor of connection to get TOS for
* @param clientFde Pointer to client side fde instance to set tosFromServer in
- */
- void getTosFromServer(const int server_fd, fde *clientFde);
-
+ */
+ void getTosFromServer(const Comm::ConnectionPointer &server, fde *clientFde);
+
/**
* Function to retrieve the netfilter mark value of the connection
* to the upstream server. Called by FwdState::dispatch if QOS
* options are enabled.
- * @param server_fd Server side descriptor of connection to get mark for
- * @param servFde Pointer to server side fde instance to get mark for
+ * @param server Server side descriptor of connection to get mark for
* @param clientFde Pointer to client side fde instance to set nfmarkFromServer in
*/
- void getNfmarkFromServer(const int server_fd, const fde *servFde, const fde *clientFde);
+ void getNfmarkFromServer(const Comm::ConnectionPointer &server, const fde *clientFde);
#if USE_LIBNETFILTERCONNTRACK
- /**
+ /**
* Callback function to mark connection once it's been found.
* This function is called by the libnetfilter_conntrack
* libraries, during nfct_query in Ip::Qos::getNfmarkFromServer.
- * nfct_callback_register is used to register this function.
+ * nfct_callback_register is used to register this function.
* @param nf_conntrack_msg_type Type of conntrack message
* @param nf_conntrack Pointer to the conntrack structure
* @param clientFde Pointer to client side fde instance to set nfmarkFromServer in
/**
* 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
+ * local cache. Called by clientReplyContext::sendMoreData if QOS is
* enabled for TOS.
- * @param fd Descriptor of socket to set the TOS for
+ * @param conn Descriptor of socket to set the TOS for
* @param hierCode Hier code of request
*/
- int doTosLocalMiss(const int fd, const hier_code hierCode);
-
+ int doTosLocalMiss(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
+ * 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.
- * @param fd Descriptor of socket to set the mark for
+ * @param conn Descriptor of socket to set the mark for
* @param hierCode Hier code of request
*/
- int doNfmarkLocalMiss(const int fd, const hier_code hierCode);
-
+ int doNfmarkLocalMiss(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* been retrieved from
* local cache. Called by clientReplyContext::doGetMoreData if QOS is
* enabled for TOS.
- * @param fd Descriptor of socket to set the TOS for
+ * @param conn Descriptor of socket to set the TOS for
*/
- int doTosLocalHit(const int fd);
-
+ int doTosLocalHit(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.
- * @param fd Descriptor of socket to set the mark for
+ * @param conn Descriptor of socket to set the mark for
*/
- int doNfmarkLocalHit(const int fd);
-
+ int doNfmarkLocalHit(const Comm::ConnectionPointer &conn);
+
/**
* Function to set the TOS value of packets. Sets the value on the socket
* which then gets copied to the packets.
- * @param fd Descriptor of socket to set the TOS for
- */
- _SQUID_INLINE_ int setSockTos(int fd, tos_t tos);
-
+ * @param conn Descriptor of socket to set the TOS for
+ */
+ _SQUID_INLINE_ int setSockTos(const Comm::ConnectionPointer &conn, tos_t tos);
+
/**
* 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
- * @param fd Descriptor of socket to set the mark for
- */
- _SQUID_INLINE_ int setSockNfmark(int fd, nfmark_t mark);
+ * @param conn Descriptor of socket to set the mark for
+ */
+ _SQUID_INLINE_ int setSockNfmark(const Comm::ConnectionPointer &conn, nfmark_t mark);
/**
* QOS configuration class. Contains all the parameters for QOS functions as well
* to find out if any Netfilter marking is required.
* This function is used on initialisation to define capabilities required (Netfilter
* marking requires CAP_NET_ADMIN).
- */
+ */
_SQUID_INLINE_ bool isAclNfmarkActive() const;
/**
// check for a configured outgoing address for this destination...
getOutgoingAddress(psstate->request, p);
- p->tos = getOutgoingTOS(psstate->request);
-
psstate->paths->push_back(p);
}
} else {