source: rtems/cpukit/libnetworking/librtemsNfs.h @ 1e039fb3

5
Last change on this file since 1e039fb3 was 16f4661f, checked in by Sebastian Huber <sebastian.huber@…>, on 03/09/18 at 07:38:18

network: Optionally install network headers

Install the network headers only if --enable-networking is specified.

Update #3254.

  • Property mode set to 100644
File size: 6.3 KB
Line 
1/**
2 * @file
3 *
4 * @brief Public Interface to the NFS Client Library for RTEMS
5 *
6 * @ingroup rtems-nfsclient
7 */
8
9/*
10 * Author: Till Straumann <strauman@slac.stanford.edu> 2002-2003
11 *
12 * Authorship
13 * ----------
14 * This software (NFS-2 client implementation for RTEMS) was created by
15 *     Till Straumann <strauman@slac.stanford.edu>, 2002-2007,
16 *         Stanford Linear Accelerator Center, Stanford University.
17 *
18 * Acknowledgement of sponsorship
19 * ------------------------------
20 * The NFS-2 client implementation for RTEMS was produced by
21 *     the Stanford Linear Accelerator Center, Stanford University,
22 *         under Contract DE-AC03-76SFO0515 with the Department of Energy.
23 *
24 * Government disclaimer of liability
25 * ----------------------------------
26 * Neither the United States nor the United States Department of Energy,
27 * nor any of their employees, makes any warranty, express or implied, or
28 * assumes any legal liability or responsibility for the accuracy,
29 * completeness, or usefulness of any data, apparatus, product, or process
30 * disclosed, or represents that its use would not infringe privately owned
31 * rights.
32 *
33 * Stanford disclaimer of liability
34 * --------------------------------
35 * Stanford University makes no representations or warranties, express or
36 * implied, nor assumes any liability for the use of this software.
37 *
38 * Stanford disclaimer of copyright
39 * --------------------------------
40 * Stanford University, owner of the copyright, hereby disclaims its
41 * copyright and all other rights in this software.  Hence, anyone may
42 * freely use it for any purpose without restriction.
43 *
44 * Maintenance of notices
45 * ----------------------
46 * In the interest of clarity regarding the origin and status of this
47 * SLAC software, this and all the preceding Stanford University notices
48 * are to remain affixed to any copy or derivative of this software made
49 * or distributed by the recipient and are to be affixed to any copy of
50 * software made or distributed by the recipient that contains a copy or
51 * derivative of this software.
52 *
53 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
54 */
55
56#ifndef LIB_RTEMS_NFS_CLIENT_H
57#define LIB_RTEMS_NFS_CLIENT_H
58
59/**
60 * @defgroup rtems-nfsclient NFS Client Library
61 *
62 * @ingroup nfsclient
63 * @{
64 */
65
66#ifdef  HAVE_CONFIG_H
67#include <config.h>
68#endif
69
70#include <rtems.h>
71#include <rtems/libio.h>
72#include <rtems/libio_.h>
73#include <rtems/seterr.h>
74#include <string.h>
75#include <stdio.h>
76#include <stdlib.h>
77#include <assert.h>
78#include <sys/stat.h>
79#include <dirent.h>
80#include <netdb.h>
81#include <ctype.h>
82#include <netinet/in.h>
83#include <arpa/inet.h>
84
85#ifdef __cplusplus
86extern "C" {
87#endif
88
89/** RPCIO driver interface.
90 * If you need RPCIO for other purposes than NFS
91 * you may want to include <rpcio.h>
92#include "rpcio.h"
93 */
94
95/** Priority of daemon; may be setup prior to calling rpcUdpInit();
96 * otherwise the network task priority from the rtems_bsdnet_config
97 * is used...
98 */
99extern rtems_task_priority rpciodPriority;
100
101#ifdef RTEMS_SMP
102/** CPU affinity of daemon; may be setup prior to calling rpcUdpInit();
103 * otherwise the network task CPU affinity from the rtems_bsdnet_config
104 * is used...
105 */
106extern const cpu_set_t *rpciodCpuset;
107extern size_t rpciodCpusetSize;
108#endif
109
110/**
111 * @brief Sets the XIDs of the RPC transaction hash table.
112 *
113 * The active RPC transactions are stored in a hash table.  Each table entry
114 * contains the XID of its corresponding transaction.  The XID consists of two
115 * parts.  The lower part is determined by the hash table index.  The upper
116 * part is incremented in each send operation.
117 *
118 * This function sets the upper part of the XID in all hash table entries.
119 * This can be used to ensure that the XIDs are not reused in a short interval
120 * for example during a boot process or after resets.
121 *
122 * @param[in] xid The upper part is used to set the upper XID part of the hash
123 * table entries.
124 */
125void
126rpcSetXIDs(uint32_t xid);
127
128/** Initialize the driver.
129 *
130 * Note, called in nfsfs initialise when mount is called.
131 *
132 * @retval 0 on success, -1 on failure
133 */
134int
135rpcUdpInit(void);
136
137/**
138 * @brief RPC cleanup and stop.
139 *
140 * @retval 0 on success, nonzero if still in use
141 */
142int
143rpcUdpCleanup(void);
144
145/** NFS driver interface */
146
147/**
148 * @brief Initialize the NFS driver.
149 *
150 * The RPCIO driver must have been initialized prior to calling this.
151 *
152 * Note, called in nfsfs initialise when mount is called with defaults.
153 *
154 * ARGS:        depth of the small and big
155 *                      transaction pools, i.e. how
156 *                      many transactions (buffers)
157 *                      should always be kept around.
158 *
159 *                      (If more transactions are needed,
160 *                      they are created and destroyed
161 *                      on the fly).
162 *
163 *                      Supply zero values to have the
164 *                      driver chose reasonable defaults.
165 *
166 * @retval 0 Successful operation.
167 * @retval -1 An error occurred.  The errno is set to indicate the error.
168 */
169int
170nfsInit(int smallPoolDepth, int bigPoolDepth);
171
172/**
173 * @brief Driver cleanup code.
174 *
175 * @retval 0 on success, nonzero if still in use
176 */
177int
178nfsCleanup(void);
179
180/**
181 * @brief Dump a list of the currently mounted NFS to a file.
182 *
183 * Dump a list of the currently mounted NFS to a file
184 * (stdout is used in case f==NULL)
185 */
186int
187nfsMountsShow(FILE *f);
188
189/**
190 * @brief Filesystem mount table mount handler.
191 *
192 * Filesystem mount table mount handler. Do not call, use the mount call.
193 */
194int
195rtems_nfs_initialize(rtems_filesystem_mount_table_entry_t *mt_entry,
196                     const void                           *data);
197
198/**
199 * @brief A utility routine to find the path leading to a
200 * rtems_filesystem_location_info_t node.
201 *
202 * This should really be present in libcsupport...
203 *
204 * @param[in] 'loc' and a buffer 'buf' (length 'len') to hold the path.
205 *
206 * @param[out] path copied into 'buf'
207 *
208 * @retval 0 on success, RTEMS error code on error.
209 */
210rtems_status_code
211rtems_filesystem_resolve_location(char *buf, int len, rtems_filesystem_location_info_t *loc);
212
213/**
214 * @brief Set the timeout (initial default: 10s) for NFS and mount calls.
215 *
216 * Set the timeout (initial default: 10s) for NFS and mount calls.
217 *
218 * @retval 0 on success, nonzero if the requested timeout is less than
219 * a clock tick or if the system clock rate cannot be determined.
220 */
221
222int
223nfsSetTimeout(uint32_t timeout_ms);
224
225/** Read current timeout (in milliseconds) */
226uint32_t
227nfsGetTimeout(void);
228
229#ifdef __cplusplus
230}
231#endif
232
233/** @} */
234#endif
Note: See TracBrowser for help on using the repository browser.