home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.sbin / amd / fsinfo / fsi_data.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-12  |  5.4 KB  |  237 lines

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