target/breakpoints: fix types in `watchpoint_add_internal()`
[openocd.git] / src / server / telnet_server.h
blob313b529f0d6cb24490ef92c8b043f4db01b97083
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
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 ***************************************************************************/
14 #ifndef OPENOCD_SERVER_TELNET_SERVER_H
15 #define OPENOCD_SERVER_TELNET_SERVER_H
17 #include <server/server.h>
19 #define TELNET_BUFFER_SIZE (10*1024)
21 #define TELNET_LINE_HISTORY_SIZE (128)
22 #define TELNET_LINE_MAX_SIZE (10*256)
24 enum telnet_states {
25 TELNET_STATE_DATA,
26 TELNET_STATE_IAC,
27 TELNET_STATE_SB,
28 TELNET_STATE_SE,
29 TELNET_STATE_WILL,
30 TELNET_STATE_WONT,
31 TELNET_STATE_DO,
32 TELNET_STATE_DONT,
33 TELNET_STATE_ESCAPE,
36 struct telnet_connection {
37 char *prompt;
38 bool prompt_visible;
39 enum telnet_states state;
40 char line[TELNET_LINE_MAX_SIZE];
41 size_t line_size;
42 size_t line_cursor;
43 char last_escape;
44 char *history[TELNET_LINE_HISTORY_SIZE];
45 size_t next_history;
46 size_t current_history;
47 bool closed;
50 struct telnet_service {
51 char *banner;
54 int telnet_init(char *banner);
55 int telnet_register_commands(struct command_context *command_context);
56 void telnet_service_free(void);
58 #endif /* OPENOCD_SERVER_TELNET_SERVER_H */