]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ip/stubQosConfig.cc
Merged from trunk.
[thirdparty/squid.git] / src / ip / stubQosConfig.cc
1 #include "squid.h"
2
3 #if USE_ZPH_QOS
4
5 #include "QosConfig.h"
6 #include "Store.h"
7
8 QosConfig::QosConfig() :
9 tos_local_hit(0),
10 tos_sibling_hit(0),
11 tos_parent_hit(0),
12 preserve_miss_tos(1),
13 preserve_miss_tos_mask(255)
14 {
15 ;
16 }
17
18 void
19 QosConfig::parseConfigLine()
20 {
21 // %i honors 0 and 0x prefixes, which are important for things like umask
22 /* parse options ... */
23 char *token;
24 while ( (token = strtok(NULL, w_space)) ) {
25
26 if (strncmp(token, "local-hit=",10) == 0) {
27 sscanf(&token[10], "%i", &tos_local_hit);
28 } else if (strncmp(token, "sibling-hit=",12) == 0) {
29 sscanf(&token[12], "%i", &tos_sibling_hit);
30 } else if (strncmp(token, "parent-hit=",11) == 0) {
31 sscanf(&token[11], "%i", &tos_parent_hit);
32 } else if (strcmp(token, "disable-preserve-miss") == 0) {
33 preserve_miss_tos = 0;
34 preserve_miss_tos_mask = 0;
35 } else if (preserve_miss_tos && strncmp(token, "miss-mask=",10) == 0) {
36 sscanf(&token[10], "%i", &preserve_miss_tos_mask);
37 }
38 }
39 }
40
41 void
42 QosConfig::dumpConfigLine(char *entry, const char *name) const
43 {
44 ; /* Not needed in stub */
45 }
46
47 #endif /* USE_ZPH_QOS */