source: trunk/athena/lib/locker/locker_private.h @ 12783

Revision 12783, 4.1 KB checked in by danw, 26 years ago (diff)
record zephyr subscriptions, but don't actually make any libzephyr calls unless the caller explicitly asks for the subscription list to be processed.
Line 
1/* $Id: locker_private.h,v 1.3 1999-03-29 17:33:22 danw Exp $ */
2
3/* Copyright 1998 by the Massachusetts Institute of Technology.
4 *
5 * Permission to use, copy, modify, and distribute this
6 * software and its documentation for any purpose and without
7 * fee is hereby granted, provided that the above copyright
8 * notice appear in all copies and that both that copyright
9 * notice and this permission notice appear in supporting
10 * documentation, and that the name of M.I.T. not be used in
11 * advertising or publicity pertaining to distribution of the
12 * software without specific, written prior permission.
13 * M.I.T. makes no representations about the suitability of
14 * this software for any purpose.  It is provided "as is"
15 * without express or implied warranty.
16 */
17
18#include <sys/types.h>
19#include <regex.h>
20#include <stdarg.h>
21
22#define LOCKER_PATH_ATTACHTAB "/var/athena/attachtab"
23#define LOCKER_PATH_ATTACH_CONF "/etc/athena/attach.conf"
24
25#define LOCKER_AFS_MOUNT_DIR "/mit"
26#define LOCKER_UFS_MOUNT_DIR "/mnt"
27
28#define LOCKER_NFS_KSERVICE "rvdsrv"
29
30#define LOCKER_DEFAULT_GID 101
31
32#define LOCKER_MOUNT_TIMEOUT 20
33
34#define LOCKER_ZEPHYR_CLASS "filsrv"
35
36enum explstate { LOCKER_DONT_CARE, LOCKER_EXPLICIT, LOCKER_NOEXPLICIT };
37
38union locker__datum {
39  char *string;
40  int flag;
41};
42
43struct locker__regexp {
44  int fstypes;
45  enum explstate explicit;
46  regex_t pattern;
47  union locker__datum data;
48};
49
50struct locker__regexp_list {
51  struct locker__regexp *tab;
52  int size, num;
53  int defflag;
54};
55
56struct locker_context {
57  /* attach.conf variables */
58  int exp_desc, exp_mountpoint, keep_mount, nfs_root_hack, ownercheck;
59  char *afs_mount_dir, *attachtab, *nfs_mount_dir;
60  struct locker__regexp_list allow, setuid, mountpoint;
61  struct locker__regexp_list allowopts, defopts, filesystem, reqopts;
62
63  /* Defined fs types */
64  struct locker_ops **fstype;
65  int nfstypes;
66
67  /* error reporting function and its cookie */
68  locker_error_fun errfun;
69  void *errdata;
70
71  /* user we're acting on behalf of, and whether or not s/he is trusted */
72  uid_t user;
73  int trusted;
74
75  /* Hesiod context */
76  void *hes_context;
77
78  /* Queued zephyr subs */
79  char **zsubs;
80  int nzsubs;
81
82  /* Number of locks held on attachtab */
83  int locks;
84};
85
86/* "kind"s for locker__attachtab_pathname */
87#define LOCKER_LOCK 0
88#define LOCKER_NAME 1
89#define LOCKER_MOUNTPOINT 2
90#define LOCKER_DIRECTORY 3
91/* Already a full path: don't touch it. */
92#define LOCKER_FULL_PATH 4
93
94/* Prototypes from attachtab.c */
95locker_attachent *locker__new_attachent(locker_context context,
96                                        struct locker_ops *type);
97int locker__lookup_attachent(locker_context context, char *name,
98                             char *mountpoint, int create,
99                             locker_attachent **atp);
100int locker__lookup_attachent_explicit(locker_context context, char *type,
101                                      char *desc, char *mountpoint,
102                                      int create, locker_attachent **atp);
103void locker__update_attachent(locker_context context, locker_attachent *at);
104char *locker__attachtab_pathname(locker_context context,
105                                 int kind, char *name);
106
107/* Prototypes from conf.c */
108int locker__fs_ok(locker_context context, struct locker__regexp_list list,
109                  struct locker_ops *fs, char *filesystem);
110char *locker__fs_data(locker_context context, struct locker__regexp_list list,
111                      struct locker_ops *fs, char *filesystem);
112struct locker_ops *locker__get_fstype(locker_context context, char *fstype);
113void locker__error(locker_context context, char *fmt, ...);
114
115/* Prototypes from mount.c */
116int locker__mount(locker_context context, locker_attachent *at,
117                  char *mountoptions);
118int locker__unmount(locker_context context, locker_attachent *at);
119
120/* Prototypes from mountpoint.c */
121int locker__canonicalize_path(locker_context context, int check,
122                              char **pathp, char **extp);
123int locker__build_mountpoint(locker_context context, locker_attachent *at);
124int locker__remove_mountpoint(locker_context context, locker_attachent *at);
125
126/* Prototypes from util.c */
127int locker__read_line(FILE *fp, char **buf, int *bufsize);
128
129/* Prototypes from zephyr.c */
130int locker__add_zsubs(locker_context context, char **subs, int nsubs);
131void locker__free_zsubs(locker_context context);
Note: See TracBrowser for help on using the repository browser.