aboutsummaryrefslogtreecommitdiff
path: root/helper
diff options
context:
space:
mode:
authorLifang Zhang <lifang.zhang@nokia.com>2021-08-18 14:24:34 +0300
committerMatias Elo <matias.elo@nokia.com>2021-09-30 14:27:54 +0300
commitfb4f59136bdf65e854c1cc4e786fab5a0f921e54 (patch)
tree34cf1b9a7d5ab9447394c41265b796f6b445fd20 /helper
parentefce6d4192737480e65cbfdca2808bebcfe1eb66 (diff)
helper: cli: allow user to provide own hostname
Hostname will be displayed as the first part of the prompt. Signed-off-by: Lifang Zhang <lifang.zhang@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Jere Leppänen <jere.leppanen@nokia.com>
Diffstat (limited to 'helper')
-rw-r--r--helper/cli.c3
-rw-r--r--helper/include/odp/helper/cli.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/helper/cli.c b/helper/cli.c
index 9efa79225..8dc6b66fa 100644
--- a/helper/cli.c
+++ b/helper/cli.c
@@ -56,6 +56,7 @@ static const odph_cli_param_t param_default = {
.address = "127.0.0.1",
.port = 55555,
.max_user_commands = 50,
+ .hostname = "ODP",
};
void odph_cli_param_init(odph_cli_param_t *param)
@@ -371,7 +372,7 @@ static struct cli_def *create_cli(cli_shm_t *shm)
cli = cli_init();
cli_set_banner(cli, NULL);
- cli_set_hostname(cli, "ODP");
+ cli_set_hostname(cli, shm->cli_param.hostname);
c = cli_register_command(cli, NULL, "call", NULL,
PRIVILEGE_UNPRIVILEGED, MODE_EXEC,
diff --git a/helper/include/odp/helper/cli.h b/helper/include/odp/helper/cli.h
index 6b8992926..982509f53 100644
--- a/helper/include/odp/helper/cli.h
+++ b/helper/include/odp/helper/cli.h
@@ -53,6 +53,8 @@ typedef struct {
uint16_t port;
/** Maximum number of user defined commands. Default is 50. */
uint32_t max_user_commands;
+ /** Hostname to be displayed as the first part of the prompt. */
+ const char *hostname;
} odph_cli_param_t;
/**