* libmisc/shell/shell.h: Pointer to

oparations table for mount command is now const.
        * libnetworking/lib/ftpfs.c, libnetworking/rtems/ftpfs.h: Rewrite of
        the FTP file system which implements now the trivial command state
        machines of RFC 959.  For the data transfer passive (= default) and
        active (= fallback) modes are now supported.
        * libmisc/shell/main_mount_ftp.c: Update for FTP file system changes.
This commit is contained in:
Thomas Doerfler
2009-03-26 14:11:53 +00:00
parent d785ce4a56
commit 8916bdc71b
5 changed files with 1151 additions and 1107 deletions

View File

@@ -1,3 +1,13 @@
2009-03-26 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libmisc/shell/shell.h: Pointer to
oparations table for mount command is now const.
* libnetworking/lib/ftpfs.c, libnetworking/rtems/ftpfs.h: Rewrite of
the FTP file system which implements now the trivial command state
machines of RFC 959. For the data transfer passive (= default) and
active (= fallback) modes are now supported.
* libmisc/shell/main_mount_ftp.c: Update for FTP file system changes.
2009-03-12 Santosh G Vattam <vattam.santosh@gmail.com> 2009-03-12 Santosh G Vattam <vattam.santosh@gmail.com>
PR 1378/filesystem PR 1378/filesystem

View File

@@ -32,6 +32,6 @@
rtems_shell_filesystems_t rtems_shell_Mount_FTP = { rtems_shell_filesystems_t rtems_shell_Mount_FTP = {
name: "ftp", name: "ftp",
driver_needed: 1, driver_needed: 1,
fs_ops: &rtems_ftp_ops, fs_ops: &rtems_ftpfs_ops,
mounter: rtems_shell_libc_mounter mounter: rtems_shell_libc_mounter
}; };

View File

@@ -222,10 +222,10 @@ typedef int (*rtems_shell_filesystems_mounter_t)(
); );
struct rtems_shell_filesystems_tt { struct rtems_shell_filesystems_tt {
const char* name; const char *name;
int driver_needed; int driver_needed;
rtems_filesystem_operations_table* fs_ops; const rtems_filesystem_operations_table *fs_ops;
rtems_shell_filesystems_mounter_t mounter; rtems_shell_filesystems_mounter_t mounter;
}; };
/** /**

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,17 @@
/** /**
* @file rtems/ftpfs.h * @file
* *
* File Transfer Protocol client declarations * @brief File Transfer Protocol file system (FTP client).
*
* Transfer file to/from remote host
*/ */
/* /*
* Copyright (c) 2009
* embedded brains GmbH
* Obere Lagerstr. 30
* D-82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
* (c) Copyright 2002 * (c) Copyright 2002
* Thomas Doerfler * Thomas Doerfler
* IMD Ingenieurbuero fuer Microcomputertechnik * IMD Ingenieurbuero fuer Microcomputertechnik
@@ -14,26 +19,115 @@
* 82178 Puchheim, Germany * 82178 Puchheim, Germany
* <Thomas.Doerfler@imd-systems.de> * <Thomas.Doerfler@imd-systems.de>
* *
* This code has been created after closly inspecting * Modified by Sebastian Huber <sebastian.huber@embedded-brains.de>.
* "tftpdriver.c" from Eric Norum.
* *
* $Id$ * This code has been created after closly inspecting "tftpdriver.c" from Eric
* Norum.
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/ */
#ifndef _RTEMS_FTPFS_H #ifndef _RTEMS_FTPFS_H
#define _RTEMS_FTPFS_H #define _RTEMS_FTPFS_H
#include <rtems/libio.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <rtems/libio.h> /**
* @defgroup rtems_ftpfs File Transfer Protocol File System
*
* The FTP file system (FTP client) can be used to transfer files from or to
* remote hosts.
*
* You can mount the FTP file system with a call to rtems_ftpfs_mount().
* Alternatively you can use mount() with the @ref rtems_ftpfs_ops operations
* table.
*
* You can open files either read-only or write-only. A seek is not allowed.
* A close terminates the control and data connections.
*
* To open a file @c file.txt in the directory @c dir (relative to home
* directory of the server) on a server named @c host using the user name
* @c user and the password @c pw you must specify the following path:
*
* @c /FTP/user:pw@host/dir/file.txt
*
* If the server is the default server specified in BOOTP, it can be ommitted:
*
* @c /FTP/user:pw/dir/file.txt
*
* The user name will be used for the password if it is ommitted:
*
* @c /FTP/user@host/dir/file.txt
*
* For the data transfer passive (= default) and active (= fallback) mode are
* supported.
*
* @{
*/
/* create mount point and mount ftp file system */ /**
extern int rtems_bsdnet_initialize_ftp_filesystem (void); * @brief Well-known port number for FTP control connection.
*/
#define RTEMS_FTPFS_CTRL_PORT 21
/* FTP File sysem operations table. */ /**
extern rtems_filesystem_operations_table rtems_ftp_ops; * @brief Default mount point for FTP file system.
*/
#define RTEMS_FTPFS_MOUNT_POINT_DEFAULT "/FTP"
/**
* @brief FTP file system operations table.
*/
extern const rtems_filesystem_operations_table rtems_ftpfs_ops;
/**
* @brief Creates the mount point @a mount_point and mounts the FTP file
* system.
*
* If @a mount_point is @c NULL the default mount point
* @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used.
*
* It is mounted with read and write access.
*
* @note The parent directories of the mount point have to exist.
*/
rtems_status_code rtems_ftpfs_mount( const char *mount_point);
/**
* @brief Enables or disables the verbose mode if @a verbose is @c true or
* @c false respectively.
*
* In the enabled verbose mode the commands and replies of the FTP control
* connections will be printed to standard error.
*/
rtems_status_code rtems_ftpfs_set_verbose( bool verbose);
/**
* @brief Returns in @a verbose if the verbose mode is enabled or disabled.
*/
rtems_status_code rtems_ftpfs_get_verbose( bool *verbose);
/** @} */
/**
* @brief Creates the default mount point @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT
* and mounts the FTP file system.
*
* It is mounted with read and write access.
*
* On success, zero is returned. On error, -1 is returned.
*
* @deprecated Use rtems_ftpfs_mount() instead.
*/
int rtems_bsdnet_initialize_ftp_filesystem( void);
#ifdef __cplusplus #ifdef __cplusplus
} }