/* 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);
+ const tos_t tos = GetTosToServer(request);
+ Ip::Qos::setSockTos(temp, tos);
}
#if SO_MARK
if (Ip::Qos::TheConfig.isAclNfmarkActive()) {
- temp->nfmark = GetNfmarkToServer(request);
- Ip::Qos::setSockNfmark(temp, temp->nfmark);
+ const nfmark_t nfmark = GetNfmarkToServer(request);
+ Ip::Qos::setSockNfmark(temp, nfmark);
}
#endif
>eui Client source EUI (MAC address, EUI-48 or EUI-64 identifier)
>la Local IP address the client connected to
>lp Local port number the client connected to
+ >qos Client connection TOS/DSCP value set by Squid
+ >nfmark Client connection netfilter mark set by Squid
la Local listening IP address the client connection was connected to.
lp Local listening port number the client connection was connected to.
<p Server port number of the last server or peer connection
<la Local IP address of the last server or peer connection
<lp Local port number of the last server or peer connection
+ <qos Server connection TOS/DSCP value set by Squid
+ <nfmark Server connection netfilter mark set by Squid
Time related format codes:
c->remote = remote;
c->peerType = peerType;
c->tos = tos;
+ c->nfmark = nfmark;
c->flags = flags;
// ensure FD is not open in the new copy.
LFT_CLIENT_LOCAL_IP,
LFT_CLIENT_LOCAL_PORT,
/*LFT_CLIENT_LOCAL_FQDN, (rDNS) */
+ LFT_CLIENT_LOCAL_TOS,
+ LFT_CLIENT_LOCAL_NFMARK,
/* client connection local squid.conf details */
LFT_LOCAL_LISTENING_IP,
LFT_SERVER_LOCAL_IP,
LFT_SERVER_LOCAL_IP_OLD_27,
LFT_SERVER_LOCAL_PORT,
+ LFT_SERVER_LOCAL_TOS,
+ LFT_SERVER_LOCAL_NFMARK,
/* original Request-Line details recieved from client */
LFT_CLIENT_REQ_METHOD,
}
break;
+ case LFT_CLIENT_LOCAL_TOS:
+ if (al->tcpClient != NULL) {
+ snprintf(tmp, sizeof(tmp), "0x%x", (uint32_t)al->tcpClient->tos);
+ out = tmp;
+ }
+ break;
+
+ case LFT_CLIENT_LOCAL_NFMARK:
+ if (al->tcpClient != NULL) {
+ snprintf(tmp, sizeof(tmp), "0x%x", al->tcpClient->nfmark);
+ out = tmp;
+ }
+ break;
+
case LFT_LOCAL_LISTENING_PORT:
if (al->cache.port) {
outint = al->cache.port->s.port();
break;
+ case LFT_SERVER_LOCAL_TOS:
+ if (al->hier.tcpServer != NULL) {
+ snprintf(tmp, sizeof(tmp), "0x%x", (uint32_t)al->hier.tcpServer->tos);
+ out = tmp;
+ }
+ break;
+
+ case LFT_SERVER_LOCAL_NFMARK:
+ if (al->hier.tcpServer != NULL) {
+ snprintf(tmp, sizeof(tmp), "0x%x", al->hier.tcpServer->nfmark);
+ out = tmp;
+ }
+ break;
+
case LFT_TIME_SECONDS_SINCE_EPOCH:
// some platforms store time in 32-bit, some 64-bit...
outoff = static_cast<int64_t>(current_time.tv_sec);
}
break;
#endif
+
case LFT_NOTE:
if (fmt->data.string) {
#if USE_ADAPTATION
{"<la", LFT_SERVER_LOCAL_IP},
{"oa", LFT_SERVER_LOCAL_IP_OLD_27},
{"<lp", LFT_SERVER_LOCAL_PORT},
- /* {"ot", LFT_PEER_OUTGOING_TOS}, */
{"ts", LFT_TIME_SECONDS_SINCE_EPOCH},
{"tu", LFT_TIME_SUBSECOND},
/// Miscellaneous >2 byte tokens
static TokenTableEntry TokenTableMisc[] = {
{">eui", LFT_CLIENT_EUI},
+ {">qos", LFT_CLIENT_LOCAL_TOS},
+ {"<qos", LFT_SERVER_LOCAL_TOS},
+ {">nfmark", LFT_CLIENT_LOCAL_NFMARK},
+ {"<nfmark", LFT_SERVER_LOCAL_NFMARK},
{"err_code", LFT_SQUID_ERROR },
{"err_detail", LFT_SQUID_ERROR_DETAIL },
{"note", LFT_NOTE },
int x = setsockopt(conn->fd, IPPROTO_IP, IP_TOS, &bTos, sizeof(bTos));
if (x < 0)
debugs(50, 2, "Ip::Qos::setSockTos: setsockopt(IP_TOS) on " << conn << ": " << xstrerror());
+ else
+ conn->tos = tos;
return x;
#else
debugs(50, DBG_IMPORTANT, "WARNING: setsockopt(IP_TOS) not supported on this platform");
int x = setsockopt(conn->fd, SOL_SOCKET, SO_MARK, &mark, sizeof(nfmark_t));
if (x < 0)
debugs(50, 2, "setSockNfmark: setsockopt(SO_MARK) on " << conn << ": " << xstrerror());
+ else
+ conn->nfmark = mark;
return x;
#elif USE_LIBCAP
debugs(50, DBG_IMPORTANT, "WARNING: setsockopt(SO_MARK) not supported on this platform");