Helper Reference Manual 1.7.1
Loading...
Searching...
No Matches
cli.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2021 Nokia
3 */
4
11#ifndef ODPH_CLI_H_
12#define ODPH_CLI_H_
13
14#include <stdarg.h>
15#include <stdint.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
42typedef void (*odph_cli_user_cmd_func_t)(int argc, char *argv[]);
43
45typedef struct {
50 const char *address;
52 uint16_t port;
56 const char *hostname;
58
68
83
106 const char *help);
107
123int odph_cli_run(void);
124
134
148int odph_cli_log(const char *fmt, ...);
149
162int odph_cli_log_va(const char *fmt, va_list in_args);
163
173
178#ifdef __cplusplus
179}
180#endif
181
182#endif
int odph_cli_init(const odph_cli_param_t *param)
Initialize CLI helper.
void(* odph_cli_user_cmd_func_t)(int argc, char *argv[])
User defined command function type.
Definition cli.h:42
int odph_cli_log(const char *fmt,...)
Print to CLI.
int odph_cli_register_command(const char *name, odph_cli_user_cmd_func_t func, const char *help)
Register a user defined command.
int odph_cli_term(void)
Terminate CLI helper.
int odph_cli_run(void)
Run CLI server.
int odph_cli_log_va(const char *fmt, va_list in_args)
Print to CLI.
void odph_cli_param_init(odph_cli_param_t *param)
Initialize CLI server params.
int odph_cli_stop(void)
Stop CLI server.
ODP CLI server parameters.
Definition cli.h:45
const char * address
A character string containing an IP address.
Definition cli.h:50
uint32_t max_user_commands
Maximum number of user defined commands.
Definition cli.h:54
const char * hostname
Hostname to be displayed as the first part of the prompt.
Definition cli.h:56
uint16_t port
TCP port.
Definition cli.h:52