tristate
uri_whitespace
ushort
+wccp2_method
wccp2_service
wccp2_service_info
wordlist
LOC: Config.Wccp.router
DEFAULT: 0.0.0.0
IFDEF: USE_WCCP
-DOC_NONE
+DOC_START
+ Use this option to define your WCCP ``home'' router for
+ Squid.
+
+ wccp_router supports a single WCCP(v1) router
+
+ wccp2_router supports multiple WCCPv2 routers
+
+ only one of the two may be used at the same time and defines
+ which version of WCCP to use.
+DOC_END
NAME: wccp2_router
TYPE: IPAddress_list
DOC_END
NAME: wccp2_forwarding_method
-TYPE: int
+TYPE: wccp2_method
LOC: Config.Wccp2.forwarding_method
-DEFAULT: 1
+DEFAULT: gre
IFDEF: USE_WCCPv2
DOC_START
WCCP2 allows the setting of forwarding methods between the
router/switch and the cache. Valid values are as follows:
- 1 - GRE encapsulation (forward the packet in a GRE/WCCP tunnel)
- 2 - L2 redirect (forward the packet using Layer 2/MAC rewriting)
+ gre - GRE encapsulation (forward the packet in a GRE/WCCP tunnel)
+ l2 - L2 redirect (forward the packet using Layer 2/MAC rewriting)
Currently (as of IOS 12.4) cisco routers only support GRE.
Cisco switches only support the L2 redirect assignment method.
DOC_END
NAME: wccp2_return_method
-TYPE: int
+TYPE: wccp2_method
LOC: Config.Wccp2.return_method
-DEFAULT: 1
+DEFAULT: gre
IFDEF: USE_WCCPv2
DOC_START
WCCP2 allows the setting of return methods between the
router/switch and the cache for packets that the cache
decides not to handle. Valid values are as follows:
- 1 - GRE encapsulation (forward the packet in a GRE/WCCP tunnel)
- 2 - L2 redirect (forward the packet using Layer 2/MAC rewriting)
+ gre - GRE encapsulation (forward the packet in a GRE/WCCP tunnel)
+ l2 - L2 redirect (forward the packet using Layer 2/MAC rewriting)
Currently (as of IOS 12.4) cisco routers only support GRE.
Cisco switches only support the L2 redirect assignment.
SQUIDCEXTERN char *strtokFile(void);
#if USE_WCCPv2
-SQUIDCEXTERN void parse_wccp2_service(void *v);
-SQUIDCEXTERN void free_wccp2_service(void *v);
+SQUIDCEXTERN void parse_wccp2_method(int *v);
+SQUIDCEXTERN void free_wccp2_method(int *v);
+SQUIDCEXTERN void dump_wccp2_method(StoreEntry * e, const char *label, int v);
+SQUIDCEXTERN void parse_wccp2_service(void *v);
+SQUIDCEXTERN void free_wccp2_service(void *v);
SQUIDCEXTERN void dump_wccp2_service(StoreEntry * e, const char *label, void *v);
SQUIDCEXTERN int check_null_wccp2_service(void *v);
* Configuration option parsing code
*/
+/**
+ * Parse wccp2_return_method and wccp2_forwarding_method options
+ * they can be '1' aka 'gre' or '2' aka 'l2'
+ * repesenting the integer numeric of the same.
+ */
+void
+parse_wccp2_method(int *method)
+{
+ char *t;
+
+ /* Snarf the method */
+ if ((t = strtok(NULL, w_space)) == NULL) {
+ debugs(80, 0, "wccp2_*_method: missing setting. Expected: gre or l2");
+ self_destruct();
+ }
+
+ /* update configuration if its valid */
+ if (strcmp(t, "gre") == 0 || strcmp(t, "1") == 0) {
+ *method = 1;
+ } else if (strcmp(t, "l2") == 0 || strcmp(t, "2") == 0) {
+ *method = 2;
+ } else {
+ debugs(80, 0, "wccp2_*_method: unknown setting. Expected: gre or l2, (got " << t << ")");
+ self_destruct();
+ }
+}
+
+void
+dump_wccp2_method(StoreEntry * e, const char *label, int v)
+{
+ switch(v)
+ {
+ case 1:
+ storeAppendPrintf(e, "%s gre\n", label);
+ break;
+ case 2:
+ storeAppendPrintf(e, "%s l2\n", label);
+ break;
+ default:
+ debugs(80, DBG_CRITICAL, "FATAL: WCCPv2 confifigured method (" << v << ") is not valid.");
+ self_destruct();
+ }
+}
+
+void
+free_wccp2_method(int *v)
+{ }
+
/*
* Format:
*