source: rtems/cpukit/libnetworking/rtems/ftpfs.h @ 8916bdc7

4.104.11
Last change on this file since 8916bdc7 was 8916bdc7, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on Mar 26, 2009 at 2:11:53 PM
  • 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.
  • Property mode set to 100644
File size: 3.3 KB
Line 
1/**
2 * @file
3 *
4 * @brief 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 <rtems/libio.h>
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43/**
44 * @defgroup rtems_ftpfs File Transfer Protocol File System
45 *
46 * The FTP file system (FTP client) can be used to transfer files from or to
47 * remote hosts.
48 *
49 * You can mount the FTP file system with a call to rtems_ftpfs_mount().
50 * Alternatively you can use mount() with the @ref rtems_ftpfs_ops operations
51 * table.
52 *
53 * You can open files either read-only or write-only.  A seek is not allowed.
54 * A close terminates the control and data connections.
55 *
56 * To open a file @c file.txt in the directory @c dir (relative to home
57 * directory of the server) on a server named @c host using the user name
58 * @c user and the password @c pw you must specify the following path:
59 *
60 * @c /FTP/user:pw@host/dir/file.txt
61 *
62 * If the server is the default server specified in BOOTP, it can be ommitted:
63 *
64 * @c /FTP/user:pw/dir/file.txt
65 *
66 * The user name will be used for the password if it is ommitted:
67 *
68 * @c /FTP/user@host/dir/file.txt
69 *
70 * For the data transfer passive (= default) and active (= fallback) mode are
71 * supported.
72 *
73 * @{
74 */
75
76/**
77 * @brief Well-known port number for FTP control connection.
78 */
79#define RTEMS_FTPFS_CTRL_PORT 21
80
81/**
82 * @brief Default mount point for FTP file system.
83 */
84#define RTEMS_FTPFS_MOUNT_POINT_DEFAULT "/FTP"
85
86/**
87 * @brief FTP file system operations table.
88 */
89extern const rtems_filesystem_operations_table rtems_ftpfs_ops;
90
91/**
92 * @brief Creates the mount point @a mount_point and mounts the FTP file
93 * system.
94 *
95 * If @a mount_point is @c NULL the default mount point
96 * @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT will be used.
97 *
98 * It is mounted with read and write access.
99 *
100 * @note The parent directories of the mount point have to exist.
101 */
102rtems_status_code rtems_ftpfs_mount( const char *mount_point);
103
104/**
105 * @brief Enables or disables the verbose mode if @a verbose is @c true or
106 * @c false respectively.
107 *
108 * In the enabled verbose mode the commands and replies of the FTP control
109 * connections will be printed to standard error.
110 */
111rtems_status_code rtems_ftpfs_set_verbose( bool verbose);
112
113/**
114 * @brief Returns in @a verbose if the verbose mode is enabled or disabled.
115 */
116rtems_status_code rtems_ftpfs_get_verbose( bool *verbose);
117
118/** @} */
119
120/**
121 * @brief Creates the default mount point @ref RTEMS_FTPFS_MOUNT_POINT_DEFAULT
122 * and mounts the FTP file system.
123 *
124 * It is mounted with read and write access.
125 *
126 * On success, zero is returned.  On error, -1 is returned.
127 *
128 * @deprecated Use rtems_ftpfs_mount() instead.
129 */
130int rtems_bsdnet_initialize_ftp_filesystem( void);
131
132#ifdef __cplusplus
133}
134#endif
135
136#endif
Note: See TracBrowser for help on using the repository browser.