-static int redis_config_node (redis_node_t *rn, oconfig_item_t *ci) /* {{{ */
-{
- int i;
- int status = 0;
-
- if ((ci->values_num != 1)
- || (ci->values[0].type != OCONFIG_TYPE_STRING))
- {
- WARNING ("redis plugin: The `Node' block needs exactly one string "
- "argument.");
- return (-1);
- }
-
- if (ci->children_num < 1)
- {
- WARNING ("redis plugin: The `Node' block needs at least one option.");
- return (-1);
- }
-
- sstrncpy (rn->name, ci->values[0].value.string, sizeof (rn->name));
-
- for (i = 0; i < ci->children_num; i++)
- {
- oconfig_item_t *option = ci->children + i;
- status = 0;
-
- if (strcasecmp ("Host", option->key) == 0)
- status = cf_util_get_string_buffer (option, rn->host, sizeof (rn->host));
- else if (strcasecmp ("Port", option->key) == 0)
- rn->port = cf_util_get_port_number (option);
- else if (strcasecmp ("Timeout", option->key) == 0)
- status = cf_util_get_int (option, &rn->timeout);
- else
- {
- WARNING ("redis plugin: Option `%s' not allowed inside a `Node' "
- "block.", option->key);
- status = -1;
- }
-
- if (status != 0)
- break;
- }
-
- return (status);
-} /* }}} */
-