ARGT_STOP = 0, /* end of the arg list */
ARGT_SINT, /* signed 64 bit integer. */
ARGT_STR, /* string */
+ ARGT_ID, /* identifier */
ARGT_IPV4, /* an IPv4 address */
ARGT_MSK4, /* an IPv4 address mask (integer or dotted), stored as ARGT_IPV4 */
ARGT_IPV6, /* an IPv6 address */
unsigned char unresolved; /* argument contains a string in <str> that must be resolved and freed */
unsigned char type_flags; /* type-specific extra flags (eg: case sensitivity for regex), ARGF_* */
union arg_data data; /* argument data */
+
+ int (*resolve_ptr)(struct arg *arg, char **err); /* ptr to custom resolve function that can be used
+ * for the arg of type ARGT_ID; the err must always
+ * be compatible with free() (i.e. either null or
+ * the result of a malloc/strdup/memprintf call)
+ */
};
/* arg lists are used to store information about arguments that could not be
[ARGT_STOP] = "end of arguments",
[ARGT_SINT] = "integer",
[ARGT_STR] = "string",
+ [ARGT_ID] = "identifier",
[ARGT_IPV4] = "IPv4 address",
[ARGT_MSK4] = "IPv4 mask",
[ARGT_IPV6] = "IPv6 address",
arg->type = ARGT_SINT;
break;
+ case ARGT_ID:
case ARGT_FE:
case ARGT_BE:
case ARGT_TAB:
pname = p->id;
switch (arg->type) {
+ case ARGT_ID:
+ err2 = NULL;
+
+ if (arg->resolve_ptr && !arg->resolve_ptr(arg, &err2)) {
+ memprintf(err, "%sparsing [%s:%d]: error in identifier '%s' in arg %d of %s%s%s%s '%s' %s proxy '%s' : %s.\n",
+ *err ? *err : "", cur->file, cur->line,
+ arg->data.str.area,
+ cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id, err2);
+ ha_free(&err2);
+ cfgerr++;
+ continue;
+ }
+ break;
+
case ARGT_SRV:
if (!arg->data.str.data) {
memprintf(err, "%sparsing [%s:%d]: missing server name in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",