Home | History | Annotate | Line # | Download | only in amd
      1 /*	$NetBSD: sun_map.h,v 1.1.1.3 2015/01/17 16:34:15 christos Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1997-2014 Erez Zadok
      5  * Copyright (c) 2005 Daniel P. Ottavio
      6  * Copyright (c) 1990 Jan-Simon Pendry
      7  * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
      8  * Copyright (c) 1990 The Regents of the University of California.
      9  * All rights reserved.
     10  *
     11  * This code is derived from software contributed to Berkeley by
     12  * Jan-Simon Pendry at Imperial College, London.
     13  *
     14  * Redistribution and use in source and binary forms, with or without
     15  * modification, are permitted provided that the following conditions
     16  * are met:
     17  * 1. Redistributions of source code must retain the above copyright
     18  *    notice, this list of conditions and the following disclaimer.
     19  * 2. Redistributions in binary form must reproduce the above copyright
     20  *    notice, this list of conditions and the following disclaimer in the
     21  *    documentation and/or other materials provided with the distribution.
     22  * 3. 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  *
     39  * File: am-utils/amd/sun_map.h
     40  *
     41  */
     42 
     43 #ifndef _SUN_MAP_H
     44 #define _SUN_MAP_H
     45 
     46 /* host */
     47 struct sun_host {
     48   qelem head;     /* link-list header */
     49   char *name;     /* hostname */
     50   int weight;     /* weight given to the host */
     51 };
     52 
     53 /* location */
     54 struct sun_location {
     55   qelem head;                 /* link-list header */
     56   char *path;                 /* server path */
     57   struct sun_host *host_list; /* list of hosts */
     58 };
     59 
     60 /* sun mount option */
     61 struct sun_opt {
     62   qelem head;    /* link-list header */
     63   char *str;     /* option string */
     64 };
     65 
     66 /* mount point */
     67 struct sun_mountpt {
     68   qelem head;                         /* link-list header */
     69   char *path;                         /* optional mount point path */
     70   char *fstype;                       /* filesystem type */
     71   struct sun_opt      *opt_list;      /* list of option strings */
     72   struct sun_location *location_list; /* list of 'struct s2a_location' */
     73 };
     74 
     75 /* automount entry */
     76 struct sun_entry {
     77   qelem head;                         /* link-list header */
     78   char *key;                          /* auto map key */
     79   char *fstype;                       /* filesystem type */
     80   struct sun_opt      *opt_list;      /* list of mount options */
     81   struct sun_location *location_list; /* list of mount locations */
     82   struct sun_mountpt  *mountpt_list;  /* list of mount points */
     83 };
     84 
     85 /*
     86  * automount map file
     87  *
     88  * XXX: Only a place holder structure, not implemented yet.
     89  */
     90 struct sun_map {
     91   qelem head;                     /* link-list header */
     92   char *path;                     /* directory path of the map file */
     93   char *mount_dir;                /* top level mount point for this map */
     94   int  lookup;                    /* lookup type i.e file, yp, program, etc. */
     95   int  direct_bool;               /* set true if this map is a direct map */
     96   struct sun_opt   *opt_list;     /* list of global map options */
     97   struct sun_opt   *include_list; /* list of included map files  */
     98   struct sun_entry *entry_list;   /* list of 'struct s2a_entry' */
     99 };
    100 
    101 /*
    102  * master map file
    103  *
    104  * XXX: Only a place holder structure, not implemented yet.
    105  */
    106 struct sun_mmap {
    107   qelem head;                   /* link-list header */
    108   struct sun_opt *include_list; /* list of included master maps */
    109   struct sun_map *amap_list;    /* list of 'struct s2a_amap' */
    110 };
    111 
    112 struct sun_list {
    113   qelem *first;
    114   qelem *last;
    115 };
    116 
    117 
    118 /*
    119  * EXTERNS
    120  */
    121 extern char *sun_entry2amd(const char *, const char *);
    122 extern struct sun_entry *sun_map_parse_read(const char *);
    123 extern void sun_list_add(struct sun_list *, qelem *);
    124 
    125 #endif /* not _SUN_MAP_H */
    126