2 * Copyright (c) 1990,1993 Regents of The University of Michigan.
3 * All Rights Reserved. See COPYRIGHT.
7 #define AFPD_GLOBALS_H 1
10 #include <sys/cdefs.h>
14 #include <sys/types.h>
15 #endif /* ADMIN_GRP */
18 #include <netdb.h> /* this isn't header-protected under ultrix */
19 #endif /* HAVE_NETDB_H */
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>
28 #define MAXUSERLEN 256
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)
41 /* set up a structure for this */
42 typedef struct uidgidset_t {
46 #endif /* FORCE_UIDGID */
48 /* a couple of these options could get stuck in unions to save
50 struct afp_volume_name {
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;
66 struct afp_volume_name defaultvol, systemvol, uservol;
69 char *guest, *loginmesg, *keyfile, *passwdfile;
73 unsigned char signature[16];
74 char *k5service, *k5realm, *k5keytab;
75 char *unixcodepage,*maccodepage;
76 charset_t maccharset, unixcharset;
82 #endif /* ADMIN_GRP */
85 /* default value for winbind authentication */
86 char *ntdomain, *ntseparator;
89 #define AFPOBJ_TMPSIZ (MAXPATHLEN)
90 typedef struct _AFPObj {
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);
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 */
113 /* typedef for AFP functions handlers */
114 typedef int (*AFPCmd)(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen);
117 extern AFPObj *AFPobj;
119 extern int afp_version;
120 extern int afp_errno;
121 extern unsigned char nologin;
122 extern struct dir *curdir;
123 extern char getwdbuf[];
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;
150 extern void afp_over_asp (AFPObj *);
152 extern void afp_over_dsi (AFPObj *);
154 #endif /* globals.h */