1 | /* |
---|
2 | * Original Author: Fernando RUIZ CASAS (fernando.ruiz@ctv.es) |
---|
3 | * May 2001 |
---|
4 | * Reworked by Till Straumann and .h overhauled by Joel Sherrill. |
---|
5 | * |
---|
6 | * Copyright (c) 2009 embedded brains GmbH and others. |
---|
7 | * |
---|
8 | * embedded brains GmbH |
---|
9 | * Obere Lagerstr. 30 |
---|
10 | * D-82178 Puchheim |
---|
11 | * Germany |
---|
12 | * <rtems@embedded-brains.de> |
---|
13 | * |
---|
14 | * The license and distribution terms for this file may be |
---|
15 | * found in the file LICENSE in this distribution or at |
---|
16 | * http://www.rtems.com/license/LICENSE. |
---|
17 | * |
---|
18 | * $Id$ |
---|
19 | */ |
---|
20 | |
---|
21 | #ifndef _RTEMS_TELNETD_H |
---|
22 | #define _RTEMS_TELNETD_H |
---|
23 | |
---|
24 | #include <rtems.h> |
---|
25 | #include <rtems/shell.h> |
---|
26 | |
---|
27 | #ifdef __cplusplus |
---|
28 | extern "C" { |
---|
29 | #endif |
---|
30 | |
---|
31 | bool rtems_telnetd_login_check( |
---|
32 | const char *user, |
---|
33 | const char *passphrase |
---|
34 | ); |
---|
35 | |
---|
36 | /** |
---|
37 | * @brief Telnet command type. |
---|
38 | */ |
---|
39 | typedef void (*rtems_telnetd_command)( |
---|
40 | char * /* device name */, |
---|
41 | void * /* arg */ |
---|
42 | ); |
---|
43 | |
---|
44 | /** |
---|
45 | * @brief Telnet configuration structure. |
---|
46 | */ |
---|
47 | typedef struct { |
---|
48 | /** |
---|
49 | * @brief Function invoked for each Telnet connection. |
---|
50 | * |
---|
51 | * The first parameter contains the device name. The second parameter |
---|
52 | * contains the argument pointer of this configuration table. |
---|
53 | */ |
---|
54 | rtems_telnetd_command command; |
---|
55 | |
---|
56 | /** |
---|
57 | * @brief Argument for command function. |
---|
58 | */ |
---|
59 | void *arg; |
---|
60 | |
---|
61 | /** |
---|
62 | * @brief Task priority. |
---|
63 | * |
---|
64 | * If this parameter is equal to zero, then the priority of network task is |
---|
65 | * used or 100 if this priority is less than two. |
---|
66 | */ |
---|
67 | rtems_task_priority priority; |
---|
68 | |
---|
69 | /** |
---|
70 | * @brief Task stack size. |
---|
71 | */ |
---|
72 | size_t stack_size; |
---|
73 | |
---|
74 | /** |
---|
75 | * @brief Login check function. |
---|
76 | * |
---|
77 | * Method used for login checks. Use @c NULL to disable a login check. |
---|
78 | */ |
---|
79 | rtems_shell_login_check_t login_check; |
---|
80 | |
---|
81 | /** |
---|
82 | * @brief Keep standard IO of the caller. |
---|
83 | * |
---|
84 | * Telnet takes over the standard input, output and error associated with |
---|
85 | * task, if this parameter is set to @c true. In this case, it will @b not |
---|
86 | * listen on any sockets. When this parameter is @c false, Telnet will |
---|
87 | * create other tasks for the shell which listen on sockets. |
---|
88 | */ |
---|
89 | bool keep_stdio; |
---|
90 | } rtems_telnetd_config_table; |
---|
91 | |
---|
92 | /** |
---|
93 | * @brief Telnet configuration. |
---|
94 | * |
---|
95 | * The application must provide this configuration table. It is used by |
---|
96 | * rtems_telnetd_initialize() to configure the Telnet subsystem. Do not modify |
---|
97 | * the entries after the intialization since it is used internally. |
---|
98 | */ |
---|
99 | extern rtems_telnetd_config_table rtems_telnetd_config; |
---|
100 | |
---|
101 | /** |
---|
102 | * @brief Initializes the Telnet subsystem. |
---|
103 | * |
---|
104 | * Uses the application provided @ref rtems_telnetd_config configuration table. |
---|
105 | */ |
---|
106 | rtems_status_code rtems_telnetd_initialize(void); |
---|
107 | |
---|
108 | #ifdef __cplusplus |
---|
109 | } |
---|
110 | #endif |
---|
111 | |
---|
112 | #endif |
---|