source: rtems/cpukit/libnetworking/rtems/ftpfs.h @ 29e92b0

4.104.115
Last change on this file since 29e92b0 was 29e92b0, checked in by Chris Johns <chrisj@…>, on 05/31/10 at 13:56:37

2010-05-31 Chris Johns <chrisj@…>

  • libcsupport/Makefile.am: Add mount-mgr.c.
  • libcsupport/src/mount-mgr.c: New.
  • include/rtems/fs.h: Added rtems_filesystem_location_mount.
  • libcsupport/include/rtems/libio.h, libcsupport/src/mount.c: New mount interface. It is similar to Linux.
  • libcsupport/include/rtems/libio_.h: Remove the init_fs_mount_table call.
  • libcsupport/src/base_fs.c: Remove init_fs_mount_table_call. Use the new mount call. Remove setting the root node in the global pathloc. Mount does this now.
  • libcsupport/src/privateenv.c: Remove the hack to set the root mount table entry in the environment.
  • libcsupport/src/unmount.cL Free the target string.
  • libblock/src/bdpart-mount.c: New mount API.
  • libfs/src/devfs/devfs.h, libfs/src/devfs/devfs_init.c, libfs/src/dosfs/dosfs.h, libfs/src/dosfs/msdos.h, libfs/src/dosfs/msdos_init.c, libfs/src/imfs/imfs.h, libfs/src/imfs/imfs_eval.c, libfs/src/imfs/imfs_init.c, libfs/src/imfs/miniimfs_init.c, libfs/src/nfsclient/src/librtemsNfs.h, libfs/src/rfs/rtems-rfs-rtems.c, libfs/src/rfs/rtems-rfs.h, libnetworking/lib/ftpfs.c, libnetworking/rtems/ftpfs.h, libnetworking/rtems/tftp.h: New mount_h API.
  • libfs/src/devfs/devfs_eval.c: Local include of extern ops.
  • libfs/src/nfsclient/src/nfs.c: New mount API. Removed the mount me call and fixed the initialisation to happen when mounting.
  • libmisc/Makefile.am, libmisc/shell/shellconfig.h: Remove mount filesystem files.
  • libmisc/fsmount/fsmount.c, libmisc/fsmount/fsmount.h: Updated to the new mount table values.
  • libmisc/shell/main_mount_ftp.c, libmisc/shell/main_mount_msdos.c, libmisc/shell/main_mount_rfs.c, libmisc/shell/main_mount_tftp.c: Removed.
  • libmisc/shell/main_mount.c: Use the new mount API. Also access the file system table for the file system types.
  • libnetworking/lib/tftpDriver.c: Updated to the new mount API. Fixed to allow mounting from any mount point. Also can now have more than file system mounted.
  • sapi/include/confdefs.h: Add file system configuration support.
  • Property mode set to 100644
File size: 4.5 KB
Line 
1/**
2 * @file
3 *
4 * File Transfer Protocol file system (FTP client).
5 */
6
7/*
8 * Copyright (c) 2009
9 * embedded brains GmbH
10 * Obere Lagerstr. 30
11 * D-82178 Puchheim
12 * Germany
13 * <rtems@embedded-brains.de>
14 *
15 * (c) Copyright 2002
16 * Thomas Doerfler
17 * IMD Ingenieurbuero fuer Microcomputertechnik
18 * Herbststr. 8
19 * 82178 Puchheim, Germany
20 * <Thomas.Doerfler@imd-systems.de>
21 *
22 * Modified by Sebastian Huber <sebastian.huber@embedded-brains.de>.
23 *
24 * This code has been created after closly inspecting "tftpdriver.c" from Eric
25 * Norum.
26 *
27 * The license and distribution terms for this file may be
28 * found in the file LICENSE in this distribution or at
29 * http://www.rtems.com/license/LICENSE.
30 *
31 * $Id$
32 */
33
34#ifndef _RTEMS_FTPFS_H
35#define _RTEMS_FTPFS_H
36
37#include <sys/time.h>
38#include <sys/ioctl.h>
39
40#include <rtems/libio.h>
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46/**
47 * @defgroup rtems_ftpfs File Transfer Protocol File System
48 *
49 * The FTP file system (FTP client) can be used to transfer files from or to
50 * remote hosts.
51 *
52 * You can mount the FTP file system with a call to rtems_ftpfs_mount().
53 * Alternatively you can use mount() with the @ref rtems_ftpfs_ops operations
54 * table.
55 *
56 * You can open files either read-only or write-only.  A seek is not allowed.
57 * A close terminates the control and data connections.
58 *
59 * To open a file @c file.txt in the directory @c dir (relative to home
60 * directory of the server) on a server named @c host using the user name
61 * @c user and the password @c pw you must specify the following path:
62 * <tt>/FTP/user:pw@@host/dir/file.txt</tt>.
63 *
64 * If the server is the default server specified in BOOTP, it can be ommitted:
65 * <tt>/FTP/user:pw/dir/file.txt</tt>.
66 *
67 * The user name will be used for the password if it is ommitted:
68 * <tt>/FTP/user@@host/dir/file.txt</tt>.
69 *
70 * For the data transfer passive (= default) and active (= fallback) mode are
71 * supported.
72 *
73 * @{
74 */
75
76/**
77 * Well-known port number for FTP control connection.
78 */
79#define RTEMS_FTPFS_CTRL_PORT 21
80
81/**
82 * Default mount point for FTP file system.
83 */
84#define RTEMS_FTPFS_MOUNT_POINT_DEFAULT "/FTP"
85
86/**
87 * FTP file system IO control requests.
88 */
89typedef enum {
90  RTEMS_FTPFS_IOCTL_GET_VERBOSE = _IOR( 'd', 1, bool *),
91  RTEMS_FTPFS_IOCTL_SET_VERBOSE = _IOW( 'd', 1, bool *),
92  RTEMS_FTPFS_IOCTL_GET_TIMEOUT = _IOR( 'd', 2, struct timeval *),
93  RTEMS_FTPFS_IOCTL_SET_TIMEOUT = _IOW( 'd', 2, struct timeval *)
94} rtems_ftpfs_ioctl_numbers;
95
96/**
97 * FTP file system operations table.
98 */
99extern const rtems_filesystem_operations_table rtems_ftpfs_ops;
100
101/**
102 * Returns in @a verbose if the verbose mode is enabled or disabled for the
103 * file system at @a mount_point.
104 *
105 * If @a mount_point is @c NULL the default mount point
106 * @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used.
107 */
108rtems_status_code rtems_ftpfs_get_verbose( const char *mount_point, bool *verbose);
109
110/**
111 * Enables or disables the verbose mode if @a verbose is @c true or
112 * @c false respectively for the file system at @a mount_point.
113 *
114 * In the enabled verbose mode the commands and replies of the FTP control
115 * connections will be printed to standard error.
116 *
117 * If @a mount_point is @c NULL the default mount point
118 * @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used.
119 */
120rtems_status_code rtems_ftpfs_set_verbose( const char *mount_point, bool verbose);
121
122/**
123 * Returns the current timeout value in @a timeout for the file system at
124 * @a mount_point.
125 *
126 * If @a mount_point is @c NULL the default mount point
127 * @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used.
128 */
129rtems_status_code rtems_ftpfs_get_timeout(
130  const char *mount_point,
131  struct timeval *timeout
132);
133
134/**
135 * Sets the timeout value to @a timeout for the file system at @a mount_point.
136 *
137 * The timeout value will be used during connection establishment of active
138 * data connections.  It will be also used for send and receive operations on
139 * data and control connections.
140 *
141 * If @a mount_point is @c NULL the default mount point
142 * @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used.
143 */
144rtems_status_code rtems_ftpfs_set_timeout(
145  const char *mount_point,
146  const struct timeval *timeout
147);
148
149/** @} */
150
151/**
152 * Creates the default mount point @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT and
153 * mounts the FTP file system. Do not call directly, use mount.xs
154 *
155 * It is mounted with read and write access.
156 */
157int rtems_ftpfs_initialize(rtems_filesystem_mount_table_entry_t *e,
158                           const void                           *d);
159
160#ifdef __cplusplus
161}
162#endif
163
164#endif
Note: See TracBrowser for help on using the repository browser.