TH_EX_CTX_MUX, /* mux whose mux_ops is in .mux_ops */
TH_EX_CTX_TASK, /* task or tasklet whose function is in .task */
TH_EX_CTX_APPLET, /* applet whose applet is in .applet */
+ TH_EX_CTX_CLI_KWL, /* CLI keyword list, using .cli_kwl */
};
struct thread_exec_ctx {
const struct mux_ops *mux_ops; /* used with TH_EX_CTX_MUX */
const struct task *(*task)(struct task *, void *, unsigned int); /* used with TH_EX_CTX_TASK */
const struct applet *applet; /* used with TH_EX_CTX_APPLET */
+ const struct cli_kw_list *cli_kwl; /* used with TH_EX_CTX_CLI_KWL */
};
};
if (caller_initcall) {
kw->exec_ctx.type = TH_EX_CTX_INITCALL;
kw->exec_ctx.initcall = caller_initcall;
+ } else {
+ kw->exec_ctx.type = TH_EX_CTX_CLI_KWL;
+ kw->exec_ctx.cli_kwl = kw_list;
}
}
LIST_APPEND(&cli_keywords.list, &kw_list->list);
#include <haproxy/api.h>
#include <haproxy/applet.h>
#include <haproxy/chunk.h>
+#include <haproxy/cli-t.h>
#include <haproxy/compiler.h>
#include <haproxy/dgram.h>
#include <haproxy/global.h>
case TH_EX_CTX_APPLET:
chunk_appendf(output,"applet '%s'", ctx->applet->name);
break;
+ case TH_EX_CTX_CLI_KWL:
+ chunk_appendf(output,"cli kwl starting with '%s %s %s %s %s'",
+ ctx->cli_kwl->kw[0].str_kw[0],
+ ctx->cli_kwl->kw[0].str_kw[1] ? ctx->cli_kwl->kw[0].str_kw[1] : "",
+ ctx->cli_kwl->kw[0].str_kw[2] ? ctx->cli_kwl->kw[0].str_kw[2] : "",
+ ctx->cli_kwl->kw[0].str_kw[3] ? ctx->cli_kwl->kw[0].str_kw[3] : "",
+ ctx->cli_kwl->kw[0].str_kw[4] ? ctx->cli_kwl->kw[0].str_kw[4] : "");
+ break;
default:
chunk_appendf(output,"other ctx %p", ctx->pointer);
break;