@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 \
+ 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 \
PeerSelectState.h \
PingData.h \
protos.h \
+ QosConfig.cc \
+ QosConfig.h \
redirect.cc \
referer.cc \
refresh.cc \
peer_sourcehash.cc \
peer_userhash.cc \
protos.h \
+ 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 \
+ 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 \
+ stubQosConfig.cc \
StatHist.cc \
stmem.cc \
String.cc \
peer_select.cc \
peer_sourcehash.cc \
peer_userhash.cc \
+ 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 \
+ stubQosConfig.cc
tests_testDiskIO_LDADD= \
$(SWAP_TEST_LDADD) \
peer_select.cc \
peer_sourcehash.cc \
peer_userhash.cc \
+ stubQosConfig.cc \
redirect.cc \
referer.cc \
refresh.cc \
peer_select.cc \
peer_sourcehash.cc \
peer_userhash.cc \
+ stubQosConfig.cc \
redirect.cc \
referer.cc \
refresh.cc \
peer_sourcehash.cc \
peer_userhash.cc \
pconn.cc \
+ stubQosConfig.cc \
redirect.cc \
referer.cc \
refresh.cc \
peer_select.cc \
peer_sourcehash.cc \
peer_userhash.cc \
+ 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 \
+ 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 \
+ stubQosConfig.cc \
String.cc \
tests/testMain.cc \
tests/testString.cc \
tests/testString.h \
tests/stub_cache_manager.cc \
$(TESTSOURCES) \
- time.cc
-
+ time.cc
tests_testString_LDADD= \
libsquid.la \
-L../lib -lmiscutil \
peer_select.cc \
peer_sourcehash.cc \
peer_userhash.cc \
+ 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.
+
+
+ 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);
nodist_pinger_SOURCES = \
Icmp.h \
../debug.cc \
+ ../globals.cc \
../time.cc \
../SquidConfig.cc \
../SquidNew.cc \
- ../globals.cc
+ ../stubQosConfig.cc
pinger_LDFLAGS = $(LIBADD_DL)
pinger_LDADD=\
--- /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