]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/globals.h
5b42bc1e381f07c98a9c98523656c1e93603c940
[netatalk.git] / etc / afpd / globals.h
1 /*
2  * $Id: globals.h,v 1.18.2.2.2.3 2004-01-08 19:16:57 lenneis Exp $
3  *
4  * Copyright (c) 1990,1993 Regents of The University of Michigan.
5  * All Rights Reserved.  See COPYRIGHT.
6  */
7
8 #ifndef AFPD_GLOBALS_H
9 #define AFPD_GLOBALS_H 1
10
11 #include <sys/param.h>
12 #include <sys/cdefs.h>
13
14 #ifdef ADMIN_GRP
15 #include <grp.h>
16 #include <sys/types.h>
17 #endif /* ADMIN_GRP */
18
19 #ifdef HAVE_NETDB_H
20 #include <netdb.h>  /* this isn't header-protected under ultrix */
21 #endif /* HAVE_NETDB_H */
22
23 #include <netatalk/at.h>
24 #include <atalk/afp.h>
25 #include <atalk/compat.h>
26 #include <atalk/unicode.h>
27
28 /* test for inline */
29 #ifndef __inline__
30 #define __inline__
31 #endif
32
33 #define MACFILELEN 31
34
35 #define OPTION_DEBUG         (1 << 0)
36 #define OPTION_USERVOLFIRST  (1 << 1)
37 #define OPTION_NOUSERVOL     (1 << 2)
38 #define OPTION_PROXY         (1 << 3)
39 #define OPTION_CUSTOMICON    (1 << 4)
40 #define OPTION_NOSLP         (1 << 5)
41
42 #ifdef FORCE_UIDGID
43 /* set up a structure for this */
44 typedef struct uidgidset_t {
45     uid_t uid;
46     gid_t gid;
47 } uidgidset;
48 #endif /* FORCE_UIDGID */
49
50 /* a couple of these options could get stuck in unions to save
51  * space. */
52 struct afp_volume_name {
53     time_t     mtime;
54     char       *name;
55     char       *full_name;
56     int        loaded;
57 };
58
59 struct afp_options {
60     int connections, port, transports, tickleval, timeout, server_notif, flags;
61     unsigned char passwdbits, passwdminlen, loginmaxfail;
62     u_int32_t server_quantum;
63     char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *configfile;
64     struct at_addr ddpaddr;
65     char *uampath, *fqdn;
66     char *pidfile;
67     struct afp_volume_name defaultvol, systemvol, uservol;
68
69     char *guest, *loginmesg, *keyfile, *passwdfile;
70     char *uamlist;
71     char *authprintdir;
72     char *signature;
73     char *k5service, *k5realm, *k5keytab;
74     char *unixcodepage,*maccodepage;
75     charset_t maccharset, unixcharset; 
76     mode_t umask;
77     mode_t save_mask;
78     int    sleep;
79 #ifdef ADMIN_GRP
80     gid_t admingid;
81 #endif /* ADMIN_GRP */
82 };
83
84 #define AFPOBJ_TMPSIZ (MAXPATHLEN)
85 typedef struct AFPObj {
86     int proto;
87     unsigned long servernum;
88     void *handle, *config;
89     struct afp_options options;
90     char *Obj, *Type, *Zone;
91     char username[MACFILELEN + 1];
92     void (*logout)(void), (*exit)(int);
93     int (*reply)(void *, int);
94     int (*attention)(void *, AFPUserBytes);
95     void (*sleep)(void);
96     /* to prevent confusion, only use these in afp_* calls */
97     char oldtmp[AFPOBJ_TMPSIZ + 1], newtmp[AFPOBJ_TMPSIZ + 1];
98     void *uam_cookie; /* cookie for uams */
99
100 #ifdef FORCE_UIDGID
101     int                 force_uid;
102     uidgidset           uidgid;
103 #endif
104 } AFPObj;
105
106 extern int              afp_version;
107 extern int              afp_errno;
108 extern unsigned char    nologin;
109 extern struct dir       *curdir;
110 extern char             getwdbuf[];
111
112 /* FIXME CNID */
113 extern char             Cnid_srv[MAXHOSTNAMELEN + 1];
114 extern int              Cnid_port;
115
116 extern int  get_afp_errno   __P((const int param));
117 extern void afp_options_init __P((struct afp_options *));
118 extern int afp_options_parse __P((int, char **, struct afp_options *));
119 extern int afp_options_parseline __P((char *, struct afp_options *));
120 extern void afp_options_free __P((struct afp_options *,
121                                       const struct afp_options *));
122 extern void setmessage __P((const char *));
123 extern void readmessage __P((AFPObj *));
124
125 /* gettok.c */
126 extern void initline   __P((int, char *));
127 extern int  parseline  __P((int, char *));
128
129 /* afp_util.c */
130 const char *AfpNum2name __P((int ));
131
132 #ifndef NO_DDP
133 extern void afp_over_asp __P((AFPObj *));
134 #endif /* NO_DDP */
135 extern void afp_over_dsi __P((AFPObj *));
136
137 #endif /* globals.h */