Changeset b412038 in rtems-docs for networking/network_servers.rst


Ignore:
Timestamp:
Apr 11, 2016, 3:53:58 AM (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11, master
Children:
bc37517
Parents:
ea0777e
git-author:
Chris Johns <chrisj@…> (04/11/16 03:53:58)
git-committer:
Amar Takhar <verm@…> (05/03/16 00:51:27)
Message:

Clean up and review of Networking User Guide.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • networking/network_servers.rst

    rea0777e rb412038  
     1.. COMMENT: RTEMS Remote Debugger Server Specifications
     2.. COMMENT: Written by: Emmanuel Raguet <raguet@crf.canon.fr>
     3
    14Network Servers
    25###############
     
    58================
    69
    7 The RTEMS FTPD is a complete file transfer protocol (FTP) daemon
    8 which can store, retrieve, and manipulate files on the local
    9 filesystem.  In addition, the RTEMS FTPD provides "hooks"
    10 which are actions performed on received data.  Hooks are useful
    11 in situations where a destination file is not necessarily
    12 appropriate or in cases when a formal device driver has not yet
    13 been implemented.
     10The RTEMS FTPD is a complete file transfer protocol (FTP) daemon which can
     11store, retrieve, and manipulate files on the local filesystem.  In addition,
     12the RTEMS FTPD provides "hooks" which are actions performed on received data.
     13Hooks are useful in situations where a destination file is not necessarily
     14appropriate or in cases when a formal device driver has not yet been
     15implemented.
    1416
    1517This server was implemented and documented by Jake Janovetz
     
    2022
    2123The configuration structure for FTPD is as follows:
    22 .. code:: c
     24
     25.. code-block:: c
    2326
    2427    struct rtems_ftpd_configuration
    2528    {
    26     rtems_task_priority     priority;           /* FTPD task priority  \*/
    27     unsigned long           max_hook_filesize;  /* Maximum buffersize  \*/
    28     /*    for hooks        \*/
    29     int                     port;               /* Well-known port     \*/
    30     struct rtems_ftpd_hook  \*hooks;             /* List of hooks       \*/
     29        rtems_task_priority     priority;           /* FTPD task priority  */
     30        unsigned long           max_hook_filesize;  /* Maximum buffersize  */
     31        /*    for hooks        */
     32        int                     port;               /* Well-known port     */
     33        struct rtems_ftpd_hook  *hooks;             /* List of hooks       */
    3134    };
    3235
    33 The FTPD task priority is specified with ``priority``.  Because
    34 hooks are not saved as files, the received data is placed in an
    35 allocated buffer.  ``max_hook_filesize`` specifies the maximum
    36 size of this buffer.  Finally, ``hooks`` is a pointer to the
    37 configured hooks structure.
     36The FTPD task priority is specified with ``priority``.  Because hooks are not
     37saved as files, the received data is placed in an allocated buffer.
     38``max_hook_filesize`` specifies the maximum size of this buffer.  Finally,
     39``hooks`` is a pointer to the configured hooks structure.
    3840
    3941Initializing FTPD (Starting the daemon)
    4042---------------------------------------
    4143
    42 Starting FTPD is done with a call to ``rtems_initialize_ftpd()``.
    43 The configuration structure must be provided in the application
    44 source code.  Example hooks structure and configuration structure
    45 folllow.
    46 .. code:: c
     44Starting FTPD is done with a call to ``rtems_initialize_ftpd()``.  The
     45configuration structure must be provided in the application source code.
     46Example hooks structure and configuration structure folllow.
     47
     48.. code-block:: c
    4749
    4850    struct rtems_ftpd_hook ftp_hooks[] =
    4951    {
    50     {"untar", Untar_FromMemory},
    51     {NULL, NULL}
     52        {"untar", Untar_FromMemory},
     53        {NULL, NULL}
    5254    };
     55
    5356    struct rtems_ftpd_configuration rtems_ftpd_configuration =
    5457    {
    55     40,                     /* FTPD task priority \*/
    56     512*1024,               /* Maximum hook 'file' size \*/
    57     0,                      /* Use default port \*/
    58     ftp_hooks               /* Local ftp hooks \*/
     58        40,                     /* FTPD task priority */
     59        512*1024,               /* Maximum hook 'file' size */
     60        0,                      /* Use default port */
     61        ftp_hooks               /* Local ftp hooks */
    5962    };
    6063
    61 Specifying 0 for the well-known port causes FTPD to use the
    62 UNIX standard FTPD port (21).
     64Specifying 0 for the well-known port causes FTPD to use the UNIX standard FTPD
     65port (21).
    6366
    6467Using Hooks
    6568-----------
    6669
    67 In the example above, one hook was installed.  The hook causes
    68 FTPD to call the function ``Untar_FromMemory`` when the
    69 user sends data to the file ``untar``.  The prototype for
    70 the ``untar`` hook (and hooks, in general) is:
    71 .. code:: c
     70In the example above, one hook was installed.  The hook causes FTPD to call the
     71function ``Untar_FromMemory`` when the user sends data to the file ``untar``.
     72The prototype for the ``untar`` hook (and hooks, in general) is:
    7273
    73     int Untar_FromMemory(unsigned char \*tar_buf, unsigned long size);
     74.. code-block:: c
     75
     76    int Untar_FromMemory(unsigned char *tar_buf, unsigned long size);
    7477
    7578An example FTP transcript which exercises this hook is:
    76 .. code:: c
     79
     80.. code-block:: shell
    7781
    7882    220 RTEMS FTP server (Version 1.0-JWJ) ready.
     
    103107    ftp> quit
    104108    221 Goodbye.
    105 
    106 .. COMMENT: RTEMS Remote Debugger Server Specifications
    107 
    108 .. COMMENT: Written by: Emmanuel Raguet <raguet@crf.canon.fr>
    109 
Note: See TracChangeset for help on using the changeset viewer.