1 /* Inline QOS functions */
4 Ip::Qos::setSockTos(int fd, tos_t tos)
7 int x = setsockopt(fd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos_t));
9 debugs(50, 2, "Ip::Qos::setSockTos: setsockopt(IP_TOS) on FD " << fd << ": " << xstrerror());
12 debugs(50, DBG_IMPORTANT, "WARNING: setsockopt(IP_TOS) not supported on this platform");
18 Ip::Qos::setSockNfmark(int fd, nfmark_t mark)
21 int x = setsockopt(fd, SOL_SOCKET, SO_MARK, &mark, sizeof(nfmark_t));
23 debugs(50, 2, "setSockNfmark: setsockopt(SO_MARK) on FD " << fd << ": " << xstrerror());
26 debugs(50, DBG_IMPORTANT, "WARNING: setsockopt(SO_MARK) not supported on this platform");
32 Ip::Qos::Config::isHitTosActive() const
34 return (tosLocalHit || tosSiblingHit || tosParentHit || tosMiss || preserveMissTos);
38 Ip::Qos::Config::isHitNfmarkActive() const
40 return (markLocalHit || markSiblingHit || markParentHit || markMiss || preserveMissMark);
44 Ip::Qos::Config::isAclNfmarkActive() const
46 acl_nfmark * nfmarkAcls [] = { nfmarkToServer, nfmarkToClient };
48 for (int i=0; i<2; i++) {
49 while (nfmarkAcls[i]) {
50 acl_nfmark *l = nfmarkAcls[i];
53 nfmarkAcls[i] = l->next;
61 Ip::Qos::Config::isAclTosActive() const
63 acl_tos * tosAcls [] = { tosToServer, tosToClient };
65 for (int i=0; i<2; i++) {
67 acl_tos *l = tosAcls[i];