52 unsigned char out_buffer[10];
53 unsigned char in_buffer[10];
60 memset(out_buffer, 0, 10);
105 unsigned char *buf_p;
113 else if (bytes_read == -1) {
114 LOG_ERROR(
"error during read: %s", strerror(errno));
120 switch (t_con->
state) {
127 unsigned char in_buffer[10];
129 &out_len, buf_p, &in_len,
189 .new_connection_during_keep_alive_handler =
NULL,
193 .keep_client_alive_handler =
NULL,
213 .handler = handle_jsp_port_command,
215 .help =
"Specify port on which to listen "
216 "for incoming JSP telnet connections.",
217 .usage =
"[port_num]",
#define CALL_COMMAND_HANDLER(name, extra ...)
Use this to macro to call a command helper (or a nested handler).
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
static int register_commands(struct command_context *cmd_ctx, const char *cmd_prefix, const struct command_registration *cmds)
Register one or more commands in the specified context, as children of parent (or top-level commends,...
static struct esp_usb_jtag * priv
int jsp_init(struct or1k_jtag *jtag_info, char *banner)
COMMAND_HANDLER(handle_jsp_port_command)
static int jsp_poll_read(void *priv)
void jsp_service_free(void)
static int jsp_connection_closed(struct connection *connection)
static const struct command_registration jsp_command_handlers[]
static const struct service_driver jsp_service_driver
static int jsp_new_connection(struct connection *connection)
static int telnet_write(struct connection *connection, const void *data, int len)
static const char *const negotiate
A skim of the relevant RFCs suggests that if my application simply sent the characters IAC DONT LINEM...
static int jsp_input(struct connection *connection)
int jsp_register_commands(struct command_context *cmd_ctx)
#define LOG_ERROR(expr ...)
int or1k_adv_jtag_jsp_xfer(struct or1k_jtag *jtag_info, int *out_len, unsigned char *out_buffer, int *in_len, unsigned char *in_buffer)
int connection_write(struct connection *connection, const void *data, int len)
int connection_read(struct connection *connection, void *data, int len)
int add_service(const struct service_driver *driver, const char *port, int max_connections, void *priv)
#define ERROR_SERVER_REMOTE_CLOSED
struct connection * connection
struct or1k_jtag * jtag_info
const char * name
the name of the server
int target_unregister_timer_callback(int(*callback)(void *priv), void *priv)
int target_register_timer_callback(int(*callback)(void *priv), unsigned int time_ms, enum target_timer_type type, void *priv)
The period is very approximate, the callback can happen much more often or much more rarely than spec...
@ TARGET_TIMER_TYPE_PERIODIC
#define TELNET_BUFFER_SIZE