]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/globals.h
Sam Noble's ADMIN_GRP patch, removed Marc's old ADMIN_GRP patch.
[netatalk.git] / etc / afpd / globals.h
1 /*
2  * Copyright (c) 1990,1993 Regents of The University of Michigan.
3  * All Rights Reserved.  See COPYRIGHT.
4  */
5
6 #ifndef AFPD_GLOBALS_H
7 #define AFPD_GLOBALS_H 1
8
9 #include <sys/param.h>
10 #include <sys/cdefs.h>
11
12 #ifdef ADMIN_GRP
13 #include <grp.h>
14 #include <sys/types.h>
15 #endif
16
17 #include <netdb.h>  /* this isn't header-protected under ultrix */
18 #include <netatalk/at.h>
19 #include <atalk/afp.h>
20 #include <atalk/compat.h>
21
22 /* test for inline */
23 #ifndef __inline__
24 #define __inline__
25 #endif
26
27 #define MACFILELEN 31
28
29
30 #define OPTION_DEBUG         (1 << 0)
31 #define OPTION_USERVOLFIRST  (1 << 1)
32 #define OPTION_NOUSERVOL     (1 << 2)
33 #define OPTION_PROXY         (1 << 3)
34 #define OPTION_CUSTOMICON    (1 << 4)
35
36 /* a couple of these options could get stuck in unions to save
37  * space. */
38 struct afp_options {
39   int connections, port, transports, tickleval, flags;
40   unsigned char passwdbits, passwdminlen, loginmaxfail;
41   u_int32_t server_quantum;
42   char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *configfile;
43   struct at_addr ddpaddr;
44   char *uampath, *nlspath, *fqdn;
45   char *pidfile, *defaultvol, *systemvol;
46   char *guest, *loginmesg, *keyfile, *passwdfile;
47   char *uamlist;
48 #ifdef ADMIN_GRP
49   gid_t admingid;
50 #endif ADMIN_GRP
51 };
52
53 #define AFPOBJ_TMPSIZ (MAXPATHLEN)
54 typedef struct AFPObj {
55   int proto;
56   unsigned long servernum;
57   void *handle, *config;
58   struct afp_options options;
59   char *Obj, *Type, *Zone;
60   char username[MACFILELEN + 1];
61   void (*logout)(void), (*exit)(int);
62   int (*reply)(void *, int);
63   int (*attention)(void *, AFPUserBytes);
64   /* to prevent confusion, only use these in afp_* calls */
65   char oldtmp[AFPOBJ_TMPSIZ + 1], newtmp[AFPOBJ_TMPSIZ + 1];
66   void *uam_cookie; /* cookie for uams */
67 } AFPObj;
68
69 extern int              afp_version;
70 extern unsigned char    nologin;
71 extern struct vol       *volumes;
72 extern struct dir       *curdir;
73 extern char             getwdbuf[];
74
75 extern void afp_options_init __P((struct afp_options *));
76 extern int afp_options_parse __P((int, char **, struct afp_options *));
77 extern int afp_options_parseline __P((char *, struct afp_options *));
78 extern void afp_options_free __P((struct afp_options *, 
79                                   const struct afp_options *));
80 extern void setmessage __P((const char *));
81 extern void readmessage __P((void));
82
83 /* gettok.c */
84 extern void initline   __P((int, char *));
85 extern int  parseline  __P((int, char *));
86
87 #ifndef NO_DDP
88 extern void afp_over_asp __P((AFPObj *));
89 #endif
90 extern void afp_over_dsi __P((AFPObj *));
91
92 #endif /* globals.h */