1/*-
2 * Copyright (c) 1999 Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD$
27 */
28#ifndef _NWFS_SUBR_H_
29#define _NWFS_SUBR_H_
30
31extern int nwfs_debuglevel;
32
33#ifdef MALLOC_DECLARE
34MALLOC_DECLARE(M_NWFSDATA);
35#endif
36
37struct ncp_conn;
38struct ncp_nlstables;
39struct ncp_open_info;
40struct nw_entry_info;
41struct nw_search_info;
42struct nwmount;
43struct thread;
44struct timespec;
45struct ucred;
46struct vattr;
47struct vnode;
48
49int  ncp_initsearch(struct vnode *dvp,struct thread *td, struct ucred *cred);
50int  ncp_search_for_file_or_subdir(struct nwmount *nmp,struct nw_search_seq *seq,
51		struct nw_entry_info *target,
52		struct thread *td, struct ucred *cred);
53int  ncp_lookup(struct vnode *dvp, int len, char *name, struct nw_entry_info *fap,
54		struct thread *td, struct ucred *cred);
55int  ncp_lookup_volume(struct ncp_conn *conn, char *volname,
56		u_char *volNum, u_int32_t *dirEnt,
57		struct thread *td, struct ucred *cred);
58int  ncp_close_file(struct ncp_conn *conn, ncp_fh *fh,
59		struct thread *td, struct ucred *cred);
60int  ncp_open_create_file_or_subdir(struct nwmount *nmp,struct vnode *dvp, int namelen,char *name,
61		int open_create_mode, u_int32_t create_attributes,
62		int desired_acc_rights, struct ncp_open_info *nop,
63		struct thread *td, struct ucred *cred);
64int  ncp_DeleteNSEntry(struct nwmount *nmp,
65		u_int32_t dirent, int namelen, char *name,
66		struct thread *td, struct ucred *cred);
67int  ncp_nsrename(struct ncp_conn *conn, int volume, int ns, int oldtype,
68	struct ncp_nlstables *nt,
69	nwdirent fdir, char *old_name, int oldlen,
70	nwdirent tdir, char *new_name, int newlen,
71	struct thread *td, struct ucred *cred);
72int  ncp_obtain_info(struct nwmount *nmp, u_int32_t dirent,
73		int namelen, char *path, struct nw_entry_info *target,
74		struct thread *td, struct ucred *cred);
75int  ncp_modify_file_or_subdir_dos_info(struct nwmount *nmp, struct vnode *vp,
76		u_int32_t info_mask,
77		struct nw_modify_dos_info *info,
78		struct thread *td, struct ucred *cred);
79int  ncp_setattr(struct vnode *,struct vattr *,struct ucred *,struct thread *td);
80int  ncp_get_namespaces(struct ncp_conn *conn, u_int32_t volume, int *nsf,
81		struct thread *td, struct ucred *cred);
82int  ncp_get_volume_info_with_number(struct ncp_conn *conn,
83		int n, struct ncp_volume_info *target,
84		struct thread *td, struct ucred *cred);
85
86void ncp_unix2dostime (struct timespec *tsp, int tz, u_int16_t *ddp,
87	     u_int16_t *dtp, u_int8_t *dhp);
88void ncp_dos2unixtime (u_int dd, u_int dt, u_int dh, int tz, struct timespec *tsp);
89
90#endif /* !_NWFS_SUBR_H_ */
91