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