r12528: Add seperate proto headers for ntvfs, tdr, smb_server and nbt_server.
[samba.git] / source4 / ntvfs / ntvfs_interface.c
1 /* 
2    Unix SMB/CIFS implementation.
3    NTVFS interface functions
4
5    Copyright (C) Stefan (metze) Metzmacher 2004
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11    
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22 #include "includes.h"
23 #include "smb_server/smb_server.h"
24 #include "ntvfs/ntvfs.h"
25
26 /* connect/disconnect */
27 NTSTATUS ntvfs_connect(struct smbsrv_request *req, const char *sharename)
28 {
29         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
30         if (!ntvfs->ops->connect) {
31                 return NT_STATUS_NOT_IMPLEMENTED;
32         }
33         return ntvfs->ops->connect(ntvfs, req, sharename);
34 }
35
36 NTSTATUS ntvfs_disconnect(struct smbsrv_tcon *tcon)
37 {
38         struct ntvfs_module_context *ntvfs;
39         if (tcon->ntvfs_ctx == NULL) {
40                 return NT_STATUS_INVALID_CONNECTION;
41         }
42         ntvfs = tcon->ntvfs_ctx->modules;
43         if (!ntvfs->ops->disconnect) {
44                 return NT_STATUS_NOT_IMPLEMENTED;
45         }
46         return ntvfs->ops->disconnect(ntvfs, tcon);
47 }
48
49 /* path operations */
50 NTSTATUS ntvfs_unlink(struct smbsrv_request *req, struct smb_unlink *unl)
51 {
52         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
53         if (!ntvfs->ops->unlink) {
54                 return NT_STATUS_NOT_IMPLEMENTED;
55         }
56         return ntvfs->ops->unlink(ntvfs, req, unl);
57 }
58
59 NTSTATUS ntvfs_chkpath(struct smbsrv_request *req, struct smb_chkpath *cp)
60 {
61         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
62         if (!ntvfs->ops->chkpath) {
63                 return NT_STATUS_NOT_IMPLEMENTED;
64         }
65         return ntvfs->ops->chkpath(ntvfs, req, cp);
66 }
67
68 NTSTATUS ntvfs_qpathinfo(struct smbsrv_request *req, union smb_fileinfo *st)
69 {
70         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
71         if (!ntvfs->ops->qpathinfo) {
72                 return NT_STATUS_NOT_IMPLEMENTED;
73         }
74         return ntvfs->ops->qpathinfo(ntvfs, req, st);
75 }
76
77 NTSTATUS ntvfs_setpathinfo(struct smbsrv_request *req, union smb_setfileinfo *st)
78 {
79         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
80         if (!ntvfs->ops->setpathinfo) {
81                 return NT_STATUS_NOT_IMPLEMENTED;
82         }
83         return ntvfs->ops->setpathinfo(ntvfs, req, st);
84 }
85
86 NTSTATUS ntvfs_openfile(struct smbsrv_request *req, union smb_open *oi)
87 {
88         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
89         if (!ntvfs->ops->openfile) {
90                 return NT_STATUS_NOT_IMPLEMENTED;
91         }
92         return ntvfs->ops->openfile(ntvfs, req, oi);
93 }
94
95 NTSTATUS ntvfs_mkdir(struct smbsrv_request *req, union smb_mkdir *md)
96 {
97         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
98         if (!ntvfs->ops->mkdir) {
99                 return NT_STATUS_NOT_IMPLEMENTED;
100         }
101         return ntvfs->ops->mkdir(ntvfs, req, md);
102 }
103
104 NTSTATUS ntvfs_rmdir(struct smbsrv_request *req, struct smb_rmdir *rd)
105 {
106         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
107         if (!ntvfs->ops->rmdir) {
108                 return NT_STATUS_NOT_IMPLEMENTED;
109         }
110         return ntvfs->ops->rmdir(ntvfs, req, rd);
111 }
112
113 NTSTATUS ntvfs_rename(struct smbsrv_request *req, union smb_rename *ren)
114 {
115         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
116         if (!ntvfs->ops->rename) {
117                 return NT_STATUS_NOT_IMPLEMENTED;
118         }
119         return ntvfs->ops->rename(ntvfs, req, ren);
120 }
121
122 NTSTATUS ntvfs_copy(struct smbsrv_request *req, struct smb_copy *cp)
123 {
124         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
125         if (!ntvfs->ops->copy) {
126                 return NT_STATUS_NOT_IMPLEMENTED;
127         }
128         return ntvfs->ops->copy(ntvfs, req, cp);
129 }
130
131 /* directory search */
132 NTSTATUS ntvfs_search_first(struct smbsrv_request *req, union smb_search_first *io, void *private,
133                                  BOOL ntvfs_callback(void *private, union smb_search_data *file))
134 {
135         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
136         if (!ntvfs->ops->search_first) {
137                 return NT_STATUS_NOT_IMPLEMENTED;
138         }
139         return ntvfs->ops->search_first(ntvfs, req, io, private, ntvfs_callback);
140 }
141
142 NTSTATUS ntvfs_search_next(struct smbsrv_request *req, union smb_search_next *io, void *private,
143                                  BOOL ntvfs_callback(void *private, union smb_search_data *file))
144 {
145         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
146         if (!ntvfs->ops->search_next) {
147                 return NT_STATUS_NOT_IMPLEMENTED;
148         }
149         return ntvfs->ops->search_next(ntvfs, req, io, private, ntvfs_callback);
150 }
151
152 NTSTATUS ntvfs_search_close(struct smbsrv_request *req, union smb_search_close *io)
153 {
154         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
155         if (!ntvfs->ops->search_close) {
156                 return NT_STATUS_NOT_IMPLEMENTED;
157         }
158         return ntvfs->ops->search_close(ntvfs, req, io);
159 }
160
161 /* operations on open files */
162 NTSTATUS ntvfs_ioctl(struct smbsrv_request *req, union smb_ioctl *io)
163 {
164         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
165         if (!ntvfs->ops->ioctl) {
166                 return NT_STATUS_NOT_IMPLEMENTED;
167         }
168         return ntvfs->ops->ioctl(ntvfs, req, io);
169 }
170
171 NTSTATUS ntvfs_read(struct smbsrv_request *req, union smb_read *io)
172 {
173         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
174         if (!ntvfs->ops->read) {
175                 return NT_STATUS_NOT_IMPLEMENTED;
176         }
177         return ntvfs->ops->read(ntvfs, req, io);
178 }
179
180 NTSTATUS ntvfs_write(struct smbsrv_request *req, union smb_write *io)
181 {
182         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
183         if (!ntvfs->ops->write) {
184                 return NT_STATUS_NOT_IMPLEMENTED;
185         }
186         return ntvfs->ops->write(ntvfs, req, io);
187 }
188
189 NTSTATUS ntvfs_seek(struct smbsrv_request *req, struct smb_seek *io)
190 {
191         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
192         if (!ntvfs->ops->seek) {
193                 return NT_STATUS_NOT_IMPLEMENTED;
194         }
195         return ntvfs->ops->seek(ntvfs, req, io);
196 }
197
198 NTSTATUS ntvfs_flush(struct smbsrv_request *req, struct smb_flush *flush)
199 {
200         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
201         if (!ntvfs->ops->flush) {
202                 return NT_STATUS_NOT_IMPLEMENTED;
203         }
204         return ntvfs->ops->flush(ntvfs, req, flush);
205 }
206
207 NTSTATUS ntvfs_close(struct smbsrv_request *req, union smb_close *io)
208 {
209         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
210         if (!ntvfs->ops->close) {
211                 return NT_STATUS_NOT_IMPLEMENTED;
212         }
213         return ntvfs->ops->close(ntvfs, req, io);
214 }
215
216 NTSTATUS ntvfs_exit(struct smbsrv_request *req)
217 {
218         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
219         if (!ntvfs->ops->exit) {
220                 return NT_STATUS_NOT_IMPLEMENTED;
221         }
222         return ntvfs->ops->exit(ntvfs, req);
223 }
224
225 NTSTATUS ntvfs_lock(struct smbsrv_request *req, union smb_lock *lck)
226 {
227         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
228         if (!ntvfs->ops->lock) {
229                 return NT_STATUS_NOT_IMPLEMENTED;
230         }
231         return ntvfs->ops->lock(ntvfs, req, lck);
232 }
233
234 NTSTATUS ntvfs_setfileinfo(struct smbsrv_request *req, union smb_setfileinfo *info)
235 {
236         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
237         if (!ntvfs->ops->setfileinfo) {
238                 return NT_STATUS_NOT_IMPLEMENTED;
239         }
240         return ntvfs->ops->setfileinfo(ntvfs, req, info);
241 }
242
243 NTSTATUS ntvfs_qfileinfo(struct smbsrv_request *req, union smb_fileinfo *info)
244 {
245         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
246         if (!ntvfs->ops->qfileinfo) {
247                 return NT_STATUS_NOT_IMPLEMENTED;
248         }
249         return ntvfs->ops->qfileinfo(ntvfs, req, info);
250 }
251
252 /* filesystem operations */
253 NTSTATUS ntvfs_fsinfo(struct smbsrv_request *req, union smb_fsinfo *fs)
254 {
255         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
256         if (!ntvfs->ops->fsinfo) {
257                 return NT_STATUS_NOT_IMPLEMENTED;
258         }
259         return ntvfs->ops->fsinfo(ntvfs, req, fs);
260 }
261
262 /* printing specific operations */
263 NTSTATUS ntvfs_lpq(struct smbsrv_request *req, union smb_lpq *lpq)
264 {
265         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
266         if (!ntvfs->ops->lpq) {
267                 return NT_STATUS_NOT_IMPLEMENTED;
268         }
269         return ntvfs->ops->lpq(ntvfs, req, lpq);
270 }
271
272 /* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
273 NTSTATUS ntvfs_trans2(struct smbsrv_request *req, struct smb_trans2 *trans2)
274 {
275         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
276         if (!ntvfs->ops->trans2) {
277                 return NT_STATUS_NOT_IMPLEMENTED;
278         }
279         return ntvfs->ops->trans2(ntvfs, req, trans2);
280 }
281
282 /* trans interface - used by IPC backend for pipes and RAP calls */
283 NTSTATUS ntvfs_trans(struct smbsrv_request *req, struct smb_trans2 *trans)
284 {
285         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
286         if (!ntvfs->ops->trans) {
287                 return NT_STATUS_NOT_IMPLEMENTED;
288         }
289         return ntvfs->ops->trans(ntvfs, req, trans);
290 }
291
292 /* logoff - called when a vuid is closed */
293 NTSTATUS ntvfs_logoff(struct smbsrv_request *req)
294 {
295         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
296         if (!ntvfs->ops->logoff) {
297                 return NT_STATUS_NOT_IMPLEMENTED;
298         }
299         return ntvfs->ops->logoff(ntvfs, req);
300 }
301
302 /* async setup - called by a backend that wants to setup any state for
303    a async request */
304 NTSTATUS ntvfs_async_setup(struct smbsrv_request *req, void *private)
305 {
306         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
307         if (!ntvfs->ops->async_setup) {
308                 return NT_STATUS_NOT_IMPLEMENTED;
309         }
310         return ntvfs->ops->async_setup(ntvfs, req, private);
311 }
312
313
314 /*
315   cancel an outstanding async request
316 */
317 NTSTATUS ntvfs_cancel(struct smbsrv_request *req)
318 {
319         struct ntvfs_module_context *ntvfs = req->tcon->ntvfs_ctx->modules;
320         if (!ntvfs->ops->cancel) {
321                 return NT_STATUS_NOT_IMPLEMENTED;
322         }
323         return ntvfs->ops->cancel(ntvfs, req);
324 }
325
326
327 /* initial setup */
328 NTSTATUS ntvfs_next_connect(struct ntvfs_module_context *ntvfs, 
329                             struct smbsrv_request *req, const char *sharename)
330 {
331         if (!ntvfs->next || !ntvfs->next->ops->connect) {
332                 return NT_STATUS_NOT_IMPLEMENTED;
333         }
334         return ntvfs->next->ops->connect(ntvfs->next, req, sharename);
335 }
336
337 NTSTATUS ntvfs_next_disconnect(struct ntvfs_module_context *ntvfs, 
338                                struct smbsrv_tcon *tcon)
339 {
340         if (!ntvfs->next || !ntvfs->next->ops->disconnect) {
341                 return NT_STATUS_NOT_IMPLEMENTED;
342         }
343         return ntvfs->next->ops->disconnect(ntvfs->next, tcon);
344 }
345
346 /* path operations */
347 NTSTATUS ntvfs_next_unlink(struct ntvfs_module_context *ntvfs, 
348                            struct smbsrv_request *req, struct smb_unlink *unl)
349 {
350         if (!ntvfs->next || !ntvfs->next->ops->unlink) {
351                 return NT_STATUS_NOT_IMPLEMENTED;
352         }
353         return ntvfs->next->ops->unlink(ntvfs->next, req, unl);
354 }
355
356 NTSTATUS ntvfs_next_chkpath(struct ntvfs_module_context *ntvfs, 
357                             struct smbsrv_request *req, struct smb_chkpath *cp)
358 {
359         if (!ntvfs->next || !ntvfs->next->ops->chkpath) {
360                 return NT_STATUS_NOT_IMPLEMENTED;
361         }
362         return ntvfs->next->ops->chkpath(ntvfs->next, req, cp);
363 }
364
365 NTSTATUS ntvfs_next_qpathinfo(struct ntvfs_module_context *ntvfs, 
366                               struct smbsrv_request *req, union smb_fileinfo *st)
367 {
368         if (!ntvfs->next || !ntvfs->next->ops->qpathinfo) {
369                 return NT_STATUS_NOT_IMPLEMENTED;
370         }
371         return ntvfs->next->ops->qpathinfo(ntvfs->next, req, st);
372 }
373
374 NTSTATUS ntvfs_next_setpathinfo(struct ntvfs_module_context *ntvfs, 
375                                 struct smbsrv_request *req, union smb_setfileinfo *st)
376 {
377         if (!ntvfs->next || !ntvfs->next->ops->setpathinfo) {
378                 return NT_STATUS_NOT_IMPLEMENTED;
379         }
380         return ntvfs->next->ops->setpathinfo(ntvfs->next, req, st);
381 }
382
383 NTSTATUS ntvfs_next_openfile(struct ntvfs_module_context *ntvfs, 
384                          struct smbsrv_request *req, union smb_open *oi)
385 {
386         if (!ntvfs->next || !ntvfs->next->ops->openfile) {
387                 return NT_STATUS_NOT_IMPLEMENTED;
388         }
389         return ntvfs->next->ops->openfile(ntvfs->next, req, oi);
390 }
391
392 NTSTATUS ntvfs_next_mkdir(struct ntvfs_module_context *ntvfs, 
393                           struct smbsrv_request *req, union smb_mkdir *md)
394 {
395         if (!ntvfs->next || !ntvfs->next->ops->mkdir) {
396                 return NT_STATUS_NOT_IMPLEMENTED;
397         }
398         return ntvfs->next->ops->mkdir(ntvfs->next, req, md);
399 }
400
401 NTSTATUS ntvfs_next_rmdir(struct ntvfs_module_context *ntvfs, 
402                           struct smbsrv_request *req, struct smb_rmdir *rd)
403 {
404         if (!ntvfs->next || !ntvfs->next->ops->rmdir) {
405                 return NT_STATUS_NOT_IMPLEMENTED;
406         }
407         return ntvfs->next->ops->rmdir(ntvfs->next, req, rd);
408 }
409
410 NTSTATUS ntvfs_next_rename(struct ntvfs_module_context *ntvfs, 
411                            struct smbsrv_request *req, union smb_rename *ren)
412 {
413         if (!ntvfs->next || !ntvfs->next->ops->rename) {
414                 return NT_STATUS_NOT_IMPLEMENTED;
415         }
416         return ntvfs->next->ops->rename(ntvfs->next, req, ren);
417 }
418
419 NTSTATUS ntvfs_next_copy(struct ntvfs_module_context *ntvfs, 
420                          struct smbsrv_request *req, struct smb_copy *cp)
421 {
422         if (!ntvfs->next || !ntvfs->next->ops->copy) {
423                 return NT_STATUS_NOT_IMPLEMENTED;
424         }
425         return ntvfs->next->ops->copy(ntvfs->next, req, cp);
426 }
427
428 /* directory search */
429 NTSTATUS ntvfs_next_search_first(struct ntvfs_module_context *ntvfs, 
430                                  struct smbsrv_request *req, union smb_search_first *io, void *private,
431                                  BOOL (*callback)(void *private, union smb_search_data *file))
432 {
433         if (!ntvfs->next || !ntvfs->next->ops->search_first) {
434                 return NT_STATUS_NOT_IMPLEMENTED;
435         }
436         return ntvfs->next->ops->search_first(ntvfs->next, req, io, private, callback);
437 }
438
439 NTSTATUS ntvfs_next_search_next(struct ntvfs_module_context *ntvfs, 
440                                 struct smbsrv_request *req, union smb_search_next *io, void *private,
441                                 BOOL (*callback)(void *private, union smb_search_data *file))
442 {
443         if (!ntvfs->next || !ntvfs->next->ops->search_next) {
444                 return NT_STATUS_NOT_IMPLEMENTED;
445         }
446         return ntvfs->next->ops->search_next(ntvfs->next, req, io, private, callback);
447 }
448
449 NTSTATUS ntvfs_next_search_close(struct ntvfs_module_context *ntvfs, 
450                                  struct smbsrv_request *req, union smb_search_close *io)
451 {
452         if (!ntvfs->next || !ntvfs->next->ops->search_close) {
453                 return NT_STATUS_NOT_IMPLEMENTED;
454         }
455         return ntvfs->next->ops->search_close(ntvfs->next, req, io);
456 }
457
458 /* operations on open files */
459 NTSTATUS ntvfs_next_ioctl(struct ntvfs_module_context *ntvfs, 
460                           struct smbsrv_request *req, union smb_ioctl *io)
461 {
462         if (!ntvfs->next || !ntvfs->next->ops->ioctl) {
463                 return NT_STATUS_NOT_IMPLEMENTED;
464         }
465         return ntvfs->next->ops->ioctl(ntvfs->next, req, io);
466 }
467
468 NTSTATUS ntvfs_next_read(struct ntvfs_module_context *ntvfs, 
469                          struct smbsrv_request *req, union smb_read *io)
470 {
471         if (!ntvfs->next || !ntvfs->next->ops->read) {
472                 return NT_STATUS_NOT_IMPLEMENTED;
473         }
474         return ntvfs->next->ops->read(ntvfs->next, req, io);
475 }
476
477 NTSTATUS ntvfs_next_write(struct ntvfs_module_context *ntvfs, 
478                           struct smbsrv_request *req, union smb_write *io)
479 {
480         if (!ntvfs->next || !ntvfs->next->ops->write) {
481                 return NT_STATUS_NOT_IMPLEMENTED;
482         }
483         return ntvfs->next->ops->write(ntvfs->next, req, io);
484 }
485
486 NTSTATUS ntvfs_next_seek(struct ntvfs_module_context *ntvfs, 
487                          struct smbsrv_request *req, struct smb_seek *io)
488 {
489         if (!ntvfs->next || !ntvfs->next->ops->seek) {
490                 return NT_STATUS_NOT_IMPLEMENTED;
491         }
492         return ntvfs->next->ops->seek(ntvfs->next, req, io);
493 }
494
495 NTSTATUS ntvfs_next_flush(struct ntvfs_module_context *ntvfs, 
496                           struct smbsrv_request *req, struct smb_flush *flush)
497 {
498         if (!ntvfs->next || !ntvfs->next->ops->flush) {
499                 return NT_STATUS_NOT_IMPLEMENTED;
500         }
501         return ntvfs->next->ops->flush(ntvfs->next, req, flush);
502 }
503
504 NTSTATUS ntvfs_next_close(struct ntvfs_module_context *ntvfs, 
505                           struct smbsrv_request *req, union smb_close *io)
506 {
507         if (!ntvfs->next || !ntvfs->next->ops->close) {
508                 return NT_STATUS_NOT_IMPLEMENTED;
509         }
510         return ntvfs->next->ops->close(ntvfs->next, req, io);
511 }
512
513 NTSTATUS ntvfs_next_exit(struct ntvfs_module_context *ntvfs, 
514                          struct smbsrv_request *req)
515 {
516         if (!ntvfs->next || !ntvfs->next->ops->exit) {
517                 return NT_STATUS_NOT_IMPLEMENTED;
518         }
519         return ntvfs->next->ops->exit(ntvfs->next, req);
520 }
521
522 NTSTATUS ntvfs_next_lock(struct ntvfs_module_context *ntvfs, 
523                          struct smbsrv_request *req, union smb_lock *lck)
524 {
525         if (!ntvfs->next || !ntvfs->next->ops->lock) {
526                 return NT_STATUS_NOT_IMPLEMENTED;
527         }
528         return ntvfs->next->ops->lock(ntvfs->next, req, lck);
529 }
530
531 NTSTATUS ntvfs_next_setfileinfo(struct ntvfs_module_context *ntvfs, 
532                                 struct smbsrv_request *req, union smb_setfileinfo *info)
533 {
534         if (!ntvfs->next || !ntvfs->next->ops->setfileinfo) {
535                 return NT_STATUS_NOT_IMPLEMENTED;
536         }
537         return ntvfs->next->ops->setfileinfo(ntvfs->next, req, info);
538 }
539
540 NTSTATUS ntvfs_next_qfileinfo(struct ntvfs_module_context *ntvfs, 
541                               struct smbsrv_request *req, union smb_fileinfo *info)
542 {
543         if (!ntvfs->next || !ntvfs->next->ops->qfileinfo) {
544                 return NT_STATUS_NOT_IMPLEMENTED;
545         }
546         return ntvfs->next->ops->qfileinfo(ntvfs->next, req, info);
547 }
548
549 /* filesystem operations */
550 NTSTATUS ntvfs_next_fsinfo(struct ntvfs_module_context *ntvfs, 
551                            struct smbsrv_request *req, union smb_fsinfo *fs)
552 {
553         if (!ntvfs->next || !ntvfs->next->ops->fsinfo) {
554                 return NT_STATUS_NOT_IMPLEMENTED;
555         }
556         return ntvfs->next->ops->fsinfo(ntvfs->next, req, fs);
557 }
558
559 /* printing specific operations */
560 NTSTATUS ntvfs_next_lpq(struct ntvfs_module_context *ntvfs, 
561                         struct smbsrv_request *req, union smb_lpq *lpq)
562 {
563         if (!ntvfs->next || !ntvfs->next->ops->lpq) {
564                 return NT_STATUS_NOT_IMPLEMENTED;
565         }
566         return ntvfs->next->ops->lpq(ntvfs->next, req, lpq);
567 }
568
569 /* trans2 interface - only used by CIFS backend to prover complete passthru for testing */
570 NTSTATUS ntvfs_next_trans2(struct ntvfs_module_context *ntvfs, 
571                            struct smbsrv_request *req, struct smb_trans2 *trans2)
572 {
573         if (!ntvfs->next || !ntvfs->next->ops->trans2) {
574                 return NT_STATUS_NOT_IMPLEMENTED;
575         }
576         return ntvfs->next->ops->trans2(ntvfs->next, req, trans2);
577 }
578
579 /* trans interface - used by IPC backend for pipes and RAP calls */
580 NTSTATUS ntvfs_next_trans(struct ntvfs_module_context *ntvfs, 
581                           struct smbsrv_request *req, struct smb_trans2 *trans)
582 {
583         if (!ntvfs->next || !ntvfs->next->ops->trans) {
584                 return NT_STATUS_NOT_IMPLEMENTED;
585         }
586         return ntvfs->next->ops->trans(ntvfs->next, req, trans);
587 }
588
589 /* logoff - called when a vuid is closed */
590 NTSTATUS ntvfs_next_logoff(struct ntvfs_module_context *ntvfs, 
591                            struct smbsrv_request *req)
592 {
593         if (!ntvfs->next || !ntvfs->next->ops->logoff) {
594                 return NT_STATUS_NOT_IMPLEMENTED;
595         }
596         return ntvfs->next->ops->logoff(ntvfs->next, req);
597 }
598
599 /* async_setup - called when setting up for a async request */
600 NTSTATUS ntvfs_next_async_setup(struct ntvfs_module_context *ntvfs, 
601                                 struct smbsrv_request *req, 
602                                 void *private)
603 {
604         if (!ntvfs->next || !ntvfs->next->ops->async_setup) {
605                 return NT_STATUS_NOT_IMPLEMENTED;
606         }
607         return ntvfs->next->ops->async_setup(ntvfs->next, req, private);
608 }
609
610 /* cancel - called to cancel an outstanding async request */
611 NTSTATUS ntvfs_next_cancel(struct ntvfs_module_context *ntvfs, 
612                            struct smbsrv_request *req)
613 {
614         if (!ntvfs->next || !ntvfs->next->ops->cancel) {
615                 return NT_STATUS_NOT_IMPLEMENTED;
616         }
617         return ntvfs->next->ops->cancel(ntvfs->next, req);
618 }