See also : "stick-table", "stick on", about ACLs and sample fetching.
-stick-table type {ip | integer | string [len <length>] | binary [len <length>]}
+stick-table type {ip|ipv4|ipv6|integer|string [len <length>]|binary [len <length>]}
size <size> [expire <expire>] [nopurge] [peers <peersect>] [srvkey <srvkey>]
[write-to <wtable>] [store <data_type>]* [brates-factor <factor>]
[recv-only]
no | yes | yes | yes
Arguments :
- ip a table declared with "type ip" will only store IPv4 addresses.
+ ip This type should be avoided in favor of a more explicit one such
+ as "ipv4" or "ipv6". Prior to version 3.2 it was the only way to
+ configure IPv4. In 3.2, "ip" is an alias for "ipv4", and "ipv4"
+ is preferred. In a future version, "ip" will instead correspond
+ to "ipv6". It is only meant to ease the transition from pre-3.2
+ to post-3.2.
+
+ ipv4 a table declared with this type will only store IPv4 addresses.
This form is very compact (about 50 bytes per entry) and allows
very fast entry lookup and stores with almost no overhead. This
is mainly used to store client source IP addresses.
*/
int stktable_parse_type(char **args, int *myidx, unsigned long *type, size_t *key_size, const char *file, int linenum)
{
+ const char *kw = args[*myidx];
+
+ /* Planning for future changes, for now "ipv4" is an alias for "ip" */
+ if (strcmp(kw, "ipv4") == 0)
+ kw = "ip";
+
for (*type = 0; *type < SMP_TYPES; (*type)++) {
if (!stktable_types[*type].kw)
continue;
- if (strcmp(args[*myidx], stktable_types[*type].kw) != 0)
+ if (strcmp(kw, stktable_types[*type].kw) != 0)
continue;
*key_size = stktable_types[*type].default_size;