OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | connection |
struct | service |
struct | service_driver |
Macros | |
#define | CONNECTION_LIMIT_UNLIMITED (-1) |
#define | ERROR_CONNECTION_REJECTED (-401) |
#define | ERROR_SERVER_REMOTE_CLOSED (-400) |
Enumerations | |
enum | connection_type { CONNECTION_TCP , CONNECTION_PIPE , CONNECTION_STDINOUT } |
Functions | |
int | add_service (const struct service_driver *driver, const char *port, int max_connections, void *priv) |
COMMAND_HELPER (server_pipe_command, char **out) | |
Defines an extended command handler function declaration to enable access to (and manipulation of) the server port number. More... | |
COMMAND_HELPER (server_port_command, unsigned short *out) | |
int | connection_read (struct connection *connection, void *data, int len) |
int | connection_write (struct connection *connection, const void *data, int len) |
void | exit_on_signal (int sig) |
bool | openocd_is_shutdown_pending (void) |
int | remove_service (const char *name, const char *port) |
void | server_free (void) |
int | server_host_os_close (void) |
int | server_host_os_entry (void) |
int | server_init (struct command_context *cmd_ctx) |
void | server_keep_clients_alive (void) |
int | server_loop (struct command_context *command_context) |
int | server_preinit (void) |
int | server_quit (void) |
int | server_register_commands (struct command_context *context) |
enum connection_type |
int add_service | ( | const struct service_driver * | driver, |
const char * | port, | ||
int | max_connections, | ||
void * | priv | ||
) |
Definition at line 197 of file server.c.
References bindto_name, close_socket(), service::connection_closed, service_driver::connection_closed_handler, CONNECTION_PIPE, CONNECTION_STDINOUT, CONNECTION_TCP, service::connections, ERROR_FAIL, ERROR_OK, service::fd, free_service(), service::input, service_driver::input_handler, service::keep_client_alive, service_driver::keep_client_alive_handler, LOG_ERROR, LOG_INFO, LOG_WARNING, service::max_connections, service_driver::name, service::name, service::new_connection, service::new_connection_during_keep_alive, service_driver::new_connection_during_keep_alive_handler, service_driver::new_connection_handler, service::next, NULL, parse_long(), service::port, service::portnumber, priv, service::priv, services, service::sin, socket_nonblock(), and service::type.
Referenced by COMMAND_HANDLER(), gdb_target_start(), ipdbg_start(), jim_arm_tpiu_swo_enable(), jsp_init(), tcl_init(), and telnet_init().
COMMAND_HELPER | ( | server_pipe_command | , |
char ** | out | ||
) |
Defines an extended command handler function declaration to enable access to (and manipulation of) the server port number.
Call server_port like a normal COMMAND_HANDLER with an extra out parameter to receive the specified port number.
Definition at line 864 of file server.c.
References CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_EXEC, command_print(), ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and LOG_WARNING.
COMMAND_HELPER | ( | server_port_command | , |
unsigned short * | out | ||
) |
Definition at line 845 of file server.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
int connection_read | ( | struct connection * | connection, |
void * | data, | ||
int | len | ||
) |
Definition at line 742 of file server.c.
References CONNECTION_TCP, connection::fd, read_socket(), connection::service, and service::type.
Referenced by arm_tpiu_swo_service_input(), ipdbg_on_connection_input(), jsp_input(), rtt_input(), semihosting_redirect_read(), semihosting_service_input_handler(), tcl_input(), and telnet_input().
int connection_write | ( | struct connection * | connection, |
const void * | data, | ||
int | len | ||
) |
Definition at line 730 of file server.c.
References CONNECTION_TCP, connection::fd_out, connection::service, service::type, and write_socket().
Referenced by arm_tpiu_swo_poll_trace(), gdb_write(), ipdbg_move_buffer_to_connection(), read_callback(), semihosting_redirect_write(), tcl_output(), and telnet_write().
void exit_on_signal | ( | int | sig | ) |
Definition at line 721 of file server.c.
Referenced by openocd_main().
bool openocd_is_shutdown_pending | ( | void | ) |
Definition at line 750 of file server.c.
References CONTINUE_MAIN_LOOP, and shutdown_openocd.
int remove_service | ( | const char * | name, |
const char * | port | ||
) |
Definition at line 354 of file server.c.
References close_socket(), CONNECTION_STDINOUT, ERROR_OK, service::fd, free_service(), service::name, name, service::next, service::port, service::priv, remove_connections(), services, and service::type.
Referenced by arm_tpiu_swo_close_output(), COMMAND_HANDLER(), and ipdbg_stop().
void server_free | ( | void | ) |
Definition at line 712 of file server.c.
References bindto_name, jsp_service_free(), tcl_service_free(), and telnet_service_free().
Referenced by openocd_main().
int server_host_os_close | ( | void | ) |
int server_host_os_entry | ( | void | ) |
Definition at line 632 of file server.c.
References ERROR_FAIL, ERROR_OK, LOG_ERROR, and WORD.
Referenced by openocd_main().
int server_init | ( | struct command_context * | cmd_ctx | ) |
Definition at line 680 of file server.c.
References ERROR_OK, remove_services(), tcl_init(), and telnet_init().
Referenced by openocd_thread().
void server_keep_clients_alive | ( | void | ) |
Definition at line 413 of file server.c.
References connection::next, service::next, and services.
Referenced by keep_alive().
int server_loop | ( | struct command_context * | command_context | ) |
Definition at line 421 of file server.c.
References add_connection(), close_socket(), command_run_line(), CONNECTION_PIPE, CONNECTION_STDINOUT, CONNECTION_TCP, service::connections, CONTINUE_MAIN_LOOP, ERROR_FAIL, ERROR_OK, connection::fd, service::fd, service::input, connection::input_pending, LOG_ERROR, LOG_INFO, service::max_connections, MSG, service::name, connection::next, service::next, NULL, polling_period, process_jim_events(), remove_connection(), services, shutdown_openocd, SHUTDOWN_REQUESTED, SHUTDOWN_WITH_ERROR_CODE, SHUTDOWN_WITH_SIGNAL_CODE, service::sin, socket_select(), target_call_timer_callbacks(), target_got_message(), target_timer_next_event(), timeval_ms(), timeval::tv_sec, timeval::tv_usec, and service::type.
Referenced by openocd_thread().
int server_preinit | ( | void | ) |
Definition at line 660 of file server.c.
References ERROR_OK, sig_handler(), and sigkey_handler().
Referenced by openocd_thread().
int server_quit | ( | void | ) |
Definition at line 697 of file server.c.
References ERROR_OK, last_signal, remove_services(), and target_quit().
Referenced by openocd_thread().
int server_register_commands | ( | struct command_context * | context | ) |
Definition at line 828 of file server.c.
References ERROR_OK, jsp_register_commands(), NULL, register_commands(), server_command_handlers, tcl_register_commands(), and telnet_register_commands().
Referenced by setup_command_handler().