source: rtems/c/src/nfsclient/src/librtemsNfs.h @ c589ebc8

4.104.114.84.95
Last change on this file since c589ebc8 was c589ebc8, checked in by Ralf Corsepius <ralf.corsepius@…>, on 07/25/07 at 05:22:23

Import from rtems-nfs-1.5.tgz.

  • Property mode set to 100644
File size: 5.0 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
74#ifdef HAVE_CEXP_H
75#include <cexpHelp.h>
76#endif
77
78/* RPCIO driver interface.
79 * If you need RPCIO for other purposes than NFS
80 * you may want to include <rpcio.h>
81#include "rpcio.h"
82 */
83
84/* Priority of daemon; may be setup prior to calling rpcUdpInit();
85 * otherwise the network task priority from the rtems_bsdnet_config
86 * is used...
87 */
88extern rtems_task_priority rpciodPriority;
89
90/* Initialize the driver
91 *
92 * RETURNS: 0 on success, -1 on failure
93 */
94int
95rpcUdpInit(void);
96
97/* Cleanup/Stop
98 *
99 * RETURNS: 0 on success, nonzero if still in use
100 */
101int
102rpcUdpCleanup(void);
103
104/* NFS driver interface */
105
106/* Initialize the NFS driver.
107 *
108 * NOTE: The RPCIO driver must have been initialized prior to
109 *       calling this.
110 *
111 * ARGS:        depth of the small and big
112 *                      transaction pools, i.e. how
113 *                      many transactions (buffers)
114 *                      should always be kept around.
115 *
116 *                      (If more transactions are needed,
117 *                      they are created and destroyed
118 *                      on the fly).
119 *
120 *                      Supply zero values to have the
121 *                      driver chose reasonable defaults.
122 */
123int
124nfsInit(int smallPoolDepth, int bigPoolDepth);
125
126/* Driver cleanup code
127 *
128 * RETURNS: 0 on success, nonzero if still in use
129 */
130int
131nfsCleanup(void);
132
133/* Dump a list of the currently mounted NFS to a file
134 * (stdout is used in case f==NULL)
135 */
136int
137nfsMountsShow(FILE *f);
138
139/* convenience wrapper
140 *
141 * NOTE: this routine calls NON-REENTRANT
142 *       gethostbyname() if the host is
143 *       not in 'dot' notation.
144 */
145int
146nfsMount(char *uidhost, char *path, char *mntpoint);
147
148/* Alternatively, a pointer to the filesystem operations
149 * table can be supplied to the native RTEMS (NON-POSIX!)
150 * 'mount()' call.
151 * Supply a "<host.in.ip.dot.notation>:<path>" string
152 * for 'device' argument to 'mount()'.
153 */
154extern struct _rtems_filesystem_operations_table nfs_fs_ops;
155
156/* A utility routine to find the path leading to a
157 * rtems_filesystem_location_info_t node.
158 *
159 * This should really be present in libcsupport...
160 *
161 * INPUT: 'loc' and a buffer 'buf' (length 'len') to hold the
162 *        path.
163 * OUTPUT: path copied into 'buf'
164 *
165 * RETURNS: 0 on success, RTEMS error code on error.
166 */
167rtems_status_code
168rtems_filesystem_resolve_location(char *buf, int len, rtems_filesystem_location_info_t *loc);
169
170/* Set the timeout (initial default: 10s) for NFS and mount calls.
171 *
172 * RETURNS 0 on success, nonzero if the requested timeout is less than
173 * a clock tick or if the system clock rate cannot be determined.
174 */
175
176int
177nfsSetTimeout(uint32_t timeout_ms);
178
179/* Read current timeout (in milliseconds) */
180uint32_t
181nfsGetTimeout();
182#endif
Note: See TracBrowser for help on using the repository browser.