From: Amos Jeffries Date: Wed, 10 Sep 2008 15:47:36 +0000 (+1200) Subject: WCCPv2 assignment method overlaps X-Git-Tag: SQUID_3_1_0_1~49^2~15^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21ec1b948d283f042950d45a6b4ce92ee0bb9a80;p=thirdparty%2Fsquid.git WCCPv2 assignment method overlaps --- diff --git a/src/cf.data.pre b/src/cf.data.pre index 10845cf793..f4e61420d2 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -4017,14 +4017,14 @@ DOC_END NAME: wccp2_forwarding_method TYPE: wccp2_method LOC: Config.Wccp2.forwarding_method -DEFAULT: gre +DEFAULT: gre_hash IFDEF: USE_WCCPv2 DOC_START WCCP2 allows the setting of forwarding methods between the router/switch and the cache. Valid values are as follows: - gre - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) - l2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) + gre_hash - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) + l2_mask - 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. @@ -4033,15 +4033,15 @@ DOC_END NAME: wccp2_return_method TYPE: wccp2_method LOC: Config.Wccp2.return_method -DEFAULT: gre +DEFAULT: gre_hash 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: - gre - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) - l2 - L2 redirect (forward the packet using Layer 2/MAC rewriting) + gre_hash - GRE encapsulation (forward the packet in a GRE/WCCP tunnel) + l2_mask - 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. @@ -4053,16 +4053,16 @@ DOC_START DOC_END NAME: wccp2_assignment_method -TYPE: int +TYPE: wccp2_method LOC: Config.Wccp2.assignment_method -DEFAULT: 1 +DEFAULT: gre_hash IFDEF: USE_WCCPv2 DOC_START WCCP2 allows the setting of methods to assign the WCCP hash Valid values are as follows: - 1 - Hash assignment - 2 - Mask assignment + gre_hash - Hash assignment + l2_mask - Mask assignment As a general rule, cisco routers support the hash assignment method and cisco switches support the mask assignment method. diff --git a/src/wccp2.cc b/src/wccp2.cc index 960906f92a..a78f6440ff 100644 --- a/src/wccp2.cc +++ b/src/wccp2.cc @@ -109,14 +109,17 @@ static EVH wccp2AssignBuckets; #define WCCP2_CAPABILITY_ASSIGNMENT_METHOD 0x02 #define WCCP2_CAPABILITY_RETURN_METHOD 0x03 -#define WCCP2_FORWARDING_METHOD_GRE 0x00000001 -#define WCCP2_FORWARDING_METHOD_L2 0x00000002 +#define WCCP2_METHOD_GRE 0x00000001 +#define WCCP2_METHOD_L2 0x00000002 -#define WCCP2_ASSIGNMENT_METHOD_HASH 0x00000001 -#define WCCP2_ASSIGNMENT_METHOD_MASK 0x00000002 +#define WCCP2_FORWARDING_METHOD_GRE WCCP2_METHOD_GRE +#define WCCP2_FORWARDING_METHOD_L2 WCCP2_METHOD_L2 -#define WCCP2_PACKET_RETURN_METHOD_GRE 0x00000001 -#define WCCP2_PACKET_RETURN_METHOD_L2 0x00000002 +#define WCCP2_ASSIGNMENT_METHOD_HASH WCCP2_METHOD_GRE +#define WCCP2_ASSIGNMENT_METHOD_MASK WCCP2_METHOD_L2 + +#define WCCP2_PACKET_RETURN_METHOD_GRE WCCP2_METHOD_GRE +#define WCCP2_PACKET_RETURN_METHOD_L2 WCCP2_METHOD_L2 #define WCCP2_HASH_ASSIGNMENT 0x00 #define WCCP2_MASK_ASSIGNMENT 0x01 @@ -1991,7 +1994,7 @@ wccp2AssignBuckets(void *voidnotused) /** * Parse wccp2_return_method and wccp2_forwarding_method options - * they can be '1' aka 'gre' or '2' aka 'l2' + * they can be '1' aka 'gre_hash' or '2' aka 'l2_mask' * repesenting the integer numeric of the same. */ void @@ -2001,17 +2004,17 @@ parse_wccp2_method(int *method) /* Snarf the method */ if ((t = strtok(NULL, w_space)) == NULL) { - debugs(80, 0, "wccp2_*_method: missing setting. Expected: gre or l2"); + debugs(80, DBG_CRITICAL, "wccp2_*_method: missing setting."); 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; + if (strcmp(t, "gre_hash") == 0 || strcmp(t, "1") == 0) { + *method = WCCP2_METHOD_GRE; + } else if (strcmp(t, "l2_mask") == 0 || strcmp(t, "2") == 0) { + *method = WCCP2_METHOD_L2; } else { - debugs(80, 0, "wccp2_*_method: unknown setting. Expected: gre or l2, (got " << t << ")"); + debugs(80, DBG_CRITICAL, "wccp2_*_method: unknown setting, got " << t ); self_destruct(); } } @@ -2022,13 +2025,13 @@ dump_wccp2_method(StoreEntry * e, const char *label, int v) switch(v) { case 1: - storeAppendPrintf(e, "%s gre\n", label); + storeAppendPrintf(e, "%s gre_hash\n", label); break; case 2: - storeAppendPrintf(e, "%s l2\n", label); + storeAppendPrintf(e, "%s l2_mask\n", label); break; default: - debugs(80, DBG_CRITICAL, "FATAL: WCCPv2 confifigured method (" << v << ") is not valid."); + debugs(80, DBG_CRITICAL, "FATAL: WCCPv2 configured method (" << v << ") is not valid."); self_destruct(); } }