7#define MAX_LINE_LEN 256
10#define CLI_COMMANDS_NUM (int) (sizeof(cli_commands) / sizeof(cli_command))
11#define CLI_HISTORY_FILE "cli_history.txt"
12#define CLI_PREFIX "BitLab> "
231int cli_get_line(
char** lineptr,
size_t* n, FILE* stream);
char * cli_command_generator(const char *text, int state)
CLI command generator.
void print_usage(const char *command_name)
Prints CLI command usage.
void print_commands()
Prints CLI commands.
int cli_history(char **args)
Prints CLI command history.
const char * create_history_dir()
Create history directory.
int cli_clear(char **args)
Clears CLI window.
int cli_help(char **args)
Prints CLI command help.
int cli_whoami(char **args)
Prints the user name.
char ** cli_completion(const char *text, int start, int end)
CLI completion function.
int cli_peer_discovery(char **args)
Discovers Bitcoin peers.
int cli_getdata(char **args)
Sends a 'getdata' message to specified peer.
int cli_tx(char **args)
Sends a 'tx' message to specified peer.
int cli_connect(char **args)
Connects to the specified IP address.
char * cli_read_line(void)
Reads input from user.
int cli_disconnect(char **args)
Disconnects from the specified node.
void * handle_cli(void *arg)
CLI handler thread.
void print_help()
Prints CLI command help.
int cli_get_line(char **lineptr, size_t *n, FILE *stream)
Gets the line from the file stream.
int cli_getblocks(char **args)
Sends a 'getblocks' message to specified peer.
int cli_info(char **args)
Prints program information.
int cli_get_ip(char **args)
Gets remote IP address on an URL or host machine if no URL is provided.
int cli_getheaders(char **args)
Sends a 'getheaders' message to specified peer.
int cli_getaddr(char **args)
Sends a 'getaddr' message to the specified peer.
int cli_inv(char **args)
Sends a 'inv' message to specified peer.
int cli_exit(char **args)
Exits BitLab CLI command.
int cli_exec_line(char *line)
Execute command.
int cli_echo(char **args)
Echoes the input.
int cli_ping(char **args)
Pings the specified IP address.
int cli_list(char **args)
Lists all connected nodes.
program_state state
The program state used to store the state of the program.
const char * cli_command_brief_desc
const char * cli_command_usage
const char * cli_command_detailed_desc
const char * cli_command_name