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