xref: /csrg-svn/usr.sbin/amd/fsinfo/fsi_data.h (revision 61793)
147480Spendry /*
247480Spendry  * Copyright (c) 1989 Jan-Simon Pendry
347480Spendry  * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
4*61793Sbostic  * Copyright (c) 1989, 1993
5*61793Sbostic  *	The Regents of the University of California.  All rights reserved.
647480Spendry  *
747480Spendry  * This code is derived from software contributed to Berkeley by
847480Spendry  * Jan-Simon Pendry at Imperial College, London.
947480Spendry  *
1047530Spendry  * %sccs.include.redist.c%
1147480Spendry  *
12*61793Sbostic  *	@(#)fsi_data.h	8.1 (Berkeley) 06/06/93
1349686Spendry  *
1452455Spendry  * $Id: fsi_data.h,v 5.2.2.1 1992/02/09 15:09:53 jsp beta $
1549686Spendry  *
1647480Spendry  */
1747480Spendry 
1847480Spendry typedef struct auto_tree auto_tree;
1947480Spendry typedef struct automount automount;
2047480Spendry typedef struct dict dict;
2147480Spendry typedef struct dict_data dict_data;
2247480Spendry typedef struct dict_ent dict_ent;
2347480Spendry typedef struct disk_fs disk_fs;
2447480Spendry typedef struct ether_if ether_if;
2547480Spendry typedef struct fsmount fsmount;
2647480Spendry typedef struct host host;
2747480Spendry typedef struct ioloc ioloc;
2847480Spendry typedef struct mount mount;
2947480Spendry typedef struct qelem qelem;
3047480Spendry 
3147480Spendry /*
3247480Spendry  * Linked lists...
3347480Spendry  */
3447480Spendry struct qelem {
3547480Spendry 	qelem *q_forw;
3647480Spendry 	qelem *q_back;
3747480Spendry };
3847480Spendry 
3947480Spendry /*
4047480Spendry  * Automount tree
4147480Spendry  */
4247480Spendry struct automount {
4347480Spendry 	qelem a_q;
4447480Spendry 	ioloc *a_ioloc;
4547480Spendry 	char *a_name;		/* Automount key */
4647480Spendry 	char *a_volname;	/* Equivalent volume to be referenced */
4747480Spendry 	char *a_symlink;	/* Symlink representation */
4847480Spendry 	qelem *a_mount;		/* Tree representation */
4947480Spendry 	dict_ent *a_mounted;
5047480Spendry };
5147480Spendry 
5247480Spendry /*
5347480Spendry  * List of automount trees
5447480Spendry  */
5547480Spendry struct auto_tree {
5647480Spendry 	qelem t_q;
5747480Spendry 	ioloc *t_ioloc;
5847480Spendry 	char *t_defaults;
5947480Spendry 	qelem *t_mount;
6047480Spendry };
6147480Spendry 
6247480Spendry /*
6347480Spendry  * A host
6447480Spendry  */
6547480Spendry struct host {
6647480Spendry 	qelem q;
6747480Spendry 	int h_mask;
6847480Spendry 	ioloc *h_ioloc;
6947480Spendry 	fsmount *h_netroot, *h_netswap;
7047480Spendry #define HF_HOST	0
7147480Spendry 	char *h_hostname;	/* The full name of the host */
7247480Spendry 	char *h_lochost;	/* The name of the host with local domains stripped */
7347480Spendry 	char *h_hostpath;	/* The filesystem path to the host (cf compute_hostpath) */
7447480Spendry #define	HF_ETHER 1
7547480Spendry 	qelem *h_ether;
7647480Spendry #define	HF_CONFIG 2
7747480Spendry 	qelem *h_config;
7847480Spendry #define	HF_ARCH 3
7947480Spendry 	char *h_arch;
8047480Spendry #define	HF_CLUSTER 4
8147480Spendry 	char *h_cluster;
8247480Spendry #define	HF_OS 5
8347480Spendry 	char *h_os;
8447480Spendry 	qelem *h_disk_fs;
8547480Spendry 	qelem *h_mount;
8647480Spendry };
8747480Spendry 
8847480Spendry /*
8947480Spendry  * An ethernet interface
9047480Spendry  */
9147480Spendry struct ether_if {
9247480Spendry 	qelem e_q;
9347480Spendry 	int e_mask;
9447480Spendry 	ioloc *e_ioloc;
9547480Spendry 	char *e_if;
9647480Spendry #define	EF_INADDR 0
9747480Spendry 	struct in_addr e_inaddr;
9847480Spendry #define	EF_NETMASK 1
9947480Spendry 	u_long e_netmask;
10047480Spendry #define	EF_HWADDR 2
10147480Spendry 	char *e_hwaddr;
10247480Spendry };
10347480Spendry 
10447480Spendry /*
10547480Spendry  * Disk filesystem structure.
10647480Spendry  *
10747480Spendry  * If the DF_* numbers are changed
10847480Spendry  * disk_fs_strings in analyze.c will
10947480Spendry  * need updating.
11047480Spendry  */
11147480Spendry struct disk_fs {
11247480Spendry 	qelem d_q;
11347480Spendry 	int d_mask;
11447480Spendry 	ioloc *d_ioloc;
11547480Spendry 	host *d_host;
11647480Spendry 	char *d_mountpt;
11747480Spendry 	char *d_dev;
11847480Spendry #define	DF_FSTYPE	0
11947480Spendry 	char *d_fstype;
12047480Spendry #define	DF_OPTS		1
12147480Spendry 	char *d_opts;
12247480Spendry #define	DF_DUMPSET	2
12347480Spendry 	char *d_dumpset;
12447480Spendry #define	DF_PASSNO	3
12547480Spendry 	int d_passno;
12647480Spendry #define	DF_FREQ		4
12747480Spendry 	int d_freq;
12847480Spendry #define	DF_MOUNT	5
12947480Spendry 	qelem *d_mount;
13047480Spendry #define	DF_LOG		6
13147480Spendry 	char *d_log;
13247480Spendry };
13347480Spendry #define	DF_REQUIRED	((1<<DF_FSTYPE)|(1<<DF_OPTS)|(1<<DF_PASSNO)|(1<<DF_MOUNT))
13447480Spendry 
13547480Spendry /*
13647480Spendry  * A mount tree
13747480Spendry  */
13847480Spendry struct mount {
13947480Spendry 	qelem m_q;
14047480Spendry 	ioloc *m_ioloc;
14147480Spendry 	int m_mask;
14247480Spendry #define	DM_VOLNAME	0
14347480Spendry 	char *m_volname;
14447480Spendry #define	DM_EXPORTFS	1
14547480Spendry 	char *m_exportfs;
14647480Spendry #define	DM_SEL		2
14747480Spendry 	char *m_sel;
14847480Spendry 	char *m_name;
14947480Spendry 	int m_name_len;
15047480Spendry 	mount *m_parent;
15147480Spendry 	disk_fs *m_dk;
15247480Spendry 	mount *m_exported;
15347480Spendry 	qelem *m_mount;
15447480Spendry };
15547480Spendry 
15647480Spendry /*
15747480Spendry  * Additional filesystem mounts
15847480Spendry  *
15947480Spendry  * If the FM_* numbers are changed
16047480Spendry  * disk_fs_strings in analyze.c will
16147480Spendry  * need updating.
16247480Spendry  */
16347480Spendry struct fsmount {
16447480Spendry 	qelem f_q;
16547480Spendry 	mount *f_ref;
16647480Spendry 	ioloc *f_ioloc;
16747480Spendry 	int f_mask;
16847480Spendry #define	FM_LOCALNAME	0
16947480Spendry 	char *f_localname;
17047480Spendry #define	FM_VOLNAME	1
17147480Spendry 	char *f_volname;
17247480Spendry #define	FM_FSTYPE	2
17347480Spendry 	char *f_fstype;
17447480Spendry #define	FM_OPTS		3
17547480Spendry 	char *f_opts;
17647480Spendry #define	FM_FROM		4
17747480Spendry 	char *f_from;
17847480Spendry };
17947480Spendry #define	FM_REQUIRED	((1<<FM_VOLNAME)|(1<<FM_FSTYPE)|(1<<FM_OPTS)|(1<<FM_FROM)|(1<<FM_LOCALNAME))
18047480Spendry #define	FM_NETROOT	0x01
18147480Spendry #define	FM_NETSWAP	0x02
18247480Spendry #define	FM_NETBOOT	(FM_NETROOT|FM_NETSWAP)
18347480Spendry 
18447480Spendry #define	DICTHASH	5
18547480Spendry struct dict_ent {
18647480Spendry 	dict_ent *de_next;
18747480Spendry 	char *de_key;
18847480Spendry 	int de_count;
18947480Spendry 	qelem de_q;
19047480Spendry };
19147480Spendry 
19247480Spendry /*
19347480Spendry  * Dictionaries ...
19447480Spendry  */
19547480Spendry struct dict_data {
19647480Spendry 	qelem dd_q;
19747480Spendry 	char *dd_data;
19847480Spendry };
19947480Spendry 
20047480Spendry struct dict {
20147480Spendry 	dict_ent *de[DICTHASH];
20247480Spendry };
20347480Spendry 
20447480Spendry /*
20547480Spendry  * Source text location for error reports
20647480Spendry  */
20747480Spendry struct ioloc {
20847480Spendry 	int i_line;
20947480Spendry 	char *i_file;
21047480Spendry };
211