summaryrefslogtreecommitdiffstats
path: root/networking/network_servers.rst
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2016-04-11 13:53:58 +1000
committerAmar Takhar <verm@darkbeer.org>2016-05-02 20:51:27 -0400
commitb41203897a7bfc7ab4a446808494e6216eff7c56 (patch)
tree86d36928e7650e679d5bc65d6fdd0d4adc45ac67 /networking/network_servers.rst
parentea0777e4ee35c7a67274771200233efabd2797b0 (diff)
downloadrtems-docs-b41203897a7bfc7ab4a446808494e6216eff7c56.tar.bz2
Clean up and review of Networking User Guide.
Diffstat (limited to 'networking/network_servers.rst')
-rw-r--r--networking/network_servers.rst85
1 files changed, 42 insertions, 43 deletions
diff --git a/networking/network_servers.rst b/networking/network_servers.rst
index cf3ec71..6026c14 100644
--- a/networking/network_servers.rst
+++ b/networking/network_servers.rst
@@ -1,16 +1,18 @@
+.. COMMENT: RTEMS Remote Debugger Server Specifications
+.. COMMENT: Written by: Emmanuel Raguet <raguet@crf.canon.fr>
+
Network Servers
###############
RTEMS FTP Daemon
================
-The RTEMS FTPD is a complete file transfer protocol (FTP) daemon
-which can store, retrieve, and manipulate files on the local
-filesystem. In addition, the RTEMS FTPD provides "hooks"
-which are actions performed on received data. Hooks are useful
-in situations where a destination file is not necessarily
-appropriate or in cases when a formal device driver has not yet
-been implemented.
+The RTEMS FTPD is a complete file transfer protocol (FTP) daemon which can
+store, retrieve, and manipulate files on the local filesystem. In addition,
+the RTEMS FTPD provides "hooks" which are actions performed on received data.
+Hooks are useful in situations where a destination file is not necessarily
+appropriate or in cases when a formal device driver has not yet been
+implemented.
This server was implemented and documented by Jake Janovetz
(janovetz@tempest.ece.uiuc.edu).
@@ -19,61 +21,63 @@ Configuration Parameters
------------------------
The configuration structure for FTPD is as follows:
-.. code:: c
+
+.. code-block:: c
struct rtems_ftpd_configuration
{
- rtems_task_priority priority; /* FTPD task priority \*/
- unsigned long max_hook_filesize; /* Maximum buffersize \*/
- /* for hooks \*/
- int port; /* Well-known port \*/
- struct rtems_ftpd_hook \*hooks; /* List of hooks \*/
+ rtems_task_priority priority; /* FTPD task priority */
+ unsigned long max_hook_filesize; /* Maximum buffersize */
+ /* for hooks */
+ int port; /* Well-known port */
+ struct rtems_ftpd_hook *hooks; /* List of hooks */
};
-The FTPD task priority is specified with ``priority``. Because
-hooks are not saved as files, the received data is placed in an
-allocated buffer. ``max_hook_filesize`` specifies the maximum
-size of this buffer. Finally, ``hooks`` is a pointer to the
-configured hooks structure.
+The FTPD task priority is specified with ``priority``. Because hooks are not
+saved as files, the received data is placed in an allocated buffer.
+``max_hook_filesize`` specifies the maximum size of this buffer. Finally,
+``hooks`` is a pointer to the configured hooks structure.
Initializing FTPD (Starting the daemon)
---------------------------------------
-Starting FTPD is done with a call to ``rtems_initialize_ftpd()``.
-The configuration structure must be provided in the application
-source code. Example hooks structure and configuration structure
-folllow.
-.. code:: c
+Starting FTPD is done with a call to ``rtems_initialize_ftpd()``. The
+configuration structure must be provided in the application source code.
+Example hooks structure and configuration structure folllow.
+
+.. code-block:: c
struct rtems_ftpd_hook ftp_hooks[] =
{
- {"untar", Untar_FromMemory},
- {NULL, NULL}
+ {"untar", Untar_FromMemory},
+ {NULL, NULL}
};
+
struct rtems_ftpd_configuration rtems_ftpd_configuration =
{
- 40, /* FTPD task priority \*/
- 512*1024, /* Maximum hook 'file' size \*/
- 0, /* Use default port \*/
- ftp_hooks /* Local ftp hooks \*/
+ 40, /* FTPD task priority */
+ 512*1024, /* Maximum hook 'file' size */
+ 0, /* Use default port */
+ ftp_hooks /* Local ftp hooks */
};
-Specifying 0 for the well-known port causes FTPD to use the
-UNIX standard FTPD port (21).
+Specifying 0 for the well-known port causes FTPD to use the UNIX standard FTPD
+port (21).
Using Hooks
-----------
-In the example above, one hook was installed. The hook causes
-FTPD to call the function ``Untar_FromMemory`` when the
-user sends data to the file ``untar``. The prototype for
-the ``untar`` hook (and hooks, in general) is:
-.. code:: c
+In the example above, one hook was installed. The hook causes FTPD to call the
+function ``Untar_FromMemory`` when the user sends data to the file ``untar``.
+The prototype for the ``untar`` hook (and hooks, in general) is:
+
+.. code-block:: c
- int Untar_FromMemory(unsigned char \*tar_buf, unsigned long size);
+ int Untar_FromMemory(unsigned char *tar_buf, unsigned long size);
An example FTP transcript which exercises this hook is:
-.. code:: c
+
+.. code-block:: shell
220 RTEMS FTP server (Version 1.0-JWJ) ready.
Name (dcomm0:janovetz): John Galt
@@ -102,8 +106,3 @@ An example FTP transcript which exercises this hook is:
226 Transfer complete.
ftp> quit
221 Goodbye.
-
-.. COMMENT: RTEMS Remote Debugger Server Specifications
-
-.. COMMENT: Written by: Emmanuel Raguet <raguet@crf.canon.fr>
-