source: rtems/cpukit/libfs/src/nfsclient/src/librtemsNfs.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.9 KB
Line 
1#ifndef LIB_RTEMS_NFS_CLIENT_H
2#define LIB_RTEMS_NFS_CLIENT_H
3/* $Id$ */
4
5/* public interface to the NFS client library for RTEMS */
6
7/* Author: Till Straumann <strauman@slac.stanford.edu> 2002-2003 */
8
9/*
10 * Authorship
11 * ----------
12 * This software (NFS-2 client implementation for RTEMS) was created by
13 *     Till Straumann <strauman@slac.stanford.edu>, 2002-2007,
14 *         Stanford Linear Accelerator Center, Stanford University.
15 *
16 * Acknowledgement of sponsorship
17 * ------------------------------
18 * The NFS-2 client implementation for RTEMS was produced by
19 *     the Stanford Linear Accelerator Center, Stanford University,
20 *         under Contract DE-AC03-76SFO0515 with the Department of Energy.
21 *
22 * Government disclaimer of liability
23 * ----------------------------------
24 * Neither the United States nor the United States Department of Energy,
25 * nor any of their employees, makes any warranty, express or implied, or
26 * assumes any legal liability or responsibility for the accuracy,
27 * completeness, or usefulness of any data, apparatus, product, or process
28 * disclosed, or represents that its use would not infringe privately owned
29 * rights.
30 *
31 * Stanford disclaimer of liability
32 * --------------------------------
33 * Stanford University makes no representations or warranties, express or
34 * implied, nor assumes any liability for the use of this software.
35 *
36 * Stanford disclaimer of copyright
37 * --------------------------------
38 * Stanford University, owner of the copyright, hereby disclaims its
39 * copyright and all other rights in this software.  Hence, anyone may
40 * freely use it for any purpose without restriction.
41 *
42 * Maintenance of notices
43 * ----------------------
44 * In the interest of clarity regarding the origin and status of this
45 * SLAC software, this and all the preceding Stanford University notices
46 * are to remain affixed to any copy or derivative of this software made
47 * or distributed by the recipient and are to be affixed to any copy of
48 * software made or distributed by the recipient that contains a copy or
49 * derivative of this software.
50 *
51 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
52 */
53
54#ifdef  HAVE_CONFIG_H
55#include <config.h>
56#endif
57
58#include <rtems.h>
59#include <rtems/libio.h>
60#include <rtems/libio_.h>
61#include <rtems/seterr.h>
62#include <string.h>
63#include <stdio.h>
64#include <stdlib.h>
65#include <assert.h>
66#include <sys/stat.h>
67#include <dirent.h>
68#include <netdb.h>
69#include <ctype.h>
70#include <netinet/in.h>
71#include <arpa/inet.h>
72
73#ifdef __cplusplus
74extern "C" {
75#endif
76
77/* RPCIO driver interface.
78 * If you need RPCIO for other purposes than NFS
79 * you may want to include <rpcio.h>
80#include "rpcio.h"
81 */
82
83/* Priority of daemon; may be setup prior to calling rpcUdpInit();
84 * otherwise the network task priority from the rtems_bsdnet_config
85 * is used...
86 */
87extern rtems_task_priority rpciodPriority;
88
89/* Initialize the driver.
90 *
91 * Note, called in nfsfs initialise when mount is called.
92 *
93 * RETURNS: 0 on success, -1 on failure
94 */
95int
96rpcUdpInit(void);
97
98/* Cleanup/Stop
99 *
100 * RETURNS: 0 on success, nonzero if still in use
101 */
102int
103rpcUdpCleanup(void);
104
105/* NFS driver interface */
106
107/* Initialize the NFS driver.
108 *
109 * NOTE: The RPCIO driver must have been initialized prior to
110 *       calling this.
111 *
112 * Note, called in nfsfs initialise when mount is called with defaults.
113 *
114 * ARGS:        depth of the small and big
115 *                      transaction pools, i.e. how
116 *                      many transactions (buffers)
117 *                      should always be kept around.
118 *
119 *                      (If more transactions are needed,
120 *                      they are created and destroyed
121 *                      on the fly).
122 *
123 *                      Supply zero values to have the
124 *                      driver chose reasonable defaults.
125 */
126int
127nfsInit(int smallPoolDepth, int bigPoolDepth);
128
129/* Driver cleanup code
130 *
131 * RETURNS: 0 on success, nonzero if still in use
132 */
133int
134nfsCleanup(void);
135
136/* Dump a list of the currently mounted NFS to a file
137 * (stdout is used in case f==NULL)
138 */
139int
140nfsMountsShow(FILE *f);
141
142/*
143 * Filesystem mount table mount handler. Do not call, use the mount call.
144 */
145int
146rtems_nfsfs_initialize(rtems_filesystem_mount_table_entry_t *mt_entry,
147                       const void                           *data);
148
149/* A utility routine to find the path leading to a
150 * rtems_filesystem_location_info_t node.
151 *
152 * This should really be present in libcsupport...
153 *
154 * INPUT: 'loc' and a buffer 'buf' (length 'len') to hold the
155 *        path.
156 * OUTPUT: path copied into 'buf'
157 *
158 * RETURNS: 0 on success, RTEMS error code on error.
159 */
160rtems_status_code
161rtems_filesystem_resolve_location(char *buf, int len, rtems_filesystem_location_info_t *loc);
162
163/* Set the timeout (initial default: 10s) for NFS and mount calls.
164 *
165 * RETURNS 0 on success, nonzero if the requested timeout is less than
166 * a clock tick or if the system clock rate cannot be determined.
167 */
168
169int
170nfsSetTimeout(uint32_t timeout_ms);
171
172/* Read current timeout (in milliseconds) */
173uint32_t
174nfsGetTimeout(void);
175
176#ifdef __cplusplus
177}
178#endif
179
180#endif
Note: See TracBrowser for help on using the repository browser.