source: rtems-libbsd/rtemsbsd/include/rtems/telnetd.h @ 65c65bb

5-freebsd-12freebsd-9.3
Last change on this file since 65c65bb was 65c65bb, checked in by Chris Johns <chrisj@…>, on Jul 1, 2016 at 5:49:52 AM

Add telnetd as service to rc.conf.

  • Property mode set to 100644
File size: 2.7 KB
Line 
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.org/license/LICENSE.
17 */
18
19#ifndef _RTEMS_TELNETD_H
20#define _RTEMS_TELNETD_H
21
22#include <rtems.h>
23#include <rtems/shell.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29bool rtems_telnetd_login_check(
30  const char *user,
31  const char *passphrase
32);
33
34/**
35 * @brief Telnet command type.
36 */
37typedef void (*rtems_telnetd_command)(
38  char * /* device name */,
39  void * /* arg */
40);
41
42/**
43 * @brief Telnet configuration structure.
44 */
45typedef struct {
46  /**
47   * @brief Function invoked for each Telnet connection.
48   *
49   * The first parameter contains the device name.  The second parameter
50   * contains the argument pointer of this configuration table.
51   */
52  rtems_telnetd_command command;
53
54  /**
55   * @brief Argument for command function.
56   */
57  void *arg;
58
59  /**
60   * @brief Task priority.
61   *
62   * If this parameter is equal to zero, then the priority of network task is
63   * used or 100 if this priority is less than two.
64   */
65  rtems_task_priority priority;
66
67  /**
68   * @brief Task stack size.
69   */
70  size_t stack_size;
71
72  /**
73   * @brief Login check function.
74   *
75   * Method used for login checks.  Use @c NULL to disable a login check.
76   */
77  rtems_shell_login_check_t login_check;
78
79  /**
80   * @brief Keep standard IO of the caller.
81   *
82   * Telnet takes over the standard input, output and error associated with
83   * task, if this parameter is set to @c true.  In this case, it will @b not
84   * listen on any sockets.  When this parameter is @c false, Telnet will
85   * create other tasks for the shell which listen on sockets.
86   */
87  bool keep_stdio;
88} rtems_telnetd_config_table;
89
90/**
91 * @brief Start the Telnet subsystem with the provided configuration.
92 */
93rtems_status_code rtems_telnetd_start(const rtems_telnetd_config_table* config);
94
95/**
96 * @brief Telnet configuration.
97 *
98 * The application must provide this configuration table.  It is used by
99 * rtems_telnetd_initialize() to configure the Telnet subsystem.  Do not modify
100 * the entries after the intialization since it is used internally.
101 */
102extern rtems_telnetd_config_table rtems_telnetd_config;
103
104/**
105 * @brief Initializes the Telnet subsystem.
106 *
107 * Uses the application provided @ref rtems_telnetd_config configuration table.
108 */
109rtems_status_code rtems_telnetd_initialize(void);
110
111#ifdef __cplusplus
112}
113#endif
114
115#endif
Note: See TracBrowser for help on using the repository browser.