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