]> arthur.barton.de Git - netatalk.git/blob - etc/afpd/globals.h
d2f86136837640439116fa66d3a4ddbdffc04d0a
[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 /* ADMIN_GRP */
16
17 #ifdef HAVE_NETDB_H
18 #include <netdb.h>  /* this isn't header-protected under ultrix */
19 #endif /* HAVE_NETDB_H */
20
21 #include <netatalk/at.h>
22 #include <atalk/afp.h>
23 #include <atalk/compat.h>
24 #include <atalk/unicode.h>
25 #include <atalk/uam.h>
26
27 #define MACFILELEN 31
28 #define MAXUSERLEN 256
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 #define OPTION_NOSLP         (1 << 5)
36 #define OPTION_ANNOUNCESSH   (1 << 6)
37 #define OPTION_UUID          (1 << 7)
38 #define OPTION_ACL2OS9MODE   (1 << 8)
39
40 #ifdef FORCE_UIDGID
41 /* set up a structure for this */
42 typedef struct uidgidset_t {
43     uid_t uid;
44     gid_t gid;
45 } uidgidset;
46 #endif /* FORCE_UIDGID */
47
48 /* a couple of these options could get stuck in unions to save
49  * space. */
50 struct afp_volume_name {
51     time_t     mtime;
52     char       *name;
53     char       *full_name;
54     int        loaded;
55 };
56
57 struct afp_options {
58     int connections, transports, tickleval, timeout, server_notif, flags, dircachesize;
59     unsigned char passwdbits, passwdminlen, loginmaxfail;
60     u_int32_t server_quantum;
61     char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *port, *configfile;
62     struct at_addr ddpaddr;
63     char *uampath, *fqdn;
64     char *pidfile;
65     char *sigconffile;
66     struct afp_volume_name defaultvol, systemvol, uservol;
67     int  closevol;
68
69     char *guest, *loginmesg, *keyfile, *passwdfile;
70     char *uamlist;
71     char *authprintdir;
72     char *signatureopt;
73     unsigned char signature[16];
74     char *k5service, *k5realm, *k5keytab;
75     char *unixcodepage,*maccodepage;
76     charset_t maccharset, unixcharset; 
77     mode_t umask;
78     mode_t save_mask;
79     int    sleep;
80 #ifdef ADMIN_GRP
81     gid_t admingid;
82 #endif /* ADMIN_GRP */
83     int    volnamelen;
84
85     /* default value for winbind authentication */
86     char *ntdomain, *ntseparator;
87 };
88
89 #define AFPOBJ_TMPSIZ (MAXPATHLEN)
90 typedef struct _AFPObj {
91     int proto;
92     unsigned long servernum;
93     void *handle, *config;
94     struct afp_options options;
95     char *Obj, *Type, *Zone;
96     char username[MAXUSERLEN];
97     void (*logout)(void), (*exit)(int);
98     int (*reply)(void *, int);
99     int (*attention)(void *, AFPUserBytes);
100     void (*sleep)(void);
101     /* to prevent confusion, only use these in afp_* calls */
102     char oldtmp[AFPOBJ_TMPSIZ + 1], newtmp[AFPOBJ_TMPSIZ + 1];
103     void *uam_cookie; /* cookie for uams */
104     struct session_info  sinfo;
105     uid_t uid;  /* client running user id */
106
107 #ifdef FORCE_UIDGID
108     int                 force_uid;
109     uidgidset           uidgid;
110 #endif
111 } AFPObj;
112
113 /* typedef for AFP functions handlers */
114 typedef int (*AFPCmd)(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf,  size_t *rbuflen);
115
116 /* afp_dsi.c */
117 extern AFPObj *AFPobj;
118
119 extern int              afp_version;
120 extern int              afp_errno;
121 extern unsigned char    nologin;
122 extern struct dir       *curdir;
123 extern char             getwdbuf[];
124
125 /* FIXME CNID */
126 extern const char *Cnid_srv;
127 extern const char *Cnid_port;
128
129 extern int  get_afp_errno   (const int param);
130 extern void afp_options_init (struct afp_options *);
131 extern int afp_options_parse (int, char **, struct afp_options *);
132 extern int afp_options_parseline (char *, struct afp_options *);
133 extern void afp_options_free (struct afp_options *,
134                                       const struct afp_options *);
135 extern void setmessage (const char *);
136 extern void readmessage (AFPObj *);
137
138 /* gettok.c */
139 extern void initline   (int, char *);
140 extern int  parseline  (int, char *);
141
142 /* afp_util.c */
143 extern const char *AfpNum2name (int );
144 extern const char *AfpErr2name(int err);
145
146 /* directory.c */
147 extern struct dir rootParent;
148
149 #ifndef NO_DDP
150 extern void afp_over_asp (AFPObj *);
151 #endif /* NO_DDP */
152 extern void afp_over_dsi (AFPObj *);
153
154 #endif /* globals.h */