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