Changeset 8a775c27 in rtems for cpukit/telnetd/telnetd.h


Ignore:
Timestamp:
Mar 27, 2009, 1:45:31 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
2649eef
Parents:
8916bdc7
Message:

2009-03-27 Sebastian Huber <sebastian.huber@…>

  • Makefile.am, preinstall.am, libmisc/Makefile.am, libmisc/shell/shell.c, libmisc/shell/shell.h, telnetd/check_passwd.c, telnetd/telnetd.c, telnetd/telnetd.h: Generalized login check.
  • libmisc/shell/login.h, libmisc/shell/login_check.c, libmisc/shell/login_prompt.c: New files.
  • libmisc/stackchk/check.c: Changed format for blown stack message.
  • libcsupport/src/libio_sockets.c: Removed superfluous cast.
  • libnetworking/rtems/ftpfs.h: Documentation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/telnetd/telnetd.h

    r8916bdc7 r8a775c27  
    44 *  Reworked by Till Straumann and .h overhauled by Joel Sherrill.
    55 *
    6  *  This program is distributed in the hope that it will be useful,
    7  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    8  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     6 * Copyright (c) 2009
     7 * embedded brains GmbH
     8 * Obere Lagerstr. 30
     9 * D-82178 Puchheim
     10 * Germany
     11 * <rtems@embedded-brains.de>
    912 *
    10  *  $Id$
     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$
    1120 */
    1221
     
    1423#define _RTEMS_TELNETD_H
    1524
     25#include <rtems.h>
     26#include <rtems/login.h>
     27
    1628#ifdef __cplusplus
    1729extern "C" {
    18 #endif 
     30#endif
     31
     32bool rtems_telnetd_login_check(
     33  const char *user,
     34  const char *passphrase
     35);
    1936
    2037/**
    21  *  This method initializes the telnetd subsystem.
     38 * @brief Telnet command type.
     39 */
     40typedef void (*rtems_telnetd_command)(
     41  char * /* device name */,
     42  void * /* arg */
     43);
     44
     45/**
     46 * @brief Telnet configuration structure.
     47 */
     48typedef 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.
    2295 *
    23  *  @param[in] cmd is the function which is the "shell" telnetd invokes
    24  *  @param[in] arg is the context pointer to cmd
    25  *  @param[in] remainOnCallerSTDIO is set to TRUE if telnetd takes over the
    26  *    standard in, out and error associated with task.  In this case,
    27  *    it will be NOT be listening on any sockets.  When this parameters
    28  *    is FALSE the telnetd will create other tasks for the shell
    29  *    which listen on sockets.
    30  *  @param[in] stack is stack size of spawned task.
    31  *  @param[in] priority is the initial priority of spawned task(s).  If
    32  *    this parameter is less than 2, then the default priority of 100 is used.
    33  *  @param[in] askForPassword is set to TRUE if telnetd is to ask for a
    34  *    password. This is set to FALSE to invoke "cmd" with no password check.
    35  *    This may be OK if "cmd" includes its own check and indeed the RTEMS Shell
    36  *    uses a login with a user name and password so this is the usual case.
     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.
    3799 */
    38 int rtems_telnetd_initialize(
    39   void               (*cmd)(char *, void *),
    40   void                *arg,
    41   bool                 remainOnCallerSTDIO,
    42   size_t               stack,
    43   rtems_task_priority  priority,
    44   bool                 askForPassword
    45 );
     100extern 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 */
     107rtems_status_code rtems_telnetd_initialize( void);
    46108
    47109#ifdef __cplusplus
    48110}
    49 #endif 
     111#endif
    50112
    51113#endif
Note: See TracChangeset for help on using the changeset viewer.