OpenOCD
server.h File Reference
Include dependency graph for server.h:
This graph shows which files directly or indirectly include this file:

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_INTERRUPTED   (-402)
 
#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)
 

Macro Definition Documentation

◆ CONNECTION_LIMIT_UNLIMITED

#define CONNECTION_LIMIT_UNLIMITED   (-1)

Definition at line 34 of file server.h.

◆ ERROR_CONNECTION_REJECTED

#define ERROR_CONNECTION_REJECTED   (-401)

Definition at line 120 of file server.h.

◆ ERROR_SERVER_INTERRUPTED

#define ERROR_SERVER_INTERRUPTED   (-402)

Definition at line 121 of file server.h.

◆ ERROR_SERVER_REMOTE_CLOSED

#define ERROR_SERVER_REMOTE_CLOSED   (-400)

Definition at line 119 of file server.h.

Enumeration Type Documentation

◆ connection_type

Enumerator
CONNECTION_TCP 
CONNECTION_PIPE 
CONNECTION_STDINOUT 

Definition at line 28 of file server.h.

Function Documentation

◆ add_service()

◆ COMMAND_HELPER() [1/2]

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 866 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() [2/2]

COMMAND_HELPER ( server_port_command  ,
unsigned short *  out 
)

◆ connection_read()

◆ connection_write()

int connection_write ( struct connection connection,
const void *  data,
int  len 
)

◆ exit_on_signal()

void exit_on_signal ( int  sig)

Definition at line 723 of file server.c.

Referenced by openocd_main().

◆ openocd_is_shutdown_pending()

◆ remove_service()

int remove_service ( const char *  name,
const char *  port 
)

◆ server_free()

void server_free ( void  )

◆ server_host_os_close()

int server_host_os_close ( void  )

Definition at line 653 of file server.c.

References ERROR_OK.

Referenced by openocd_main().

◆ server_host_os_entry()

int server_host_os_entry ( void  )

Definition at line 633 of file server.c.

References ERROR_FAIL, ERROR_OK, LOG_ERROR, and WORD.

Referenced by openocd_main().

◆ server_init()

int server_init ( struct command_context cmd_ctx)

Definition at line 681 of file server.c.

References ERROR_OK, remove_services(), tcl_init(), and telnet_init().

Referenced by openocd_thread().

◆ server_keep_clients_alive()

void server_keep_clients_alive ( void  )

Definition at line 414 of file server.c.

References connection::next, service::next, and services.

Referenced by keep_alive().

◆ server_loop()

◆ server_preinit()

int server_preinit ( void  )

Definition at line 661 of file server.c.

References ERROR_OK, sig_handler(), and sigkey_handler().

Referenced by openocd_thread().

◆ server_quit()

int server_quit ( void  )

Definition at line 698 of file server.c.

References ERROR_OK, last_signal, remove_services(), and target_quit().

Referenced by openocd_thread().

◆ server_register_commands()

int server_register_commands ( struct command_context context)