fsi_data.h revision 38494
138494Sobrien/*
238494Sobrien * Copyright (c) 1997-1998 Erez Zadok
338494Sobrien * Copyright (c) 1989 Jan-Simon Pendry
438494Sobrien * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
538494Sobrien * Copyright (c) 1989 The Regents of the University of California.
638494Sobrien * All rights reserved.
738494Sobrien *
838494Sobrien * This code is derived from software contributed to Berkeley by
938494Sobrien * Jan-Simon Pendry at Imperial College, London.
1038494Sobrien *
1138494Sobrien * Redistribution and use in source and binary forms, with or without
1238494Sobrien * modification, are permitted provided that the following conditions
1338494Sobrien * are met:
1438494Sobrien * 1. Redistributions of source code must retain the above copyright
1538494Sobrien *    notice, this list of conditions and the following disclaimer.
1638494Sobrien * 2. Redistributions in binary form must reproduce the above copyright
1738494Sobrien *    notice, this list of conditions and the following disclaimer in the
1838494Sobrien *    documentation and/or other materials provided with the distribution.
1938494Sobrien * 3. All advertising materials mentioning features or use of this software
2038494Sobrien *    must display the following acknowledgement:
2138494Sobrien *      This product includes software developed by the University of
2238494Sobrien *      California, Berkeley and its contributors.
2338494Sobrien * 4. Neither the name of the University nor the names of its contributors
2438494Sobrien *    may be used to endorse or promote products derived from this software
2538494Sobrien *    without specific prior written permission.
2638494Sobrien *
2738494Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2838494Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2938494Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3038494Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3138494Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3238494Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3338494Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3438494Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3538494Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3638494Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3738494Sobrien * SUCH DAMAGE.
3838494Sobrien *
3938494Sobrien *      %W% (Berkeley) %G%
4038494Sobrien *
4138494Sobrien * $Id: fsi_data.h,v 5.2.2.1 1992/02/09 15:09:53 jsp beta $
4238494Sobrien *
4338494Sobrien */
4438494Sobrien
4538494Sobrientypedef struct auto_tree auto_tree;
4638494Sobrientypedef struct automount automount;
4738494Sobrientypedef struct dict dict;
4838494Sobrientypedef struct dict_data dict_data;
4938494Sobrientypedef struct dict_ent dict_ent;
5038494Sobrientypedef struct disk_fs disk_fs;
5138494Sobrientypedef struct ether_if ether_if;
5238494Sobrientypedef struct fsmount fsmount;
5338494Sobrientypedef struct host host;
5438494Sobrientypedef struct ioloc ioloc;
5538494Sobrientypedef struct fsi_mount fsi_mount;
5638494Sobrien
5738494Sobrien
5838494Sobrien/*
5938494Sobrien * Automount tree
6038494Sobrien */
6138494Sobrienstruct automount {
6238494Sobrien  qelem a_q;
6338494Sobrien  ioloc *a_ioloc;
6438494Sobrien  char *a_name;			/* Automount key */
6538494Sobrien  char *a_volname;		/* Equivalent volume to be referenced */
6638494Sobrien  char *a_symlink;		/* Symlink representation */
6738494Sobrien  char *a_opts;			/* opts for mounting */
6838494Sobrien  char *a_hardwiredfs;		/* hack to bypass bogus fs definitions */
6938494Sobrien  qelem *a_mount;		/* Tree representation */
7038494Sobrien  dict_ent *a_mounted;
7138494Sobrien};
7238494Sobrien
7338494Sobrien/*
7438494Sobrien * List of automount trees
7538494Sobrien */
7638494Sobrienstruct auto_tree {
7738494Sobrien  qelem t_q;
7838494Sobrien  ioloc *t_ioloc;
7938494Sobrien  char *t_defaults;
8038494Sobrien  qelem *t_mount;
8138494Sobrien};
8238494Sobrien
8338494Sobrien/*
8438494Sobrien * A host
8538494Sobrien */
8638494Sobrienstruct host {
8738494Sobrien  qelem q;
8838494Sobrien  int h_mask;
8938494Sobrien  ioloc *h_ioloc;
9038494Sobrien  fsmount *h_netroot, *h_netswap;
9138494Sobrien#define HF_HOST	0
9238494Sobrien  char *h_hostname;		/* The full name of the host */
9338494Sobrien  char *h_lochost;		/* The name of the host with local domains *
9438494Sobrien				 * * * stripped */
9538494Sobrien  char *h_hostpath;		/* The filesystem path to the host (cf * * *
9638494Sobrien				 * compute_hostpath) */
9738494Sobrien#define	HF_ETHER 1
9838494Sobrien  qelem *h_ether;
9938494Sobrien#define	HF_CONFIG 2
10038494Sobrien  qelem *h_config;
10138494Sobrien#define	HF_ARCH 3
10238494Sobrien  char *h_arch;
10338494Sobrien#define	HF_CLUSTER 4
10438494Sobrien  char *h_cluster;
10538494Sobrien#define	HF_OS 5
10638494Sobrien  char *h_os;
10738494Sobrien  qelem *h_disk_fs;
10838494Sobrien  qelem *h_mount;
10938494Sobrien};
11038494Sobrien
11138494Sobrien/*
11238494Sobrien * An ethernet interface
11338494Sobrien */
11438494Sobrienstruct ether_if {
11538494Sobrien  qelem e_q;
11638494Sobrien  int e_mask;
11738494Sobrien  ioloc *e_ioloc;
11838494Sobrien  char *e_if;
11938494Sobrien#define	EF_INADDR 0
12038494Sobrien  struct in_addr e_inaddr;
12138494Sobrien#define	EF_NETMASK 1
12238494Sobrien  u_long e_netmask;
12338494Sobrien#define	EF_HWADDR 2
12438494Sobrien  char *e_hwaddr;
12538494Sobrien};
12638494Sobrien
12738494Sobrien/*
12838494Sobrien * Disk filesystem structure.
12938494Sobrien *
13038494Sobrien * If the DF_* numbers are changed
13138494Sobrien * disk_fs_strings in analyze.c will
13238494Sobrien * need updating.
13338494Sobrien */
13438494Sobrienstruct disk_fs {
13538494Sobrien  qelem d_q;
13638494Sobrien  int d_mask;
13738494Sobrien  ioloc *d_ioloc;
13838494Sobrien  host *d_host;
13938494Sobrien  char *d_mountpt;
14038494Sobrien  char *d_dev;
14138494Sobrien#define	DF_FSTYPE	0
14238494Sobrien  char *d_fstype;
14338494Sobrien#define	DF_OPTS		1
14438494Sobrien  char *d_opts;
14538494Sobrien#define	DF_DUMPSET	2
14638494Sobrien  char *d_dumpset;
14738494Sobrien#define	DF_PASSNO	3
14838494Sobrien  int d_passno;
14938494Sobrien#define	DF_FREQ		4
15038494Sobrien  int d_freq;
15138494Sobrien#define	DF_MOUNT	5
15238494Sobrien  qelem *d_mount;
15338494Sobrien#define	DF_LOG		6
15438494Sobrien  char *d_log;
15538494Sobrien};
15638494Sobrien
15738494Sobrien#define	DF_REQUIRED	((1<<DF_FSTYPE)|(1<<DF_OPTS)|(1<<DF_PASSNO)|(1<<DF_MOUNT))
15838494Sobrien
15938494Sobrien/*
16038494Sobrien * A mount tree
16138494Sobrien */
16238494Sobrienstruct fsi_mount {
16338494Sobrien  qelem m_q;
16438494Sobrien  ioloc *m_ioloc;
16538494Sobrien  int m_mask;
16638494Sobrien#define	DM_VOLNAME	0
16738494Sobrien  char *m_volname;
16838494Sobrien#define	DM_EXPORTFS	1
16938494Sobrien  char *m_exportfs;
17038494Sobrien#define	DM_SEL		2
17138494Sobrien  char *m_sel;
17238494Sobrien  char *m_name;
17338494Sobrien  int m_name_len;
17438494Sobrien  fsi_mount *m_parent;
17538494Sobrien  disk_fs *m_dk;
17638494Sobrien  fsi_mount *m_exported;
17738494Sobrien  qelem *m_mount;
17838494Sobrien};
17938494Sobrien
18038494Sobrien/*
18138494Sobrien * Additional filesystem mounts
18238494Sobrien *
18338494Sobrien * If the FM_* numbers are changed
18438494Sobrien * disk_fs_strings in analyze.c will
18538494Sobrien * need updating.
18638494Sobrien */
18738494Sobrienstruct fsmount {
18838494Sobrien  qelem f_q;
18938494Sobrien  fsi_mount *f_ref;
19038494Sobrien  ioloc *f_ioloc;
19138494Sobrien  int f_mask;
19238494Sobrien#define	FM_LOCALNAME	0
19338494Sobrien  char *f_localname;
19438494Sobrien#define	FM_VOLNAME	1
19538494Sobrien  char *f_volname;
19638494Sobrien#define	FM_FSTYPE	2
19738494Sobrien  char *f_fstype;
19838494Sobrien#define	FM_OPTS		3
19938494Sobrien  char *f_opts;
20038494Sobrien#define	FM_FROM		4
20138494Sobrien  char *f_from;
20238494Sobrien#define FM_DIRECT	5
20338494Sobrien};
20438494Sobrien
20538494Sobrien#define	FM_REQUIRED	((1<<FM_VOLNAME)|(1<<FM_FSTYPE)|(1<<FM_OPTS)|(1<<FM_FROM)|(1<<FM_LOCALNAME))
20638494Sobrien#define	FM_NETROOT	0x01
20738494Sobrien#define	FM_NETSWAP	0x02
20838494Sobrien#define	FM_NETBOOT	(FM_NETROOT|FM_NETSWAP)
20938494Sobrien
21038494Sobrien#define	DICTHASH	5
21138494Sobrienstruct dict_ent {
21238494Sobrien  dict_ent *de_next;
21338494Sobrien  char *de_key;
21438494Sobrien  int de_count;
21538494Sobrien  qelem de_q;
21638494Sobrien};
21738494Sobrien
21838494Sobrien/*
21938494Sobrien * Dictionaries ...
22038494Sobrien */
22138494Sobrienstruct dict_data {
22238494Sobrien  qelem dd_q;
22338494Sobrien  char *dd_data;
22438494Sobrien};
22538494Sobrien
22638494Sobrienstruct dict {
22738494Sobrien  dict_ent *de[DICTHASH];
22838494Sobrien};
22938494Sobrien
23038494Sobrien/*
23138494Sobrien * Source text location for error reports
23238494Sobrien */
23338494Sobrienstruct ioloc {
23438494Sobrien  int i_line;
23538494Sobrien  char *i_file;
23638494Sobrien};
237