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