server: specify port as a string

This will allow switching to using named pipes.

Split this out as a seperate commit to make changes
easier to follow.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
Øyvind Harboe
2010-09-27 08:48:31 +02:00
parent cb2dba2c12
commit 6c137a2fc0
5 changed files with 104 additions and 41 deletions

View File

@@ -75,6 +75,11 @@ int add_service(char *name, enum connection_type type, unsigned short port,
input_handler_t in_handler, connection_closed_handler_t close_handler,
void *priv);
int add_service_pipe(char *name, const char *port,
int max_connections, new_connection_handler_t new_connection_handler,
input_handler_t in_handler, connection_closed_handler_t close_handler,
void *priv);
int server_preinit(void);
int server_init(struct command_context *cmd_ctx);
int server_quit(void);
@@ -101,6 +106,10 @@ void openocd_sleep_postlude(void);
* Call server_port like a normal COMMAND_HANDLER with an extra @a out parameter
* to receive the specified port number.
*/
#define SERVER_PIPE_COMMAND() \
COMMAND_HELPER(server_pipe_command, const char **out)
SERVER_PIPE_COMMAND();
#define SERVER_PORT_COMMAND() \
COMMAND_HELPER(server_port_command, unsigned short *out)