ret = add_service("gdb",
port, target->gdb_max_connections, &gdb_new_connection, &gdb_input,
- &gdb_connection_closed, gdb_service);
+ &gdb_connection_closed, gdb_service, NULL);
/* initialize all targets gdb service with the same pointer */
{
struct target_list *head;
new_connection_handler_t new_connection_handler,
input_handler_t input_handler,
connection_closed_handler_t connection_closed_handler,
- void *priv)
+ void *priv,
+ struct service **new_service)
{
struct service *c, **p;
struct hostent *hp;
;
*p = c;
+ /* if new_service is not NULL, return the created service into it */
+ if (new_service)
+ *new_service = c;
+
return ERROR_OK;
}
int add_service(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);
+ void *priv, struct service **new_service);
int remove_service(const char *name, const char *port);
int server_host_os_entry(void);
return add_service("tcl", tcl_port, CONNECTION_LIMIT_UNLIMITED,
&tcl_new_connection, &tcl_input,
- &tcl_closed, NULL);
+ &tcl_closed, NULL, NULL);
}
COMMAND_HANDLER(handle_tcl_port_command)
int ret = add_service("telnet", telnet_port, CONNECTION_LIMIT_UNLIMITED,
telnet_new_connection, telnet_input, telnet_connection_closed,
- telnet_service);
+ telnet_service, NULL);
if (ret != ERROR_OK) {
free(telnet_service);
jsp_new_connection,
jsp_input,
jsp_connection_closed,
- jsp_service);
+ jsp_service,
+ NULL);
}
COMMAND_HANDLER(handle_jsp_port_command)