+ struct service *next;
+};
+
+int add_service(const struct service_driver *driver, const char *port,
+ int max_connections, void *priv);
+int remove_service(const char *name, const char *port);
+
+int server_host_os_entry(void);
+int server_host_os_close(void);
+
+int server_preinit(void);
+int server_init(struct command_context *cmd_ctx);
+int server_quit(void);
+void server_free(void);
+void exit_on_signal(int sig);
+
+void server_keep_clients_alive(void);
+
+int server_loop(struct command_context *command_context);
+
+int server_register_commands(struct command_context *context);
+
+int connection_write(struct connection *connection, const void *data, int len);
+int connection_read(struct connection *connection, void *data, int len);
+
+bool openocd_is_shutdown_pending(void);
+
+/**
+ * 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 @a out parameter
+ * to receive the specified port number.
+ */
+COMMAND_HELPER(server_pipe_command, char **out);