2 * Copyright (c) 1990,1993 Regents of The University of Michigan.
3 * All Rights Reserved. See COPYRIGHT.
7 #define AFPD_GLOBALS_H 1
13 #include <sys/types.h>
14 #endif /* ADMIN_GRP */
17 #include <netdb.h> /* this isn't header-protected under ultrix */
18 #endif /* HAVE_NETDB_H */
20 #include <netatalk/at.h>
21 #include <atalk/afp.h>
22 #include <atalk/compat.h>
23 #include <atalk/unicode.h>
24 #include <atalk/uam.h>
26 /* #define DOSFILELEN 12 */ /* Type1, DOS-compat*/
27 #define MACFILELEN 31 /* Type2, HFS-compat */
28 #define UTF8FILELEN_EARLY 255 /* Type3, early Mac OS X 10.0-10.4.? */
29 /* #define UTF8FILELEN_NAME_MAX 765 */ /* Type3, 10.4.?- , getconf NAME_MAX */
30 /* #define UTF8FILELEN_SPEC 0xFFFF */ /* Type3, spec on document */
31 /* #define HFSPLUSFILELEN 510 */ /* HFS+ spec, 510byte = 255codepoint */
33 #define MAXUSERLEN 256
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 #define OPTION_ANNOUNCESSH (1 << 6)
42 #define OPTION_UUID (1 << 7)
43 #define OPTION_ACL2MACCESS (1 << 8)
44 #define OPTION_NOZEROCONF (1 << 9)
45 #define OPTION_KEEPSESSIONS (1 << 10) /* preserve sessions across master afpd restart with SIGQUIT */
47 /* a couple of these options could get stuck in unions to save
49 struct afp_volume_name {
57 int connections, transports, tickleval, timeout, server_notif, flags, dircachesize;
58 int sleep; /* Maximum time allowed to sleep (in tickles) */
59 int disconnected; /* Maximum time in disconnected state (in tickles) */
60 int fce_fmodwait; /* number of seconds FCE file mod events are put on hold */
61 unsigned int tcp_sndbuf, tcp_rcvbuf;
62 unsigned char passwdbits, passwdminlen, loginmaxfail;
63 uint32_t server_quantum;
64 int dsireadbuf; /* scale factor for sizefof(dsi->buffer) = server_quantum * dsireadbuf */
65 char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *port, *configfile;
70 struct afp_volume_name defaultvol, systemvol, uservol;
73 char *guest, *loginmesg, *keyfile, *passwdfile;
77 unsigned char signature[16];
78 char *k5service, *k5realm, *k5keytab;
79 char *unixcodepage,*maccodepage;
80 charset_t maccharset, unixcharset;
85 #endif /* ADMIN_GRP */
88 /* default value for winbind authentication */
89 char *ntdomain, *ntseparator;
95 #define AFPOBJ_TMPSIZ (MAXPATHLEN)
96 typedef struct _AFPObj {
98 unsigned long servernum;
99 void *handle; /* either (DSI *) or (ASP *) */
101 struct afp_options options;
102 char *Obj, *Type, *Zone;
103 char username[MAXUSERLEN];
104 void (*logout)(void), (*exit)(int);
105 int (*reply)(void *, int);
106 int (*attention)(void *, AFPUserBytes);
107 /* to prevent confusion, only use these in afp_* calls */
108 char oldtmp[AFPOBJ_TMPSIZ + 1], newtmp[AFPOBJ_TMPSIZ + 1];
109 void *uam_cookie; /* cookie for uams */
110 struct session_info sinfo;
111 uid_t uid; /* client running user id */
112 int ipc_fd; /* anonymous PF_UNIX socket for IPC with afpd parent */
115 /* typedef for AFP functions handlers */
116 typedef int (*AFPCmd)(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen);
118 /* Global variables */
119 extern AFPObj *AFPobj;
120 extern int afp_version;
121 extern int afp_errno;
122 extern unsigned char nologin;
123 extern struct dir *curdir;
124 extern char getwdbuf[];
125 extern struct afp_options default_options;
126 extern const char *Cnid_srv;
127 extern const char *Cnid_port;
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 *);
139 extern void initline (int, char *);
140 extern int parseline (int, char *);
143 extern const char *AfpNum2name (int );
144 extern const char *AfpErr2name(int err);
147 extern struct dir rootParent;
149 extern void afp_over_dsi (AFPObj *);
151 #endif /* globals.h */