xref: /freebsd/usr.sbin/rpc.umntall/mounttab.h (revision afe1ef249f67c207515285f01df1b3467e822917)
1c69a34d4SMatthew Dillon /*
2c69a34d4SMatthew Dillon  * Copyright (c) 1999 Martin Blapp
3c69a34d4SMatthew Dillon  * All rights reserved.
4c69a34d4SMatthew Dillon  *
5c69a34d4SMatthew Dillon  * Redistribution and use in source and binary forms, with or without
6c69a34d4SMatthew Dillon  * modification, are permitted provided that the following conditions
7c69a34d4SMatthew Dillon  * are met:
8c69a34d4SMatthew Dillon  * 1. Redistributions of source code must retain the above copyright
9c69a34d4SMatthew Dillon  *    notice, this list of conditions and the following disclaimer.
10c69a34d4SMatthew Dillon  * 2. Redistributions in binary form must reproduce the above copyright
11c69a34d4SMatthew Dillon  *    notice, this list of conditions and the following disclaimer in the
12c69a34d4SMatthew Dillon  *    documentation and/or other materials provided with the distribution.
13c69a34d4SMatthew Dillon  *
14c69a34d4SMatthew Dillon  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15c69a34d4SMatthew Dillon  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16c69a34d4SMatthew Dillon  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17c69a34d4SMatthew Dillon  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18c69a34d4SMatthew Dillon  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19c69a34d4SMatthew Dillon  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20c69a34d4SMatthew Dillon  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21c69a34d4SMatthew Dillon  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22c69a34d4SMatthew Dillon  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23c69a34d4SMatthew Dillon  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24c69a34d4SMatthew Dillon  * SUCH DAMAGE.
25c69a34d4SMatthew Dillon  *
26c69a34d4SMatthew Dillon  * $FreeBSD$
27c69a34d4SMatthew Dillon  */
28c69a34d4SMatthew Dillon 
29c69a34d4SMatthew Dillon #define STRSIZ  (RPCMNT_NAMELEN+RPCMNT_PATHLEN+100)
30c69a34d4SMatthew Dillon #define PATH_MOUNTTAB	"/var/db/mounttab"
31c69a34d4SMatthew Dillon 
32c69a34d4SMatthew Dillon /* Structure for /var/db/mounttab */
33c69a34d4SMatthew Dillon struct mtablist {
34c69a34d4SMatthew Dillon 	time_t	mtab_time;
35c69a34d4SMatthew Dillon 	char	mtab_host[RPCMNT_NAMELEN];
36c69a34d4SMatthew Dillon 	char	mtab_dirp[RPCMNT_PATHLEN];
37c69a34d4SMatthew Dillon 	struct mtablist *mtab_next;
38c69a34d4SMatthew Dillon };
39c69a34d4SMatthew Dillon 
40afe1ef24SIan Dowse extern struct mtablist *mtabhead;
41afe1ef24SIan Dowse 
42c69a34d4SMatthew Dillon int	add_mtab(char *, char *);
43afe1ef24SIan Dowse void	clean_mtab(char *, char *, int);
44afe1ef24SIan Dowse int	read_mtab(void);
45afe1ef24SIan Dowse int	write_mtab(int);
46c69a34d4SMatthew Dillon void	free_mtab(void);
47