* libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c:  Added
	rtems_ftpfs_mount() again.  Documentation.
This commit is contained in:
Sebastian Huber
2010-06-09 11:36:09 +00:00
parent 14fc3a77f8
commit c69b6fe66a
3 changed files with 40 additions and 31 deletions

View File

@@ -1,3 +1,8 @@
2010-06-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libnetworking/rtems/ftpfs.h, libnetworking/lib/ftpfs.c: Added
rtems_ftpfs_mount() again. Documentation.
2010-06-09 Sebastian Huber <sebastian.huber@embedded-brains.de> 2010-06-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/include/rtems/libio.h, sapi/include/confdefs.h: Added * libcsupport/include/rtems/libio.h, sapi/include/confdefs.h: Added

View File

@@ -99,6 +99,8 @@ typedef struct {
struct timeval timeout; struct timeval timeout;
} rtems_ftpfs_mount_entry; } rtems_ftpfs_mount_entry;
static const rtems_filesystem_operations_table rtems_ftpfs_ops;
static const rtems_filesystem_file_handlers_r rtems_ftpfs_handlers; static const rtems_filesystem_file_handlers_r rtems_ftpfs_handlers;
static const rtems_filesystem_file_handlers_r rtems_ftpfs_root_handlers; static const rtems_filesystem_file_handlers_r rtems_ftpfs_root_handlers;
@@ -130,8 +132,6 @@ static int rtems_ftpfs_set_connection_timeout(
return 0; return 0;
} }
#if 0
CCJ_REMOVE_MOUNT
rtems_status_code rtems_ftpfs_mount(const char *mount_point) rtems_status_code rtems_ftpfs_mount(const char *mount_point)
{ {
int rv = 0; int rv = 0;
@@ -140,17 +140,17 @@ rtems_status_code rtems_ftpfs_mount(const char *mount_point)
mount_point = RTEMS_FTPFS_MOUNT_POINT_DEFAULT; mount_point = RTEMS_FTPFS_MOUNT_POINT_DEFAULT;
} }
rv = mkdir(mount_point, S_IRWXU | S_IRWXG | S_IRWXO); rv = rtems_mkdir(mount_point, S_IRWXU | S_IRWXG | S_IRWXO);
if (rv != 0) { if (rv != 0) {
return RTEMS_IO_ERROR; return RTEMS_IO_ERROR;
} }
rv = mount( rv = mount(
NULL, NULL,
&rtems_ftpfs_ops, mount_point,
RTEMS_FILESYSTEM_TYPE_FTPFS,
RTEMS_FILESYSTEM_READ_WRITE, RTEMS_FILESYSTEM_READ_WRITE,
NULL, NULL
mount_point
); );
if (rv != 0) { if (rv != 0) {
return RTEMS_IO_ERROR; return RTEMS_IO_ERROR;
@@ -158,7 +158,6 @@ rtems_status_code rtems_ftpfs_mount(const char *mount_point)
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
} }
#endif
static rtems_status_code rtems_ftpfs_do_ioctl( static rtems_status_code rtems_ftpfs_do_ioctl(
const char *mount_point, const char *mount_point,
@@ -1318,7 +1317,7 @@ static int rtems_ftpfs_fstat(
return 0; return 0;
} }
const rtems_filesystem_operations_table rtems_ftpfs_ops = { static const rtems_filesystem_operations_table rtems_ftpfs_ops = {
.evalpath_h = rtems_ftpfs_eval_path, .evalpath_h = rtems_ftpfs_eval_path,
.evalformake_h = NULL, .evalformake_h = NULL,
.link_h = NULL, .link_h = NULL,

View File

@@ -1,7 +1,7 @@
/** /**
* @file * @file
* *
* File Transfer Protocol file system (FTP client). * @brief File Transfer Protocol file system (FTP client).
*/ */
/* /*
@@ -46,12 +46,11 @@ extern "C" {
/** /**
* @defgroup rtems_ftpfs File Transfer Protocol File System * @defgroup rtems_ftpfs File Transfer Protocol File System
* *
* The FTP file system (FTP client) can be used to transfer files from or to * @brief The FTP file system (FTP client) can be used to transfer files from
* remote hosts. * or to remote hosts.
* *
* You can mount the FTP file system with a call to rtems_ftpfs_mount(). * 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 * Alternatively you can use mount() directly.
* table.
* *
* You can open files either read-only or write-only. A seek is not allowed. * You can open files either read-only or write-only. A seek is not allowed.
* A close terminates the control and data connections. * A close terminates the control and data connections.
@@ -74,17 +73,17 @@ extern "C" {
*/ */
/** /**
* Well-known port number for FTP control connection. * @brief Well-known port number for FTP control connection.
*/ */
#define RTEMS_FTPFS_CTRL_PORT 21 #define RTEMS_FTPFS_CTRL_PORT 21
/** /**
* Default mount point for FTP file system. * @brief Default mount point for FTP file system.
*/ */
#define RTEMS_FTPFS_MOUNT_POINT_DEFAULT "/FTP" #define RTEMS_FTPFS_MOUNT_POINT_DEFAULT "/FTP"
/** /**
* FTP file system IO control requests. * @brief FTP file system IO control requests.
*/ */
typedef enum { typedef enum {
RTEMS_FTPFS_IOCTL_GET_VERBOSE = _IOR( 'd', 1, bool *), RTEMS_FTPFS_IOCTL_GET_VERBOSE = _IOR( 'd', 1, bool *),
@@ -94,13 +93,19 @@ typedef enum {
} rtems_ftpfs_ioctl_numbers; } rtems_ftpfs_ioctl_numbers;
/** /**
* FTP file system operations table. * @brief Creates the mount point @a mount_point and mounts the FTP file
*/ * system.
extern const rtems_filesystem_operations_table rtems_ftpfs_ops; *
* 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.
*/
rtems_status_code rtems_ftpfs_mount( const char *mount_point);
/** /**
* Returns in @a verbose if the verbose mode is enabled or disabled for the * @brief Returns in @a verbose if the verbose mode is enabled or disabled for
* file system at @a mount_point. * the file system at @a mount_point.
* *
* If @a mount_point is @c NULL the default mount point * If @a mount_point is @c NULL the default mount point
* @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used. * @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used.
@@ -108,7 +113,7 @@ extern const rtems_filesystem_operations_table rtems_ftpfs_ops;
rtems_status_code rtems_ftpfs_get_verbose( const char *mount_point, bool *verbose); rtems_status_code rtems_ftpfs_get_verbose( const char *mount_point, bool *verbose);
/** /**
* Enables or disables the verbose mode if @a verbose is @c true or * @brief Enables or disables the verbose mode if @a verbose is @c true or
* @c false respectively for the file system at @a mount_point. * @c false respectively for the file system at @a mount_point.
* *
* In the enabled verbose mode the commands and replies of the FTP control * In the enabled verbose mode the commands and replies of the FTP control
@@ -120,8 +125,8 @@ rtems_status_code rtems_ftpfs_get_verbose( const char *mount_point, bool *verbos
rtems_status_code rtems_ftpfs_set_verbose( const char *mount_point, bool verbose); rtems_status_code rtems_ftpfs_set_verbose( const char *mount_point, bool verbose);
/** /**
* Returns the current timeout value in @a timeout for the file system at * @brief Returns the current timeout value in @a timeout for the file system
* @a mount_point. * at @a mount_point.
* *
* If @a mount_point is @c NULL the default mount point * If @a mount_point is @c NULL the default mount point
* @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used. * @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used.
@@ -132,7 +137,8 @@ rtems_status_code rtems_ftpfs_get_timeout(
); );
/** /**
* Sets the timeout value to @a timeout for the file system at @a mount_point. * @brief Sets the timeout value to @a timeout for the file system at
* @a mount_point.
* *
* The timeout value will be used during connection establishment of active * The timeout value will be used during connection establishment of active
* data connections. It will be also used for send and receive operations on * data connections. It will be also used for send and receive operations on
@@ -149,13 +155,12 @@ rtems_status_code rtems_ftpfs_set_timeout(
/** @} */ /** @} */
/** /**
* Creates the default mount point @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT and * Do not call directly, use rtems_ftpfs_mount() or mount().
* mounts the FTP file system. Do not call directly, use mount.xs
*
* It is mounted with read and write access.
*/ */
int rtems_ftpfs_initialize(rtems_filesystem_mount_table_entry_t *e, int rtems_ftpfs_initialize(
const void *d); rtems_filesystem_mount_table_entry_t *mt_entry,
const void *data
);
#ifdef __cplusplus #ifdef __cplusplus
} }