src/adaptation/Makefile \
src/ICAP/Makefile \
src/icmp/Makefile \
+ src/ip/Makefile \
src/eCAP/Makefile \
contrib/Makefile \
snmplib/Makefile \
<UL>
<LI>Allows you to select a TOS/Diffserv value to mark local hits.</LI>
<LI>Allows you to select a TOS/Diffserv value to mark peer hits.</LI>
-<LI>Allows you to selectively set only sibling or sibling+parent requests</LI>
-<LI>Allows any HTTP response towards clients will have the TOS value of the response coming from
-the remote server masked with the value of zph_preserve_miss_tos_mask.
+<LI>Allows you to selectively mark only sibling or parent requests</LI>
+<LI>Allows any HTTP response towards clients to have the TOS value of the response coming from
+the remote server preserved.
For this to work correctly, you will need to patch your linux kernel with the TOS preserving ZPH patch.
The kernel patch can be downloaded from
<A HREF="http://zph.bratcheda.org">http://zph.bratcheda.org</A></LI>
<P>Squid 3.1 needs to be configured with --enable-zph-qos for the ZPH QoS controls to be available.</P>
<P>The configuration options for 2.7 and 3.1 are based on different ZPH patches.
-The two releases configuration differs and is not at this point directly translatable.</P>
+The two releases configuration differs and only the TOS mode settings are directly translatable.</P>
<P>
<UL>
-<LI><EM>zph_tos_local</EM> Responses found as a HIT in the local cache</LI>
-<LI><EM>zph_tos_peer</EM> Responses found as a HIT on peer caches.</LI>
-<LI><EM>zph_tos_parent</EM> Qos to Sibling caches only or all peers.</LI>
-<LI><EM>zph_preserve_miss_tos</EM> Use the same ToS settings received by Squid from the remote server,
-on the client connection. Requires a kernel patch.</LI>
+<LI><EM>qos_flows local-hit=0xff</EM> Responses found as a HIT in the local cache</LI>
+<LI><EM>qos_flows sibling-hit=0xff</EM> Responses found as a HIT in a sibling peer</LI>
+<LI><EM>qos_flows parent-hit=0xff</EM> Responses found as a HIT in a parent peer</LI>
</UL>
</P>
+<P>The lines above are spearated for documentation. qos_flows may be configured with all options on one line, or separated as shown.
+Also options may be repeated as many times as desired. Only the final configured value for any option will be used.</P>
+
+<P>The legacy Option and Priority modes available in Squid-2.7 are no longer supported.</P>
+
<H2><A NAME="ss2.7">2.7</A> <A HREF="#toc2.7">SSL Bump (for HTTPS Filtering and Adaptation)</A>
</H2>
</PRE>
</P>
-<DT><B>zph_preserve_miss_tos</B><DD>
+<DT><B>qos_flows local-hit= sibling-hit= parent-hit=</B><DD>
<P>
<PRE>
- If set to on (default), any HTTP response towards clients will
- have the TOS value of the response comming from the remote
- server masked with the value of zph_preserve_miss_tos_mask.
- For this to work correctly, you will need to patch your linux
- kernel with the TOS preserving ZPH patch.
- The kernel patch can be downloaded from http://zph.bratcheda.org
-
-</PRE>
-</P>
+ Allows you to select a TOS/DSCP value to mark outgoing
+ connections with, based on where the reply was sourced.
-<DT><B>zph_preserve_miss_tos_mask</B><DD>
-<P>
-<PRE>
- Allows you to mask certain bits in the TOS received from the
- remote server, before copying the value to the TOS send towards
- clients.
- Default: 0xFF (255) (TOS from server is not changed).
-
-</PRE>
-</P>
+ TOS values really only have local significance - so you should
+ know what you're specifying. For more information, see RFC2474,
+ RFC2475, and RFC3260.
-<DT><B>zph_tos_local</B><DD>
-<P>
-<PRE>
- Allows you to select a TOS/Diffserv value to mark local hits. Read above
- (tcp_outgoing_tos) for details/requirements about TOS.
- Default: 0 (disabled).
-
-</PRE>
-</P>
+ The TOS/DSCP byte must be exactly that - octet value 0x00-0xFF.
+ Note that in practice often only values up to 0x3F are usable
+ as the two highest bits have been redefined for use by ECN
+ (RFC3168).
-<DT><B>zph_tos_parent</B><DD>
-<P>
-<PRE>
- Set this to off if you want only sibling hits to be marked.
- If set to on (default), parent hits are being marked too.
-
-</PRE>
-</P>
+ This setting is configured by setting the source TOS values:
-<DT><B>zph_tos_peer</B><DD>
-<P>
-<PRE>
- Allows you to select a TOS/Diffserv value to mark peer hits. Read above
- (tcp_outgoing_tos) for details/requirements about TOS.
- Default: 0 (disabled).
+ local-hit=0xFF Value to mark local cache hits.
+
+ sibling-hit=0xFF Value to mark hits from sibling peers.
+
+ parent-hit=0xFF Value to mark hits from parent peers.
+
+
+ NOTE: 'miss' preserve feature is only possible on Linux at this time.
+
+ For the following to work correctly, you will need to patch your
+ linux kernel with the TOS preserving ZPH patch.
+ The kernel patch can be downloaded from http://zph.bratcheda.org
+
+ disable-preserve-miss
+ If set, any HTTP response towards clients will
+ have the TOS value of the response comming from the
+ remote server masked with the value of miss-mask.
+ miss-mask=0xFF
+ Allows you to mask certain bits in the TOS received from the
+ remote server, before copying the value to the TOS sent
+ towards clients.
+ Default: 0xFF (TOS from server is not changed).
</PRE>
</P>
<P>Replaced by <EM>url_rewrite_bypass</EM></P>
<DT><B>zph_local</B><DD>
-<P>Replaced by <EM>zph_tos_local</EM></P>
+<P>Replaced by <EM>qos_flows local-hit=</EM></P>
<DT><B>zph_mode</B><DD>
<P>Obsolete.</P>
<P>Obsolete.</P>
<DT><B>zph_parent</B><DD>
-<P>Replaced by <EM>zph_tos_peer</EM> and <EM>zph_tos_parent</EM></P>
+<P>Replaced by <EM>qos_flows parent-hit=</EM></P>
<DT><B>zph_sibling</B><DD>
-<P>Replaced by <EM>zph_tos_peer</EM></P>
+<P>Replaced by <EM>qos_flows sibling-hit=</EM></P>
</DL>
</P>
<itemize>
<item>Allows you to select a TOS/Diffserv value to mark local hits.
<item>Allows you to select a TOS/Diffserv value to mark peer hits.
- <item>Allows you to selectively set only sibling or sibling+parent requests
- <item>Allows any HTTP response towards clients will have the TOS value of the response coming from
- the remote server masked with the value of zph_preserve_miss_tos_mask.
+ <item>Allows you to selectively mark only sibling or parent requests
+ <item>Allows any HTTP response towards clients to have the TOS value of the response coming from
+ the remote server preserved.
For this to work correctly, you will need to patch your linux kernel with the TOS preserving ZPH patch.
The kernel patch can be downloaded from <url url="http://zph.bratcheda.org" name="http://zph.bratcheda.org">
<item>Allows you to mask certain bits in the TOS received from the remote server,
<p>Squid 3.1 needs to be configured with --enable-zph-qos for the ZPH QoS controls to be available.
<p>The configuration options for 2.7 and 3.1 are based on different ZPH patches.
-The two releases configuration differs and is not at this point directly translatable.
+The two releases configuration differs and only the TOS mode settings are directly translatable.
<itemize>
-<item><em>zph_tos_local</em> Responses found as a HIT in the local cache
-<item><em>zph_tos_peer</em> Responses found as a HIT on peer caches.
-<item><em>zph_tos_parent</em> Qos to Sibling caches only or all peers.
-<item><em>zph_preserve_miss_tos</em> Use the same ToS settings received by Squid from the remote server,
- on the client connection. Requires a kernel patch.
+<item><em>qos_flows local-hit=0xff</em> Responses found as a HIT in the local cache
+<item><em>qos_flows sibling-hit=0xff</em> Responses found as a HIT in a sibling peer
+<item><em>qos_flows parent-hit=0xff</em> Responses found as a HIT in a parent peer
</itemize>
+<p>The lines above are spearated for documentation. qos_flows may be configured with all options on one line, or separated as shown.
+Also options may be repeated as many times as desired. Only the final configured value for any option will be used.
+
+<p>The legacy <b>Option</b> and <b>Priority</b> modes available in Squid-2.7 are no longer supported.
+
<sect1>SSL Bump (for HTTPS Filtering and Adaptation)
See also: sslproxy_flags and DONT_VERIFY_PEER.
</verb>
- <tag>zph_preserve_miss_tos</tag>
+ <tag>qos_flows local-hit= sibling-hit= parent-hit=</tag>
<verb>
- If set to on (default), any HTTP response towards clients will
- have the TOS value of the response comming from the remote
- server masked with the value of zph_preserve_miss_tos_mask.
- For this to work correctly, you will need to patch your linux
- kernel with the TOS preserving ZPH patch.
- The kernel patch can be downloaded from http://zph.bratcheda.org
- </verb>
+ Allows you to select a TOS/DSCP value to mark outgoing
+ connections with, based on where the reply was sourced.
- <tag>zph_preserve_miss_tos_mask</tag>
- <verb>
- Allows you to mask certain bits in the TOS received from the
- remote server, before copying the value to the TOS send towards
- clients.
- Default: 0xFF (255) (TOS from server is not changed).
- </verb>
+ TOS values really only have local significance - so you should
+ know what you're specifying. For more information, see RFC2474,
+ RFC2475, and RFC3260.
- <tag>zph_tos_local</tag>
- <verb>
- Allows you to select a TOS/Diffserv value to mark local hits. Read above
- (tcp_outgoing_tos) for details/requirements about TOS.
- Default: 0 (disabled).
- </verb>
+ The TOS/DSCP byte must be exactly that - octet value 0x00-0xFF.
+ Note that in practice often only values up to 0x3F are usable
+ as the two highest bits have been redefined for use by ECN
+ (RFC3168).
- <tag>zph_tos_parent</tag>
- <verb>
- Set this to off if you want only sibling hits to be marked.
- If set to on (default), parent hits are being marked too.
- </verb>
+ This setting is configured by setting the source TOS values:
- <tag>zph_tos_peer</tag>
- <verb>
- Allows you to select a TOS/Diffserv value to mark peer hits. Read above
- (tcp_outgoing_tos) for details/requirements about TOS.
- Default: 0 (disabled).
+ local-hit=0xFF Value to mark local cache hits.
+
+ sibling-hit=0xFF Value to mark hits from sibling peers.
+
+ parent-hit=0xFF Value to mark hits from parent peers.
+
+
+ NOTE: 'miss' preserve feature is only possible on Linux at this time.
+
+ For the following to work correctly, you will need to patch your
+ linux kernel with the TOS preserving ZPH patch.
+ The kernel patch can be downloaded from http://zph.bratcheda.org
+
+ disable-preserve-miss
+ If set, any HTTP response towards clients will
+ have the TOS value of the response comming from the
+ remote server masked with the value of miss-mask.
+ miss-mask=0xFF
+ Allows you to mask certain bits in the TOS received from the
+ remote server, before copying the value to the TOS sent
+ towards clients.
+ Default: 0xFF (TOS from server is not changed).
</verb>
<p>Replaced by <em>url_rewrite_bypass</em>
<tag>zph_local</tag>
- <p>Replaced by <em>zph_tos_local</em>
+ <p>Replaced by <em>qos_flows local-hit=</em>
<tag>zph_mode</tag>
<p>Obsolete.
<p>Obsolete.
<tag>zph_parent</tag>
- <p>Replaced by <em>zph_tos_peer</em> and <em>zph_tos_parent</em>
+ <p>Replaced by <em>qos_flows parent-hit=</em>
<tag>zph_sibling</tag>
- <p>Replaced by <em>zph_tos_peer</em>
+ <p>Replaced by <em>qos_flows sibling-hit=</em>
</descrip>
TESTS=$(check_PROGRAMS)
check_PROGRAMS=
-SUBDIRS = fs repl auth icmp
+SUBDIRS = fs repl auth icmp ip
if USE_ADAPTATION
SUBDIRS += adaptation
@DISK_PROGRAMS@ \
$(UNLINKD)
-cf_gen_SOURCES = cf_gen.cc defines.h debug.cc time.cc
+cf_gen_SOURCES = \
+ cf_gen.cc \
+ defines.h \
+ debug.cc \
+ ip/stubQosConfig.cc \
+ time.cc
+
nodist_cf_gen_SOURCES = globals.cc
nodist_cf_gen_HEADER = cf_gen_defines.h
cf_gen.$(OBJEXT): cf_gen_defines.h
TextException.cc \
TextException.h
-
# authentication framework
libauth_la_SOURCES = \
AuthConfig.cc \
libsquid.la \
libauth.la \
icmp/libicmp.la icmp/libicmp-core.la \
+ ip/libip.la \
-L../lib \
@XTRA_OBJS@ \
@DISK_LINKOBJS@ \
peer_sourcehash.cc \
peer_userhash.cc \
protos.h \
+ ip/stubQosConfig.cc \
redirect.cc \
referer.cc \
refresh.cc \
tests/stub_store.cc HttpHeaderTools.cc HttpHeader.cc acl.cc mem.cc \
MemBuf.cc HttpHdrContRange.cc Packer.cc ACLChecklist.cc HttpHdrCc.cc HttpHdrSc.cc \
HttpHdrScTarget.cc url.cc ACLProxyAuth.cc ACLRegexData.cc ACLUserData.cc \
+ ip/stubQosConfig.cc \
StatHist.cc HttpHdrRange.cc ETag.cc tests/stub_errorpage.cc \
tests/stub_HttpRequest.cc tests/stub_DelayId.cc \
tests/stub_MemObject.cc mem_node.cc \
mem_node.cc \
Packer.cc \
Parsing.cc \
+ ip/stubQosConfig.cc \
StatHist.cc \
stmem.cc \
String.cc \
peer_select.cc \
peer_sourcehash.cc \
peer_userhash.cc \
+ ip/stubQosConfig.cc \
redirect.cc \
referer.cc \
refresh.cc \
tests/testDiskIO.cc \
tests/testDiskIO.h \
tests/testMain.cc \
- tests/stub_cache_manager.cc
+ tests/stub_cache_manager.cc \
+ ip/stubQosConfig.cc
nodist_tests_testDiskIO_SOURCES= \
$(SWAP_TEST_GEN_SOURCES)
tests_testDiskIO_LDADD = \
peer_select.cc \
peer_sourcehash.cc \
peer_userhash.cc \
+ ip/stubQosConfig.cc \
redirect.cc \
referer.cc \
refresh.cc \
peer_select.cc \
peer_sourcehash.cc \
peer_userhash.cc \
+ ip/stubQosConfig.cc \
redirect.cc \
referer.cc \
refresh.cc \
peer_sourcehash.cc \
peer_userhash.cc \
pconn.cc \
+ ip/stubQosConfig.cc \
redirect.cc \
referer.cc \
refresh.cc \
peer_select.cc \
peer_sourcehash.cc \
peer_userhash.cc \
+ ip/stubQosConfig.cc \
redirect.cc \
referer.cc \
refresh.cc \
HttpHdrScTarget.cc url.cc ACLProxyAuth.cc ACLRegexData.cc ACLUserData.cc \
StatHist.cc HttpHdrRange.cc ETag.cc tests/stub_errorpage.cc \
tests/stub_HttpRequest.cc tests/stub_access_log.cc \
+ ip/stubQosConfig.cc \
refresh.cc \
tests/stub_store_client.cc \
tests/stub_tools.cc \
@SQUID_CPPUNIT_LA@
# string needs mem.cc.
+# libsquid pulls in SquidConfig and children. stub them.
tests_testString_SOURCES = \
mem.cc \
+ ip/stubQosConfig.cc \
String.cc \
tests/testMain.cc \
tests/testString.cc \
tests/testString.h \
tests/stub_cache_manager.cc \
- time.cc
+ time.cc
nodist_tests_testString_SOURCES = \
$(TESTSOURCES)
tests_testString_LDADD = \
peer_select.cc \
peer_sourcehash.cc \
peer_userhash.cc \
+ ip/stubQosConfig.cc \
redirect.cc \
referer.cc \
refresh.cc \
onoff
peer
peer_access cache_peer acl
+QosConfig
refreshpattern
removalpolicy
size_t
tcp_outgoing_tos 0x20 good_service_net
TOS/DSCP values really only have local significance - so you should
- know what you're specifying. For more information, see RFC2474 and
- RFC3260.
+ know what you're specifying. For more information, see RFC2474,
+ RFC2475, and RFC3260.
The TOS/DSCP byte must be exactly that - a octet value 0 - 255, or
"default" to use whatever default your host has. Note that in
making the request.
DOC_END
-NAME: zph_tos_local
-TYPE: int
+NAME: qos_flows
+TYPE: QosConfig
IFDEF: USE_ZPH_QOS
-DEFAULT: 0
-LOC: Config.zph_tos_local
+DEFAULT: none
+LOC: Config.zph
DOC_START
- Allows you to select a TOS/Diffserv value to mark local hits. Read above
- (tcp_outgoing_tos) for details/requirements about TOS.
- Default: 0 (disabled).
-DOC_END
+ Allows you to select a TOS/DSCP value to mark outgoing
+ connections with, based on where the reply was sourced.
-NAME: zph_tos_peer
-TYPE: int
-IFDEF: USE_ZPH_QOS
-DEFAULT: 0
-LOC: Config.zph_tos_peer
-DOC_START
- Allows you to select a TOS/Diffserv value to mark peer hits. Read above
- (tcp_outgoing_tos) for details/requirements about TOS.
- Default: 0 (disabled).
-DOC_END
+ TOS values really only have local significance - so you should
+ know what you're specifying. For more information, see RFC2474,
+ RFC2475, and RFC3260.
-NAME: zph_tos_parent
-COMMENT: on|off
-TYPE: onoff
-IFDEF: USE_ZPH_QOS
-DEFAULT: on
-LOC: Config.onoff.zph_tos_parent
-DOC_START
- Set this to off if you want only sibling hits to be marked.
- If set to on (default), parent hits are being marked too.
-DOC_END
+ The TOS/DSCP byte must be exactly that - octet value 0x00-0xFF.
+ Note that in practice often only values up to 0x3F are usable
+ as the two highest bits have been redefined for use by ECN
+ (RFC3168).
-NAME: zph_preserve_miss_tos
-COMMENT: on|off
-TYPE: onoff
-IFDEF: USE_ZPH_QOS
-DEFAULT: on
-LOC: Config.onoff.zph_preserve_miss_tos
-DOC_START
- If set to on (default), any HTTP response towards clients will
- have the TOS value of the response comming from the remote
- server masked with the value of zph_preserve_miss_tos_mask.
- For this to work correctly, you will need to patch your linux
- kernel with the TOS preserving ZPH patch.
- The kernel patch can be downloaded from http://zph.bratcheda.org
-DOC_END
+ This setting is configured by setting the source TOS values:
+
+ local-hit=0xFF Value to mark local cache hits.
+
+ sibling-hit=0xFF Value to mark hits from sibling peers.
+
+ parent-hit=0xFF Value to mark hits from parent peers.
+
+
+ NOTE: 'miss' preserve feature is only possible on Linux at this time.
+
+ For the following to work correctly, you will need to patch your
+ linux kernel with the TOS preserving ZPH patch.
+ The kernel patch can be downloaded from http://zph.bratcheda.org
+
+ disable-preserve-miss
+ If set, any HTTP response towards clients will
+ have the TOS value of the response comming from the
+ remote server masked with the value of miss-mask.
+
+ miss-mask=0xFF
+ Allows you to mask certain bits in the TOS received from the
+ remote server, before copying the value to the TOS sent
+ towards clients.
+ Default: 0xFF (TOS from server is not changed).
-NAME: zph_preserve_miss_tos_mask
-TYPE: int
-IFDEF: USE_ZPH_QOS
-DEFAULT: 255
-LOC: Config.zph_preserve_miss_tos_mask
-DOC_START
- Allows you to mask certain bits in the TOS received from the
- remote server, before copying the value to the TOS send towards
- clients.
- Default: 255 (TOS from server is not changed).
DOC_END
NAME: tcp_outgoing_address
assert(http->out.size == 0);
assert(http->out.offset == 0);
#if USE_ZPH_QOS
- if (Config.zph_tos_local) {
- debugs(33, 2, "ZPH Local hit, TOS="<<Config.zph_tos_local);
- comm_set_tos(http->getConn()->fd,Config.zph_tos_local);
+ if (Config.zph.tos_local_hit) {
+ debugs(33, 2, "ZPH Local hit, TOS=" << Config.zph.tos_local_hit);
+ comm_set_tos(http->getConn()->fd, Config.zph.tos_local_hit);
}
#endif /* USE_ZPH_QOS */
tempBuffer.offset = reqofs;
if (reqofs==0 && !logTypeIsATcpHit(http->logType)) {
assert(fd >= 0); // the beginning of this method implies fd may be -1
int tos = 0;
- if (Config.zph_tos_peer &&
- (http->request->hier.code==SIBLING_HIT ||
- (Config.onoff.zph_tos_parent && http->request->hier.code==PARENT_HIT) ) ) {
- tos = Config.zph_tos_peer;
- debugs(33, 2, "ZPH: Peer hit with hier.code="<<http->request->hier.code<<", TOS="<<tos);
- } else if (Config.onoff.zph_preserve_miss_tos && Config.zph_preserve_miss_tos_mask) {
- tos = fd_table[fd].upstreamTOS & Config.zph_preserve_miss_tos_mask;
+ if (Config.zph.tos_sibling_hit && http->request->hier.code==SIBLING_HIT ) {
+ tos = Config.zph.tos_sibling_hit;
+ debugs(33, 2, "ZPH: Sibling Peer hit with hier.code=" << http->request->hier.code << ", TOS=" << tos);
+ } else if (Config.zph.tos_parent_hit && http->request->hier.code==PARENT_HIT) {
+ tos = Config.zph.tos_parent_hit;
+ debugs(33, 2, "ZPH: Parent Peer hit with hier.code=" << http->request->hier.code << ", TOS=" << tos);
+ } else if (Config.zph.preserve_miss_tos && Config.zph.preserve_miss_tos_mask) {
+ tos = fd_table[fd].upstreamTOS & Config.zph.preserve_miss_tos_mask;
debugs(33, 2, "ZPH: Preserving TOS on miss, TOS="<<tos);
}
comm_set_tos(fd,tos);
netdbPingSite(request->GetHost());
-#if USE_ZPH_QOS
+#if USE_ZPH_QOS && _SQUID_LINUX_
+ /* Bug 2537: This part of ZPH only applies to patched Linux kernels. */
+
/* Retrieves remote server TOS value, and stores it as part of the
* original client request FD object. It is later used to forward
* remote server's TOS in the response to the client in case of a MISS.
# TODO: remove when these are cleaned up in their own way.
nodist_pinger_SOURCES = \
../debug.cc \
+ ../globals.cc \
../time.cc \
../SquidConfig.cc \
../SquidNew.cc \
- ../globals.cc
+ ../ip/stubQosConfig.cc
pinger_LDFLAGS = $(LIBADD_DL)
pinger_LDADD=\
--- /dev/null
+#
+# Makefile for the Squid IP layer API
+#
+
+# Housekeeping, shared by all Squid Makefiles.
+# TODO: make this set by configure?
+AM_CFLAGS = @SQUID_CFLAGS@
+AM_CXXFLAGS = @SQUID_CXXFLAGS@
+DEFS = @DEFS@
+CLEANFILES =
+
+INCLUDES = -I$(top_srcdir)/src @SQUID_CPPUNIT_INC@ -I$(top_srcdir)/include -I$(top_builddir)/lib
+$(OBJS): $(top_srcdir)/include/version.h $(top_srcdir)/include/autoconf.h
+
+
+# IP Specific Configurations
+
+#EXTRA_PROGRAMS = \
+# testIcmp
+
+noinst_LTLIBRARIES = libip.la
+
+libip_la_SOURCES = \
+ QosConfig.h \
+ QosConfig.cc
+
+
+check_PROGRAMS= testHeaders
+TESTS= $(check_PROGRAMS)
+
+## Special Universal .h dependency test script
+## aborts if error encountered
+testHeaders: $(top_srcdir)/src/icmp/*.h
+ $(SHELL) $(top_srcdir)/test-suite/testheaders.sh "$(CXXCOMPILE)" "$(top_srcdir)/src/icmp/" || exit 1
+
+## No such file...
+testHeaders.c:
+ touch testHeaders.c
+CLEANFILES += testHeaders.c
--- /dev/null
+#include "squid.h"
+
+#if USE_ZPH_QOS
+
+#include "QosConfig.h"
+#include "Store.h"
+
+QosConfig::QosConfig() :
+ tos_local_hit(0),
+ tos_sibling_hit(0),
+ tos_parent_hit(0),
+ preserve_miss_tos(1),
+ preserve_miss_tos_mask(255)
+{
+ ;
+}
+
+void
+QosConfig::parseConfigLine()
+{
+ // %i honors 0 and 0x prefixes, which are important for things like umask
+ /* parse options ... */
+ char *token;
+ while( (token = strtok(NULL, w_space)) ) {
+
+ if(strncmp(token, "local-hit=",10) == 0) {
+ sscanf(&token[10], "%i", &tos_local_hit);
+ }
+ else if(strncmp(token, "sibling-hit=",12) == 0) {
+ sscanf(&token[12], "%i", &tos_sibling_hit);
+ }
+ else if(strncmp(token, "parent-hit=",11) == 0) {
+ sscanf(&token[11], "%i", &tos_parent_hit);
+ }
+ else if(strcmp(token, "disable-preserve-miss") == 0) {
+ preserve_miss_tos = 0;
+ preserve_miss_tos_mask = 0;
+ }
+ else if(preserve_miss_tos && strncmp(token, "miss-mask=",10) == 0) {
+ sscanf(&token[10], "%i", &preserve_miss_tos_mask);
+ }
+ }
+}
+
+void
+QosConfig::dumpConfigLine(StoreEntry * entry, const char *name) const
+{
+ storeAppendPrintf(entry, "%s", name);
+
+ if (tos_local_hit >0) {
+ storeAppendPrintf(entry, " local-hit=%2x", tos_local_hit);
+ }
+
+ if (tos_sibling_hit >0) {
+ storeAppendPrintf(entry, " sibling-hit=%2x", tos_sibling_hit);
+ }
+ if (tos_parent_hit >0) {
+ storeAppendPrintf(entry, " parent-hit=%2x", tos_parent_hit);
+ }
+ if (preserve_miss_tos != 0) {
+ storeAppendPrintf(entry, " disable-preserve-miss");
+ }
+ if (preserve_miss_tos && preserve_miss_tos_mask != 0) {
+ storeAppendPrintf(entry, " miss-mask=%2x", preserve_miss_tos_mask);
+ }
+ storeAppendPrintf(entry, "\n");
+}
+
+#endif /* USE_ZPH_QOS */
--- /dev/null
+#ifndef SQUID_QOSCONFIG_H
+#define SQUID_QOSCONFIG_H
+
+#include "config.h"
+
+#if USE_ZPH_QOS
+
+class StoreEntry;
+
+class QosConfig
+{
+public:
+ int tos_local_hit;
+ int tos_sibling_hit;
+ int tos_parent_hit;
+ int preserve_miss_tos;
+ int preserve_miss_tos_mask;
+
+public:
+ QosConfig();
+ ~QosConfig() {};
+
+ void parseConfigLine();
+ void dumpConfigLine(StoreEntry *entry, const char *name) const;
+};
+
+/* legacy parser access wrappers */
+#define parse_QosConfig(X) (X)->parseConfigLine()
+#define dump_QosConfig(e,n,X) (X).dumpConfigLine(e,n)
+#define free_QosConfig(X)
+
+#endif /* USE_ZPH_QOS */
+#endif /* SQUID_QOSCONFIG_H */
--- /dev/null
+#include "squid.h"
+
+#if USE_ZPH_QOS
+
+#include "QosConfig.h"
+#include "Store.h"
+
+QosConfig::QosConfig() :
+ tos_local_hit(0),
+ tos_sibling_hit(0),
+ tos_parent_hit(0),
+ preserve_miss_tos(1),
+ preserve_miss_tos_mask(255)
+{
+ ;
+}
+
+void
+QosConfig::parseConfigLine()
+{
+ // %i honors 0 and 0x prefixes, which are important for things like umask
+ /* parse options ... */
+ char *token;
+ while( (token = strtok(NULL, w_space)) ) {
+
+ if(strncmp(token, "local-hit=",10) == 0) {
+ sscanf(&token[10], "%i", &tos_local_hit);
+ }
+ else if(strncmp(token, "sibling-hit=",12) == 0) {
+ sscanf(&token[12], "%i", &tos_sibling_hit);
+ }
+ else if(strncmp(token, "parent-hit=",11) == 0) {
+ sscanf(&token[11], "%i", &tos_parent_hit);
+ }
+ else if(strcmp(token, "disable-preserve-miss") == 0) {
+ preserve_miss_tos = 0;
+ preserve_miss_tos_mask = 0;
+ }
+ else if(preserve_miss_tos && strncmp(token, "miss-mask=",10) == 0) {
+ sscanf(&token[10], "%i", &preserve_miss_tos_mask);
+ }
+ }
+}
+
+void
+QosConfig::dumpConfigLine(StoreEntry * entry, const char *name) const
+{
+ ; /* Not needed in stub */
+}
+
+#endif /* USE_ZPH_QOS */
#include "icmp/IcmpConfig.h"
#endif
+#if USE_ZPH_QOS
+#include "QosConfig.h"
+#endif
+
/* forward decl for SquidConfig, see RemovalPolicy.h */
class RemovalPolicySettings;
int log_uses_indirect_client;
#endif /* FOLLOW_X_FORWARDED_FOR */
-#if USE_ZPH_QOS
- int zph_tos_parent;
- int zph_preserve_miss_tos;
-#endif
int WIN32_IpAddrChangeMonitor;
} onoff;
int sleep_after_fork; /* microseconds */
time_t minimum_expiry_time; /* seconds */
external_acl *externalAclHelperList;
+
#if USE_ZPH_QOS
- int zph_tos_local;
- int zph_tos_peer;
- int zph_preserve_miss_tos_mask;
+ QosConfig zph;
#endif
+
#if USE_SSL
struct {