xref: /original-bsd/usr.sbin/amd/fsinfo/fsi_data.h (revision ff516eb5)
1 /*
2  * Copyright (c) 1989 Jan-Simon Pendry
3  * Copyright (c) 1989 Imperial College of Science, Technology & Medicine
4  * Copyright (c) 1989, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  *
7  * This code is derived from software contributed to Berkeley by
8  * Jan-Simon Pendry at Imperial College, London.
9  *
10  * %sccs.include.redist.c%
11  *
12  *	@(#)fsi_data.h	8.1 (Berkeley) 06/06/93
13  *
14  * $Id: fsi_data.h,v 5.2.2.1 1992/02/09 15:09:53 jsp beta $
15  *
16  */
17 
18 typedef struct auto_tree auto_tree;
19 typedef struct automount automount;
20 typedef struct dict dict;
21 typedef struct dict_data dict_data;
22 typedef struct dict_ent dict_ent;
23 typedef struct disk_fs disk_fs;
24 typedef struct ether_if ether_if;
25 typedef struct fsmount fsmount;
26 typedef struct host host;
27 typedef struct ioloc ioloc;
28 typedef struct mount mount;
29 typedef struct qelem qelem;
30 
31 /*
32  * Linked lists...
33  */
34 struct qelem {
35 	qelem *q_forw;
36 	qelem *q_back;
37 };
38 
39 /*
40  * Automount tree
41  */
42 struct automount {
43 	qelem a_q;
44 	ioloc *a_ioloc;
45 	char *a_name;		/* Automount key */
46 	char *a_volname;	/* Equivalent volume to be referenced */
47 	char *a_symlink;	/* Symlink representation */
48 	qelem *a_mount;		/* Tree representation */
49 	dict_ent *a_mounted;
50 };
51 
52 /*
53  * List of automount trees
54  */
55 struct auto_tree {
56 	qelem t_q;
57 	ioloc *t_ioloc;
58 	char *t_defaults;
59 	qelem *t_mount;
60 };
61 
62 /*
63  * A host
64  */
65 struct host {
66 	qelem q;
67 	int h_mask;
68 	ioloc *h_ioloc;
69 	fsmount *h_netroot, *h_netswap;
70 #define HF_HOST	0
71 	char *h_hostname;	/* The full name of the host */
72 	char *h_lochost;	/* The name of the host with local domains stripped */
73 	char *h_hostpath;	/* The filesystem path to the host (cf compute_hostpath) */
74 #define	HF_ETHER 1
75 	qelem *h_ether;
76 #define	HF_CONFIG 2
77 	qelem *h_config;
78 #define	HF_ARCH 3
79 	char *h_arch;
80 #define	HF_CLUSTER 4
81 	char *h_cluster;
82 #define	HF_OS 5
83 	char *h_os;
84 	qelem *h_disk_fs;
85 	qelem *h_mount;
86 };
87 
88 /*
89  * An ethernet interface
90  */
91 struct ether_if {
92 	qelem e_q;
93 	int e_mask;
94 	ioloc *e_ioloc;
95 	char *e_if;
96 #define	EF_INADDR 0
97 	struct in_addr e_inaddr;
98 #define	EF_NETMASK 1
99 	u_long e_netmask;
100 #define	EF_HWADDR 2
101 	char *e_hwaddr;
102 };
103 
104 /*
105  * Disk filesystem structure.
106  *
107  * If the DF_* numbers are changed
108  * disk_fs_strings in analyze.c will
109  * need updating.
110  */
111 struct disk_fs {
112 	qelem d_q;
113 	int d_mask;
114 	ioloc *d_ioloc;
115 	host *d_host;
116 	char *d_mountpt;
117 	char *d_dev;
118 #define	DF_FSTYPE	0
119 	char *d_fstype;
120 #define	DF_OPTS		1
121 	char *d_opts;
122 #define	DF_DUMPSET	2
123 	char *d_dumpset;
124 #define	DF_PASSNO	3
125 	int d_passno;
126 #define	DF_FREQ		4
127 	int d_freq;
128 #define	DF_MOUNT	5
129 	qelem *d_mount;
130 #define	DF_LOG		6
131 	char *d_log;
132 };
133 #define	DF_REQUIRED	((1<<DF_FSTYPE)|(1<<DF_OPTS)|(1<<DF_PASSNO)|(1<<DF_MOUNT))
134 
135 /*
136  * A mount tree
137  */
138 struct mount {
139 	qelem m_q;
140 	ioloc *m_ioloc;
141 	int m_mask;
142 #define	DM_VOLNAME	0
143 	char *m_volname;
144 #define	DM_EXPORTFS	1
145 	char *m_exportfs;
146 #define	DM_SEL		2
147 	char *m_sel;
148 	char *m_name;
149 	int m_name_len;
150 	mount *m_parent;
151 	disk_fs *m_dk;
152 	mount *m_exported;
153 	qelem *m_mount;
154 };
155 
156 /*
157  * Additional filesystem mounts
158  *
159  * If the FM_* numbers are changed
160  * disk_fs_strings in analyze.c will
161  * need updating.
162  */
163 struct fsmount {
164 	qelem f_q;
165 	mount *f_ref;
166 	ioloc *f_ioloc;
167 	int f_mask;
168 #define	FM_LOCALNAME	0
169 	char *f_localname;
170 #define	FM_VOLNAME	1
171 	char *f_volname;
172 #define	FM_FSTYPE	2
173 	char *f_fstype;
174 #define	FM_OPTS		3
175 	char *f_opts;
176 #define	FM_FROM		4
177 	char *f_from;
178 };
179 #define	FM_REQUIRED	((1<<FM_VOLNAME)|(1<<FM_FSTYPE)|(1<<FM_OPTS)|(1<<FM_FROM)|(1<<FM_LOCALNAME))
180 #define	FM_NETROOT	0x01
181 #define	FM_NETSWAP	0x02
182 #define	FM_NETBOOT	(FM_NETROOT|FM_NETSWAP)
183 
184 #define	DICTHASH	5
185 struct dict_ent {
186 	dict_ent *de_next;
187 	char *de_key;
188 	int de_count;
189 	qelem de_q;
190 };
191 
192 /*
193  * Dictionaries ...
194  */
195 struct dict_data {
196 	qelem dd_q;
197 	char *dd_data;
198 };
199 
200 struct dict {
201 	dict_ent *de[DICTHASH];
202 };
203 
204 /*
205  * Source text location for error reports
206  */
207 struct ioloc {
208 	int i_line;
209 	char *i_file;
210 };
211