OpenOCD
telnet_server.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /***************************************************************************
4  * Copyright (C) 2005 by Dominic Rath *
5  * Dominic.Rath@gmx.de *
6  * *
7  * Copyright (C) 2007,2008 Øyvind Harboe *
8  * oyvind.harboe@zylin.com *
9  * *
10  * Copyright (C) 2008 by Spencer Oliver *
11  * spen@spen-soft.co.uk *
12  ***************************************************************************/
13 
14 #ifndef OPENOCD_SERVER_TELNET_SERVER_H
15 #define OPENOCD_SERVER_TELNET_SERVER_H
16 
17 #include <server/server.h>
18 
19 #define TELNET_BUFFER_SIZE (10*1024)
20 
21 #define TELNET_LINE_HISTORY_SIZE (128)
22 #define TELNET_LINE_MAX_SIZE (10*256)
23 
34 };
35 
37  char *prompt;
39  enum telnet_states state;
41  size_t line_size;
42  size_t line_cursor;
45  size_t next_history;
47  bool closed;
48 };
49 
51  char *banner;
52 };
53 
54 int telnet_init(char *banner);
56 void telnet_service_free(void);
57 
58 #endif /* OPENOCD_SERVER_TELNET_SERVER_H */
char * history[TELNET_LINE_HISTORY_SIZE]
Definition: telnet_server.h:44
char line[TELNET_LINE_MAX_SIZE]
Definition: telnet_server.h:40
enum telnet_states state
Definition: telnet_server.h:39
void telnet_service_free(void)
#define TELNET_LINE_HISTORY_SIZE
Definition: telnet_server.h:21
int telnet_init(char *banner)
telnet_states
Definition: telnet_server.h:24
@ TELNET_STATE_DO
Definition: telnet_server.h:31
@ TELNET_STATE_SB
Definition: telnet_server.h:27
@ TELNET_STATE_ESCAPE
Definition: telnet_server.h:33
@ TELNET_STATE_DONT
Definition: telnet_server.h:32
@ TELNET_STATE_WILL
Definition: telnet_server.h:29
@ TELNET_STATE_IAC
Definition: telnet_server.h:26
@ TELNET_STATE_WONT
Definition: telnet_server.h:30
@ TELNET_STATE_DATA
Definition: telnet_server.h:25
@ TELNET_STATE_SE
Definition: telnet_server.h:28
#define TELNET_LINE_MAX_SIZE
Definition: telnet_server.h:22
int telnet_register_commands(struct command_context *command_context)