14 #ifndef OPENOCD_SERVER_SERVER_H
15 #define OPENOCD_SERVER_SERVER_H
24 #ifdef HAVE_NETINET_IN_H
25 #include <netinet/in.h>
34 #define CONNECTION_LIMIT_UNLIMITED (-1)
39 struct sockaddr_in
sin;
73 struct sockaddr_in
sin;
119 #define ERROR_SERVER_REMOTE_CLOSED (-400)
120 #define ERROR_CONNECTION_REJECTED (-401)
static struct esp_usb_jtag * priv
void exit_on_signal(int sig)
int connection_write(struct connection *connection, const void *data, int len)
int connection_read(struct connection *connection, void *data, int len)
COMMAND_HELPER(server_pipe_command, char **out)
Defines an extended command handler function declaration to enable access to (and manipulation of) th...
int server_host_os_close(void)
int server_register_commands(struct command_context *context)
int server_host_os_entry(void)
void server_keep_clients_alive(void)
bool openocd_is_shutdown_pending(void)
int server_loop(struct command_context *command_context)
int remove_service(const char *name, const char *port)
int add_service(const struct service_driver *driver, const char *port, int max_connections, void *priv)
int server_init(struct command_context *cmd_ctx)
struct command_context * cmd_ctx
const char * name
the name of the server
int(* connection_closed_handler)(struct connection *connection)
callback to tear down the connection
void(* keep_client_alive_handler)(struct connection *connection)
called periodically to send keep-alive messages on the connection
int(* new_connection_handler)(struct connection *connection)
complete code to accept a new connection.
int(* new_connection_during_keep_alive_handler)(struct connection *connection)
optional minimal setup to accept a connection during keep-alive
int(* input_handler)(struct connection *connection)
callback to handle incoming data
int(* new_connection_during_keep_alive)(struct connection *connection)
struct connection * connections
int(* input)(struct connection *connection)
int(* connection_closed)(struct connection *connection)
unsigned short portnumber
void(* keep_client_alive)(struct connection *connection)
enum connection_type type
int(* new_connection)(struct connection *connection)