fsi_data.h revision 42629
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
2042629Sobrien *    must display the following acknowledgment:
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 *
4142629Sobrien * $Id: fsi_data.h,v 1.1.1.1 1998/11/05 02:04:54 ezk Exp $
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
9242629Sobrien  char *h_hostname;	/* The full name of the host */
9342629Sobrien  char *h_lochost;	/* The name of the host with local domains stripped */
9442629Sobrien  char *h_hostpath;	/* The filesystem path to the host (cf
9542629Sobrien			   compute_hostpath) */
9638494Sobrien#define	HF_ETHER 1
9738494Sobrien  qelem *h_ether;
9838494Sobrien#define	HF_CONFIG 2
9938494Sobrien  qelem *h_config;
10038494Sobrien#define	HF_ARCH 3
10138494Sobrien  char *h_arch;
10238494Sobrien#define	HF_CLUSTER 4
10338494Sobrien  char *h_cluster;
10438494Sobrien#define	HF_OS 5
10538494Sobrien  char *h_os;
10638494Sobrien  qelem *h_disk_fs;
10738494Sobrien  qelem *h_mount;
10838494Sobrien};
10938494Sobrien
11038494Sobrien/*
11138494Sobrien * An ethernet interface
11238494Sobrien */
11338494Sobrienstruct ether_if {
11438494Sobrien  qelem e_q;
11538494Sobrien  int e_mask;
11638494Sobrien  ioloc *e_ioloc;
11738494Sobrien  char *e_if;
11838494Sobrien#define	EF_INADDR 0
11938494Sobrien  struct in_addr e_inaddr;
12038494Sobrien#define	EF_NETMASK 1
12138494Sobrien  u_long e_netmask;
12238494Sobrien#define	EF_HWADDR 2
12338494Sobrien  char *e_hwaddr;
12438494Sobrien};
12538494Sobrien
12638494Sobrien/*
12738494Sobrien * Disk filesystem structure.
12838494Sobrien *
12938494Sobrien * If the DF_* numbers are changed
13038494Sobrien * disk_fs_strings in analyze.c will
13138494Sobrien * need updating.
13238494Sobrien */
13338494Sobrienstruct disk_fs {
13438494Sobrien  qelem d_q;
13538494Sobrien  int d_mask;
13638494Sobrien  ioloc *d_ioloc;
13738494Sobrien  host *d_host;
13838494Sobrien  char *d_mountpt;
13938494Sobrien  char *d_dev;
14038494Sobrien#define	DF_FSTYPE	0
14138494Sobrien  char *d_fstype;
14238494Sobrien#define	DF_OPTS		1
14338494Sobrien  char *d_opts;
14438494Sobrien#define	DF_DUMPSET	2
14538494Sobrien  char *d_dumpset;
14638494Sobrien#define	DF_PASSNO	3
14738494Sobrien  int d_passno;
14838494Sobrien#define	DF_FREQ		4
14938494Sobrien  int d_freq;
15038494Sobrien#define	DF_MOUNT	5
15138494Sobrien  qelem *d_mount;
15238494Sobrien#define	DF_LOG		6
15338494Sobrien  char *d_log;
15438494Sobrien};
15538494Sobrien
15638494Sobrien#define	DF_REQUIRED	((1<<DF_FSTYPE)|(1<<DF_OPTS)|(1<<DF_PASSNO)|(1<<DF_MOUNT))
15738494Sobrien
15838494Sobrien/*
15938494Sobrien * A mount tree
16038494Sobrien */
16138494Sobrienstruct fsi_mount {
16238494Sobrien  qelem m_q;
16338494Sobrien  ioloc *m_ioloc;
16438494Sobrien  int m_mask;
16538494Sobrien#define	DM_VOLNAME	0
16638494Sobrien  char *m_volname;
16738494Sobrien#define	DM_EXPORTFS	1
16838494Sobrien  char *m_exportfs;
16938494Sobrien#define	DM_SEL		2
17038494Sobrien  char *m_sel;
17138494Sobrien  char *m_name;
17238494Sobrien  int m_name_len;
17338494Sobrien  fsi_mount *m_parent;
17438494Sobrien  disk_fs *m_dk;
17538494Sobrien  fsi_mount *m_exported;
17638494Sobrien  qelem *m_mount;
17738494Sobrien};
17838494Sobrien
17938494Sobrien/*
18038494Sobrien * Additional filesystem mounts
18138494Sobrien *
18238494Sobrien * If the FM_* numbers are changed
18338494Sobrien * disk_fs_strings in analyze.c will
18438494Sobrien * need updating.
18538494Sobrien */
18638494Sobrienstruct fsmount {
18738494Sobrien  qelem f_q;
18838494Sobrien  fsi_mount *f_ref;
18938494Sobrien  ioloc *f_ioloc;
19038494Sobrien  int f_mask;
19138494Sobrien#define	FM_LOCALNAME	0
19238494Sobrien  char *f_localname;
19338494Sobrien#define	FM_VOLNAME	1
19438494Sobrien  char *f_volname;
19538494Sobrien#define	FM_FSTYPE	2
19638494Sobrien  char *f_fstype;
19738494Sobrien#define	FM_OPTS		3
19838494Sobrien  char *f_opts;
19938494Sobrien#define	FM_FROM		4
20038494Sobrien  char *f_from;
20138494Sobrien#define FM_DIRECT	5
20238494Sobrien};
20338494Sobrien
20438494Sobrien#define	FM_REQUIRED	((1<<FM_VOLNAME)|(1<<FM_FSTYPE)|(1<<FM_OPTS)|(1<<FM_FROM)|(1<<FM_LOCALNAME))
20538494Sobrien#define	FM_NETROOT	0x01
20638494Sobrien#define	FM_NETSWAP	0x02
20738494Sobrien#define	FM_NETBOOT	(FM_NETROOT|FM_NETSWAP)
20838494Sobrien
20938494Sobrien#define	DICTHASH	5
21038494Sobrienstruct dict_ent {
21138494Sobrien  dict_ent *de_next;
21238494Sobrien  char *de_key;
21338494Sobrien  int de_count;
21438494Sobrien  qelem de_q;
21538494Sobrien};
21638494Sobrien
21738494Sobrien/*
21838494Sobrien * Dictionaries ...
21938494Sobrien */
22038494Sobrienstruct dict_data {
22138494Sobrien  qelem dd_q;
22238494Sobrien  char *dd_data;
22338494Sobrien};
22438494Sobrien
22538494Sobrienstruct dict {
22638494Sobrien  dict_ent *de[DICTHASH];
22738494Sobrien};
22838494Sobrien
22938494Sobrien/*
23038494Sobrien * Source text location for error reports
23138494Sobrien */
23238494Sobrienstruct ioloc {
23338494Sobrien  int i_line;
23438494Sobrien  char *i_file;
23538494Sobrien};
236